SQLite Forum

In-memory database from sqlite file
Thanks for the insight David.

> Since you're completely ignoring the locking mechanism and just taking the file contents by brute force whether the process using it is done cleaning up after itself or not, then you can't be sure what you're grabbing is complete.

This is an interesting point. Does this mean that by doing this the risk is limited to losing some records (or not being able to read anything at all)? Or is this completely undefined behaviour (so we could read garbage data that is not present in the DB)?

In our specific case, the DB tables are append-only, and we are only interested in detecting new entries after they have been added, with no particular latency requirements. So if we risked missing some records that would be ok - we would just pick them up later on; but if the risk is that we read data that is wrong or not supposed to be there, then we're in trouble.