Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to deprecated sqlite pragma "default_cache_size"

Tags:

python

sqlite

The sqlite docs says that using the pragma default_cache_size is deprecated. I looked, but I couldn't see any explanation for why. Is there a reason for this? I'm working on an embedded python program, and we open and close connections a lot. Is the only alternative to use the pragma cache_size on every database connection?

like image 557
Falmarri Avatar asked Nov 05 '22 21:11

Falmarri


1 Answers

As Firefox is massively using SQLite I wouldn't be surprised if this request came from their camp to prevent any kind of 3rd party interference (e.g. "trashing" with large/small/invalid/obscure values) by this kind of pragma propagating through all database connections

Hence, my strong belief is that there is no alternative and that you really need to set cache_size for each database connection

like image 170
stamparm Avatar answered Nov 09 '22 03:11

stamparm