|
@@ -26,6 +26,21 @@ int main(string[] args) {
|
|
|
}
|
|
}
|
|
|
var db = application.container.configure_with<DatabaseConfigurator>();
|
|
var db = application.container.configure_with<DatabaseConfigurator>();
|
|
|
db.register_connection(@"sqlite://$(db_path)");
|
|
db.register_connection(@"sqlite://$(db_path)");
|
|
|
|
|
+ // SQLite serialisation posture (the flake family where a SELECT
|
|
|
|
|
+ // stepping against a concurrent write lock — the test harness's
|
|
|
|
|
+ // fixture writes share this file — returned SQLITE_BUSY, which
|
|
|
|
|
+ // the ORM's lazy enumerator reports as end-of-rows: an EMPTY
|
|
|
|
|
+ // result for data that exists): WAL readers never block on (and
|
|
|
|
|
+ // are never blocked by) writers, and the busy timeout absorbs
|
|
|
|
|
+ // the remaining writer-writer window.
|
|
|
|
|
+ try {
|
|
|
|
|
+ var connection = application.container.create_scope()
|
|
|
|
|
+ .resolve<InvercargillSql.Connection>();
|
|
|
|
|
+ connection.execute("PRAGMA journal_mode = WAL");
|
|
|
|
|
+ connection.execute("PRAGMA busy_timeout = 5000");
|
|
|
|
|
+ } catch (Error pragma_error) {
|
|
|
|
|
+ print(@"[ClankerSaddle] sqlite pragmas failed: $(pragma_error.message)\n");
|
|
|
|
|
+ }
|
|
|
db.add_migration<ClankerSaddle.Data.Migrations.M0001_Initial>();
|
|
db.add_migration<ClankerSaddle.Data.Migrations.M0001_Initial>();
|
|
|
db.add_entity<Project>(Project.entity_mapping);
|
|
db.add_entity<Project>(Project.entity_mapping);
|
|
|
db.add_entity<ProjectLink>(ProjectLink.entity_mapping);
|
|
db.add_entity<ProjectLink>(ProjectLink.entity_mapping);
|