jeudi 2 avril 2015

How to get the journal mode of my sqlite db

How can I get the journal mode of my sqlite db using sqlalchemy?



@event.listens_for(Engine, "connect")
def set_sqlite_pragma(dbapi_connection, connection_record):
print "PRAGMA start"
cursor = dbapi_connection.cursor()
print cursor.execute("PRAGMA journal_mode=WAL;")
print cursor.execute("PRAGMA journal_mode;")
cursor.close()
print "PRAGMA end"


Can I use cursor object? I am not sure how to retrieve it.


Aucun commentaire:

Enregistrer un commentaire