Write the integer value P3 into cookie number P2 of database P1.
An example
21 of the 178 statements we compiled against the sample database use SetCookie. This is the one with the shortest program; the rows that use SetCookie are highlighted.
Write the integer value P3 into cookie number P2 of database P1.
P2==1 is the schema version. P2==2 is the database format.
P2==3 is the recommended pager cache
size, and so forth. P1==0 is the main database file and P1==1 is the
database file used to store temporary tables.
A transaction must be started before executing this opcode.
If P2 is the SCHEMA_VERSION cookie (cookie number 1) then the internal
schema version is set to P3-P5. The "PRAGMA schema_version=N" statement
has P5 set to 1, so that the internal schema version will be different
from the database schema version, resulting in a schema reset.
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.