Commit Graph
10411 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é 2d19cab2b5 Merge branch 'development' v6.10.0 2023-03-20 07:53:38 +01:00
Gwendal Roué a551fbf443 v6.10.0 2023-03-20 07:53:28 +01:00
Gwendal Roué c6e220a531 Merge pull request #1350 from groue/dev/long-lived-read-only-transaction
DatabasePool won't close read-only connections if requested, and ValueObservation no longer opens a new database connection when it starts
2023-03-20 07:50:30 +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é 6ca4986bc2 CHANGELOG 2023-03-17 13:52:29 +01:00
Gwendal Roué 063877d49c Configuration.persistentReaderConnections 2023-03-17 13:52:29 +01:00
Gwendal Roué 2f4d0c4588 CHANGELOG 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é 5d7fdeae5a Fix compiler warnings in tests 2023-03-17 13:52:01 +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
Gwendal Roué be41d2dd03 Merge branch 'development' v6.9.2 2023-03-14 08:33:07 +01:00
Gwendal Roué e6c3a8d07a v6.9.2 2023-03-14 08:32:58 +01:00
Gwendal Roué 5e41ca7e4e CHANGELOG 2023-03-14 08:12:38 +01:00
Gwendal Roué 0f942c014c Cleanup 2023-03-14 08:10:56 +01:00
Gwendal Roué 40bebda712 Merge pull request #1349 from JonLz/fix-migrations-docs
Fix Migrations.md example so it compiles
2023-03-13 20:35:21 +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é c22fc202a9 Fix typo 2023-03-13 08:06:07 +01:00
Gwendal Roué a0f14d816a Merge branch 'development' v6.9.1 2023-03-12 18:18:06 +01:00
Gwendal Roué ad33dfcfbf v6.9.1 2023-03-12 18:17:48 +01:00
Gwendal Roué 840fa3b5da RecordError DocC 2023-03-12 18:14:38 +01:00
Gwendal Roué 397a008237 More links to DocC reference 2023-03-12 18:01:24 +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é ff7f9073fc Add links to DocC reference 2023-03-12 16:32:54 +01:00
Gwendal Roué 93616775f6 Merge branch 'development' v6.9.0 2023-03-12 12:48:30 +01:00
Gwendal Roué 81751625e0 v6.9.0 2023-03-12 12:48:19 +01:00
Gwendal Roué 9798f9f9fa Update Package.resolved for demo apps 2023-03-12 12:40:38 +01:00
Gwendal Roué db165581ea Merge pull request #1348 from groue/dev/argument-optimization
SQLite argument binding optimization
2023-03-12 11:56:57 +01:00
Gwendal Roué b4e851aa49 More statement arguments documentation 2023-03-12 10:59:38 +01:00
Gwendal Roué 0169e340dc CHANGELOG 2023-03-11 16:40:47 +01:00
Gwendal Roué 1d5d1aea68 Upgrade performance tests dependencies 2023-03-11 12:10:25 +01:00
Gwendal Roué 0c333b6e22 Performance improvements 2023-03-11 12:10:25 +01:00
Gwendal Roué 6a24d835d3 Performance tests for various statement arguments strategies 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