Repository navigation
SQLite in-memory test databases and FOR_UPDATE
Fix: SQLite in-memory test databases
- Changed the default SQLite data source from
:memory:tofile:?mode=memory&cache=sharedso that multiple connections share the same in-memory database. - Removed the special-case that skipped
setDatabaseInDataSourceNamefor SQLite; it now follows the same code path as other drivers. - Updated the comment to clarify that SQLite in-memory databases are automatically freed when all connections close.
New: FOR_UPDATE() virtual function
Added a FOR_UPDATE() virtual function for portable row-level locking in SELECT statements.
SELECT * FROM users WHERE id=? FOR_UPDATE()Expands per driver:
- MySQL / PostgreSQL —
FOR UPDATE - MSSQL —
WITH (UPDLOCK, ROWLOCK) - SQLite — empty string (transaction-level locking is sufficient)