Closed Weakky closed 3 years ago
Great, did you test this in Prisma engines already?
When merging, remember to squash.
I did, it works. It actually works even without this fix since the QE fix no longer passes the db_name
params anyway, so the attach db stuff is no longer called. PR's here, I just need to add a simple test https://github.com/prisma/prisma-engines/pull/1644
Fixes https://github.com/prisma/prisma-engines/issues/1481
This removes support for the path params "db_name". Quaint was using the
ATTACH DATABASE
statement as a hack to scope the db under some custom name. TheATTACH DATABASE
statement is initially designed to create another connection to a different db so that one can query multiple dbs. This was causing subtle issues with transactions.Namely, if inside a transaction, a user would "manually" execute (with
executeRaw
) a write without prefixing the tables with the custom db name (using one connection), and that the QE would also execute a read, this time with the tables prefixed with the db_name (therefore with another connection), this would cause two different connections attempting to do READ/WRITES inside a transaction, causing locks as explained in this doc https://sqlite.org/isolation.htmlSQLite has as default db name, it's called
main
. This PR defaults thedb_name
tomain
. This enables:main
)main
connection.