Closed aus70 closed 1 year ago
@ConnorRigby may have more insight into this than I do. I have not played much with the encrypted database stuff.
I think the issue is that storage_up
https://github.com/elixir-sqlite/ecto_sqlite3/blob/6fdb3e45024f83e0c862abe5aff7662657dc3b24/lib/ecto/adapters/sqlite3.ex#L467 does not set the PRAGMA KEY
as the open function does (see https://github.com/elixir-sqlite/exqlite/blob/main/lib/exqlite/connection.ex#L446)
@warmwaffles What do you think about changing the storage_up
function to use Exqlite.Connection.connect/1
?
when using sqlcipher, the
mix ecto.migrate
command (aftermix ecto.create
) results in the following error:interestingly, using
mix ecto.migrate
right aftermix ecto.drop
results in the following error:[error] Exqlite.Connection (#PID<0.372.0>) failed to connect: ** (Exqlite.Error) database is locked
but immediately afterwards the db is created, the migration is successful and the db is correctly encrypted. Is this the expected behavior? How come
mix ecto.migrate
creates the db?