Hi All,

When using pysqlite I can pass the following uri to sqlite.connect (i'll 
explain later why): file:db.sqlite?mode=ro&vfs=unix-none

I translated it into: sqlite:///db.sqlite?mode=ro&vfs=unix-none in order to 
pass it to create_engine only to find out that sqlalchemy extracts the 
parameters to keyword arguments to the connect function. 

The connect function doesn't handle these arguments. So it seems there are 
two types of arguments for connect, arguments for the python wrapper 
(connect's arguments), and arguments to the sqlite library (parameters 
within the URI).  

How can I pass those without sqlalchemy extracting them?
Can I pass a connection initialized myself somehow?

Some context:

I have one process that dumps lots of data into a sqlite DB.
I have another process reading the data.
I would like the reader to never interrupt the writer.
But I've found out that even when the reader process is doing only select 
statements, it still creates transactions, locks the file and therefore, 
the writer will have transactions failing.
So the solution for making the writer always succeed is for the reader to 
never touch the file on disk nor use any kind of locking (fcntl). 
In order to do that I need to pass the mode and vfs flags directly to 
sqlite.connect.
This solution is not perfect as some select statements would fail with a 
DatabaseError because the file changed but i prefer having the reader retry 
and not the writer.


              Thanks!, Alon Horev 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/OMRZN7kiYacJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to