5 ms·
The negative value in the cache size pragma seems a mistake, but it isn’t. Negative values are used to specify a cache size that is a multiple of the page size
by lrossi 6y ago
The negative value in the cache size pragma seems a mistake, but it isn’t. Negative values are used to specify a cache size that is a multiple of the page size (more or less) and the sign is discarded.
Not a great choice of API IMHO, but it’s a database, I’ve seen much worse.
https://www.sqlite.org/pragma.html#pragma_cache_size https://www.sqlite.org/pragma.html#pragma_cache_size
- polyrand 6y agoI agree it's a very weird API, but you get used to it. In python, when initializing the DB I always use: conn.execute(f"PRAGMA cache_size = {-1 * 64_000}") That way I never forget about the minus.
- deleted 6y ago[deleted]