One of the requirements for sqlite3_snapshot_get is that "One or more
transactions must have been written to the current wal file since it was
created on disk (by any connection). This means that a snapshot cannot be
taken on a wal mode database with no wal file immediately after it is first
opened. At least one transaction must be written to it first."

I am looking for a simple way to ensure that this is the case.

One way of course, is to simply start a write transaction with at least one
write and roll it back. Simply doing BEGIN IMMEDIATE; COMMIT; does not
appear to qualify although it does cause the WAL file to be created, it
must not write a transaction to the WAL file. Creating a "test" table and
adding a row and then rolling this back seems to work, but I'd like to not
have to rely on a database not already having a table by a particular name.

Is there a simpler way that is more like a NO-OP of some sort but that will
ensure that the WAL file has at least one transaction in it?

Thank you

Adam
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to