SQLite VDBE opcode

SeekEnd

Position cursor P1 at the end of the btree for the purpose of appending a new entry onto the btree.

An example

3 of the 178 statements we compiled against the sample database use SeekEnd. This is the one with the shortest program; the rows that use SeekEnd are highlighted.

REINDEX tracks_album
addropcodep1p2p3p4p5
0Init02000
1SorterOpen201k(2,,)0
2OpenRead04060
3Rewind0900
4Column0120
5Rowid0300
6MakeRecord2210
7SorterInsert2100
8Next0400
9Clear5000
10OpenWrite150k(2,,)1
11SorterSort21600
12SorterData2110
13SeekEnd1000
14IdxInsert11016
15SorterNext21200
16Close0000
17Close1000
18Close2000
19Halt0000
20Transaction01101
21Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Clear, Close, Column, Goto, Halt, IdxInsert, Init, MakeRecord, Next, OpenRead, OpenWrite, Rewind, Rowid, SorterData, SorterInsert, SorterNext, SorterOpen, SorterSort, Transaction.

What the SQLite documentation says

Position cursor P1 at the end of the btree for the purpose of appending a new entry onto the btree.

It is assumed that the cursor is used only for appending and so if the cursor is valid, then the cursor must already be pointing at the end of the btree and so no changes are made to the cursor.

From sqlite.org's list of opcodes for SQLite 3.54.1, in the public domain. Opcodes are not a stable interface and change between releases.

← SCopy · SeekGE →