Commit Graph
3676 Commits
Author SHA1 Message Date
Gwendal Roué 9318693fe4 Attached Cache 2023-03-20 13:19:18 +01:00
Gwendal Roué a1b76f9e06 Fix typo 2023-03-20 09:21:50 +01:00
Gwendal RouéandRogerio de Paula Assis 600d1b84b6 Update GRDB/Core/SerializedDatabase.swift
Co-authored-by: Rogerio de Paula Assis <rog@anz.com>
2023-03-20 07:02:00 +01:00
Gwendal Roué 5629cfe6ff Fix documentation 2023-03-19 13:56:56 +01:00
Gwendal Roué 5d9b9edfe1 Fix asyncWALSnapshotTransaction usage.
We must use its result asynchronously.
2023-03-19 12:39:48 +01:00
Gwendal Roué 449c243a36 Rename persistentReaderConnections to dbConfiguration.persistentReadOnlyConnections 2023-03-18 11:08:56 +01:00
Gwendal Roué 063877d49c Configuration.persistentReaderConnections 2023-03-17 13:52:29 +01:00
Gwendal Roué 0a544dc0d2 Cleanup relationships between SerializedDatabase, WALSnapshotTransaction, and DatabasePool
SerializedDatabase hides its allowsUnsafeTransactions property, and makes it thread-safe by protecting it inside its serialized dispatch queue.

WALSnapshotTransaction always notifies when the reader connection is no longer used, and reuses the "isInsideTransaction" wording.
2023-03-17 13:52:29 +01:00
Gwendal Roué d64274474b ValueObservation: stop creating a new connection on start
Since #1248, ValueObservation on DatabasePool creates a new database connection when it starts. #1256 has revealed that opening a connection can take too much time, which unfortunate consequences: the first value is notified too late, and we block the main thread when the observation is started in the `.immediate` scheduling :-/

In this commit, ValueObservation on DatabasePool just uses one of the available readers, thus avoiding creating a new connection.

When WAL snapshots are available, a long-running read-only transaction is kept opened on this reader, until we can start observing the write transactions, compare database versions, and perform a fetch+notification if and only if the database was modified.

When WAL snapshots are not available (Xcode 14.0 and macOS, or specific SQLCipher or SQLite builds), a double notification of the initial value is always performed, since we can't prove that the database was not changed between the initial fetch and the write access.
2023-03-17 13:52:29 +01:00
Gwendal Roué e66dfacab8 WALSnapshotTransaction 2023-03-17 13:52:29 +01:00
Gwendal Roué 0d4c6e592e SerializedDatabase.allowsUnsafeTransactions 2023-03-17 13:52:29 +01:00
Gwendal Roué 378c6785ea Clarification on the truncate optimization 2023-03-16 18:44:46 +01:00
Gwendal Roué 6d392f0a87 Use DatabaseError.connectionIsClosed() where appropriate 2023-03-16 13:44:08 +01:00
Gwendal Roué 7c81c37e1f Move DatabaseRegionObservation documentation in an extension file 2023-03-15 16:51:46 +01:00
Gwendal Roué 3f876978a1 Move TransactionObserver documentation in an extension file 2023-03-15 16:51:46 +01:00
Gwendal Roué a0ed1bfd33 Move ValueObservation documentation in an extension file 2023-03-15 16:51:46 +01:00
Jon Lazar 37fd4c18b0 Update Migrations.md
Fix closure parameter syntax so that the example compiles.
2023-03-13 15:26:07 -04:00
Gwendal Roué d5a41bd11b Disable SQLITE_STATIC optimization when there are too many arguments 2023-03-13 19:33:52 +01:00
Gwendal Roué 840fa3b5da RecordError DocC 2023-03-12 18:14:38 +01:00
Gwendal Roué f7559d4c76 Moved row adapters doc into DocC 2023-03-12 17:25:16 +01:00
Gwendal Roué 8cd71ac832 Fix TableRecord.databaseSelection sample code 2023-03-12 17:18:28 +01:00
Gwendal Roué 0ffd25bc74 Fix documentation typo 2023-03-12 16:33:10 +01:00
Gwendal Roué b4e851aa49 More statement arguments documentation 2023-03-12 10:59:38 +01:00
Gwendal Roué 0c333b6e22 Performance improvements 2023-03-11 12:10:25 +01:00
Gwendal Roué 3382280cc3 Statement.execute(arguments:) uses temporary bindings
Inspired by @helje5 in https://hachyderm.io/@helge@mastodon.social/109978514220902036

Thank you!!

Now, onto cursors!
2023-03-11 12:10:25 +01:00
Gwendal Roué 60fa8a630f Improve Statement.databaseRegion documentation 2023-03-11 12:08:17 +01:00
Gwendal Roué 9ba64c2426 Statement argument validation: fix wrong documentation and strenghten tests 2023-03-11 09:12:37 +01:00
Gwendal Roué 29b5b99b89 Fix typos 2023-03-11 08:00:23 +01:00
Gwendal Roué 6509f7ed40 Improve DatabaseValueConvertible documentation 2023-03-06 08:22:29 +01:00
Gwendal Roué 67bdc740bd DatabaseValueConvertible and collections: move the rationale out of the user-facing documentation. 2023-03-06 08:03:08 +01:00
Gwendal Roué 1e2b454c4c Enhance wording 2023-03-05 17:14:06 +01:00
Gwendal Roué 229bd98b9c Enhance Database Connection DocC overview 2023-03-05 13:51:14 +01:00
Gwendal Roué 692eac43a9 Fix typos 2023-03-05 07:44:12 +01:00
Gwendal Roué 4f398a3457 Prepared statements documentation is now hosted in the Statement DocC 2023-03-04 17:08:12 +01:00
Gwendal Roué 44c13e5bff Make sure Statement.reset(withArguments:) resets 2023-03-04 16:28:45 +01:00
Gwendal Roué 67dfdc1bbb Move DatabaseValueConvertible.swift DocC in an extension file 2023-03-04 15:19:55 +01:00
Gwendal Roué cc8ed5ccb5 Enhanced DocC for DatabaseValueConvertible
Also:
- Redirect the "Custom Value Types" README chapter to DatabaseValueConvertible documentation.
- Document how to support Tagged https://github.com/pointfreeco/swift-tagged
2023-03-04 14:51:46 +01:00
Gwendal Roué 441823d5f4 Enhance discoverability of the Database Sharing guide
https://github.com/groue/GRDB.swift/discussions/1343
2023-03-04 12:19:21 +01:00
Gwendal Roué e936d6b42d Fix DatabaseError documentation 2023-03-02 06:58:33 +01:00
Gwendal Roué cc567f2555 Expose the fts5_api structure 2023-03-01 08:23:36 +01:00
Gwendal Roué b3763ad08e RecordCursor: same documation as all cursors 2023-02-26 10:26:03 +01:00
Gwendal Roué 43ff278748 Improve transactionDate and transactionClock documentation 2023-02-23 08:34:09 +01:00
Gwendal Roué 5ed44b94bc More improvements to RecordTimestamps.md 2023-02-23 07:59:08 +01:00
Gwendal Roué e683df3494 Tweak wording and explore more timestamp handling scenarios 2023-02-22 14:10:28 +01:00
Gwendal Roué 3fab2db88d RecordTimestamps.md organization 2023-02-22 08:07:27 +01:00
Gwendal Roué 5f013b6ee7 Layout for Xcode doc reader 2023-02-22 07:17:53 +01:00
Gwendal Roué 734d911416 Fix typo 2023-02-22 06:18:13 +01:00
Gwendal Roué 86bde428bf Make TimestampedRecord a subprotocol of MutablePersistableRecord 2023-02-22 06:13:32 +01:00
Gwendal Roué c5045dbe7a TimestampedRecord.updateChangesWithTimestamp 2023-02-21 22:48:37 +01:00
Gwendal Roué b0d73f3126 EncodableRecord.databaseChanges(modify:) 2023-02-21 22:48:37 +01:00