Closed garaud closed 9 years ago
OK, sorry. When I read the python docs about the sqlite3 module, I can do:
db = DB(filename=":memory:", dbtype='sqlite')
without error. But I can't see the table that I previously created before calling db.py I don't know if the in-memory db is correctly loaded.
My bad (again) :
Every :memory: database is distinct from every other. So, opening two database connections each with the filename ":memory:" will create two independent in-memory databases.
from https://www.sqlite.org/inmemorydb.html I understand that each time I created a new connection with the ":memory:" parameter, with SQLAlchemy, db.py or sqlite3, this is a new in-memory database. I have not found a way to attach a connection to an existing in-memory DB (and it's surely safe).
I'll just create a temporary db filename and voilà.
Damien
Hi,
Suppose, for demo or test purposes, I have a in-memory SQLite database such as:
engine = create_engine('sqlite://')
if I use SQLAlchemyCan I read it from db.DB? I test:
without success. Is there a plan to support it?
Thanks ! Cheers, Damien G.