sqlcipher3 icon indicating copy to clipboard operation
sqlcipher3 copied to clipboard

file is not a database

Open iamyb opened this issue 1 year ago • 1 comments

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()

iamyb avatar Dec 06 '24 03:12 iamyb

  • 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"?

laggykiller avatar Jan 08 '25 23:01 laggykiller

No further information given, closing for now. Feel free to reopen if you can answer the missing information.

laggykiller avatar Aug 25 '25 21:08 laggykiller