sqlcipher3
sqlcipher3 copied to clipboard
file is not a database
Hello, thanks for the wheel first.
I met one error when add "PRAGMA journal_mode" into my code. any idea about it?
sqlalchemy.exc.DatabaseError: (sqlcipher3.dbapi2.DatabaseError) file is not a database_
@event.listens_for(Engine, "connect")
def set_sqlite_pragma(dbapi_connection, connection_record):
if isinstance(dbapi_connection, SQLite3Connection):
cursor = dbapi_connection.cursor()
cursor.execute("PRAGMA journal_mode;")
# cursor.execute('PRAGMA wal_checkpoint=TRUNCATE;')
cursor.execute("PRAGMA foreign_keys=ON")
cursor.close()
- Is the file really a database? You can check by trying to open the file with programs like DB Browser
- Correct key?
- Correct sqlcipher version?
- Does the problem only occur when executing "PRAGMA journal_mode"?
No further information given, closing for now. Feel free to reopen if you can answer the missing information.