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
Gwendal Roué
dffe56f8a9
Simplify ValueReducer definition
2022-11-13 18:09:06 +01:00
Gwendal Roué
4871304c60
Enable WALSnapshot on macOS (Xcode 14.1+)
2022-11-13 15:29:44 +01:00
Gwendal Roué
cbac0e7286
Enhance Configuration.threadingMode documentation
2022-11-13 10:54:40 +01:00
Gwendal Roué
997d6cb677
DatabaseSnapshot does not require the WAL mode
...
One can create a snapshot from a read-only pool on a non-WAL database, and that's OK. The snaphost still sees an unchanging database content (but other connections can't write).
2022-11-13 10:54:40 +01:00
Gwendal Roué
51230834c8
Configuration.maximumReaderCount can be queried
...
This is useful for tools that adapt their own inner scheduling to the actual capacity for concurrent reads.
2022-11-13 10:54:40 +01:00
Gwendal Roué
638e586dbc
Expose Database.registerAccess(to:)
...
This helps tools that intend to declare an observed region without directly accessing it. This will be necessary for (future) snapshot-based observations that postpone actual database access.
2022-11-13 10:54:40 +01:00
Gwendal Roué
6dc4d50e00
Expose Configuration.readQoS and writeQoS
...
This helps tools that perform their own asynchronous jobs that depend on database scheduling. By using the same QoS as the database, they won't create priority inversion or similar scheduling misuses.
2022-11-12 11:55:37 +01:00