Open joanrieu opened 1 year ago
I'm not aware of any way to lock the db reliably. SQLite doesn't even have row locks.
As for transactional DDL, SQLite only supports it partially.
About the transactional DDL, I'm by no means an expert, so I would love to read more about that partial support you're talking about, as it directly impacts this topic. All I could find online seemed to indicate full support.
SQLite can perform exclusive full-DB locking for transactions, so assuming transactional DDL is supported this is enough. If working without transactions, the locking_mode pragma can help achieve the same.
Hi, once again thanks for this great library.
I've run into a bad surprise when performing migrations concurrently, as the SQLite adapter does not actually perform any locking during migrations: sqlite-adapter.ts
It assumes incorrectly that connection-level exclusivity is enough to guarantee that migrations can run safely but that is not true: when migrations are run by multiple callers (with each their own db connection), you end up having multiple migrators stepping on each other's toes.
(As a side-note, I do not see why the adapter reports
supportsTransactionalDdl = false
either.)