#105 regressed in memory databases when transactions are used. Once a transaction is created, the entire in memory database will be effectively discarded for subsequent db operations that the client makes.
From the regressing PR.
- A single connection is created lazily whenever user executes a statement
- When a transaction starts, the Transaction object takes ownership of the current transaction.
- Subsequent queries will create a new connection.
In particular, this line of code from within transaction, null's out this.#db.
Subsequent calls to #getDb will create a new database here. Because it's purely in memory, this essentially creates a new empty database.
I wonder if the fix would be as simple as skipping the dropping/recreating of the Database if path === ':memory'.
#105 regressed in memory databases when transactions are used. Once a transaction is created, the entire in memory database will be effectively discarded for subsequent db operations that the client makes.
From the regressing PR.
In particular, this line of code from within
transaction,null's outthis.#db.Subsequent calls to
#getDbwill create a new database here. Because it's purely in memory, this essentially creates a new empty database.I wonder if the fix would be as simple as skipping the dropping/recreating of the
Databaseifpath === ':memory'.