Commit Graph
3594 Commits
Author SHA1 Message Date
Gwendal Roué 05da03ab1a Expose generated columns with availability checks 2022-12-10 11:32:23 +01:00
Gwendal Roué 5ab7bfb229 recordNotFound returns an error instead of Never
https://forums.swift.org/t/methods-that-throw-and-return-never/61715
2022-11-30 21:33:15 +01:00
Gwendal Roué 4a4ff9950c FetchableRecord.find() methods 2022-11-30 19:36:25 +01:00
Gwendal Roué afc578db7f TableRecord.recordNotFound() methods 2022-11-30 19:36:08 +01:00
Gwendal Roué df3bd46346 Rename PersistenceError to RecordError 2022-11-30 19:11:07 +01:00
Gwendal Roué 08ec50f44b Enhance documentation for explicit rowid support 2022-11-28 21:09:48 +01:00
Gwendal Roué 156ed53588 Remove obsolete documentation comment 2022-11-28 21:05:30 +01:00
Gwendal Roué 65bd4d90c2 Enhance DatabaseRegionObservation documentation 2022-11-28 08:36:30 +01:00
Gwendal Roué 409bd3bb26 Move Database Observation documentation to DocC 2022-11-28 08:27:12 +01:00
Gwendal Roué fed4833764 Move DatabaseRegionObservation documentation to DocC 2022-11-27 18:45:48 +01:00
Gwendal Roué e3cc15707a Move ValueObservation documentation to DocC 2022-11-27 18:27:26 +01:00
Gwendal Roué 5302b98a15 http -> https 2022-11-27 15:12:57 +01:00
Gwendal Roué 35e60f2b97 Precision 2022-11-27 14:48:43 +01:00
Gwendal Roué 7bd1992e61 Fix ergonomics issue with the definition of compound primary key
If the user would forget the PrimaryKeyDefinition, the primary was not defined:

try db.create(table: "membership") { t in
    // WRONG: pk is unused
    t.primaryKey { pk in
        t.column("playerId", .integer)
        t.column("teamId", .text)
    }
}

The fix is to remove the PrimaryKeyDefinition:

try db.create(table: "membership") { t in
    t.primaryKey {
        t.column("playerId", .integer)
        t.column("teamId", .text)
    }
}
2022-11-27 14:09:25 +01:00
Gwendal Roué f8728bbed8 Enhance documentation 2022-11-27 13:01:42 +01:00
Gwendal Roué 7a9b8093ed Fix Swiftlint warnings 2022-11-27 12:46:23 +01:00
Gwendal Roué f5ebf0de4d Use primary key definitions with NOT NULL constraint by default 2022-11-27 12:35:47 +01:00
Gwendal Roué cd16e921fe Tests for primary key definition with NOT NULL constraint by default 2022-11-27 11:47:56 +01:00
Gwendal Roué 8b8e480391 Primary key definition with NOT NULL constraint by default 2022-11-27 11:32:38 +01:00
Gwendal Roué 3074b61cb7 Move schema documentation to DocC 2022-11-27 11:07:13 +01:00
Gwendal Roué d91e6c2db6 Add schema recommendations to DatabaseSchema.md 2022-11-26 17:09:58 +01:00
Gwendal Roué 4e4699ebed Improve inline documentation 2022-11-26 16:26:46 +01:00
Gwendal Roué 6295f4609e More precise WALSnapshot creation errors 2022-11-25 08:31:47 +01:00
Gwendal Roué e430b4ebd7 DatabaseSnapshotReader reentrant read is not unsafe 2022-11-25 08:15:14 +01:00
Gwendal Roué 4ff8928dc4 Simplify declaration of ValueObservation factory methods (SE-0267) 2022-11-23 19:46:00 +01:00
Gwendal Roué 10596e17bf Cleanup snapshot configurations 2022-11-23 19:42:12 +01:00
Gwendal Roué 392e9e447d Shared in-memory databases 2022-11-23 18:32:57 +01:00
Gwendal Roué e8f1e76958 Enhance documentation 2022-11-18 17:45:51 +01:00
Gwendal Roué 131f414a75 Enhance DatabaseSchema.md 2022-11-18 13:49:28 +01:00
Gwendal Roué d4cefc984f Update documentation index 2022-11-18 13:33:28 +01:00
Gwendal Roué 2dce8d533e Project organization 2022-11-18 13:33:28 +01:00
Gwendal Roué dc43607921 Cleanup 2022-11-18 13:33:28 +01:00
Gwendal Roué 0ba3dff901 Rewrite availability check for WAL snapshots
Also, enable WAL snapshots with SQLCipher, if SQLITE_ENABLE_SNAPSHOT is set.
2022-11-18 13:33:28 +01:00
Gwendal Roué fcf8ac43b7 Delete obsolete comment 2022-11-18 12:41:15 +01:00
Gwendal Roué 9b4d76ca37 Robustness: DatabaseSnapshotPool discards connections that have lost the snapshot 2022-11-18 08:53:39 +01:00
Gwendal Roué 9b663e3bcc Pool can discard elements after use 2022-11-18 08:52:52 +01:00
Gwendal Roué 8a42c11624 DatabaseSnapshotPool documentation 2022-11-17 22:38:41 +01:00
Gwendal Roué 79d4db7827 More DatabaseSnapshotPool tests 2022-11-17 21:56:01 +01:00
Gwendal Roué b1770e89b7 Introduce DatabaseSnapshotReader 2022-11-17 20:11:58 +01:00
Gwendal Roué 12d656d3a1 Let SQLite check if DatabaseSnapshotPool can be created 2022-11-17 20:01:17 +01:00
Gwendal Roué 0bc49460d7 DatabaseSnapshotPool uses its own pool of connections
In the previous implementation, the snapshot pool would use the same reader connections as the database pool. This would create problem with reentrant reads. Let's make things simple, and not share any database connection.
2022-11-17 18:36:17 +01:00
Gwendal Roué c4c0b1ce90 Test and fix unsafe and async DatabaseSnapshotPool 2022-11-14 19:10:52 +01:00
Gwendal Roué 9ac8c0703d Remove dead code 2022-11-14 19:02:10 +01:00
Gwendal Roué 433ed36a4b More documentation about transactions 2022-11-14 18:51:39 +01:00
Gwendal Roué c23b93d71b Document that reentrant database accesses use the current database connection when possible 2022-11-14 18:38:33 +01:00
Gwendal Roué b8bc8273a9 Turn snapshot tokens into a proper reader: DatabaseSnapshotPool 2022-11-14 18:22:13 +01:00
Gwendal Roué bcb70855d5 Enhance WALSnapshotToken documentation 2022-11-14 10:42:09 +01:00
Gwendal Roué eaf8dc239a Simplify WALSnapshotToken creation 2022-11-14 10:39:48 +01:00
Gwendal Roué 6864e6b2fb Enhance registerAccess(to:) documentation 2022-11-14 08:47:58 +01:00
Gwendal Roué a71eb3d662 Introduce WALSnapshotToken 2022-11-13 18:28:54 +01:00