Compare commits

...
6084 Commits
Author SHA1 Message Date
Gwendal Roué 389b14ede0 Tests for super encoders WIP 2024-03-18 19:07:07 +01:00
Gwendal Roué 4e0ab25106 Fix flaky tests due to Recorder incorrect critical section 2024-03-17 22:40:38 +01:00
Gwendal Roué c52db6095a Stop testing test_CocoaPodsLint
Because it does no longer work due to https://github.com/CocoaPods/CocoaPods/issues/11839
2024-03-17 22:15:08 +01:00
Gwendal Roué 1464940eeb Merge pull request #1511 from groue/dev/schema-dump
Database schema dump
2024-03-17 22:11:55 +01:00
Gwendal Roué f274e464cd CHANGELOG 2024-03-17 20:45:48 +01:00
Gwendal Roué c3e7736534 Dump schema 2024-03-17 20:45:31 +01:00
Gwendal Roué 9b95dd5be1 Merge pull request #1510 from groue/dev/trivial-sendable-conformances
Add Sendable conformances and unavailabilities
2024-03-17 20:45:01 +01:00
Gwendal Roué 77da5f4a30 CHANGELOG 2024-03-17 19:18:30 +01:00
Gwendal Roué 43ced9b2f0 Trivial Sendable conformances
Either added, either made explicitly unavailable.
2024-03-17 18:25:04 +01:00
Gwendal Roué 4ffad63f1b Fix Swift 5.10 warning on WALSnapshot 2024-03-17 17:55:25 +01:00
Gwendal Roué 62e7ea1ef2 CHANGELOG 2024-03-17 17:55:15 +01:00
Gwendal Roué 91492b849d Merge pull request #1508 from groue/dev/issue-1500
Fix ValueObservation mishandling of database schema modification
2024-03-17 17:53:28 +01:00
Gwendal Roué d54d0abc07 Fix WALSnapshotTransaction so that it clears its schema cache if needed 2024-03-17 16:13:35 +01:00
Gwendal Roué 3b096b38e7 Failing test for #1500 2024-03-17 16:13:35 +01:00
Gwendal Roué 9593297cf0 CHANGELOG 2024-03-17 14:54:07 +01:00
Gwendal Roué 8ac5591189 Merge pull request #1503 from simba909/master
Conform Database.ColumnType to Sendable
2024-03-17 14:51:44 +01:00
Simon Jarbrant 4232fa687d Conform Database.ColumnType to Sendable 2024-03-08 14:28:36 +01:00
Gwendal Roué bd9aea303d Merge branch 'development' 2024-02-25 16:32:30 +01:00
Gwendal Roué 5abc737bf0 v6.25.0 2024-02-25 16:31:11 +01:00
Gwendal Roué d4d14e3dd7 CHANGELOG 2024-02-25 16:28:06 +01:00
Gwendal Roué 660d2b1fe7 Merge pull request #1496 from danielepantaleone/development
Added privacy manifest file
2024-02-25 16:23:15 +01:00
Gwendal Roué bb44f48414 Add the PrivacyInfo.xcprivacy file to the GRDB target 2024-02-25 15:08:53 +01:00
Gwendal Roué bbe7d2f1ca Remove PrivacyInfo.xcprivacy from podspec
This technique has CocoaPods overwrite the app and other pods's manifest file and is not correct.

Currently, there's no CocoaPods support for privacy manifest unless I'm mistaken: https://github.com/CocoaPods/CocoaPods/issues/11990

And we can't publish new GRDB version on CocoaPods anyway: https://github.com/CocoaPods/CocoaPods/issues/11839
2024-02-25 15:07:35 +01:00
Daniele Pantaleone 45e0de9960 Added privacy manifest to GRDBCustom project 2024-02-18 17:03:43 +01:00
Daniele Pantaleone 1920482158 Added privacy manifest file 2024-02-15 16:57:46 +01:00
Gwendal Roué 0437c0fed6 Merge pull request #1490 from danielinoa/patch-2
Update LICENSE to 2024
2024-02-07 08:53:45 +01:00
Daniel Inoa d08d2f52fb Update LICENSE 2024-02-06 18:30:52 -08:00
Gwendal Roué d1ff0912f1 Fix release date 2024-01-21 12:27:30 +01:00
Gwendal Roué e069e2732e Merge branch 'development' 2024-01-21 11:14:33 +01:00
Gwendal Roué c791e376e8 v6.24.2 2024-01-21 11:14:20 +01:00
Gwendal Roué acf1eb935b Merge pull request #1485 from groue/dev/immediate_transactions
Recommend IMMEDIATE transactions when a database is shared between multiple processes
2024-01-17 21:10:45 +01:00
Gwendal Roué 87c4b1cfa8 CHANGELOG 2024-01-17 20:06:38 +01:00
Gwendal Roué d0fc34b199 Recommend IMMEDIATE transactions in the Sharing a Database guide
Fix #1483
2024-01-17 20:04:39 +01:00
Gwendal Roué 9cee1e218d Tests for SQLITE_BUSY prevention with IMMEDIATE transactions
Those tests support the recommendation of IMMEDIATE transactions for shared databasesS.

See #1483
2024-01-17 19:39:40 +01:00
Gwendal Roué f5d55cb1a1 TODO 2024-01-17 10:51:42 +01:00
Gwendal Roué 345a3dae28 CHANGELOG 2024-01-14 17:31:17 +01:00
Gwendal Roué 1239178bee Improve diagnostic when an association to/from view are lacking an explicit ForeignKey
Related discussion: https://github.com/groue/GRDB.swift/discussions/1481
2024-01-14 17:31:17 +01:00
Gwendal Roué e5a7c73dc9 Tests for associations to or from views 2024-01-14 14:33:17 +01:00
Gwendal Roué 11e914db12 Fix code signing issues with GRDBDemoiOS 2024-01-13 13:09:53 +01:00
Gwendal Roué 181ccd8d7d Merge branch 'development' 2024-01-06 19:56:07 +01:00
Gwendal Roué 2800e9a81e v6.24.1 2024-01-06 19:55:52 +01:00
Gwendal Roué 18d2d512f0 Merge pull request #1477 from groue/dev/dump-virtual-tables
Remove shadow tables from database dump
2024-01-06 19:52:33 +01:00
Gwendal Roué c06552fbd4 Document that shadow tables are not recorded by dumpContent() 2024-01-06 18:36:58 +01:00
Gwendal Roué a00a3f7c80 Fix failing test that dumpContent ignores shadow tables 2024-01-06 18:14:37 +01:00
Gwendal Roué b9ac9b1ca8 Failing test that dumpContent ignores shadow tables 2024-01-06 18:12:45 +01:00
Gwendal Roué 07f1ddac04 Test that dumpContent ignores GRDB internal tables 2024-01-06 18:12:21 +01:00
Gwendal Roué 12829e5bfb Merge branch 'development' 2024-01-06 14:53:16 +01:00
Gwendal Roué 09fa46a0d9 v6.24.0 2024-01-06 13:27:00 +01:00
Gwendal Roué e359529503 When releasing, run the full test suite from a pristine repository 2024-01-06 13:27:00 +01:00
Gwendal Roué ac8d1b77b9 Merge pull request #1466 from barnettben/1463-schema-names
Add schema name option to table introspection methods
2024-01-06 13:18:50 +01:00
Gwendal Roué 002c5ec2f1 Revert "Report test results from Github actions"
This reverts commit aadb887b34.
2024-01-06 12:27:26 +01:00
Gwendal Roué b42f618a01 Disable tests for attached schemas when databases are encrypted 2024-01-06 12:08:54 +01:00
Ben Barnett 27a4215424 Add schemaName parameter to foreign key checking functions 2023-12-08 18:22:49 +00:00
Ben Barnett 65167ec7da Add schemaName parameter to table/view/triggerExists() 2023-12-08 18:22:49 +00:00
Ben Barnett 73489fc0e7 Add schemaName parameter to indexes(on:) 2023-12-08 18:22:49 +00:00
Ben Barnett 1aca8efa65 Add schemaName parameter to foreignKeys(on:) 2023-12-08 18:22:49 +00:00
Ben Barnett a22bf83ae8 Split duplicate nested conditions into separate function 2023-12-07 18:32:34 +00:00
Ben Barnett f00a974211 Add schemaName parameter to columns(in:) 2023-12-06 20:49:48 +00:00
Ben Barnett ac475cc158 Add schemaName parameter to primaryKey(_:) 2023-12-06 20:32:17 +00:00
Gwendal Roué eacbdf23af Merge branch 'development' 2023-12-01 08:21:27 +01:00
Gwendal Roué e31a80e3c4 v6.23.0 2023-12-01 08:06:55 +01:00
Gwendal Roué e3cf966c81 Documentation organization 2023-12-01 08:02:32 +01:00
Gwendal Roué eeb71039d4 Merge pull request #1462 from groue/dev/read-only
Temporary read-only access
2023-11-30 13:48:52 +01:00
Gwendal Roué c5203f078d Make Database.readOnly public 2023-11-30 07:56:21 +01:00
Gwendal Roué e29c52d7e5 Update obsolete documentation of stopObservingDatabaseChangesUntilNextTransaction 2023-11-27 10:00:41 +01:00
Gwendal Roué 06ac26a213 Merge branch 'development' 2023-11-26 12:02:16 +01:00
Gwendal Roué fae845a986 v6.22.0 2023-11-26 10:48:42 +01:00
Gwendal Roué b671bb0faa CHANGELOG 2023-11-26 10:37:27 +01:00
Gwendal Roué 93462cfd2c Documentation 2023-11-26 10:33:00 +01:00
Gwendal Roué 54357e4fec Merge pull request #1460 from groue/dev/notify-changes
Explicit change notifications
2023-11-26 08:34:23 +01:00
Gwendal Roué d8760253ff Add missing DocC reference 2023-11-25 17:10:40 +01:00
Gwendal Roué dc281cee25 Cleanup tests for unspecified changes to a column 2023-11-25 17:01:11 +01:00
Gwendal Roué a8ed98e414 Mention undetected changes in the Database Sharing Guide 2023-11-25 16:50:01 +01:00
Gwendal Roué f1a8c5ac92 Wording 2023-11-25 16:49:37 +01:00
Gwendal Roué 079c0c7f26 The unit of change notification is the event kind, not the region 2023-11-25 16:44:18 +01:00
Gwendal Roué bced461c4f Fix failing test for DatabaseRegionObservation and Database.notifyChanges(in:) 2023-11-25 15:32:35 +01:00
Gwendal Roué 9d6e127822 Failing test for DatabaseRegionObservation and Database.notifyChanges(in:) 2023-11-25 15:32:35 +01:00
Gwendal Roué dff7971cd7 Fix failing test for ValueObservation and Database.notifyChanges(in:) 2023-11-25 15:32:35 +01:00
Gwendal Roué 3df718c1a6 Failing test for ValueObservation and Database.notifyChanges(in:) 2023-11-25 15:32:35 +01:00
Gwendal Roué 3e52e265ce Fix failing test for stopObservingDatabaseChangesUntilNextTransaction() from databaseDidChange() 2023-11-25 15:32:35 +01:00
Gwendal Roué abf48eb86f Failing test for stopObservingDatabaseChangesUntilNextTransaction() from databaseDidChange() 2023-11-25 15:32:35 +01:00
Gwendal Roué 56ad833ab7 New Dealing with Undetected Changes documentation chapter 2023-11-25 15:32:35 +01:00
Gwendal Roué 8afd986790 Fix failing tests for Database.notifyChanges(in:) and master tables 2023-11-25 15:32:35 +01:00
Gwendal Roué 918afbd33e Fix failing tests for Database.notifyChanges(in:) and regular tables 2023-11-25 14:39:13 +01:00
Gwendal Roué b5cb8fadf0 Failing tests for Database.notifyChanges(in:) 2023-11-25 14:39:13 +01:00
Gwendal Roué 1a16bdeac8 TransactionObserver.databaseDidChange() 2023-11-25 13:30:23 +01:00
Gwendal Roué 5e749eb50b Document that changes performed by SQLite statements that are not compiled and executed by GRDB are not detected. 2023-11-24 14:10:57 +01:00
Gwendal Roué 836e7733da Prepare TransactionObserverTests for unspecified change notifications 2023-11-24 13:40:02 +01:00
Gwendal Roué 8b19c3424c Test async read after async write 2023-11-11 13:38:03 +01:00
Gwendal Roué 7eaf67fb6a CHANGELOG 2023-11-02 15:04:45 +01:00
Gwendal Roué 753d7db65f Merge pull request #1452 from groue/dev/SQLite-3.44.0
SQLite 3.44.0, FILTER and ORDER BY clauses in aggregate functions
2023-11-02 15:03:30 +01:00
Gwendal Roué f0fe5ff017 TODO GRDB7 2023-11-02 14:08:15 +01:00
Gwendal Roué 225d7a8c2d Fix test for SQLCipher 2023-11-02 14:03:52 +01:00
Gwendal Roué 46ad19d2e3 Documentation 2023-11-02 14:03:52 +01:00
Gwendal Roué 2603b6ea03 Support for ORDER BY and FILTER in aggregate functions 2023-11-02 14:03:52 +01:00
Gwendal Roué f7156b9490 Custom SQLite 3.44.0 2023-11-02 14:03:52 +01:00
Gwendal Roué f1f8e8438a Merge branch 'development' 2023-10-29 10:00:25 +01:00
Gwendal Roué 6bd1e6b8fb v6.21.0 2023-10-29 08:46:10 +01:00
Gwendal Roué ae21996947 CHANGELOG 2023-10-29 08:43:30 +01:00
Gwendal Roué 8479c4c874 Merge pull request #1449 from groue/dev/temp-copies
Backport temporary copies from GRDBSnapshotTesting
2023-10-29 08:42:20 +01:00
Gwendal Roué 4c8fc93fec Fix tests for encrypted databases 2023-10-29 07:34:23 +01:00
Gwendal Roué 38bb8d3505 Backport temporary copies from GRDBSnapshotTesting 2023-10-28 18:38:15 +02:00
Gwendal Roué 850542dd25 CHANGELOG 2023-10-28 18:37:38 +02:00
Gwendal Roué aaad020b0b Merge pull request #1448 from groue/dev/dump-views
Add support for stable ordering and dump of views.
2023-10-28 18:36:15 +02:00
Gwendal Roué ba320a08e3 Make dumpTables able to print views 2023-10-28 15:46:31 +02:00
Gwendal Roué 42fd32731a Make withStableOrder able to deal with views 2023-10-28 15:46:10 +02:00
Gwendal Roué 8fa434272e Make all read closures explicit in the documentation
The short form dbQueue.read(fetch) can confuse the reader.
2023-10-22 07:59:08 +02:00
Gwendal Roué fd2e552cfb Merge branch 'development' 2023-10-15 11:20:12 +02:00
Gwendal Roué 13bf0686ef v6.20.2 2023-10-15 11:10:02 +02:00
Gwendal Roué 1a9e306c78 Merge pull request #1442 from groue/dev/fix-macos-json-availability
Extend the macOS availability of JSON functions
2023-10-15 11:02:49 +02:00
Gwendal Roué 565335ea0d Update documentation 2023-10-15 09:06:28 +02:00
Gwendal Roué aabdffabc2 All JSON functions are available on macOS 10.15, but -> and ->>
Thank you @martindufort for the detailed report: https://gist.github.com/groue/046ebddb4a410304094c022d756081c8
2023-10-15 09:06:28 +02:00
Gwendal Roué 85792b8293 One availability per JSON function 2023-10-15 08:18:36 +02:00
Gwendal Roué c4c13b6f53 Doc updates for GRDBSnapshotTesting 2023-10-14 11:22:48 +02:00
Gwendal Roué d597fd56e9 v6.20.1 2023-10-13 07:42:44 +02:00
Gwendal Roué 94a7a59cc9 Remove debug print 2023-10-13 07:40:02 +02:00
Gwendal Roué f6f93469fb Merge branch 'development' 2023-10-13 07:18:32 +02:00
Gwendal Roué 120241b069 v6.20.0 2023-10-12 22:37:01 +02:00
Gwendal Roué 856d9cbe53 Merge pull request #1439 from groue/dev/dump
Dump requests
2023-10-12 22:34:20 +02:00
Gwendal Roué a8331d7335 CHANGELOG 2023-10-12 09:17:50 +02:00
Gwendal Roué dc1f9450c0 Expose DatabaseValue.init(sqliteStatement:index:)
This helps users implement custom dump formats
2023-10-12 09:17:50 +02:00
Gwendal Roué 7a7ee554c7 OrderedRequest.withStableOrder() 2023-10-12 09:17:50 +02:00
Gwendal Roué aadb887b34 Report test results from Github actions
https://github.com/kishikawakatsumi/xcresulttool/discussions/630
2023-10-12 09:17:50 +02:00
Gwendal Roué 69ae4c4e96 Dump 2023-10-12 09:17:50 +02:00
Gwendal Roué f4ac0ab119 Make it possible to observe the supplementary fetches 2023-10-08 20:41:05 +02:00
Gwendal Roué 8d4cc05021 Add missing tests for GRDB+SQLCipher 2023-10-08 20:20:07 +02:00
Gwendal Roué 16d6c92722 Add missing test file to GRDBCustom 2023-10-08 20:14:21 +02:00
Gwendal Roué c7047c4b33 Trim SQL in DatabaseError descriptoin 2023-10-08 20:07:59 +02:00
Gwendal Roué e22bf8fe0a DocC organization 2023-10-08 20:05:22 +02:00
Gwendal Roué e994fca2b5 Fix documentation typo 2023-10-07 11:36:31 +02:00
Gwendal Roué c599f6423e Fix link 2023-10-04 23:00:02 +02:00
Gwendal Roué 458b7211df Merge branch 'development' 2023-10-04 22:06:37 +02:00
Gwendal Roué 703e3c2b68 v6.19.0 2023-10-04 22:06:27 +02:00
Gwendal Roué 0eb973b6db Record types with an auto-incremented id should avoid the Identifiable protocol. 2023-10-04 22:02:18 +02:00
Gwendal Roué cbcc057222 Merge pull request #1436 from groue/experimental/JSONColumn
JSON functions
2023-10-04 21:22:43 +02:00
Gwendal Roué d64de2bbdb CHANGELOG 2023-10-04 19:57:45 +02:00
Gwendal Roué 1f0b52a012 JSON documentation 2023-10-04 19:57:45 +02:00
Gwendal Roué 908f8b242a Prepare documentation for JSON 2023-10-04 19:55:12 +02:00
Gwendal Roué 9faea276d8 JSON tests 2023-10-04 19:55:12 +02:00
Gwendal Roué 5a42d78e06 Data decoding and encoding strategies
Users must be able to store JSON data as text in the database.
2023-10-04 19:55:12 +02:00
Gwendal Roué 546e8aa77c JSONColumn and SQLJSONExpressible 2023-10-04 19:55:12 +02:00
Gwendal Roué ed01d40ba9 JSON functions 2023-10-04 19:55:12 +02:00
Gwendal Roué 97e6f88b31 Add new .jsonText column type 2023-10-04 19:55:12 +02:00
Gwendal Roué 718102f743 Create indexes on expressions 2023-10-02 07:49:59 +02:00
Gwendal Roué 8cc52983b7 Introduce SQLFunctionFlags 2023-10-01 15:39:47 +02:00
Gwendal Roué b896923fd4 TODO GRDB7: remove painful optionals due to IGNORE 2023-10-01 15:37:27 +02:00
Gwendal Roué 4abcbdf452 CHANGELOG 2023-09-16 17:53:50 +02:00
Gwendal Roué 6706de0103 Workaround for https://github.com/CocoaPods/CocoaPods/issues/12012 2023-09-16 17:52:40 +02:00
Gwendal Roué cc534fd19c Merge pull request #1429 from JhonnyBillM/dev/1428-EXTEND-VALUE-CONVERTIBLE-JSON-FORMAT-CUSTOMIZATION
Extend `DatabaseValueConvertible` JSON parsing format customization
2023-09-16 17:51:12 +02:00
Gwendal Roué 65dd5f1da8 Merge pull request #1430 from groue/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-09-16 15:25:52 +02:00
Gwendal Roué 76dbcfe700 Fix documentation wording 2023-09-16 14:14:30 +02:00
Gwendal Roué 7944979d56 Add new methods to DocC 2023-09-16 14:14:20 +02:00
Gwendal Roué 7f6ab59250 Markdown files are soft-wrapped 2023-09-16 14:10:17 +02:00
Gwendal Roué 746f65a979 JSON encoder is always user-provided
Now all created JSONEncoder or JSONDecoder are user-controlled.
2023-09-16 14:07:37 +02:00
Gwendal Roué 9188251780 Add missing import required by SPM 2023-09-16 14:03:38 +02:00
Gwendal Roué 1e995b659d Hard-wrap documentation comments 2023-09-16 14:03:26 +02:00
dependabot[bot] e560993b44 Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 06:25:17 +00:00
Jhonny Bill Mena eec476b9ba ADD - unit tests for custom JSON Encoder and Decoder in DatabaseValueConvertible 2023-09-10 23:54:50 -04:00
Jhonny Bill Mena 3f96a965b9 ADD - databaseJSONDecoder and databaseJSONEncoder methods
ADD - optional jsonEncoder parameter to DatabaseValueEncoder

ADD - docs around new JSON customization methods
2023-09-10 23:54:50 -04:00
Gwendal Roué ce63f697ed Merge branch 'development' 2023-09-01 12:36:14 +02:00
Gwendal Roué 92f5b2a9dd v6.18.0 2023-09-01 11:39:48 +02:00
Gwendal Roué 5f103df04d Update CONTRIBUTING.md for DocC 2023-08-31 09:45:37 +02:00
Gwendal Roué 7cbcbe12f0 Expose path on DatabaseReader 2023-08-31 09:42:13 +02:00
Gwendal Roué c12fff16d3 CHANGELOG 2023-08-28 15:06:23 +01:00
Gwendal Roué e40569844f Merge branch 'development' 2023-08-26 10:41:10 +01:00
Gwendal Roué 3ac7598e9b v6.17.0 2023-08-26 09:47:38 +01:00
Gwendal Roué fd847d5a25 CHANGELOG 2023-08-26 09:41:39 +01:00
Gwendal Roué 6fec245d2f Merge pull request #1421 from groue/dev/journalModeSetup
Make it possible to open a DatabaseQueue in the WAL mode
2023-08-26 09:40:18 +01:00
Gwendal Roué 9e5cb95e1f Documentation for Configuration.journalMode 2023-08-25 10:11:41 +01:00
Gwendal Roué 13bc9ae56c Tests for Configuration.journalMode 2023-08-25 09:10:43 +01:00
Gwendal Roué e79b4e25db Apply Configuration.journalMode 2023-08-25 09:10:33 +01:00
Gwendal Roué f76093a0c7 Database.setUpWALMode() 2023-08-25 09:10:26 +01:00
Gwendal Roué 45b248b4ed Configuration.journalMode 2023-08-25 09:10:26 +01:00
Gwendal Roué 97c04a7f26 Shorten line length 2023-07-29 11:42:02 +02:00
Gwendal Roué 9ff58c32e7 Use CChar instead of Int8 when we deal with C strings 2023-07-29 11:13:41 +02:00
Gwendal Roué 0b2b26fd11 A statement can delete even if it's not a DELETE statement (through triggers) 2023-07-29 11:08:55 +02:00
Gwendal Roué 6f18de6a94 Fix typo 2023-07-29 11:08:02 +02:00
Gwendal Roué 28c6ea96b4 Fix redundant_self_in_closure Swiftlint warning 2023-07-29 10:06:33 +02:00
Gwendal Roué 206bf209af Fix unneeded_synthesized_initializer Swiftlint warning 2023-07-29 10:00:42 +02:00
Gwendal Roué e83f3eb25e Merge branch 'development' 2023-07-09 18:32:52 +02:00
Gwendal Roué e16d4accb3 v6.16.0 2023-07-09 18:08:27 +02:00
Gwendal Roué 9ff4060b10 Merge pull request #1405 from groue/dev/belongsToColumn
Simplify the declaration of BelongsTo associations in the database schema
2023-07-09 17:30:57 +02:00
Gwendal Roué 4ac434c83c CHANGELOG 2023-07-09 17:22:41 +02:00
Gwendal Roué 913168df2d Upgrade tests with belongsTo 2023-07-09 17:22:38 +02:00
Gwendal Roué f8c99f96bc Upgrade playgrounds with belongsTo 2023-07-09 17:22:38 +02:00
Gwendal Roué 466ecd5ba5 Documentation 2023-07-09 17:22:38 +02:00
Gwendal Roué 7a0a354d22 Implement ForeignKeyDefinition 2023-07-09 17:22:38 +02:00
Gwendal Roué 349253e196 Failing tests for ForeignKeyDefinition 2023-07-09 17:16:08 +02:00
Gwendal Roué dd85e699e2 Help handling of columns with no declared type 2023-07-09 17:16:08 +02:00
Gwendal Roué c647840485 PrimaryKeyInfo exposes column types 2023-07-09 17:16:08 +02:00
Gwendal Roué 3375282252 Update outdated documentation about views 2023-07-09 17:13:22 +02:00
Gwendal Roué 82d3af48c3 CHANGELOG 2023-07-09 17:13:22 +02:00
Gwendal Roué bebb751b3c Create and drop view 2023-07-09 17:13:22 +02:00
Gwendal Roué 08fbd82ead Rename StatementArgumentsSink.forRawSQL to literalValues 2023-07-09 17:13:22 +02:00
Gwendal Roué 89dd426403 CHANGELOG 2023-07-09 15:16:06 +02:00
Gwendal Roué 3206d04f0e Merge pull request #1401 from kustra/dev/linux-compile-fixes
Linux compilation fixes
2023-07-09 15:12:41 +02:00
Gwendal Roué ee0d3e43e0 iOS 17: Update date formatter tests so that it does not depend on the space before AM/PM
iOS 17 has changed that space
2023-07-09 14:37:45 +02:00
László Kustra f113963d31 Remove obsolete SQLite trace logic, as min SQLite version is 3.19.3 2023-07-07 11:05:17 +02:00
Gwendal Roué 7d48703986 CHANGELOG 2023-07-02 15:43:50 +02:00
Gwendal Roué f06e117d66 Merge pull request #1403 from groue/dev/ci-macOS13
GitHub CI: test Xcode 14.3.1, macOS 13
2023-07-02 15:43:29 +02:00
Gwendal Roué 5fca5fdabf Force MACOSX_DEPLOYMENT_TARGET on SQLCipher CocoaPods tests
Workaround for https://github.com/CocoaPods/CocoaPods/issues/11839
2023-07-02 14:18:07 +02:00
Gwendal Roué 2bd080799f Test universal xcframework 2023-07-02 14:18:07 +02:00
Gwendal Roué 1577825585 GitHub CI: test Xcode 14.3.1, macOS 13 2023-07-02 14:18:07 +02:00
Gwendal Roué 9b7ba606d8 Merge pull request #1402 from groue/dev/sqlite-3.42.0
Upgrade custom SQLite builds to 3.42.0
2023-07-02 14:17:18 +02:00
Gwendal Roué c9d8ce57a7 Trigger CI on custom SQLite upgrade 2023-07-02 12:44:18 +02:00
Gwendal Roué 2bb904775f CHANGELOG 2023-07-02 12:38:41 +02:00
Gwendal Roué 66826288d6 Upgrade custom SQLite builds to 3.42.0 2023-07-02 12:32:56 +02:00
Gwendal Roué 59c41c97af Clarify the prevention of database access from TransactionObserver callbacks 2023-07-02 10:58:09 +02:00
László Kustra 47d8ef4358 Fix the Linux version of sqlite3_trace for SQLite 3.19.3 2023-06-29 16:23:36 +02:00
László Kustra 25b49cba01 Add autoreleasepool shim for Linux 2023-06-29 16:23:36 +02:00
László Kustra 788887a2b8 Remove selector-based NotificationCenter calls on Linux 2023-06-29 16:23:36 +02:00
László Kustra 4057e3be07 Use cross-platform ProcessInfo instance property 2023-06-29 16:23:36 +02:00
Gwendal Roué 284a4ee1ac Merge branch 'development' 2023-06-17 12:59:06 +02:00
Gwendal Roué b27e378cfa v6.15.1 2023-06-17 12:04:26 +02:00
Gwendal Roué 459726f9af Improve documentation of erase() 2023-06-15 14:17:48 +02:00
Gwendal Roué 4f00e405c3 CHANGELOG 2023-06-11 15:40:02 +02:00
Gwendal Roué 87f4d816e6 Merge pull request #1391 from groue/dev/issue-1390
Fix upsert in FTS5-synchronized tables
2023-06-11 15:36:52 +02:00
Gwendal Roué ea7ebe1ff5 Fix failing test for #1390 2023-06-11 13:15:55 +02:00
Gwendal Roué 89899432ba Failing test for #1390 2023-06-11 13:15:55 +02:00
Gwendal Roué 3a1c211746 Address #1389 by forcing the user to specify a tracked region
This is technically a breaking change, but nobody will notice it.
2023-06-08 12:17:27 +02:00
Gwendal Roué c3664e2b16 Fix Xcode 15 DocC warnings 2023-06-06 08:15:02 +02:00
Gwendal Roué ea1353bd6c Remove invalid documentation link 2023-06-06 08:13:43 +02:00
Gwendal Roué 4a5d4d6e49 Fix Xcode 15 warnings 2023-06-06 08:06:06 +02:00
Gwendal Roué c85abdba86 Fix typo 2023-06-02 16:13:51 +02:00
Gwendal Roué 57aa4c30bf Merge branch 'development' 2023-06-02 16:07:14 +02:00
Gwendal Roué 67b7941129 v6.15.0 2023-06-02 15:39:29 +02:00
Gwendal Roué db01b0063c Fix a test that relied on observation of every single changes 2023-06-02 15:39:26 +02:00
Gwendal Roué e1ddc8154f Merge pull request #1382 from groue/dev/request-all
Add `DerivableRequest.all()`
2023-06-02 13:34:43 +02:00
Gwendal Roué e637c156a2 CHANGELOG 2023-06-02 13:31:19 +02:00
Gwendal Roué 60ad8a809a Tests for FilteredRequest.all() and none() 2023-06-02 13:31:02 +02:00
Gwendal Roué 84ac401886 Add FilteredRequest.all()
This method does nothing: it returns `self`. It exists in order to match `none()`.
2023-06-02 13:31:02 +02:00
Gwendal Roué 26b875f64c Merge pull request #1384 from groue/dev/issue-1383
Allow ValueObservation to start from a truncated wal file
2023-06-02 13:29:27 +02:00
Gwendal Roué fdc8abfdbe CHANGELOG 2023-06-02 12:07:35 +02:00
Gwendal Roué fc641092f7 Document how truncating wal checkpoints impact ValueObservation 2023-06-02 12:04:28 +02:00
Gwendal Roué 63d360053b Fix typo and obsolete comments 2023-06-02 10:20:42 +02:00
Gwendal Roué dc440d5a8f Fix failing tests for non-empty wal files on DatabasePool creation 2023-06-02 09:44:18 +02:00
Gwendal Roué 5ab0d18055 Failing tests for non-empty wal files on DatabasePool creation 2023-06-02 09:35:51 +02:00
Gwendal Roué 437b800d8c Add test for the SQLite file provided by @kustra
https://github.com/groue/GRDB.swift/issues/1383#issuecomment-1572897011
2023-06-02 08:34:14 +02:00
Gwendal Roué b840babb55 Document the intent of #1383 regression tests 2023-06-01 20:15:05 +02:00
Gwendal Roué 725d4a3fba When a wal snapshot can't be created, ValueConcurrentObserver fallbacks to plain reads
This commit fixes #1383
2023-06-01 20:00:04 +02:00
Gwendal Roué 4ab8ac8d3f Failing test for #1383 (async version) 2023-06-01 19:53:34 +02:00
Gwendal Roué 73b279b5c1 Document methods that fail if the wal file is missing or truncated 2023-06-01 19:15:21 +02:00
Gwendal Roué fa681fb8c6 Enhance error message when WALSnapshot initializer fails 2023-06-01 19:07:28 +02:00
Gwendal Roué cedcfbe330 Mark opportunities for snapshot creation failure (including #1383) 2023-06-01 17:26:04 +02:00
Gwendal Roué abd3ba39b1 Explicit tests that a DatabasePool can read from a new instance, and from a truncated wal file 2023-06-01 17:20:25 +02:00
Gwendal Roué d66d2118b5 Failing test for #1383 2023-06-01 17:05:06 +02:00
Gwendal Roué 0a92a99223 Merge branch 'development' 2023-05-25 18:29:47 +02:00
Gwendal Roué 19e5e62098 v6.14.0 2023-05-25 18:29:15 +02:00
Gwendal Roué d948e37388 CHANGELOG 2023-05-25 18:25:04 +02:00
Gwendal Roué 60de81633e Merge pull request #1379 from groue/dev/default-index-name
Create indexes with a default name
2023-05-25 18:24:06 +02:00
Gwendal Roué c02139c045 Default name for newly created indexes 2023-05-25 09:03:09 +02:00
Gwendal Roué 93bd527984 Merge pull request #1376 from groue/dev/bitwise-operations
Bitwise operations
2023-05-23 14:03:01 +02:00
Gwendal Roué 157d02b55c CHANGELOG 2023-05-23 08:21:35 +02:00
Gwendal Roué 82d28b3167 Bitwise assignment operators &= |= <<= >>= 2023-05-23 08:16:14 +02:00
Gwendal Roué 717c2836ec Bitwise operators & | ~ << >> 2023-05-23 08:15:04 +02:00
Gwendal Roué cf8fa0e5f8 Merge branch 'development' 2023-05-15 20:06:01 +02:00
Gwendal Roué 84ef0a92da v6.13.0 2023-05-15 20:05:30 +02:00
Gwendal Roué 2ae000df43 CHANGELOG 2023-05-15 19:05:30 +02:00
Gwendal Roué 738a187f68 Merge pull request #1373 from groue/dev/issue-1371
Disallow string literals in check()
2023-05-15 18:57:29 +02:00
Gwendal Roué 4ff057ac3b Deprecate table constraints built from SQLExpressible - prefer SQLSpecificExpressible instead
Fixes #1371
2023-05-15 12:45:33 +02:00
Gwendal Roué 0d49d7612f Enhance wording 2023-05-01 12:16:48 +02:00
Gwendal Roué 342b81f65e Update dark logo 2023-04-30 12:55:56 +02:00
Gwendal Roué a651f34f67 Upgrade performance test dependencies 2023-04-30 12:20:21 +02:00
Gwendal Roué 5475dc98dc Merge branch 'development' 2023-04-29 18:29:02 +02:00
Gwendal Roué 3692ba2293 v6.12.0 2023-04-29 17:37:22 +02:00
Gwendal Roué 266efa041c Expose FetchableRecordDecoder 2023-04-29 17:15:54 +02:00
Gwendal Roué ebb2f7346d Cleanup FTS5 documentation 2023-04-29 16:50:15 +02:00
Gwendal Roué f955e5fabc Merge pull request #1364 from groue/issue1362-test
Fix ValueObservation deadlock
2023-04-29 16:34:58 +02:00
Gwendal Roué 65c803a110 Fix #1362 2023-04-29 13:24:46 +02:00
Gwendal Roué 8b1b3b0396 Fix tests that relied on observation of every single changes 2023-04-29 12:47:25 +02:00
Gwendal Roué bf28d1bd85 Disable xcpretty on $CI 2023-04-29 12:47:15 +02:00
Gwendal Roué 45edf58f9e Refactor ValueObservationRecorder matching test 2023-04-29 12:47:00 +02:00
Gwendal Roué d07e8bd3a0 The scenario that leads to the #1362 deadlock 2023-04-18 18:22:47 +02:00
Matt Gallagher 7feaa748a4 Removed some unneeded configuration from the test. 2023-04-18 13:06:05 +10:00
Matt Gallagher c159638498 A test demonstrating deadlock when observer count exceeds size of DatabasePool. 2023-04-18 12:48:06 +10:00
Gwendal Roué 5aa385094b Merge branch 'development' 2023-04-17 20:20:50 +02:00
Gwendal Roué 1cd20176c6 v6.11.0 2023-04-17 20:20:30 +02:00
Gwendal Roué 06891e99e1 Prepare for release 2023-04-17 20:20:30 +02:00
Gwendal Roué d5f38a6a24 Fix Swiftlint warning 2023-04-17 19:17:50 +02:00
Gwendal Roué 68d23a5f33 README layout 2023-04-17 08:36:32 +02:00
Gwendal Roué 75f92f6f14 Dark logo 2023-04-17 08:35:31 +02:00
Gwendal Roué 6c70ee6b77 Remove the Swift language versions 2023-04-16 16:51:33 +02:00
Gwendal Roué c8ae3cb61c Update usage sample code 2023-04-16 14:07:43 +02:00
Gwendal Roué dd4d3e35f3 Concurrency Guide layout 2023-04-16 13:27:11 +02:00
Gwendal Roué 7b2619e757 Refactor README introduction 2023-04-16 13:25:24 +02:00
Gwendal Roué a7b9a27c51 DocC home page layout 2023-04-16 13:09:31 +02:00
Gwendal Roué fcfd6e9028 ValueConcurrentObserver releases its initial WAL transaction earlier 2023-04-15 11:59:19 +02:00
Gwendal Roué 9011f71247 Fix tests for unavailable wal snapshots 2023-04-15 09:50:46 +02:00
Gwendal Roué 069bce217d Attempts at finding regression tests for #1362 2023-04-14 08:28:34 +02:00
Gwendal Roué 5a91340671 CHANGELOG 2023-04-13 08:02:41 +02:00
Gwendal Roué ba2e3cb468 Merge pull request #1361 from groue/dev/issue-1360
DatabaseMigrator.eraseDatabaseOnSchemaChange ignores internal schema objects
2023-04-13 08:00:05 +02:00
Gwendal Roué f633be4ba1 Fix test for #1360 2023-04-12 08:02:38 +02:00
Gwendal Roué 4074fcfcc7 Failing test for #1360 2023-04-12 08:00:19 +02:00
Gwendal Roué 18cdf4956e Fix typos 2023-04-10 16:52:03 +02:00
Gwendal Roué 18e06a78a3 Merge branch 'development' 2023-04-10 15:06:33 +02:00
Gwendal Roué 065ca71876 v6.10.2 2023-04-10 14:16:41 +02:00
Gwendal Roué 859a1d6184 Enhance Recommended Practices for Designing Record Types 2023-04-10 14:11:39 +02:00
Gwendal Roué f2ea4e91db CHANGELOG 2023-04-10 11:32:12 +02:00
Gwendal Roué 1add9a9752 Fix incorrect test 2023-04-10 11:31:19 +02:00
Gwendal Roué 17c3f82f50 Remove weird Xcode error regarding the Scripts "project" 2023-04-10 11:31:19 +02:00
Gwendal Roué 52a3d6ba23 Move the "Recommended Practices for Designing Record Types" to DocC 2023-04-10 09:51:38 +02:00
Gwendal Roué 54007a9ce1 Refactor demo apps for enhanced configuration management 2023-04-09 11:40:40 +02:00
Gwendal Roué 77d8a46039 Remove obsolete TODOs 2023-04-08 12:30:55 +02:00
Gwendal Roué f6e695a21d More explicit any/some 2023-04-08 12:01:59 +02:00
Gwendal Roué 3184334535 Merge branch 'development' 2023-04-01 17:22:35 +02:00
Gwendal Roué 12e3923af1 v6.10.1 2023-04-01 16:01:43 +02:00
Gwendal Roué b81e858ca0 Better fix for #1357
Previous fix would not correctly address #1357 when invalid double-quoted identifiers are interpreted as string literals (Configuration.acceptsDoubleQuotedStringLiterals = true, or SQLCipher 3)
2023-04-01 14:59:42 +02:00
Gwendal Roué 82f300e534 GitHub actions: Xcode 14.2 2023-04-01 14:30:57 +02:00
Gwendal Roué 9df1cfd110 CHANGELOG 2023-04-01 14:12:50 +02:00
Gwendal Roué 373fe467d6 Fix failing test for #1357 2023-04-01 14:09:50 +02:00
Gwendal Roué 81eb6b128f Failing test for #1357 2023-04-01 14:09:50 +02:00
Gwendal Roué c7ee12eff7 Remove deprecated swiftlint rule 2023-04-01 13:14:45 +02:00
Gwendal Roué 89330daa52 Use xcbeautify when available 2023-04-01 13:05:43 +02:00
Gwendal Roué e408bd17d8 Fix Swiftlint warning 2023-04-01 13:04:52 +02:00
Gwendal Roué 99ddc5e13c Makefile: add explicit macOS destinations 2023-04-01 12:56:44 +02:00
Gwendal Roué 4c0cc84c2d Improve DatabaseEventPredicate usage with SQLITE_ENABLE_PREUPDATE_HOOK 2023-03-31 08:02:04 +02:00
Gwendal Roué 4762f8bb36 Fix spawnConcurrentRead documentation 2023-03-29 13:02:49 +02:00
Gwendal Roué 7e6f71912c Enhance DatabaseQueue read-only transactions 2023-03-29 13:02:31 +02:00
Gwendal Roué 6b311941b1 Remove WWDCCompanion from the release process 2023-03-22 18:40:48 +01:00
Gwendal Roué 5facc24ebb Fix compiler warnings for Swift 5.8 2023-03-22 18:40:37 +01:00
Gwendal Roué 018ae03f8e Improve DatabaseEventPredicate usage 2023-03-22 08:30:21 +01:00
Gwendal Roué 52aef76b63 Fix Swiftlint warning 2023-03-22 08:25:37 +01:00
Gwendal Roué 2fa5ca767f WALSnapshot is only available when the SQLite feature is
Since #1350 we no longer need to expose it and check for failures at runtime.
2023-03-20 15:05:17 +01:00
Gwendal Roué a1b76f9e06 Fix typo 2023-03-20 09:21:50 +01:00
Gwendal Roué 2d19cab2b5 Merge branch 'development' 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' 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' 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' 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
Gwendal Roué 29b5b99b89 Fix typos 2023-03-11 08:00:23 +01:00
Gwendal Roué 725d38ea06 Fix typo 2023-03-07 11:08:00 +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é a77f9d3f6a CHANGELOG 2023-03-05 13:52:26 +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é 7b2393f2cd Cleanup 2023-03-04 15:23:19 +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é 1e5ee4b292 Fix Xcode 14.3 beta 2 warnings 2023-03-04 11:53:41 +01:00
Gwendal Roué 159a34bdf2 Demo apps: bump GRDBQuery to 0.6.0 2023-03-04 10:03:51 +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é c824b42757 Restore busy timeout tests
In the context of #1339
2023-02-25 10:56:56 +01:00
Gwendal Roué d3862c0424 Merge branch 'development' 2023-02-24 13:22:53 +01:00
Gwendal Roué f6cb77a489 v6.8.0 2023-02-24 13:11:18 +01:00
Gwendal Roué a1faa88579 Merge pull request #1338 from groue/dev/TimestampedRecord
TimestampedRecord sample code
2023-02-24 13:03:48 +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é 9f0bd4944b Cleanup 2023-02-22 08: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
Gwendal Roué 9e2eb6c599 Enhance TimestampedRecord
In particular, `touch` performs an update on disk, just like the unix command.
2023-02-21 21:42:36 +01:00
Gwendal Roué 3bf73e9f66 TimestampedRecord demo 2023-02-21 08:51:03 +01:00
Gwendal Roué 9bd26a5a1b Improve Modification Timestamp documentation 2023-02-20 13:30:29 +01:00
Gwendal Roué 84f5a91f7b Improve Modification Timestamp documentation 2023-02-20 13:23:36 +01:00
Gwendal Roué c9ae697a44 Remove obsolete documentation about FTS5 2023-02-19 21:30:41 +01:00
Gwendal Roué e76cda27dc Merge branch 'development' 2023-02-19 20:00:51 +01:00
Gwendal Roué 2618c9fa1e v6.7.0 2023-02-19 19:58:05 +01:00
Gwendal Roué 522e4be817 Merge pull request #1336 from groue/dev/FTS5
Enable FTS5 by default
2023-02-19 19:53:37 +01:00
Gwendal Roué ff8b9e5cb8 CHANGELOG 2023-02-19 18:42:08 +01:00
Gwendal Roué 38c9ec29f5 Enable FTS5 by default in CocoaPods 2023-02-19 18:25:16 +01:00
Gwendal Roué 3b0cf1fb0b FTS5 DocC 2023-02-19 17:38:19 +01:00
Gwendal Roué dc4f10ecb0 Remove Xcode warning 2023-02-19 12:10:17 +01:00
Gwendal Roué 012ed8133f Enable FTS5 by default in SPM 2023-02-19 12:10:09 +01:00
Gwendal Roué d0314e0db8 Enable FTS5 by default in GRDB.xcodeproj 2023-02-19 12:03:49 +01:00
Gwendal Roué 850db8f2e9 Fix #1327 2023-02-18 15:11:34 +01:00
Gwendal Roué 44ec63dbe2 Merge pull request #1331 from groue/dev/transactionDate
Transaction Date
2023-02-18 14:42:51 +01:00
Gwendal Roué e9afb04b1e Test that transaction date is reset after a rollback error 2023-02-18 12:19:56 +01:00
Gwendal Roué 72216beacb Enhance wording 2023-02-18 12:06:11 +01:00
Gwendal Roué 6500a97f88 Documentation 2023-02-18 11:58:46 +01:00
Gwendal Roué 3c71a6deea "Record Timestamps and Transaction Date" documentation chapter 2023-02-18 11:52:21 +01:00
Gwendal Roué e4421c509c Improve transactionDate documentation 2023-02-18 10:18:10 +01:00
Gwendal Roué c8339db68b CHANGELOG 2023-02-18 10:17:10 +01:00
Gwendal Roué 961b3a9cad Database.transactionDate must be called from a valid DispatchQueue 2023-02-18 08:31:05 +01:00
Gwendal Roué efa8f0e69d Configuration.transactionClock is experimental as well 2023-02-18 08:31:05 +01:00
Gwendal Roué 93928a791a Tests for Transaction Date 2023-02-18 08:31:05 +01:00
Gwendal Roué f649d9e19e Transaction Date 2023-02-18 08:31:05 +01:00
Gwendal Roué 31350672c7 CHANGELOG 2023-02-17 12:37:28 +01:00
Gwendal Roué 17906dc505 Table SQL interpolation
Addresses https://github.com/groue/GRDB.swift/issues/1332
2023-02-14 08:58:26 +01:00
Gwendal Roué f8f586a98c More BRAG 2023-02-10 10:07:35 +01:00
Gwendal Roué 302fc69f3a TableDefinition.primaryKey(["a", "b"]) is no longer sunsetted
People need it to define the primary key on non-consecutive columns: https://github.com/groue/GRDB.swift/discussions/1326
2023-02-10 08:11:02 +01:00
Gwendal Roué 0045592891 Merge pull request #1328 from ytti/master
Update README.md
2023-02-10 07:58:25 +01:00
ytti 69105e6f80 Update README.md
In SQLCipher passphrase as Data example, fix the use of Data instance
2023-02-09 09:36:03 +02:00
Gwendal Roué aff924a72b Upgrade Swiftlint and fix warnings 2023-02-04 11:23:14 +01:00
Gwendal Roué abaa14db83 Fix typo 2023-01-30 08:41:32 +01:00
Gwendal Roué 9b113fb548 Fix documentation 2023-01-30 08:00:47 +01:00
Gwendal Roué ac214e6760 SE-0345: if let shorthand for shadowing an existing optional variable 2023-01-30 08:00:47 +01:00
Gwendal Roué d3c289a320 Availability checks cleanup 2023-01-22 12:37:40 +01:00
Gwendal Roué c64e9f947b Merge pull request #1320 from baekteun/refactor/availabilityMacOS
UPDATE :: OSX -> macOS in Availability Check
2023-01-22 12:16:20 +01:00
Gwendal Roué 7a790c1f23 Enhance test for StatementArguments initializer from [Any]
Also, this removes a Swift 5.8 warning.
2023-01-20 17:05:58 +01:00
Gwendal Roué bc9190a1dc Document expected deprecation warnings
This addresses #1321
2023-01-17 07:44:49 +01:00
baegteun a9feac1339 ♻️ :: OSX -> macOS in Availability Check 2023-01-17 13:58:37 +09:00
Gwendal Roué 846939d632 Merge pull request #1316 from baekteun/master
✏️ :: replace OSX -> macOS in document
2023-01-16 07:56:52 +01:00
Gwendal Roué ba68e3b02d Merge branch 'development' 2023-01-15 15:30:52 +01:00
Gwendal Roué 59f98ae1fd v6.6.1 2023-01-15 15:30:40 +01:00
Gwendal Roué 590158ca3e Update license for 2023 2023-01-15 15:24:30 +01:00
Gwendal Roué 7d7724c3aa Link to Mastodon account 2023-01-15 15:21:37 +01:00
Gwendal Roué 76a065af6d Merge pull request #1317 from groue/dev/fix-1315
Fix removal of prefetched associations
2023-01-15 15:12:17 +01:00
Gwendal Roué 2976e81a95 Fix failing test for #1315 2023-01-15 13:39:05 +01:00
Gwendal Roué fb547c1a15 Failing test for #1315 2023-01-15 13:27:04 +01:00
Gwendal Roué 38ce06d263 OrderedDictionary.description 2023-01-14 12:33:41 +01:00
Gwendal Roué 3794e7e801 DatabasePromise.description 2023-01-14 12:21:08 +01:00
baegteun 557ad3d3d3 OS X -> macOS in Remake or CHANGELOG.md 2023-01-14 11:43:27 +09:00
baegteun 70a35afad8 OSX -> macOS in CHANGELOG.md 2023-01-14 11:39:13 +09:00
baegteun 4a5713502f OSX.gitignore -> macOS.gitignore 2023-01-14 11:38:02 +09:00
Gwendal Roué c3cc998fc1 Merge branch 'development' 2022-12-29 14:12:13 +01:00
Gwendal Roué 0f0f33d0d1 v6.6.0 2022-12-29 14:06:18 +01:00
Gwendal Roué 0b92c856ae Upgrade demo apps 2022-12-29 14:06:18 +01:00
Gwendal Roué 6e2e1f4889 Update documentation links 2022-12-29 14:06:18 +01:00
Gwendal Roué 0dd17a9a16 Turn ValueObservationScheduler into a protocol 2022-12-29 12:38:06 +01:00
Gwendal Roué 4100b0627f DatabaseCursor DocC 2022-12-18 11:58:03 +01:00
Gwendal Roué c50cfd937e DocC: DatabaseQueue and DatabasePool 2022-12-18 11:45:28 +01:00
Gwendal Roué 3d7170f1bc DocC: Configuration 2022-12-17 10:11:36 +01:00
Gwendal Roué 2c5a86479a DocC: Transactions and Savepoints 2022-12-17 10:11:36 +01:00
Gwendal Roué 119f226610 DocC: GeneratedColumnQualification 2022-12-12 08:42:18 +01:00
Gwendal Roué d2db26d570 Merge pull request #1301 from groue/dev/xcode-14.2
CI Cleanup
2022-12-10 16:50:44 +01:00
Gwendal Roué 82ed41b700 Remove junk from Makefile 2022-12-10 15:17:44 +01:00
Gwendal Roué 639eadbad2 CI: more Xcode 14.1 2022-12-10 14:20:42 +01:00
Gwendal Roué 4ff3221feb CI: explicit iOS and tvOS tests 2022-12-10 14:04:00 +01:00
Gwendal Roué a61a769da9 CI: explicit macOS tests 2022-12-10 13:26:53 +01:00
Gwendal Roué 04bdafd448 Makefile change triggers Github workflow 2022-12-10 13:19:10 +01:00
Gwendal Roué 5fa5e62d0e CHANGELOG 2022-12-10 13:06:39 +01:00
Gwendal Roué 1d5f05351a Merge pull request #1304 from groue/dev/generated-columns
Expose generated columns with availability checks
2022-12-10 13:04:09 +01:00
Gwendal Roué 05da03ab1a Expose generated columns with availability checks 2022-12-10 11:32:23 +01:00
Gwendal Roué 7b63ddf542 Merge branch 'development' 2022-12-05 11:19:16 +01:00
Gwendal Roué 13860219be v6.5.0 2022-12-05 11:18:59 +01:00
Gwendal Roué 4cbf442cc8 Merge pull request #1299 from groue/dev/find
Record.find() convenience methods
2022-11-30 22:48:58 +01:00
Gwendal Roué 2bde3e11bc Tests for find(_🔑) and find(_🆔) 2022-11-30 21:39:44 +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é 520766a74e CHANGELOG 2022-11-30 20:07:42 +01:00
Gwendal Roué 6c16a9a4e5 Document the find method 2022-11-30 20:02:24 +01:00
Gwendal Roué 726022d5a5 Support for legacy urls 2022-11-30 19:52:55 +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é f9cfadce78 CHANGELOG 2022-11-28 20:57:48 +01:00
Gwendal Roué 2269a82479 CHANGELOG 2022-11-28 18:43:26 +01:00
Gwendal Roué 8330469ac3 Merge branch 'development' 2022-11-28 17:14:48 +01:00
Gwendal Roué 72f56a1b03 v6.4.0 2022-11-28 13:29:23 +01:00
Gwendal Roué cbd05c9037 Fix documentation link 2022-11-28 13:28:35 +01:00
Gwendal Roué a27c34e635 CHANGELOG 2022-11-28 13:19:56 +01:00
Gwendal Roué 35019f7a36 Merge pull request #1297 from groue/experimental/expose-CSQLite
SPM: expose the CSQLite product
2022-11-28 11:40:28 +01:00
Gwendal Roué 69e4706549 Expose CSQLite as a SPM product 2022-11-28 10:37:39 +01:00
Gwendal Roué 65bd4d90c2 Enhance DatabaseRegionObservation documentation 2022-11-28 08:36:30 +01:00
Gwendal Roué 7343912ac3 Fix broken links 2022-11-28 08:31:45 +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é ef019bb9da CHANGELOG 2022-11-27 15:05:45 +01:00
Gwendal Roué 35e60f2b97 Precision 2022-11-27 14:48:43 +01:00
Gwendal Roué 2e2b79a3a9 The technique for exposing rowids to record types has moved to DocC 2022-11-27 14:29:14 +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é f774aa7c07 Fix tests for named in-memory database 2022-11-27 12:46:59 +01:00
Gwendal Roué 7a9b8093ed Fix Swiftlint warnings 2022-11-27 12:46:23 +01:00
Gwendal Roué c7df15faf5 CHANGELOG 2022-11-27 12:41:00 +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é a0bfbafd9c Add tests for MutablePersistableRecord on tables without explicit primary key 2022-11-26 16:27:27 +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é 847386860f Fix test compilation on Xcode 14
Grrr
2022-11-17 22:48:13 +01:00
Gwendal Roué 8a42c11624 DatabaseSnapshotPool documentation 2022-11-17 22:38:41 +01:00
Gwendal Roué e4c5cc3451 Test that DatabaseSnapshotPool can be used from ValueObservation 2022-11-17 22:04:06 +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é 2743ded335 Merge pull request #1293 from groue/experimental/WALSnapshotToken
Enable concurrent reads from a WAL snapshot
2022-11-14 20:53:26 +01:00
Gwendal Roué e129df15db Fix tests for Xcode 14.0 2022-11-14 19:29: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é 4b21704258 CHANGELOG 2022-11-13 18:35:59 +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é a6f9b1c4b7 CHANGELOG 2022-11-13 10:55:31 +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
Gwendal Roué 5d50e396c1 Enhance Configuration documentation 2022-11-12 11:55:37 +01:00
Gwendal Roué 981d42aed6 Execute SPM tests in parallel 2022-11-12 11:55:37 +01:00
Gwendal Roué 8ffceb49c8 Document SPI_BUILDER 2022-11-11 15:14:59 +01:00
Gwendal Roué b14ef2112c Fix documentation typo 2022-11-11 12:55:35 +01:00
Gwendal Roué 2d31ed4618 Merge branch 'development' 2022-11-11 11:34:48 +01:00
Gwendal Roué 5e7b604ecd v6.3.1 2022-11-11 11:34:02 +01:00
Gwendal Roué 90ec3c188b Host documentation on SPI 2022-11-11 11:34:02 +01:00
Gwendal Roué 1625bc83f8 Documentation organization 2022-11-11 11:34:02 +01:00
Gwendal Roué be9740b5f6 Discourage usage of reentrant by linking to the related doc 2022-11-10 08:50:41 +01:00
Gwendal Roué f914fe73ff DocC Concurrency Resources 2022-11-10 08:34:54 +01:00
Gwendal Roué 57b07515c7 Rename GRDB_DOCC_PLUGIN to SPI_BUILDER
This addresses https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/2122#issuecomment-1305649066
2022-11-09 21:56:19 +01:00
Gwendal Roué 9d03c1ae61 DocC: Single-Row Tables 2022-11-09 21:54:17 +01:00
Gwendal Roué 3014ddb00a Enhance Documentation 2022-11-09 21:52:22 +01:00
Gwendal Roué 85b2e113b2 Relocate DatabaseSnapshot documentation 2022-11-09 17:16:03 +01:00
Gwendal Roué c5a0598cea DocC: Concurrency Guides 2022-11-09 13:22:53 +01:00
Gwendal Roué 5242fe10f6 Enhance Documentation 2022-11-09 13:22:53 +01:00
Gwendal Roué 71880a9b8e Enhance Documentation 2022-11-09 13:20:08 +01:00
Gwendal Roué 14fb1945be Fix documentation 2022-11-08 22:57:48 +01:00
Gwendal Roué 33cdf6f270 Extract <doc:DatabaseSchema> 2022-11-08 19:28:13 +01:00
Gwendal Roué ca079cab17 TODO 2022-11-08 19:28:09 +01:00
Gwendal Roué 0873474a17 DocC: SQL 2022-11-08 18:22:03 +01:00
Gwendal Roué bfe2450da5 Fix typo 2022-11-08 08:53:59 +01:00
Gwendal Roué 19b0b6af3e http -> https 2022-11-08 08:45:37 +01:00
Gwendal Roué cdf480ef1f Migrations guide cleanup 2022-11-08 08:41:10 +01:00
Gwendal Roué da3059f0a8 fix typos and wordings 2022-11-08 05:43:09 +01:00
Gwendal Roué 754ced7b5e Enhance DocC output for ForeignKeyViolation 2022-11-07 22:50:50 +01:00
Gwendal Roué fb81ec6792 Migrations Guide in now a DocC article 2022-11-07 22:44:37 +01:00
Gwendal Roué 1be868c4b0 Fix documentation typo 2022-11-07 09:16:50 +01:00
Gwendal Roué 4dda8d7650 Host DocC on Github pages
SPI will be up soon, but we have to fix the dead links currently published on the master branch

https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/discussions/2120
2022-11-07 08:14:39 +01:00
Gwendal Roué 16fe4331f2 make doc generates DocC for hosting on Github pages
Example: http://groue.github.io/GRDB.swift/docs/6.3/documentation/grdb
2022-11-07 08:14:39 +01:00
Gwendal Roué 5ff2ad9e71 Merge branch 'development' 2022-11-06 20:47:53 +01:00
Gwendal Roué f5259af512 v6.3.0 2022-11-06 20:47:03 +01:00
Gwendal Roué 2dd2d2db35 Makefile no longer needs to be updated on each release 2022-11-06 20:46:53 +01:00
Gwendal Roué 9fd3e822e5 More links to future SPI-hosted pages 2022-11-06 20:45:48 +01:00
Gwendal Roué edbfc7749c Merge pull request #1291 from groue/dev/DocC
DocC inline documentation
2022-11-06 20:36:46 +01:00
Gwendal Roué 2aa7e3c79f Makefile: support for Xcode 14.1 2022-11-06 19:42:49 +01:00
Gwendal Roué 3592db997a Makefile: allow disabling min iOS destination 2022-11-06 19:05:38 +01:00
Gwendal Roué 4307f6a680 Fix Swiftlint warnings 2022-11-06 18:43:00 +01:00
Gwendal Roué b7b83a965b Update the Swift Package Index manifest file 2022-11-06 18:11:18 +01:00
Gwendal Roué fcfecc5a73 Update Release Process 2022-11-06 18:09:49 +01:00
Gwendal Roué 39a76ff929 Links to future SPI-hosted pages 2022-11-06 18:09:09 +01:00
Gwendal Roué aef2d087ae CHANGELOG 2022-11-06 17:50:40 +01:00
Gwendal Roué 0b12e89e62 DocC: AssociationAggregate 2022-11-06 17:18:27 +01:00
Gwendal Roué 0379947ab1 Rename DocC article about SQL 2022-11-06 16:57:27 +01:00
Gwendal Roué 2e5cf546c6 DocC: RowAdapter 2022-11-06 16:45:13 +01:00
Gwendal Roué 0c011b970b Add missing experimental notices 2022-11-06 16:31:12 +01:00
Gwendal Roué a08a86cc76 Update CONTRIBUTING.md 2022-11-06 16:24:34 +01:00
Gwendal Roué 29a21302a2 Generate documentation in ~/Sites/GRDB 2022-11-06 16:02:36 +01:00
Gwendal Roué 13c804d1cc DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué 811d287bd9 Row.withUnsafeData 2022-11-06 16:02:36 +01:00
Gwendal Roué 1818534513 DocC 2022-11-06 16:02:36 +01:00
Gwendal Roué 8d316dc969 Test insertAndFetch with IGNORE policy 2022-11-06 16:02:36 +01:00
Gwendal Roué 38e7e649c7 Upgrade GRDBPerformance dependencies 2022-10-29 17:10:16 +02:00
Gwendal Roué 3df9e8e5c1 Merge branch 'development' 2022-10-29 16:49:28 +02:00
Gwendal Roué c98d918bf6 v6.2.0 2022-10-29 15:36:01 +02:00
Gwendal Roué c197e2f520 Don't run unicode61 tokenizer categories tests before SQLite 3.25.0 2022-10-29 15:04:09 +02:00
Gwendal Roué 13b3f1d741 Github workflow: use Xcode 14.0.1 2022-10-29 14:35:54 +02:00
Gwendal Roué ad011a0974 CHANGELOG 2022-10-29 14:21:33 +02:00
Gwendal Roué a89dad2554 Fix Swiftlint warnings 2022-10-29 14:21:33 +02:00
Gwendal Roué 4f4553f4f0 Regression tests for tokenizer arguments quoting 2022-10-29 14:21:33 +02:00
Gwendal Roué 9b505bb34b Fix quoting of FTS5 tokenizer arguments
Tokenizer arguments only need to be quoted ("foo" -> "'foo'") when we generate SQL for a tokenizer. They must not be quoted when we instantiate a tokenizer with the fts5_tokenizer.xCreate function.

This commit fixes tokenizer instantiation by not quoting arguments when we call the fts5_tokenizer.xCreate function.

Before this fix, the FTS5Tokenizer.tokenize(query:) method would return incorrect tokens.
2022-10-29 14:21:33 +02:00
Gwendal Roué 6c841bf96e Merge pull request #1289 from idkclub/categories
Add support for passing in categories to the unicode61 tokenizer
2022-10-29 14:08:47 +02:00
Jon 76b05369ff Add support for passing in categories to the unicode61 tokenizer 2022-10-21 16:21:07 -04:00
Gwendal Roué e79b6a5622 Fix typo 2022-10-21 08:50:01 +02:00
Gwendal Roué 13e1f4d7c2 Merge branch 'development' 2022-10-20 14:08:36 +02:00
Gwendal Roué 8aaf1af9f0 v6.1.0 2022-10-20 13:23:37 +02:00
Gwendal Roué 3b10e1df41 CHANGELOG 2022-10-20 13:19:54 +02:00
Gwendal Roué 6caa27cb20 Merge pull request #1288 from jcavar/feature/strict-support
Add support for .strict table option in 3.37+
2022-10-20 13:00:07 +02:00
Gwendal Roué 6ca3bb051a make smokeTest checks SQLCipher 3
It's better to quickly catch failures to support SQLCipher 3.
2022-10-20 08:49:48 +02:00
Gwendal Roué 901d010ab3 Restore the test that strict tables won't accept ill-typed values. 2022-10-20 08:46:49 +02:00
Gwendal Roué 3c4ff5b26e Single test for strict tables
Also, skip the test for old SQLCipher version.
2022-10-20 08:46:49 +02:00
Gwendal Roué 2ade133b50 Move availability check below doc comment 2022-10-20 08:27:46 +02:00
Josip Cavar c57e76be52 Add support for .strict table option in 3.37+ 2022-10-19 15:55:46 +02:00
Gwendal Roué 9531a7f8fc More specialization 2022-09-17 15:49:28 +02:00
Gwendal Roué 9e3eebf4c2 Merge pull request #1279 from daveverwer/add-spi-documentation
Added an external documentation link for the Swift Package Index
2022-09-17 12:46:35 +02:00
Gwendal Roué 1221cb703a Update link to documentation 2022-09-17 12:45:55 +02:00
Dave Verwer 59b40de83e Added a Swift Package Index manifest with an external documentation link. 2022-09-14 12:15:46 +01:00
Gwendal Roué 0ac435744a Merge branch 'development' 2022-09-09 11:50:22 +02:00
Gwendal Roué 589e53b231 v6.0.0 2022-09-09 11:40:39 +02:00
Gwendal Roué 125f112fb7 CHANGELOG 2022-09-09 11:34:58 +02:00
Gwendal Roué c6aa323cd8 Skip flaky test 2022-09-09 09:50:25 +02:00
Gwendal Roué 1c7b618a89 Parallelizable tests 2022-09-09 09:33:57 +02:00
Gwendal Roué d3ad7acd59 No WALSnapshot on macOS and macOS Catalyst
Fix #1276
2022-09-09 08:16:55 +02:00
Gwendal Roué 82b4d90a82 Xcode 14 RC doesn't ship with the Swift 5.6 stdlib
https://forums.swift.org/t/xcode-14-rc-cannot-specialize-protocol-type/60171
2022-09-09 08:16:55 +02:00
Gwendal Roué 2a3318ef9a ALTER TABLE DROP COLUMN is properly reported with SQLITE_ALTER_TABLE for SQLite 3.38+ 2022-09-07 08:51:05 +02:00
Gwendal Roué f2c46784a6 ArrayRowImpl is checked Sendable 2022-09-07 08:50:32 +02:00
Gwendal Roué 9340fdc7c2 DatabaseValue.Storage is checked Sendable 2022-09-07 08:02:34 +02:00
Gwendal Roué b0f7493765 BREAKING: rename request methods that build a DatabasePromise
This creates an opportunity for future `request.filter { ... }` apis that look like standard ones. Why not `Player.filter { $0.score > 1000 }` eventually, perhaps with code generation?
2022-09-06 22:56:40 +02:00
Gwendal Roué 30234fde62 CHANGELOG 2022-09-06 08:54:29 +02:00
Gwendal Roué fdbcb07452 Fix #1275 2022-09-06 08:25:21 +02:00
Gwendal Roué dced16bdce Update SQLiteCustom to v3.39.3 2022-09-05 20:43:51 +02:00
Gwendal Roué 849be02906 Remove useless Xcode requirements in documentation
GRDB 6 requires Xcode 14+, Swift concurrency is always available.
2022-09-05 20:32:50 +02:00
Gwendal Roué b3f5b892a6 CHANGELOG 2022-09-05 08:46:05 +02:00
Gwendal Roué 65efc413fe Fix for failing test for #1274
https://github.com/groue/GRDB.swift/discussions/1274
2022-09-05 08:43:43 +02:00
Gwendal Roué f3b8b7221c Failing test for #1274
https://github.com/groue/GRDB.swift/discussions/1274
2022-09-05 08:42:29 +02:00
Gwendal Roué f04a02731d Add defaultLocalization to GRDB package
This solves the "manifest property 'defaultLocalization' not set; it is required in the presence of localized resources" error
2022-09-04 14:09:35 +02:00
Gwendal Roué 6add38e3e5 BREAKING: Allow ValueObservation to perform different kinds of fetch
We're interested in allowing observations to build values based on snapshots
2022-09-04 12:06:17 +02:00
Gwendal Roué 202b3e5620 Encapsulate ValueObservation database accesses
Also, enhance Database.isolated(readOnly:) by not creating a savepoint if the database is already inside a transaction.
2022-09-04 10:11:22 +02:00
Gwendal Roué 49cce0aa8a CHANGELOG 2022-08-29 14:22:04 +02:00
Gwendal Roué ccf3486827 CHANGELOG 2022-08-29 14:21:01 +02:00
Gwendal Roué cb93979a44 Update CONTRIBUTING.md
It needed to be updated for cross-platform targets
2022-08-28 14:52:31 +02:00
Gwendal Roué 628ac58535 Merge branch 'development' 2022-08-28 13:45:17 +02:00
Gwendal Roué 373f95a6cb v6.0.0-beta.4 2022-08-28 13:44:35 +02:00
Gwendal Roué f2859ff8bf Use SQLITE_OPEN_EXRESCODE when available 2022-08-28 12:50:47 +02:00
Gwendal Roué e2b412afc8 Merge branch 'dev/TableInfo' into development 2022-08-28 12:49:59 +02:00
Gwendal Roué 040e5d9d87 WITHOUT ROWID check: prefer PRAGMA table_list when available
This avoids the undesired errors described in #945.
2022-08-28 12:28:39 +02:00
Gwendal Roué 189430c1fe PRAGMA table_list 2022-08-28 12:28:39 +02:00
Gwendal Roué 3d77a8da86 Update the manual installation documentation 2022-08-28 09:59:52 +02:00
Gwendal Roué c40256600a Update playgrounds doc 2022-08-28 09:49:34 +02:00
Gwendal Roué b617f432c0 Merge branch 'dev/cross-platform-targets' into development 2022-08-27 14:43:33 +02:00
Gwendal Roué 72ef13f4fb CHANGELOG 2022-08-27 14:43:06 +02:00
Gwendal Roué 535f44c463 Update the GRDB6 migration guide 2022-08-27 14:42:57 +02:00
Gwendal Roué 4c10899a3c Single Cross-Platform Target 2022-08-27 13:43:44 +02:00
Gwendal Roué 524ee1d098 Merge pull request #1271 from groue/dev/SQLite-3.39.2
Bump custom SQLite builds v3.39.2
2022-08-27 12:27:56 +02:00
Gwendal Roué 973b679baa CHANGELOG 2022-08-27 12:27:14 +02:00
Gwendal Roué 0321c79c2d Update SQLiteCustom to v3.39.2 2022-08-27 12:16:59 +02:00
Gwendal Roué e82a03615f Merge branch 'development' 2022-08-25 19:11:29 +02:00
Gwendal Roué 51c9071b3d v6.0.0-beta.3 2022-08-25 19:11:20 +02:00
Gwendal Roué 91e5f838d3 Merge branch 'dev/GRDB6-singleton-record' into development 2022-08-25 19:10:09 +02:00
Gwendal Roué d026232cbf CHANGELOG 2022-08-25 19:09:51 +02:00
Gwendal Roué c2e4aaf51d Throw SQLITE_MISUSE in case of programmer error in the aroundXxx callbacks
While writing SingletonRecordTest.swift, I tried the solution below, in order to turn a failed update into an insert:

    func aroundUpdate(_ db: Database, columns: Set<String>, update: () throws -> PersistenceSuccess) throws {
        do {
            _ = try update()
        } catch {
            insert(db)
        }
    }

But this can't work. This `insert(db)` is unable to provide the information we need in `update()`: the result of the eventual RETURNING clause, and the PersistenceSuccess that contains the persisted PersistenceContainer.

So we now detect two misuses: 1) not calling the action method, and 2) not rethrowing the error of the action method.
2022-08-25 19:05:27 +02:00
Gwendal Roué 05b81df614 Update the migration guide with the actions to perform on customized records 2022-08-25 19:05:27 +02:00
Gwendal Roué 3e4b04d4d1 Test the "Single-Row Tables" guide 2022-08-25 19:05:27 +02:00
Gwendal Roué 56cdaabd9c Update the "Single-Row Tables" guide 2022-08-25 19:05:27 +02:00
Gwendal Roué c65a19c50f Merge pull request #1268 from groue/dev/issue-1267
Fix SQL generation of CHECK constraints.
2022-08-25 08:31:53 +02:00
Gwendal Roué 5247a1537c CHANGELOG 2022-08-25 08:31:20 +02:00
Gwendal Roué 58f970701f BREAKING: Fix failing test for #1267
The regression was probably due to a bad interaction between Implicitly Opened Existentials (SE-0352) and Opaque Parameter Declarations (SE-0341) which GRDB 6 now uses in a lot of places.

Considering the sample code below:

    try db.create(table: ...) { t in
      t.column(...).check { $0 != Column(...) }
    }

- The `check` method accepts a closure that returns `any SQLExpressible` (the same as GRDB 5)
- The `!=` SQL comparison operator is `(some SQLSpecificExpressible, some SQLSpecificExpressible) -> SQLExpression`, when it was `(SQLSpecificExpressible, SQLSpecificExpressible) -> SQLExpression` in GRDB 5

The compiler has started preferring interpreting the != operator as Column's Equatable implementation, instead of the `!=` SQL comparison operator

We force the compiler to use the SQL comparison operator by removing the Equatable conformance from Column. It was introduced in a70b42c, as a support for a feature that has been removed since then.

This is a breaking change, but this also is an improvement. Now `column1 != column2` has a single meaning, and the library is less prone to similar regressions in the future.
2022-08-25 08:26:37 +02:00
Gwendal Roué 980f5247f0 Failing test for #1267 2022-08-25 08:12:32 +02:00
Gwendal Roué d70032c483 Merge branch 'development' 2022-08-23 22:17:06 +02:00
Gwendal Roué 14321e411c v6.0.0-beta.2 2022-08-23 22:16:37 +02:00
Gwendal Roué d3d2ad1b91 Merge branch 'dev/upsert-documentation' into development 2022-08-23 22:10:33 +02:00
Gwendal Roué 55f3c2f510 CHANGELOG 2022-08-23 22:05:23 +02:00
Gwendal Roué ffa183821c UPSERT documentation 2022-08-23 22:05:23 +02:00
Gwendal Roué 327911d057 Upsert: add support for conflict target and assignments 2022-08-23 20:02:17 +02:00
Gwendal Roué c6657b7063 ColumnAssignment that does nothing
A cool upsert feature is to overwrite an existing value in case of conflict, but another cool upsert feature is to NOT overwrite an existing value. This commit makes it possible to create a ColumnAssignement that does nothing.
2022-08-23 20:02:17 +02:00
Gwendal Roué 2a5626efea Replace if let x = x with if let x 2022-08-22 20:40:00 +02:00
Gwendal Roué 6bf346ccf5 Merge branch 'development' 2022-08-21 21:57:30 +02:00
Gwendal Roué 1036dd4d6e v6.0.0-beta 2022-08-21 21:56:51 +02:00
Gwendal Roué 48f14c7a8c Merge pull request #1221 from groue/GRDB6/development
GRDB 6
2022-08-21 21:44:19 +02:00
Gwendal Roué 2789444acd Enable UPSERT and RETURNING with SQLCipher 2022-08-21 21:22:34 +02:00
Gwendal Roué 8f8b273424 CHANGELOG organization 2022-08-21 21:22:34 +02:00
Gwendal Roué 37f0a0bb9a BREAKING: throwing EncodableRecord.encode(to:) 2022-08-21 21:22:34 +02:00
Gwendal Roué d2dd18b3e5 Remove note and warning icons
Those are handled by Github now:
https://github.com/community/community/discussions/16925
2022-08-21 21:22:34 +02:00
Gwendal Roué 422e0ae85a BREAKING: Handles both commits and rollbacks
Replace afterNextTransactionCommit(_:) with afterNextTransaction(onCommit:onRollback:)
2022-08-21 21:22:34 +02:00
Gwendal Roué 8f562d3e11 NEW: Upsert 2022-08-21 21:22:34 +02:00
Gwendal Roué a702fe6bc9 BREAKING: persistence callbacks, and support for RETURNING
- Replace performInsert, performUpdate, etc with callbacks: willInsert, aroundInsert, didInsert, etc.
- Always call didInsert, even with INSERT OR IGNORE
- Explicit conflict resolution in persistence methods
- Add ...AndFetch... methods
2022-08-21 21:22:34 +02:00
Gwendal Roué 0ed9367b26 BREAKING: DatabaseCursor no longer exposes its prepared statement 2022-08-21 21:22:34 +02:00
Gwendal Roué eda403bd31 StatementArguments is Hashable 2022-08-21 21:22:34 +02:00
Gwendal Roué c553d2d69e Documentation 2022-08-21 21:22:34 +02:00
Gwendal Roué 5243db7fbc Spelling 2022-08-21 21:22:34 +02:00
Gwendal Roué 4ced8c78e7 Less "iff" (some people think this is a typo)
iff = if and only if
2022-08-21 21:22:34 +02:00
Gwendal Roué c38d903f4d Make RequestProtocols.swift easier to read 2022-08-21 21:22:34 +02:00
Gwendal Roué 1239c14e6d Explicit initializers for HasOneThrough and HasManyThrough associations 2022-08-21 21:22:34 +02:00
Gwendal Roué 5004994344 TODO 2022-08-21 21:22:34 +02:00
Gwendal Roué c86581dedc Make SQLQueryGenerator.swift easier to read 2022-08-21 21:22:34 +02:00
Gwendal Roué 546bba17fb Make LockedBox.swift easier to read 2022-08-21 21:22:34 +02:00
Gwendal Roué 27b65c9a80 BREAKING: Starting DatabaseRegionObservation returns a cancellable 2022-08-21 21:22:34 +02:00
Gwendal Roué 1bfba945d3 Fix invalid Swift syntax in documentation 2022-08-21 21:22:34 +02:00
Gwendal Roué 4c73456f86 Make SQL.swift easier to read 2022-08-21 21:22:34 +02:00
Gwendal Roué 84940af3dc Cleanup statement separator character set 2022-08-21 21:22:34 +02:00
Gwendal Roué e0786537db BREAKING: replace Int32 with CInt everywhere it is possible 2022-08-21 21:22:34 +02:00
Gwendal Roué 496c2ae359 Make Database+Statements.swift easier to read 2022-08-21 21:22:34 +02:00
Gwendal Roué 5b7c58faf4 Make Database+Schema.swift easier to read 2022-08-21 21:22:34 +02:00
Gwendal Roué 0658808028 Make Database.swift easier to read
Enhance documentation, and rename some types and variables.
2022-08-21 21:22:34 +02:00
Gwendal Roué fb6ea57d74 Don’t setup database observation in read-only connections.
Observation of read-only connections has turned useless since read-only transactions are no longer reported to TransactionObserver, in #1213
2022-08-21 21:22:34 +02:00
Gwendal Roué 0879311646 Make TransactionObserver.swift easier to read
Add some documentation, and rename some types and variables.
2022-08-21 21:22:34 +02:00
Gwendal Roué 2f2cccacf9 Remove UI tests of demo apps, since GRDBQuery is tested on its own
(Don't test the framework)
2022-08-21 21:22:34 +02:00
Gwendal Roué e5d10ed8c1 fix async AppDatabaseTests tests 2022-08-21 21:22:34 +02:00
Gwendal Roué 070ee2c796 Makefile: disable -warn-concurrency and -enable-actor-data-race-checks
This creates issues with Xcode 14 beta 4
2022-08-21 21:22:34 +02:00
Gwendal Roué 9a9406a69d SE-0353: Constrained Existential Types
https://github.com/apple/swift-evolution/blob/main/proposals/0353-constrained-existential-types.md
2022-08-21 21:22:34 +02:00
Gwendal Roué b2eafd4a13 SE-0361: Extensions on bound generic types
https://github.com/apple/swift-evolution/blob/main/proposals/0361-bound-generic-extensions.md
2022-08-21 21:22:34 +02:00
Gwendal Roué 36892fee55 BREAKING: Bump minimum SQLite version to 3.19.3 2022-08-21 21:22:34 +02:00
Gwendal Roué 49a66e197b Foster some FetchRequest<...> in the documentation 2022-08-21 21:22:34 +02:00
Gwendal Roué 80ec31f588 BREAKING: remove DerivableRequest.limit(_:offset:) 2022-08-21 21:22:34 +02:00
Gwendal Roué c26ed6c280 NEW: throw decoding errors 2022-08-21 21:22:34 +02:00
Gwendal Roué eb98541923 Documentation 2022-08-21 21:22:34 +02:00
Gwendal Roué 895964de16 BREAKING: Throwing FetchableRecord.init(row:) 2022-08-21 21:22:34 +02:00
Gwendal Roué 927fc21f00 NEW: ValueObservation.map accepts a throwing closure
This will allow us to call a throwing FetchableRecord.init(row:) from this operator
2022-08-21 21:22:34 +02:00
Gwendal Roué a15f731042 BREAKING: remove Record.copy()
This will allow FetchableRecord.init(row:) to throw
2022-08-21 21:22:34 +02:00
Gwendal Roué 3000cd3c7f TODO 2022-08-21 21:22:34 +02:00
Gwendal Roué 2011776cbe Remove misleading comments 2022-08-21 21:22:34 +02:00
Gwendal Roué 33a039717c Refer to UIApplication notifications by their names
It looks like FB9801372 was fixed
2022-08-21 21:22:34 +02:00
Gwendal Roué a20d543bcf Swiftlint: disable the for_where rule 2022-08-21 21:22:34 +02:00
Gwendal Roué 55445dcc7c NEW: RangeReplaceableCollection.append(contentsOf: cursor) 2022-08-21 21:22:34 +02:00
Gwendal Roué 34a4fa6444 TODO 2022-08-21 21:22:34 +02:00
Gwendal Roué dba7f1b2dc BREAKING: turn Cursor.isEmpty into a property
https://github.com/apple/swift-evolution/blob/main/proposals/0310-effectful-readonly-properties.md
2022-08-21 21:22:34 +02:00
Gwendal Roué 180c8975ac Stop using #filePath 2022-08-21 21:22:34 +02:00
Gwendal Roué 11a6d53d8a SE-0326: closure result type inference
https://github.com/apple/swift-evolution/blob/main/proposals/0326-extending-multi-statement-closure-inference.md
2022-08-21 21:22:34 +02:00
Gwendal Roué 42987dd849 Cleanup filter(rawKeys:) 2022-08-21 21:22:34 +02:00
Gwendal Roué 7ffc332327 BREAKING: replace selectID() with selectPrimaryKey(as:)
Since Optional is a database value like others, selectID would be a request of optionals for records with an optional ID type:

    struct Player: Identifiable, MutablePersistableRecord {
        var id: Int64?
    }

    Player.selectID() // QueryInterface<Int64?>

This is not good, because primary keys are not null. And those requests would fetch impractical types such as [Int64?], Set<Int64?>, Int64??.

Instead, we introduce selectPrimaryKey(as:), which allows the user to provide the desired type.

    Player.selectPrimaryKey(as: Int64.self) // QueryInterface<Int64>
2022-08-21 21:22:34 +02:00
Gwendal Roué a9fcf1b9c1 SE-0335, SE-0341, SE-0346, SE-0352, SE-0358: some, any, primary associated types 2022-08-21 21:22:34 +02:00
Gwendal Roué c0c6b34869 SE-0346: primary associated types 2022-08-21 21:22:34 +02:00
Gwendal Roué dd55175978 SE-0345: if let x { }
https://github.com/apple/swift-evolution/blob/main/proposals/0345-if-let-shorthand.md
2022-08-21 21:22:34 +02:00
Gwendal Roué 58293befc9 BREAKING: Optional is a database value like others 2022-08-21 21:22:34 +02:00
Gwendal Roué 458e1e2675 BREAKING: throwing DatabaseQueue() initializer
As a consequence, FTS3.tokenize(_:) is a throwing method as well.
2022-08-21 21:22:33 +02:00
Gwendal Roué 6f0d45eedb BREAKING: throwing DatabaseWriter.barrierWriteWithoutTransaction
It used to be rethrowing, but it was then unable to deal with closed databases.

The async version is modified accordingly: it accepts a Result<Database, Error>, instead of a raw Database.

DatabaseMigrator.asyncMigrate is impacted as well: it accepts a Result<Database, Error>, instead of a (Database, Error?) tuple.
2022-08-21 19:21:57 +02:00
Gwendal Roué fe225fe452 BREAKING: Remove deprecated methods 2022-08-21 19:21:57 +02:00
Gwendal Roué 78b9c543a3 Swift 5.7 required: SPM testing convenience
Make it possible to test SQLITE_ENABLE_FTS5 and SQLITE_ENABLE_PREUPDATE_HOOK with `make test_SPM`.

This is very handy because Xcode 14 beta 3 has difficulties testing GRDBCustom.
2022-08-21 19:21:57 +02:00
Gwendal Roué 86de843bda Swift 5.7 required: Xcode 14 updates 2022-08-21 19:21:57 +02:00
Gwendal Roué 20dcab75c7 Swift 5.7 required: SPM resources 2022-08-21 19:21:57 +02:00
Gwendal Roué 23cbf13af0 Swift 5.7 required: Availability checks 2022-08-21 19:21:57 +02:00
Gwendal Roué 6da7d47394 Swift 5.7 required: Remove compiler checks 2022-08-21 19:21:57 +02:00
Gwendal Roué fcb037bdf0 Swift 5.7 required: Bump deployment targets 2022-08-21 19:21:57 +02:00
Gwendal Roué df0ae43c5f Swift 5.7 required: Sendable 2022-08-21 19:21:26 +02:00
Gwendal Roué fc59b45493 Swift 5.7 required: Package.swift 2022-08-21 19:21:26 +02:00
Gwendal Roué a22113faa5 Swift 5.7 required: podspec 2022-08-21 19:21:26 +02:00
Gwendal Roué d1a32d1950 Swift 5.7 required: Makefile 2022-08-21 19:21:26 +02:00
Gwendal Roué e150ca6864 Migration guide to GRDB 6 2022-08-21 19:21:26 +02:00
Gwendal Roué 9d7e27ced1 Add support for index origin 2022-07-25 08:07:27 +02:00
Gwendal Roué df7ba20ff2 Test columnInfos(in:) for views 2022-07-24 15:17:20 +02:00
Gwendal Roué 8dc0168841 Database.sqliteConnection setter is private 2022-07-24 15:14:35 +02:00
Gwendal Roué 23f4254ae3 Merge branch 'development' 2022-07-09 18:28:22 +02:00
Gwendal Roué 2df6a17c1c v5.26.0 2022-07-09 18:27:57 +02:00
Gwendal Roué 5aeee0e429 CHANGELOG 2022-07-09 17:17:27 +02:00
Gwendal Roué 3a61a8a0e0 Merge pull request #1253 from george-signal/george-signal/optional-memory-management
Make memory management optional.
2022-07-09 17:14:11 +02:00
Gwendal Roué e0766449f1 Fix compilation error on iOS Xcode 13.3.1.app, macOS 12, Swift 5.6 2022-07-09 16:14:37 +02:00
Gwendal Roué c1e752132c Document why DatabasePool.releaseMemory() needs a barrier 2022-07-09 14:28:09 +02:00
Gwendal Roué 6ab90a03c4 Document releaseMemoryEventually and automaticMemoryManagement 2022-07-09 14:00:00 +02:00
Gwendal Roué 23fa42a3e4 Make Database.releaseMemory() public
This allows us to document how to release memory asynchronously with a DatabaseQueue (in the next commit)
2022-07-09 13:55:39 +02:00
Gwendal Roué 07eaeee123 automaticMemoryManagement tests check for actual connection closing 2022-07-09 13:39:39 +02:00
Gwendal Roué 0bfb4de02d Enhance DatabaseQueue automatic memory management
We have async methods, now: no need to use a global dispatch queue.
2022-07-09 13:39:11 +02:00
Gwendal Roué d72b7109ad DatabasePool automatic memory management no longer uses any reader barrier
This fixes the failing `testDatabasePoolDoesNotPreventConcurrentReadsOnPressureEvent` test
2022-07-09 13:39:11 +02:00
Gwendal Roué e1a63a4c05 Introduce DatabasePool.releaseMemoryEventually 2022-07-09 13:33:01 +02:00
Gwendal Roué caab403282 Failing test for concurrent read on memory warning 2022-07-09 13:31:15 +02:00
George Nachman bbe94a9607 Make memory management optional.
Memory management may not be desirable for all
users of GRDB. `DatabasePool.releaseMemory`
creates a barrier which may cause normally fast
readers to block for a long time. If this is not a
desirable tradeoff, the new
`automaticMemoryManagement` flag in
`Configuration` allows you to disable this feature
of GRDB.
2022-07-05 15:27:55 -07:00
Gwendal Roué 84bee1977e Merge pull request #1248 from groue/dev/WALSnapshot
Avoid double notification of the initial value for ValueObservation on DatabasePool
2022-06-30 20:35:52 +02:00
Gwendal Roué 0aa561e61c [skip-ci] CHANGELOG 2022-06-30 19:32:35 +02:00
Gwendal Roué b1b51c01f8 [skip-ci] Xcode drives me crazy 2022-06-30 19:32:24 +02:00
Gwendal Roué cc5196757d Fix for Xcode 12.4 2022-06-30 19:22:23 +02:00
Gwendal Roué 0e9766373d Merge pull request #1246 from sameer4/patch-1
Update AssociationsBasics.md
2022-06-30 10:43:50 +02:00
Sameer aacaa433c9 Update AssociationsBasics.md
Fixed a typo
2022-06-30 12:51:53 +05:00
Gwendal Roué 44ec3535c2 Documentation 2022-06-24 16:48:38 +02:00
Gwendal Roué 38c0d68db7 WALSnapshot
SQLITE_ENABLE_SNAPSHOT is available from Xcode 14 :-)
2022-06-24 16:48:38 +02:00
Gwendal Roué f3cc4add9f Merge pull request #1240 from danielinoa/patch-1
Fix inline documentation typo in Row
2022-06-12 14:47:16 +02:00
Daniel Inoa 432670e13a Fix documentation typo in Row 2022-06-12 05:14:28 -07:00
Gwendal Roué 3ba13b0af6 Merge pull request #1239 from groue/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-06-12 08:32:19 +02:00
dependabot[bot] 1a6228e2c5 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-11 15:37:15 +00:00
Gwendal Roué e02f2c8aba Merge branch 'development' 2022-06-11 17:35:55 +02:00
Gwendal Roué c0e9c8746d v5.25.0 2022-06-11 17:35:39 +02:00
Gwendal Roué d1cba5e5c8 TODO 2022-06-11 17:35:39 +02:00
Gwendal Roué bf824bf68c Makefile: support for Xcode 14.0 2022-06-11 14:59:02 +02:00
Gwendal Roué 5e5b44aa7f Fix Swiftlint build phase 2022-06-11 14:59:02 +02:00
Gwendal Roué 806919b5be Merge pull request #1235 from groue/dev/raise-default-qos
Raise default Quality of Service to .userInitiated
2022-06-08 23:35:48 +02:00
Gwendal Roué a289aecc3c CHANGELOG 2022-06-08 08:13:12 +02:00
Gwendal Roué 3f7adec072 Default qos is .userInitiated
Addresses #1234
2022-06-08 08:12:47 +02:00
Gwendal Roué c9f3a1e17f CHANGELOG 2022-06-08 08:12:30 +02:00
Gwendal Roué cf2a79e12f Merge pull request #1228 from turrisxyz/Dependabot-GitHub-Actions
chore: Included githubactions in the dependabot config
2022-06-08 08:09:37 +02:00
Gwendal Roué a0212eb129 [skip ci] Early mention of the async accesses 2022-06-07 19:32:39 +02:00
Gwendal Roué d5470b7278 Merge pull request #1233 from GetToSet/ethanwong/fix-xcode-14-warning
Fix warnings of redundant conformance constraint on Xcode 14.
2022-06-07 09:33:44 +02:00
Ethan Wong cd6960f5e9 Fix warnings of redundant conformance constraint on Xcode 14. 2022-06-07 11:35:37 +08:00
naveen f72859b5b2 chore: Included githubactions in the dependabot config
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-06-01 01:30:32 +00:00
Gwendal Roué b947065d25 Merge pull request #1226 from turrisxyz/Pinned-Dependencies-GitHub
chore: Set permissions for GitHub actions
2022-05-31 08:12:22 +02:00
naveen 11f95806c4 chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-05-31 00:30:47 +00:00
Gwendal Roué 2ac5c77353 Merge branch 'development' 2022-05-26 13:32:23 +02:00
Gwendal Roué 2a849d380c v5.24.1 2022-05-26 13:31:48 +02:00
Gwendal Roué fd31632203 Bump GRDBPerformance dependencies 2022-05-26 13:31:48 +02:00
Gwendal Roué 4a98a53dad CHANGELOG 2022-05-26 12:09:42 +02:00
Gwendal Roué 952ee0a137 Rename Pool.async to asyncGet 2022-05-25 17:25:43 +02:00
Gwendal Roué ee92db9d6f Pool has a QoS 2022-05-25 17:21:50 +02:00
Gwendal Roué de4266499c Configuration.readQoS 2022-05-25 17:19:41 +02:00
Gwendal Roué 4b7a9bbe7b CI: raise timeouts 2022-05-25 09:27:01 +02:00
Gwendal Roué 184d5aa4af CI: raise timeouts 2022-05-25 09:01:39 +02:00
Gwendal Roué 6c48e492d1 CI: raise timeouts 2022-05-24 21:58:46 +02:00
Gwendal Roué 26fedd2702 CI: raise timeouts 2022-05-24 20:47:34 +02:00
Gwendal Roué 06216fd875 Merge pull request #1225 from groue/dev/thread-limit
Prevent heavy DatabasePool concurrent reads from creating too many threads
2022-05-24 20:46:54 +02:00
Gwendal Roué 42050e5e28 CHANGELOG 2022-05-24 19:54:51 +02:00
Gwendal Roué 9ed309b470 Fix failing tests for number of threads created by DatabasePool 2022-05-24 19:31:22 +02:00
Gwendal Roué 00d1a80b31 Failing tests for number of threads created by DatabasePool 2022-05-24 19:31:09 +02:00
Gwendal Roué aaf3efe6df Merge pull request #1163 from groue/dev/ci
Tests with GitHub actions
2022-05-24 08:18:57 +02:00
Gwendal Roué d8f2989542 Split SQLCipher clear/encrypted tests 2022-05-23 14:20:26 +02:00
Gwendal Roué 28543109ea Rename CI jobs 2022-05-23 08:18:09 +02:00
Gwendal Roué 63c2bd0876 Raise SQLCipher CI timeouts 2022-05-23 08:17:12 +02:00
Gwendal Roué 59bd10b1b5 Raise all CI timeouts 2022-05-22 18:05:13 +02:00
Gwendal Roué 758f561fbf Raise timeout threshold for SQLCipher CI tests 2022-05-22 17:31:45 +02:00
Gwendal Roué 40b0e98eb5 Delete obsolete Travis setup files 2022-05-22 16:47:21 +02:00
Gwendal Roué 2ec0a4c69d More tests 2022-05-22 16:47:20 +02:00
Gwendal Roué ca43f1e803 Test macOS, All Xcodes and Swifts 2022-05-18 16:40:39 +02:00
Gwendal Roué 0a7e7d1e5c Makefile: support for Xcode 13.4 2022-05-18 13:48:24 +02:00
Gwendal Roué 1260980150 Remove return keywords 2022-05-18 08:14:19 +02:00
Gwendal Roué f0cfde682e Update outdated documentation 2022-05-18 08:12:00 +02:00
Gwendal Roué 096a3b2f0f Merge pull request #1217 from GetToSet/development
Update doc issue on TableRequest.filter(keys:).
2022-05-16 11:03:17 +02:00
Ethan Wong f313a43ef9 Update doc issue on TableRequest.filter(keys:). 2022-05-07 13:32:31 +08:00
Gwendal Roué fead2ea634 Merge branch 'development' 2022-05-01 11:43:49 +02:00
Gwendal Roué 5b254eec16 v5.24.0 2022-05-01 11:43:14 +02:00
Gwendal Roué 3632edb238 Mention SwiftUI support in the README 2022-05-01 11:36:26 +02:00
Gwendal Roué 752415b5fb Merge pull request #1213 from groue/dev/fix-1209
Fix crash when the number of active ValueObservations is high
2022-05-01 08:25:56 +02:00
Gwendal Roué f17a786165 CHANGELOG 2022-04-30 16:07:04 +02:00
Gwendal Roué b89ce00361 Document that read-only transactions are not notified 2022-04-30 16:06:59 +02:00
Gwendal Roué c5eba4741d Test that read-only transactions are not notified 2022-04-30 15:42:57 +02:00
Gwendal Roué fb18a3938f Database.isolated(readOnly: true) avoids triggering database observation
Fix failing test for #1209
2022-04-30 15:27:20 +02:00
Gwendal Roué 5082207bb0 Don't notify read-only transactions 2022-04-30 15:27:20 +02:00
Gwendal Roué 06b5367053 Default transaction kind is .deferred in read-only connections
This applies to both connections open in read-only mode, and pragma query_only.
2022-04-30 14:29:31 +02:00
Gwendal Roué 819ee588c9 Failing test for #1209 2022-04-30 14:26:04 +02:00
Gwendal Roué 1b3f1ed393 Fix typo 2022-04-30 13:26:25 +02:00
Gwendal Roué f0fe7e86ca Merge pull request #1212 from groue/MartinP7r-patch-1
Fix apple docs links
2022-04-29 12:18:03 +02:00
Martin Pfundmair dd5ce280b5 Fix apple docs links 2022-04-29 16:10:03 +09:00
Matt Gallagher 744aa825a3 Merge pull request #1203 from EvanHahn/fix-changelog-links
Fix changelog links
2022-04-20 12:25:10 +10:00
Evan Hahn 24f3de9dfa Fix changelog links
This change:

1. Makes all links use HTTPS (there were a few that used insecure HTTP)
2. Corrects a few links, which previously went to the wrong place

It was easy to find HTTP links—a simple search. I wrote a silly script,
to be run in the browser console, to find the rest:

```js
(() => {
  for (const a of document.getElementsByTagName("a")) {
    if (!/^#\d+$/.test(a.innerText)) {
      continue;
    }

    const id = a.innerText.slice(1);
    const expectedPullHref = `https://github.com/groue/GRDB.swift/pull/${id}`;
    const expectedIssueHref = `https://github.com/groue/GRDB.swift/issues/${id}`;

    if (a.href !== expectedPullHref && a.href !== expectedIssueHref) {
      console.error(`"${a.innerText}" has an invalid href, ${a.href}`);
    }
  }
})();
```

Hope this helps!
2022-04-19 18:30:53 -05:00
Gwendal Roué 4472d3a60e Merge branch 'development' 2022-04-16 10:10:05 +02:00
Gwendal Roué dc03adb4e2 v5.23.0 2022-04-16 10:09:45 +02:00
Gwendal Roué dea9bedacb Merge pull request #1200 from groue/dev/require-swift-5.6-for-concurrency
Require Swift 5.6 Compiler for Concurrency Support
2022-04-14 07:11:17 +02:00
Gwendal Roué 83d243853b CHANGELOG 2022-04-13 23:21:38 +02:00
Gwendal Roué 209192d3a5 Require Swift 5.6 Compiler for Concurrency Support 2022-04-13 23:07:33 +02:00
Gwendal Roué 15c06e0374 Merge branch 'development' 2022-04-02 14:56:09 +02:00
Gwendal Roué 0324f592dc v5.22.2 2022-04-02 14:55:54 +02:00
Gwendal Roué 051787b17f Merge pull request #1196 from layoutSubviews/development
Fix a crash when an observation is quickly cancelled
2022-04-02 14:50:38 +02:00
Gwendal Roué feebc07101 Documentation 2022-04-02 13:21:26 +02:00
Renaud Lienhart 80c15c6ef6 Fix a crash when an observation is quickly cancelled 2022-03-31 10:55:00 +11:00
Gwendal Roué 9014b3ebd0 Fix #1192 2022-03-26 14:48:27 +01:00
Gwendal Roué bec58a32d4 And fix typo... 2022-03-26 12:54:00 +01:00
Gwendal Roué b66374670c CHANGELOG: add 5.22.1 in the list of releases 2022-03-26 12:53:11 +01:00
Gwendal Roué f3992a034d Merge branch 'development' 2022-03-26 11:52:33 +01:00
Gwendal Roué 8b120fa9b6 v5.22.1 2022-03-26 11:52:17 +01:00
Gwendal Roué 8b58ec4cee Merge branch 'dev/issue1194' into development 2022-03-26 11:46:03 +01:00
Gwendal Roué 9b7b603a69 Documentation 2022-03-26 11:44:33 +01:00
Gwendal Roué a3a26bf88f Fix #1194 2022-03-26 11:43:44 +01:00
Gwendal Roué 770484b78d Failing test for #1194 2022-03-26 11:33:10 +01:00
Gwendal Roué fafa74c246 Fix ValueObservation.publisher documentation 2022-03-22 19:24:06 +01:00
Gwendal Roué 62450b5817 Bump performance comparison dependencies 2022-03-22 18:00:21 +01:00
Gwendal Roué e9b8df68ee Merge branch 'development' 2022-03-22 17:38:18 +01:00
Gwendal Roué 9fa831b6bb v5.22.0 2022-03-22 16:41:40 +01:00
Gwendal Roué 43e1871005 Fix for Xcode 12.4 2022-03-22 13:46:09 +01:00
Gwendal Roué 8a6e784428 Fix for Xcode 12.5.1
Without this change, the compiler would crash with Abort trap: 6
2022-03-22 09:26:12 +01:00
Gwendal Roué 727ca68b98 CHANGELOG 2022-03-22 08:36:24 +01:00
Gwendal Roué fb3e08aba8 Merge pull request #1186 from benrb/databaseerror-message
DatabaseError provide error message as localizedFailureReason
2022-03-22 08:26:14 +01:00
Ben Barnett 1c614e8de6 Test localizedFailureReason is not nil
-localizedFailureReason can be nil in some cases, but not in the one we are testing here
2022-03-20 08:23:35 +00:00
Ben Barnett 3f0a8e6730 Provide error message as a failure reason 2022-03-20 08:07:39 +00:00
Gwendal Roué 6916a8feca #1183 cleanup 2022-03-18 03:36:20 +01:00
Gwendal Roué e08dfdb0bf Merge pull request #1183 from groue/dev/strong-observation
Starting a ValueObservation keeps a strong reference on the database connection.
2022-03-17 19:17:03 +01:00
Gwendal Roué 6236b8a068 Move Headers build phase before Compile Sources
This prevents a build error when running tests with Xcode 13.3:

error: Cycle inside GRDBiOS; building could produce unreliable results. This usually can be resolved by moving the target's Headers build phase before Compile Sources.
2022-03-17 18:50:11 +01:00
Gwendal Roué 55dea6f9d2 Makefile: support for Xcode 13.3 2022-03-17 18:44:30 +01:00
Gwendal Roué cdb08988f4 CHANGELOG 2022-03-17 18:44:30 +01:00
Gwendal Roué 881bbd3f0d Update documentation 2022-03-17 18:44:30 +01:00
Gwendal Roué 6ab3fea8fb Refactor ValueObservation 2022-03-17 18:44:30 +01:00
Gwendal Roué 287ceb8b07 Documentation & cleanup 2022-03-17 18:44:30 +01:00
Gwendal Roué 4eefb9afbe Merge pull request #1184 from GetToSet/ethanwong/update-row-adapter-doc
Update RowAdapter doc to cover all concrete adapters.
2022-03-17 18:05:09 +01:00
Ethan Wong 4ea04ec978 Update RowAdapter doc to cover all concrete adapters. 2022-03-18 00:59:16 +08:00
Gwendal Roué c30b49117b If a scope is found, there is no point searching for prefetched rows 2022-03-04 12:04:02 +01:00
Gwendal Roué ec975819b7 Fix for container.decodeNil(forKey:) in the context of including(all:) 2022-03-04 11:55:53 +01:00
Gwendal Roué b974dfa9a7 Use fetchSet when available 2022-03-04 11:40:42 +01:00
Gwendal Roué e19f21be99 TODO 2022-03-04 10:28:23 +01:00
Gwendal Roué 9b0e41ad58 Details about date formats 2022-02-13 12:27:27 +01:00
Gwendal Roué d40474d2b7 Merge branch 'development' 2022-02-06 12:14:25 +01:00
Gwendal Roué 685074932e v5.21.0 2022-02-06 12:14:05 +01:00
Gwendal Roué f1a23bacc0 Extend the thank you notice 2022-02-06 12:10:35 +01:00
Gwendal Roué fbef103f01 CHANGELOG 2022-02-06 12:09:27 +01:00
Gwendal Roué fc9f0bcad1 Wording 2022-02-06 10:20:06 +01:00
Gwendal Roué 1929e96d11 Merge pull request #1165 from BeehiveInnovations/development
Add dynamic library to products to support dynamic linking
2022-02-06 10:13:31 +01:00
Gwendal Roué 9d4eb8a6dd test_install_SPM_Dynamic_Project: use a destination
Otherwise `make test_install_SPM_Dynamic_Project` uses a default destination, which CAN be the current mac, and thus require code signing:

% make test_install_SPM_Dynamic_Project
...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], ... }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
...
❌  error: Signing for "ios-dynamic" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'ios-dynamic' from project 'ios-dynamic')
** BUILD FAILED **
2022-02-06 10:00:58 +01:00
Fahad 3914a9ec21 Updated Makefile. Updated code-signing team 2022-02-06 01:25:34 +04:00
Fahad 29bacc138c Replaced test project with iOS project 2022-02-06 01:14:19 +04:00
Beehive InnovationsandGwendal Roué ba866359b2 Update README.md
Co-authored-by: Gwendal Roué <gr@pierlis.com>
2022-02-03 23:11:54 +04:00
Beehive InnovationsandGwendal Roué ffced55d3c Update README.md
Co-authored-by: Gwendal Roué <gr@pierlis.com>
2022-02-03 22:52:10 +04:00
Beehive Innovations 74caa96dcb Undo and use automatic
More clarity on this now - helps compile optimize and skip producing a `.a` static library entirely.
2022-02-03 22:13:12 +04:00
Beehive Innovations f6bea21e80 The first target should explicitly say static
Otherwise the behavior is undefined since omitting the type may at some point in time cause Xcode to pull it in as dynamic (when they fix their dependency resolution).
2022-02-03 21:44:06 +04:00
Fahad 27f6125099 Dynamic library test added 2022-02-03 13:36:52 +04:00
Beehive Innovations 70ea2027e4 Renamed dynamic library name
In line with naming standard used by other libraries
2022-02-03 13:11:24 +04:00
Beehive Innovations e28658c574 Updated SPM installation instructions
Added note about static / dynamic
2022-02-03 13:09:52 +04:00
fahad@guidedways.com c184b76849 Add dynamic library to products to allows dynamic linking 2022-02-03 09:25:42 +04:00
Gwendal Roué d23d74f65f Merge pull request #1164 from groue/dev/migrator-is-not-concurrent
Drop async apis from DatabaseMigrator
2022-02-01 18:17:02 +01:00
Gwendal Roué 984a5b4c4c CHANGELOG 2022-02-01 16:55:05 +01:00
Gwendal Roué 8e84beee36 Fix Swift 5.6 warnings 2022-02-01 10:08:24 +01:00
Gwendal Roué 95ce4a3f8a Drop async apis from DatabaseMigrator
This is because DatabaseMigrator can't be Sendable as long as it runs migrations that embed non-@Sendable closures.
2022-02-01 09:53:20 +01:00
Gwendal Roué 98ca653c6a Merge branch 'development' 2022-02-01 09:07:15 +01:00
Gwendal Roué e5a8e130d7 v5.20.0 2022-02-01 07:44:09 +01:00
Gwendal Roué 72e8dd2816 Cleanup 2022-01-31 20:20:02 +01:00
Gwendal Roué b5338650db Bump performance comparison dependencies 2022-01-31 19:23:55 +01:00
Gwendal Roué 75f72472ff Cleanup 2022-01-31 08:37:57 +01:00
Gwendal Roué 09f7d4d952 Complete #1161 2022-01-30 15:27:11 +01:00
Gwendal Roué c1c3cf6605 Merge pull request #1162 from groue/dev/fix-truncate-optimization
Fix truncate optimization handling
2022-01-30 15:26:14 +01:00
Gwendal Roué fc7f24ef6e Test case insensitivity of truncation optimization prevention 2022-01-30 14:57:37 +01:00
Gwendal Roué 3d0b34590f Fix typo 2022-01-30 14:49:31 +01:00
Gwendal Roué 2d6c2873e0 CHANGELOG 2022-01-30 14:42:22 +01:00
Gwendal Roué 4e65425c00 Cleanup 2022-01-30 14:41:29 +01:00
Gwendal Roué b82f92f726 Test for cursor next() followed by forEach() 2022-01-30 14:33:22 +01:00
Gwendal Roué b8c0e9d2c2 Fix failing test for cached statement which does not prevent the truncate optimization 2022-01-30 14:24:28 +01:00
Gwendal Roué b2df255306 Failing test for cached statement which does not prevent the truncate optimization 2022-01-30 14:12:46 +01:00
Gwendal Roué c60b8cfc53 Refactor prevention of truncate optimization
We now always use the same authorizer, which is always ready to prevent truncate optimization depending on the current transaction observers.
2022-01-30 14:07:43 +01:00
Gwendal Roué 9dc6fbd7f9 Fix #1159 2022-01-30 12:27:19 +01:00
Gwendal Roué 9a4e1f7806 Merge pull request #1161 from groue/dev/write-target-queue
Target DispatchQueue for non-read-only database connections
2022-01-30 12:07:25 +01:00
Gwendal Roué 5dde1409ad CHANGELOG 2022-01-29 17:54:33 +01:00
Gwendal Roué 936fd3ed5f Test that DatabaseMigrator.eraseDatabaseOnSchemaChange does not deadlock on Configuration.writeTargetQueue 2022-01-29 17:47:30 +01:00
Gwendal Roué ed4471c5b9 Configuration.writeTargetQueue 2022-01-29 17:45:21 +01:00
Gwendal Roué dd025a14e4 Merge pull request #1160 from groue/dev/privacy
Hide statement arguments by default
2022-01-29 16:29:58 +01:00
Gwendal Roué 29808e51ff Fix typo 2022-01-29 16:06:22 +01:00
Gwendal Roué 426044154c Fix public statement arguments for system SQLite 2022-01-29 15:54:39 +01:00
Gwendal Roué d69db0b9a1 CHANGELOG 2022-01-29 15:32:21 +01:00
Gwendal Roué 914bd14cd1 CHANGELOG 2022-01-29 15:27:44 +01:00
Gwendal Roué b5395a097c Documentation 2022-01-29 15:27:40 +01:00
Gwendal Roué 99c596f778 Fix DatabaseError public initializer 2022-01-29 15:21:44 +01:00
Gwendal Roué fd22fac5c0 Don't shed too much light on expandedSQL & expandedDescription properties 2022-01-29 15:12:41 +01:00
Gwendal Roué 6e3a15ebed Statement.description no longer contains statement arguments 2022-01-29 14:57:18 +01:00
Gwendal Roué bb8b39f7fd Documentation for public statement arguments 2022-01-29 14:54:47 +01:00
Gwendal Roué fc5138ae91 Configuration.publicStatementArguments
This flags allows database errors and trace events to hide or show statement arguments by default.
2022-01-28 13:57:12 +01:00
Gwendal Roué d3985c7ebf TraceEvent.description no longer contains statement arguments
Use TraceEvent.expandedDescription in order to see statements arguments
2022-01-27 19:30:00 +01:00
Gwendal Roué 9f0ba49c93 DatabaseError.description no longer contains statement arguments
Use DatabaseError.expandedDescription in order to see statements arguments
2022-01-27 19:30:00 +01:00
Gwendal Roué 09922c34ff Code formatting 2022-01-23 12:24:34 +01:00
Gwendal Roué 3826003d93 TODO 2022-01-23 10:51:15 +01:00
Gwendal Roué 9baa72cfd7 Mention association annotation methods in the main README 2022-01-21 13:48:51 +01:00
Gwendal Roué aacc69f485 Fix typos 2022-01-21 13:43:44 +01:00
Gwendal Roué 301fb34702 Fix failing test for including(all:) on limited request and composite primary keys 2022-01-21 13:42:42 +01:00
Gwendal Roué 6444285ee2 Failing test for including(all:) on limited request and composite primary keys 2022-01-21 13:39:40 +01:00
Gwendal Roué bd42dc69f0 CHANGELOG 2022-01-19 19:27:50 +01:00
Gwendal Roué 14d8763a84 Merge branch 'development' 2022-01-19 16:20:21 +01:00
Gwendal Roué c46e8257d8 v5.19.0 2022-01-19 16:18:59 +01:00
Gwendal Roué 948c7870bd Merge pull request #1151 from freak4pc/fk-docs
Fix documentation for foreignKeysEnabled
2022-01-19 15:50:16 +01:00
Shai MishaliandGwendal Roué fa896eee23 Update GRDB/Core/Configuration.swift
Co-authored-by: Gwendal Roué <gr@pierlis.com>
2022-01-19 16:46:55 +02:00
Shai Mishali c4023ccf0a Fix documentation for foreignKeysEnabled 2022-01-19 15:48:11 +02:00
Gwendal Roué fe92b93f0b CHANGELOG 2022-01-19 08:15:19 +01:00
Gwendal Roué 28109a3947 Merge pull request #1144 from TimAEllis/feature/add-drop-column
Add drop column support
2022-01-19 08:06:24 +01:00
Gwendal Roué 124cba1b21 Work around missing SQLITE_ALTER_TABLE action 2022-01-19 07:29:16 +01:00
Gwendal Roué ca47426c61 Merge pull request #1149 from BB9z/fix-typos
Fix typos
2022-01-19 06:31:12 +01:00
Gwendal Roué 90c85c6703 TODO 2022-01-19 06:25:33 +01:00
BB9z 6d3f309cad Fix typos 2022-01-19 00:10:42 +08:00
Gwendal Roué 06dbaba7cc Add failing test for schema cache invalidation 2022-01-18 08:50:42 +01:00
Timothy Ellis daf44d9baa Exposed drop(column:) to custom builds and cipher 2022-01-18 10:11:12 +11:00
Timothy Ellis 187a661626 Updated to reflect drop column 2022-01-17 10:31:11 +11:00
Timothy Ellis 55302cb937 Added test for drop column 2022-01-17 10:02:23 +11:00
Timothy Ellis 869d776962 Added drop column support 2022-01-17 10:02:04 +11:00
Gwendal Roué b53b43b1fc Cleanup 2022-01-16 14:50:55 +01:00
Gwendal Roué 42d29b305e Cleanup 2022-01-16 13:54:03 +01:00
Gwendal Roué 8f100a6395 Document that GRDB/SQLCipher must be the only pod
Addresses #1141
2022-01-16 10:49:02 +01:00
Gwendal Roué 44dd21690f Merge pull request #1139 from groue/dev/more-1124
Deal with authorization callbacks from more cursors
2022-01-14 18:43:13 +01:00
Gwendal Roué 6d31190c3f DatabaseCursor.forEach() honors the _isDone flag 2022-01-14 18:31:16 +01:00
Gwendal Roué 549f7ec66e Cleanup and cursor profiling tests 2022-01-14 18:25:30 +01:00
Gwendal Roué 3eea2967b3 Improve error message 2022-01-14 17:49:17 +01:00
Gwendal Roué 8e6827070f Improve documentation 2022-01-14 13:47:54 +01:00
Gwendal Roué d105b35750 More #1124-related documentation 2022-01-14 13:29:34 +01:00
Gwendal Roué 149d5ac151 Fix GRDBProfiling 2022-01-14 13:13:34 +01:00
Gwendal Roué ed6c5438b9 Move DatabaseCursor state to Statement 2022-01-14 13:13:34 +01:00
Gwendal Roué bd67153095 Fix #1124 for more cursors 2022-01-13 14:28:04 +01:00
Gwendal Roué 3fff6b2f51 Fix typo 2022-01-13 07:29:38 +01:00
Gwendal Roué 62a0b1c148 Fix typo 2022-01-09 19:03:31 +01:00
Gwendal Roué dfca044433 Merge branch 'development' 2022-01-09 18:56:04 +01:00
Gwendal Roué 78df734f51 v5.18.0 2022-01-09 17:36:31 +01:00
Gwendal Roué e72b7e4597 Merge pull request #1133 from groue/dev/strict-tables
Support for STRICT tables
2022-01-09 17:22:50 +01:00
Gwendal Roué fb6c695658 CHANGELOG 2022-01-09 17:12:17 +01:00
Gwendal Roué a1c0c6d1f3 Update documentation for the new table/index creation options 2022-01-09 17:01:37 +01:00
Gwendal Roué 68f3e5586b Test strict tables, and table/index creation options 2022-01-09 17:01:37 +01:00
Gwendal Roué 8760033045 Update the list of extended result codes from SQLite 3.37.2
This updated list contains SQLITE_CONSTRAINT_DATATYPE, introduced with strict tables.
2022-01-09 17:01:37 +01:00
Gwendal Roué b2fabf5fc3 Strict tables need REAL and ANY column types 2022-01-09 17:01:37 +01:00
Gwendal Roué 95f1d83d78 The .strict table creation option
The .strict table creation option

The .strict table creation option
2022-01-09 17:01:37 +01:00
Gwendal Roué 790c054a28 Fix Swiftlint warnings 2022-01-09 14:43:27 +01:00
Gwendal Roué 06a5d6f44b Merge pull request #1132 from groue/dev/sqlite-3.72.2
Bump custom SQLite builds v3.72.2
2022-01-09 14:42:28 +01:00
Gwendal Roué 3145a916a0 CHANGELOG 2022-01-09 14:33:33 +01:00
Gwendal Roué 94ff9f3e45 The casing of ColumnInfo.type depends on the SQLite version 2022-01-09 14:28:00 +01:00
Gwendal Roué c172dac909 Update test for SQLite to v3.37.2 2022-01-09 14:21:51 +01:00
Gwendal Roué 5b7ba122e8 Bump custom SQLite to v3.37.2 2022-01-09 14:06:27 +01:00
Gwendal Roué 0513e0acf8 Enhance wording in the pull request template 2022-01-09 13:42:22 +01:00
Gwendal Roué b3d49de023 Mention CONTRIBUTING in the pull request template 2022-01-09 13:41:11 +01:00
Gwendal Roué 779e2c202f Merge pull request #1128 from groue/dev/issue-1124
Deal with authorization callbacks from cursors of FetchableRecord
2022-01-09 13:38:20 +01:00
Gwendal Roué be45781cf9 CHANGELOG 2022-01-09 13:31:03 +01:00
Gwendal Roué c7d816b860 Merge branch 'development' into dev/issue-1124 2022-01-09 13:27:54 +01:00
Gwendal Roué a0f6f7a9ab Merge pull request #1129 from groue/dev/detached-column
Detached columns
2022-01-09 13:27:04 +01:00
Gwendal Roué 86c0180487 CHANGELOG 2022-01-09 13:17:29 +01:00
Gwendal Roué 80c11d0bc4 Merge branch 'development' into dev/detached-column 2022-01-09 13:13:31 +01:00
Gwendal Roué 66602ba2e2 CHANGELOG 2022-01-09 13:13:11 +01:00
Gwendal Roué 8fdcc020e0 Documentation 2022-01-08 14:09:14 +01:00
Gwendal Roué 1bb2029e74 Fix #1124 by dealing with authorizers 2022-01-08 13:51:41 +01:00
Gwendal Roué fc0e1bede1 Methods that fully consume a cursor prefer forEach to next
This allows custom forEach implementations to wrap the full consumption of a cursor
2022-01-08 13:50:14 +01:00
Gwendal Roué 823af1944e Cursor.forEach is a customization point 2022-01-08 13:47:54 +01:00
Gwendal Roué 2093b477df Failing test for #1124 2022-01-08 13:18:32 +01:00
Gwendal Roué 29cd08cba4 Fix typo 2022-01-07 15:01:29 +01:00
Gwendal Roué 76523db5b9 Removed undesired :nodoc: comment 2022-01-07 14:58:42 +01:00
Gwendal Roué c0305853bc Enhance fatal error message for reversed literal ordering terms 2022-01-07 14:43:57 +01:00
Gwendal Roué 5d51f2a884 New Embedding SQL in Query Interface Requests chapter 2022-01-07 14:41:15 +01:00
Gwendal Roué bdf54e80a9 Mention detached columns in the documentation of expression.forKey(_:) 2022-01-07 13:30:27 +01:00
Gwendal Roué e799c8534e ColumnExpression.detached 2022-01-07 10:07:15 +01:00
Gwendal Roué 536ad2ebff Merge branch 'master' into development 2022-01-07 10:06:42 +01:00
Gwendal Roué 972f45295f Request make smokeTest to pass before submitting a pull request. 2022-01-07 10:06:21 +01:00
Gwendal Roué b96bd52c38 Merge branch 'dev/issue-1074-incremental_backup_api' into development 2022-01-06 18:36:31 +01:00
Gwendal Roué 2af0a74676 Fix SQLCipher 3 and 4 test projects 2022-01-06 14:13:25 +01:00
Gwendal Roué 4aa37f6169 Expert users need raw access to expert values 2022-01-06 13:52:09 +01:00
Gwendal Roué 37571525e6 Merge branch 'development' into dev/issue-1074-incremental_backup_api 2022-01-06 13:45:26 +01:00
Gwendal Roué 911b2a76d8 Merge pull request #1121 from byohay/feature/fix-variables-with-spaces
GRDB: quote PROJECT_DIR and SRCROOT environment variables.
2021-12-31 14:32:29 +01:00
Gwendal Roué 54b13de632 Merge pull request #1120 from jnross/joe/fix-typo
Fix typos of the word "default"
2021-12-31 13:56:56 +01:00
Ben Yohay 4a3232199f GRDB: quote PROJECT_DIR and SRCROOT environment variables.
Using those variables without quoting will yield unexpected results if
they contain spaces.
2021-12-29 14:40:56 +02:00
Joseph Ross bf28abbb25 Fix typos of the word "default" 2021-12-28 14:49:33 -08:00
Gwendal Roué c945504a34 Addition and substraction are not bijective functions (due to floating point rounding errors) 2021-12-21 11:13:28 +01:00
Gwendal Roué 8217966215 Table creation methods accept throwing closures 2021-12-21 09:26:55 +01:00
Gwendal Roué c96a74658c TODO 2021-12-19 12:34:16 +01:00
Gwendal Roué 042e220f49 Rewrite CONTRIBUTING.md 2021-12-18 14:31:02 +01:00
Michael Allman a71639159b Add DatabaseBackupProgress and update the documentation 2021-12-15 01:52:25 -05:00
Gwendal Roué d633927999 Merge branch 'development' 2021-12-14 19:33:32 +01:00
Gwendal Roué 8df7020ad7 v5.17.0 2021-12-14 19:32:51 +01:00
Gwendal Roué bc95c5c977 Performance tests: upgrade dependencies 2021-12-14 19:15:59 +01:00
Gwendal Roué ef4709d3f0 Fix async vaccum(info:) tests by using the same encryption level for the destination database 2021-12-14 14:21:16 +01:00
Gwendal Roué e1984721dc Merge pull request #1079 from groue/dev/async
Async / Await
2021-12-14 13:29:02 +01:00
Gwendal Roué 469898c5df CHANGELOG 2021-12-14 13:15:22 +01:00
Gwendal Roué 0207aef4dc CHANGELOG 2021-12-14 12:48:48 +01:00
Gwendal Roué d7604d2174 Merge branch 'development' into dev/async 2021-12-14 12:46:49 +01:00
Gwendal Roué 89421c92fb More support for inclusion checks with explicit collation
This commit addresses https://github.com/groue/GRDB.swift/issues/1094

The position of the `collating` method is now irrelevant in all those cases:

// name COLLATE NOCASE IN ('foo', 'bar')
["foo", "bar"].contains(Column("name")).collating(.nocase)
["foo", "bar"].contains(Column("name").collating(.nocase))

// name BETWEEN 'foo' AND 'bar' COLLATE NOCASE
("foo"..."bar").contains(Column("name")).collating(.nocase)
("foo"..."bar").contains(Column("name").collating(.nocase))

// (name >= 'foo' COLLATE NOCASE) AND (name < 'bar' COLLATE NOCASE)
("foo"..<"bar").contains(Column("name")).collating(.nocase)
("foo"..<"bar").contains(Column("name").collating(.nocase))
2021-12-14 12:45:50 +01:00
Gwendal Roué 0cf4c4efba Merge branch 'development' into dev/async 2021-12-12 17:00:08 +01:00
Gwendal Roué 710142edc0 CHANGELOG 2021-12-12 16:44:43 +01:00
Gwendal Roué 7001b60cf7 More support for association existence check
New: support for associated tables WITHOUT ROWID with a compound primary key
New: support for associated views

Checking for the existence of associated CTEs is still not implemented (it fails with "table does not exist" error).
2021-12-12 16:43:40 +01:00
Gwendal Roué dcc2d211b2 Database.primaryKey() fails for views 2021-12-12 16:14:25 +01:00
Gwendal Roué 340203686d ValueObservation.removeDuplicates(by:) 2021-12-12 15:12:34 +01:00
Gwendal Roué ae609cec3b Support for the TOTAL SQL aggregate function 2021-12-12 14:46:43 +01:00
Gwendal Roué 8ba89a398a Add ABS and LENGTH SQL functions on association aggregates 2021-12-12 14:27:41 +01:00
Gwendal Roué 95b3f447e4 Revert "Make sure Inflections.default is lazily loaded, even in optimized release builds"
This reverts commit c62ccf1de7 (aimed at fixing #755).

We can do this because https://github.com/apple/swift/pull/30445 is present in the Swift 5.3 release https://github.com/apple/swift/releases/tag/swift-5.3-RELEASE
2021-12-12 13:57:34 +01:00
Gwendal Roué bc2a66e40f Don't throw any error when checking if a table is WITHOUT ROWID 2021-12-12 13:29:02 +01:00
Gwendal Roué cb32a0d0cc CHANGELOG 2021-12-12 12:56:53 +01:00
Gwendal Roué effc991de1 Deprecate DatabaseRegion.init(table:)
This commit reverts #510
2021-12-12 12:36:27 +01:00
Gwendal Roué 3049b88fea Merge pull request #1110 from maxhumber/patch-1
Minor changes to a tip in the README
2021-12-12 10:27:13 +01:00
Max Humber c39db96521 Minor changes to a tip in the README 2021-12-11 15:28:02 -05:00
Gwendal Roué d7514f84f1 Disable concurrency check flags by default 2021-12-10 12:40:08 +01:00
Gwendal Roué 1b62e06c4a Expose Sendable conformance to Swift 5.5
But async apis are still only exposed to Swift 5.5.2.

Sendable conformances are helpful for users of Xcode < 13.2.
2021-12-10 08:08:47 +01:00
Michael Allman bedf2dbcd4 Revise and correct some names and backup code documentation 2021-12-08 10:23:11 -08:00
Michael Allman 13e195db40 Revise incremental backup API to report progress via a throwing callback
function
2021-12-08 09:37:10 -08:00
Michael Allman 087ad10086 Add an API to track progress of and cancel backups in progress, for both
the DatabaseReader/DatabaseWriter API and Database API
2021-12-08 09:37:10 -08:00
Michael Allman f012c011b1 Import the Foundation framework in DatabaseReader.swift, which is required to get the Progress class 2021-12-08 09:37:10 -08:00
Michael Allman f829d46b7f Change default backup page step size from 5 to 100, which is the value used in the sqlite3 cli .backup command 2021-12-08 09:37:10 -08:00
Michael Allman ab6f18e46d Initial commit of code to implement progress-reporting database backups 2021-12-08 09:37:10 -08:00
Gwendal Roué 9579671c02 Remove a concurrency-related warning 2021-12-08 18:16:36 +01:00
Gwendal Roué 01f4c04c4d DatabaseReader is Sendable 2021-12-08 18:12:28 +01:00
Gwendal Roué 7ac78a8ec1 Share concurrency check flags with tests 2021-12-08 18:11:44 +01:00
Gwendal Roué 97e00ab44f Fix async test for SQLCipher VACUUM INTO 2021-12-08 13:18:12 +01:00
Gwendal Roué 33d9ca0e97 UIApplication notification names are isolated to @MainActor
I believe this is incorrect: FB9801372 (UIApplication.didReceiveMemoryWarningNotification should not be declared @MainActor)

Meanwhile, just use the string version.

A workaround based on a MainActor-isolated task can't work due to conflict between compiler version and minimum iOS target:

    #if compiler(>=5.5) && canImport(_Concurrency)
    if #available(...) { // Check for availability of concurrency runtime
        Task { @MainActor [weak self] in
            NotificationCenter.default.addObserver(..., name: UIApplication.didReceiveMemoryWarningNotification, object: nil)
        }
    } else {
        // IMPOSSIBLE CASE: No access to Task, no access to notification names
    }
    #else
    NotificationCenter.default.addObserver(..., name: UIApplication.didReceiveMemoryWarningNotification, object: nil)
    #endif
2021-12-08 12:48:19 +01:00
Gwendal Roué b2985b77c4 Concurrency check flags depend on Xcode version
Xcode 12 won't accept those flags. And we only need them starting Xcode 13.2
2021-12-08 12:00:32 +01:00
Gwendal Roué ec882e8126 Enable concurrency check flags by default 2021-12-08 11:18:54 +01:00
Gwendal Roué 61b0df8017 Enable async APIs on Xcode 13.2+ only
Xcode 13.1 won't have access to async apis. This simplifies our availability checks.

The techniques were inspired from:

- https://github.com/swift-server/guides/blob/main/docs/concurrency-adoption-guidelines.md#api-design
- https://github.com/swift-server/guides/blob/main/docs/concurrency-adoption-guidelines.md#backwards-compatibility-of-declarations-and-checked-swift-concurrency
2021-12-08 11:17:40 +01:00
Gwendal Roué 103266d70c Merge branch 'development' into dev/async 2021-12-08 08:00:49 +01:00
Gwendal Roué 3f02724e60 RowDecodingError is Sendable
Xcode 13.2 RC won't compile unless we make a Sendable copy of the row that could not be decoded.
2021-12-08 07:59:43 +01:00
Gwendal Roué ca05a93c98 Merge pull request #1107 from tcwalther/tw-fix-db-create-index-docstring
Fix docstring for Database.create(index: ...)
2021-12-07 13:32:26 +01:00
Thomas Walther 48f6cee7a6 Fix docstring for Database.create(index: ...) 2021-12-07 13:20:14 +01:00
Gwendal Roué 8ed16f4440 Fix some compiler warnings with -Xfrontend -warn-concurrency
https://twitter.com/olebegemann/status/1467893554915782668
2021-12-07 09:23:37 +01:00
Gwendal Roué 6ec3ebc398 Merge branch 'development' into dev/async 2021-12-06 18:04:35 +01:00
Gwendal Roué 86d0fedfbb Fix wording 2021-12-05 17:08:15 +01:00
Gwendal Roué 0330365d49 Merge branch 'development' 2021-12-05 16:59:59 +01:00
Gwendal Roué ca2f36781e v5.16.0 2021-12-05 16:59:37 +01:00
Gwendal Roué 6c7f71f620 Fix typo 2021-12-05 16:47:32 +01:00
Gwendal Roué 60bf5d30b0 Merge pull request #1106 from groue/dev/annotated-with-association
Sugar for fetching only a few columns of associated records
2021-12-05 16:41:49 +01:00
Gwendal Roué 94caf4ba97 todo: find a way to prefix the selection with the association key 2021-12-05 15:53:59 +01:00
Gwendal Roué a7002e1e09 Enhance "Columns Selected by an Association" 2021-12-05 15:22:07 +01:00
Gwendal Roué 54a991b3b9 Emphasize sections 2021-12-05 15:15:38 +01:00
Gwendal Roué 54ca12437a CHANGELOG 2021-12-05 15:10:25 +01:00
Gwendal Roué 3298cca75f Rewrite the Joining And Prefetching Associated Records chapter 2021-12-05 15:10:25 +01:00
Gwendal Roué 4fe0b687d2 Documentation for annotated(withOptional:), annotated(withRequired:) 2021-12-05 15:04:51 +01:00
Gwendal Roué 9df0f4cdbd Inline documentation for annotated(withOptional:), annotated(withRequired:) 2021-12-05 15:04:44 +01:00
Gwendal Roué e1dc24ac93 Update examples with Team/Player 2021-12-04 10:01:31 +01:00
Gwendal Roué 88e60ed0c6 Update FAQ: How do I select only one column of an associated record? 2021-12-04 09:50:16 +01:00
Gwendal Roué b4ca103002 Tests for annotated(withOptional:), annotated(withRequired:) 2021-12-04 09:49:23 +01:00
Gwendal Roué 564c4cef5c annotated(withOptional:), annotated(withRequired:) 2021-12-03 19:24:56 +01:00
Gwendal Roué 7a77a1fd06 Merge branch 'development' 2021-12-02 19:43:04 +01:00
Gwendal Roué c7291db360 v5.15.0 2021-12-02 18:48:36 +01:00
Gwendal Roué a52d1b1d21 Merge pull request #1102 from groue/dev/ValueObservation-explicit-region-tracking
Explicit tracked region for ValueObservation
2021-12-02 18:40:40 +01:00
Gwendal Roué 89b1783220 TrackingMode is a property of ValueObservation
No reducer changes the tracking mode, so let's simplify the code.
2021-12-02 17:22:18 +01:00
Gwendal Roué 76d2168988 Extend the general description of ValueObservation behavior
Link to the ability to track something which is not the fetched region.
2021-12-02 17:22:18 +01:00
Gwendal Roué e419bb55ca Enhance documentation of DatabaseRegion 2021-12-02 17:22:18 +01:00
Gwendal Roué 06eb45db65 Documentation for ValueObservation(region:fetch:) 2021-12-02 17:22:18 +01:00
Gwendal Roué 6180e4b815 Fix for Swift 5.3 2021-12-02 17:22:18 +01:00
Gwendal Roué 85747935c8 ValueObservation can track an explicit database region 2021-12-02 17:22:18 +01:00
Gwendal Roué 36fba9a79a TODO: deprecate DatabaseRegion(table:)
We have `Table` now, wich is DatabaseRegionConvertible.

This deprecation will revert https://github.com/groue/GRDB.swift/pull/510
2021-12-02 17:21:58 +01:00
Gwendal Roué 6240585a03 Make sure ValueObservation fetches in an isolated transaction
Previously, ValueObservation could fetch in a non-isolated way. When an external connection would commit changes, we could fetch inconsistent values. Here we make sure ValueObservation always fetch in an isolated way.
2021-12-02 09:46:02 +01:00
Gwendal Roué ad66fbc666 ValueObserver documentation 2021-12-02 09:46:02 +01:00
Gwendal Roué e69092ca6a Add DatabaseRegionConvertible to Table 2021-12-02 09:45:38 +01:00
Gwendal Roué bb2ce74125 Add helper method Database.isolated(readOnly:) 2021-12-02 09:45:28 +01:00
Gwendal Roué 06bf3980b6 Fix documentation links 2021-12-02 09:17:36 +01:00
Gwendal Roué 97d4a60148 Merge branch 'development' into dev/async
# Conflicts:
#	Documentation/DemoApps/GRDBDemoiOS/README.md
#	Documentation/DemoApps/README.md
2021-11-27 12:05:24 +01:00
Gwendal Roué 6dc7367853 Merge branch 'development' 2021-11-25 18:29:23 +01:00
Gwendal Roué 4228df9c06 v5.14.0 2021-11-25 18:23:31 +01:00
Gwendal Roué ca9fd1f8e6 CHANGELOG 2021-11-25 18:18:15 +01:00
Gwendal Roué 1fbf2f8693 GRDBCombineDemo uses the GRDBQuery package 2021-11-25 17:26:19 +01:00
Gwendal Roué 811c41af6d @Query has been exported to https://github.com/groue/GRDBQuery 2021-11-25 15:25:40 +01:00
Gwendal Roué 5d87609f4b Ignore .swiftpm 2021-11-25 15:08:53 +01:00
Gwendal Roué a9036a4563 Ignore .swiftpm 2021-11-25 14:49:37 +01:00
Gwendal Roué 988c7bb62f Query documentation 2021-11-25 13:56:07 +01:00
Gwendal Roué 51182fc862 Query documentation 2021-11-25 13:55:00 +01:00
Gwendal Roué 485509a8cc Query documentation 2021-11-25 13:47:27 +01:00
Gwendal Roué a81f80cddb Query documentation 2021-11-25 13:46:50 +01:00
Gwendal Roué d590a06212 Query documentation 2021-11-25 12:39:50 +01:00
Gwendal Roué b3a1497791 Query documentation 2021-11-25 12:38:27 +01:00
Gwendal Roué c7f0a80a91 Query documentation 2021-11-25 10:52:10 +01:00
Gwendal Roué 068081d043 Query documentation 2021-11-25 10:37:06 +01:00
Gwendal Roué 01ba7de2f9 Query documentation 2021-11-25 10:16:38 +01:00
Gwendal Roué 10e784bee3 Query documentation 2021-11-25 10:11:35 +01:00
Gwendal Roué 21c6c9c794 Query documentation 2021-11-25 09:49:19 +01:00
Gwendal Roué dec515aceb Query documentation 2021-11-25 09:42:21 +01:00
Gwendal Roué 9be04da707 Query documentation 2021-11-25 09:41:25 +01:00
Gwendal Roué 6b02b4ca02 Rename Query generic parameter to Request 2021-11-25 09:37:40 +01:00
Gwendal Roué 5983473aa5 Query documentation 2021-11-25 09:33:24 +01:00
Gwendal Roué 1c4456a9fc Query documentation 2021-11-25 09:28:59 +01:00
Gwendal Roué 82a2776acd Query documentation 2021-11-25 09:14:54 +01:00
Gwendal Roué c7fb5cb3e3 Query demo README 2021-11-24 20:48:56 +01:00
Gwendal Roué f726b670f9 Polish Query demo app 2021-11-24 20:18:37 +01:00
Gwendal Roué 62e710b9b1 Cleanup Query demo app 2021-11-24 19:16:39 +01:00
Gwendal Roué 66f953a21a Rename Query demo app 2021-11-24 17:19:07 +01:00
Gwendal Roué ceed45cf22 QuerySideEffect demo 2021-11-24 09:40:15 +01:00
Gwendal Roué 13a040ae1b CHANGELOG 2021-11-18 08:39:01 +01:00
Gwendal Roué d8b83fba12 improve compilation time 2021-11-18 08:34:59 +01:00
Gwendal Roué 93c4249619 ForeignKeyViolation.databaseError(_:) 2021-11-16 08:51:33 +01:00
Gwendal Roué ebc8524706 Add missing public qualifiers 2021-11-16 08:45:34 +01:00
Gwendal Roué ea41f34f3d Quote table name in raw SQL query 2021-11-16 08:40:16 +01:00
Gwendal Roué 861ca5f022 Merge branch 'development' into dev/async 2021-11-07 16:30:37 +01:00
Gwendal Roué 59f9482aa7 Fix links to documentation images 2021-11-07 16:29:17 +01:00
Gwendal Roué 8658b7bc10 Merge branch 'development' 2021-11-07 16:20:59 +01:00
Gwendal Roué 42eeb54d6f v5.13.0 2021-11-07 16:06:50 +01:00
Gwendal Roué fe32981e0e Performance report: fallback for hardware name
The https://apple.stackexchange.com/a/98089 technique does not work on my mac
2021-11-07 16:06:50 +01:00
Gwendal Roué 0c9de25a8c Bump number of operations performed by performance tests
Apple Silicon and SSD are too fast, and we need to display higher numbers
2021-11-07 16:06:50 +01:00
Gwendal Roué 2b5d3f1d72 Upgrade Realm version in performance tests 2021-11-07 16:06:50 +01:00
Gwendal Roué 9da2e66e46 Fix flaky test 2021-11-07 14:58:18 +01:00
Gwendal Roué 8bf45e5452 Remove debugging code 2021-11-07 14:46:36 +01:00
Gwendal Roué d85168dd3c Query cleanup 2021-11-07 13:47:04 +01:00
Gwendal Roué 7ed103d5e4 Documentation 2021-11-07 13:25:50 +01:00
Gwendal Roué b44a9eb470 Extract @Query into its own package 2021-11-07 12:03:55 +01:00
Gwendal Roué d240d8c5f0 Fix typo 2021-11-07 11:58:51 +01:00
Gwendal Roué 74f268a378 Makefile: test_GRDBAsyncDemo 2021-11-07 11:49:42 +01:00
Gwendal Roué f74ce91a17 Merge branch 'development' into dev/async
# Conflicts:
#	CHANGELOG.md
#	Documentation/Concurrency.md
#	README.md
2021-11-07 11:47:01 +01:00
Gwendal Roué 23a9b6e1ae Makefile: test BUILD_LIBRARY_FOR_DISTRIBUTION & XCFramework 2021-11-07 11:13:35 +01:00
Gwendal Roué 03822bdf99 Makefile: skip test_framework_GRDBtvOS_minTarget until simulator is installed 2021-11-07 10:45:03 +01:00
Gwendal Roué b0c77a5e0f Makefile: tests for demo apps 2021-11-07 10:41:12 +01:00
Gwendal Roué af2d65ef49 Fix Swiftlint warnings 2021-11-07 10:32:00 +01:00
Gwendal Roué 72271b0299 CHANGELOG 2021-11-07 10:07:46 +01:00
Gwendal Roué b5433803ef Makefile: support for Xcode 13.1 2021-11-07 10:03:42 +01:00
Gwendal Roué 037443e600 Wording 2021-11-07 09:36:50 +01:00
Gwendal Roué 19b182b6a8 Remove the immediate transactions advice
It has write transactions fail faster, but it also has writes that only read, or writes that do nothing fail - for no good reason.
2021-11-07 09:20:38 +01:00
Gwendal Roué 0955ac3001 New concurrent read illustration 2021-11-07 09:14:23 +01:00
Gwendal Roué ff7773cf41 Wording 2021-11-07 08:29:24 +01:00
Gwendal Roué 8a0cbb63f5 Wording 2021-11-07 08:25:24 +01:00
Gwendal Roué d3e55cf8f6 wording 2021-11-07 08:23:47 +01:00
Gwendal Roué 7af3858ff6 More robust DatabasePool.close() test 2021-11-07 08:17:48 +01:00
Gwendal Roué c3bbd3d6f8 CHANGELOG 2021-11-07 08:17:46 +01:00
Gwendal Roué eb9d0bce58 Documentation 2021-11-07 08:16:58 +01:00
Gwendal Roué 716e223844 Fix typo 2021-11-06 17:09:12 +01:00
Gwendal Roué 1df5d834e8 Wording 2021-11-06 17:06:51 +01:00
Gwendal Roué 05b03ef56c Wording 2021-11-06 17:02:47 +01:00
Gwendal Roué 06827de207 All fetches are stale 2021-11-06 17:00:19 +01:00
Gwendal Roué 1070b9bd9d Exercise guarantees in context 2021-11-06 16:05:05 +01:00
Gwendal Roué de4c06478d New Concurrency Images 2021-11-06 16:00:40 +01:00
Gwendal Roué 78d5b4abaa Doc of completion block-based async accesses 2021-11-06 12:39:05 +01:00
Gwendal Roué 5e89d08fd0 Layout Concurrency Guide 2021-11-06 12:27:19 +01:00
Gwendal Roué 3d5b436a81 CHANGELOG 2021-11-06 12:23:54 +01:00
Gwendal Roué 1738ad34cd Extract the Concurrency Guide 2021-11-06 12:23:54 +01:00
Gwendal Roué 65668cfc8e Documentation 2021-11-06 11:22:16 +01:00
Gwendal Roué 9249efbe6f Fix UIKit warnings 2021-11-06 09:43:38 +01:00
Gwendal Roué 913860f3ce UUID encoding strategies uppercaseString and lowercaseString
This commit was influenced by https://forums.swift.org/t/53058
2021-11-04 20:33:55 +01:00
Gwendal Roué 088f76db9e Merge pull request #1095 from groue/dev/foreign-keys-checks
Precise foreign key checks for migrations
2021-11-04 19:38:56 +01:00
Gwendal Roué 454dd73c4c CHANGELOG 2021-11-04 18:52:19 +01:00
Gwendal Roué c81a4dbf32 Distinguish "FOREIGN KEY constraint failed" from "FOREIGN KEY constraint violation" errors 2021-11-04 18:44:44 +01:00
Gwendal Roué 127c4e0440 Rename methods that check foreign keys 2021-11-04 18:26:24 +01:00
Gwendal Roué ffdc80646e Documentation 2021-11-04 16:12:46 +01:00
Gwendal Roué 7e9a2f5a73 Fix typo 2021-11-04 15:12:24 +01:00
Gwendal Roué 8a36f4d94e Clean up tests 2021-11-04 15:10:41 +01:00
Gwendal Roué 63ba4fb294 Rename unsafeWithoutDeferredForeignKeyChecks to disablingDeferredForeignKeyChecks 2021-11-04 15:10:33 +01:00
Gwendal Roué d0997efbb6 Documentation 2021-11-04 14:27:34 +01:00
Gwendal Roué 6193c6aa00 foreignKeyViolations() and checkForeignKeyViolations() 2021-11-04 14:19:11 +01:00
Gwendal Roué b66b907fbc Documentation 2021-11-03 14:56:59 +01:00
Gwendal Roué 51c15e9db6 Precise handling of foreign key checks in migrations 2021-11-03 13:26:24 +01:00
Gwendal Roué 0a8967ccde move applied migration identifiers table creation to the top of migrations execution
https://github.com/zdnk/GRDB.swift/commit/51ff937397248355d4b264aedfd5a8f05893a2b8

Thanks @zdnk :-)
2021-11-03 08:33:09 +01:00
Gwendal Roué 19fd58f64f Documentation 2021-11-02 21:48:51 +01:00
Gwendal Roué 19c7ec568c Documentation 2021-11-02 21:42:44 +01:00
Gwendal Roué bc8a31dcd2 Documentation 2021-11-02 20:33:03 +01:00
Gwendal Roué 2273efa07f Improve documentation of persistence methods 2021-11-02 08:13:34 +01:00
Gwendal Roué 62f568d932 Merge branch 'development' into dev/async 2021-11-02 06:02:29 +01:00
Gwendal Roué 1aab03b02a Fix close() test
The behavior of sqlite3_close_v2() depends on SQLite version. Don't test this behavior.
2021-11-01 19:55:31 +01:00
Gwendal Roué 1646dfc49b Fix FAQ organization 2021-11-01 10:28:31 +01:00
Gwendal Roué 640a67257f Documentation for async DatabaseMigrator.migrate() 2021-11-01 10:19:03 +01:00
Gwendal Roué 5be27dd90a CHANGELOG 2021-11-01 10:08:19 +01:00
Gwendal Roué 485ce79293 More ValueObservation async cancellation test 2021-11-01 09:45:16 +01:00
Gwendal Roué 5725d9db21 Refactor the ValueObservation async cancellation test 2021-11-01 08:03:00 +01:00
Gwendal Roué 7897c6a799 asyncUnsafeRead handle closed connection 2021-11-01 07:25:26 +01:00
Gwendal Roué 5f549ef6af Cleanup with Table 2021-11-01 07:22:09 +01:00
Gwendal Roué ac94a2f90e Merge branch 'development' into dev/async 2021-10-31 19:35:13 +01:00
Gwendal Roué 15b38353bc Add experimental warning to the documentation of async methods 2021-10-31 19:35:05 +01:00
Gwendal Roué a7c1a99866 Fix wording 2021-10-31 18:48:26 +01:00
Gwendal Roué 1a87faacfa Merge branch 'development' into dev/async 2021-10-31 18:32:03 +01:00
Gwendal Roué 5cc881138e CHANGELOG 2021-10-31 18:31:32 +01:00
Gwendal Roué 5e56a4465c close() documentation 2021-10-31 18:27:08 +01:00
Gwendal Roué 20cb50f52d Public close() method 2021-10-31 18:12:13 +01:00
Gwendal Roué b4f30784f4 Support for SwiftLint installed via Homebrew on Apple Silicon 2021-10-31 15:32:26 +01:00
Gwendal Roué 0f0c345ebb Fix markdown format 2021-10-31 14:38:10 +01:00
Gwendal Roué 1ee2c8097a SharedValueObservation is experimental 2021-10-31 13:55:18 +01:00
Gwendal Roué 3e58f35f1e I'm so fed up with this
https://developer.apple.com/forums/thread/663975
2021-10-31 13:54:53 +01:00
Gwendal Roué f70b75633c Documentation: fix typo 2021-10-31 12:34:09 +01:00
Gwendal Roué 3a44311b95 Documentation: fix typos and wordings 2021-10-31 12:33:17 +01:00
Gwendal Roué e0a6f43101 Documentation: async/await examples 2021-10-31 12:30:44 +01:00
Gwendal Roué 0c8c8cb1f4 Concurrency Guide: fix wordings 2021-10-31 12:22:23 +01:00
Gwendal Roué fa8598d1e8 Async/Await support is experimental 2021-10-31 11:50:05 +01:00
Gwendal Roué 6cf5a2c33d Merge branch 'development' into dev/async
# Conflicts:
#	CHANGELOG.md
2021-10-31 11:48:27 +01:00
Gwendal Roué 9790d05795 CHANGELOG 2021-10-31 11:29:32 +01:00
Gwendal Roué 273b9befd8 Update documentation for date and uuid encoding strategies 2021-10-31 11:26:27 +01:00
Gwendal Roué 31a5180a58 CHANGELOG 2021-10-31 11:09:22 +01:00
Gwendal Roué 8076e7c725 Fix failing tests for key/id encoding strategies 2021-10-31 11:07:17 +01:00
Gwendal Roué 4cc3768344 Failing tests for key/id encoding strategies 2021-10-31 11:04:01 +01:00
Gwendal Roué 0317c4e454 Reuse screenshot of Combine demo 2021-10-31 06:06:55 +01:00
Gwendal Roué db78c22904 Demo app requirements 2021-10-31 06:04:46 +01:00
Gwendal Roué 6b36c74de9 Concurrency: move saved(_:) and inserted(_:) suggestion to a FAQ 2021-10-31 06:03:35 +01:00
Gwendal Roué 51ab275714 Concurrency: suggest saved(_:) and inserted(_:) 2021-10-30 23:44:30 +02:00
Gwendal Roué b9e1f4604e Concurrency Guide: fix wordings 2021-10-30 23:20:29 +02:00
Gwendal Roué 0b853c5447 Concurrency Guide: fix wordings 2021-10-30 21:08:02 +02:00
Gwendal Roué 691ee8f7fd Concurrency Guide: fix typos and wordings 2021-10-30 20:38:48 +02:00
Gwendal Roué c755dc70ef Restrict async/await to Xcode 13.1+ 2021-10-30 20:09:39 +02:00
Gwendal Roué 9cc30018b6 CHANGELOG 2021-10-30 19:52:09 +02:00
Gwendal Roué 4616ef5229 Remove Concurrency guide from main README 2021-10-30 19:47:57 +02:00
Gwendal Roué 10a741a346 Concurrency Guide 2021-10-30 19:47:57 +02:00
Gwendal Roué 3c78029b3c SwiftUI demo apps: PlayerEditionView saves player when back button is pressed 2021-10-25 19:07:40 +02:00
Gwendal Roué 3ea6fb2201 Merge branch 'development' into dev/async 2021-10-25 18:23:00 +02:00
Gwendal Roué de7d5f42d4 Clarify the benefits of shared observations 2021-10-25 08:47:50 +02:00
Gwendal Roué 450a7c2d71 SharedValueObservation async sequence 2021-10-24 17:47:08 +02:00
Gwendal Roué 2542ad7de8 Reuse ValueObservationStart, and move BufferingPolicy to AsyncValueObservation 2021-10-24 17:33:32 +02:00
Gwendal Roué 2a665df672 Merge branch 'development' into dev/async 2021-10-24 17:13:16 +02:00
Gwendal Roué bddbc31733 Merge pull request #1088 from groue/dev/shareValueObservation
Shared ValueObservation
2021-10-24 17:11:31 +02:00
Gwendal Roué 92e4c8f785 I want a new keyboard ASAP 2021-10-24 17:06:25 +02:00
Gwendal Roué 909afc0233 Fix typo 2021-10-24 17:05:10 +02:00
Gwendal Roué d73228a812 Documentation 2021-10-24 17:04:07 +02:00
Gwendal Roué 76cac45720 Fix typo 2021-10-24 16:35:32 +02:00
Gwendal Roué 22a4f08f40 CHANGELOG 2021-10-24 16:25:18 +02:00
Gwendal Roué ae0edde7c5 Documentation 2021-10-24 16:22:47 +02:00
Gwendal Roué c62e4fd94c Documentation 2021-10-24 16:17:46 +02:00
Gwendal Roué 7690db9284 Documentation 2021-10-24 16:15:46 +02:00
Gwendal Roué 2f212b8a5f SharedValueObservation error handling 2021-10-24 15:46:32 +02:00
Gwendal Roué abc6c55e14 Documentation 2021-10-24 15:17:52 +02:00
Gwendal Roué 450ff62392 Fix SQLCipher tests 2021-10-24 14:03:39 +02:00
Gwendal Roué a5dd61ff13 Fix availability checks in tests
Fix `make test_framework_GRDBiOS_minTarget` with Xcode 13
2021-10-24 13:41:07 +02:00
Gwendal Roué c3618e0cf0 SharedValueObservation publisher 2021-10-24 12:38:00 +02:00
Gwendal Roué a3a804fa82 Upgrade CombineExpectations 2021-10-24 12:37:28 +02:00
Gwendal Roué 8ccaf59d4d Default SharedValueObservation extent: .whileObserved 2021-10-23 17:47:12 +02:00
Gwendal Roué 9e0b1b3ded SharedValueObservation 2021-10-23 17:23:48 +02:00
Gwendal Roué 0a65399a7b Merge branch 'development' into dev/async 2021-10-23 12:48:33 +02:00
Gwendal Roué 618969ab2a More tests for optional collections from prefetched rows 2021-10-23 12:46:30 +02:00
Gwendal Roué 53c662d179 Decode optional collections from prefetched rows
This allows to define records that only decode to-many associations when they are eager-loaded.

See https://github.com/groue/GRDB.swift/issues/1084#issuecomment-948880910
2021-10-23 12:40:55 +02:00
Gwendal Roué 02f71cfecc AsyncValueObservation: let user control buffering policy 2021-10-20 08:16:24 +02:00
Gwendal Roué 00cd547ea6 UIKit demo app: use UIAction 2021-10-19 20:12:26 +02:00
Gwendal Roué 66bbf15f58 UIKit demo app: use @IBSegueAction 2021-10-19 19:30:23 +02:00
Gwendal Roué dbb19979d6 Demo app: prefer tracking over trackingConstantRegion
For those specific player requests, trackingConstantRegion is _correct_. But readers may blindly copy and paste, and use trackingConstantRegion when they should not.

So the demo apps prefer the unoptimized but always-correct `tracking` method instead.
2021-10-19 08:57:45 +02:00
Gwendal Roué 0d8d40d683 Demo apps: document why we use .immediate observation scheduling 2021-10-19 08:55:41 +02:00
Gwendal Roué 5d69d2a35b All demo apps provide unbounded read-only access to the database
Also, UIKit app now does not have to deal with an initial asynchronous delivery of players
2021-10-19 08:54:48 +02:00
Gwendal Roué 128399871a Demo projects organization 2021-10-19 08:15:14 +02:00
Gwendal Roué 4dd5677755 Demo apps: rename newRandom to makeRandom 2021-10-19 08:03:56 +02:00
Gwendal Roué dbf3335188 Demo apps: prefer inserted(_:) over mutating a temp variable 2021-10-19 08:02:09 +02:00
Gwendal Roué 048082f4b2 Demo apps: prefer isEmpty(db) over fetchCount(db) == 0 2021-10-19 07:58:03 +02:00
Gwendal Roué 6a980f90da Async sequence is unsuitable for preventing flash of missing content
See https://forums.swift.org/t/52862 for a longer explanation.

Fortunately, we can base @Query on Combine publishers, which do not have this problem.
2021-10-18 08:41:44 +02:00
Gwendal Roué e4bfea8bcc Use inserted(_:) in order to avoid a temporary variable 2021-10-17 21:25:19 +02:00
Gwendal Roué 329a7c8301 @Query cleanup & documentation 2021-10-17 14:09:53 +02:00
Gwendal Roué 1ff5159d40 Add the MIT license to Query.swift
This file is designed to be copied into user apps: make sure the license comes along.
2021-10-17 13:38:28 +02:00
Gwendal Roué d6f8a9a9ea UIKit demo app is iOS15+/watchOS8+ 2021-10-17 13:26:42 +02:00
Gwendal Roué c711efc7e0 Combine demo app is iOS15+ 2021-10-17 13:26:42 +02:00
Gwendal Roué 01d2bc89a9 Cleanup async demo app 2021-10-17 13:26:42 +02:00
Gwendal Roué 6bcee422b7 Improve tests of async demo app 2021-10-17 13:26:42 +02:00
Gwendal Roué 07faea9cfe Restore demo app tests 2021-10-17 13:26:42 +02:00
Gwendal Roué b76950f695 Follow EnvironmentValues.managedObjectContext example: appDatabase is not optional 2021-10-17 13:26:42 +02:00
Gwendal Roué b9e79791a3 Modernize syntax 2021-10-17 13:26:42 +02:00
Gwendal Roué 533cef692f Use SwiftUI Label 2021-10-17 13:26:42 +02:00
Gwendal Roué 0bed585fd0 Use dismiss from SwiftUI environment 2021-10-17 13:26:42 +02:00
Gwendal Roué 54bef0bba6 Workaround "flash of missing content" https://forums.swift.org/t/52862 2021-10-17 13:26:42 +02:00
Gwendal Roué a7820f9a35 Cleanup 2021-10-17 13:26:42 +02:00
Gwendal Roué bd89311f4d Refactor Query for async sequences 2021-10-17 13:26:41 +02:00
Gwendal Roué 1e17bf011f Refactor Query for AppDatabase access 2021-10-17 13:26:41 +02:00
Gwendal Roué ed8ff31b3e GRDBAsyncDemo 2021-10-17 13:26:41 +02:00
Gwendal Roué 0ead20cdd6 All async apis are experimental 2021-10-17 13:26:41 +02:00
Gwendal Roué 2ad6131d08 Require canImport(_Concurrency)
This fixes the build for macOS 11.5
2021-10-17 13:26:41 +02:00
Gwendal Roué 646782d499 test AsyncValueObservation with all DatabaseQueue & Pool
Also use .trackingConstantRegion since it triggers optimizations
2021-10-17 13:24:10 +02:00
Gwendal Roué a888c46b1a New: AsyncValueObservation 2021-10-17 13:24:10 +02:00
Gwendal Roué 046d1d6355 -Xfrontend -warn-concurrency -Xfrontend -enable-actor-data-race-checks 2021-10-17 13:24:10 +02:00
Gwendal Roué 8936ef6a40 DatabaseMigrator async methods
migrate(_:)
migrate(_:upTo:)
2021-10-17 13:24:10 +02:00
Gwendal Roué 8754b10a40 Documentation of DatabaseWriter async methods 2021-10-17 13:24:10 +02:00
Gwendal Roué 1f73c20ae2 DatabaseWriter async methods
write, writeWithoutTransaction, barrierWriteWithoutTransaction, erase, vacuum, vacuum(into:)
2021-10-17 13:24:10 +02:00
Gwendal Roué a827188881 async DatabaseReader.unsafeRead 2021-10-17 13:23:34 +02:00
Gwendal Roué 64be4763f2 async DatabaseReader.read 2021-10-17 13:23:34 +02:00
Gwendal Roué 20a1c8666e Merge pull request #1078 from groue/dev/qol
More convenience methods
2021-10-17 13:21:22 +02:00
Gwendal Roué e6f00a7c4b CHANGELOG 2021-10-17 13:11:06 +02:00
Gwendal Roué aa05148a18 Documentation 2021-10-17 13:05:07 +02:00
Gwendal Roué 94c86211bc Add inserted and saved in the list of record methods 2021-10-17 13:00:13 +02:00
Gwendal Roué b4570c0e84 Fix typos in Table documentation 2021-10-17 12:56:24 +02:00
Gwendal Roué 8c9ac0ecd2 Documentation for exists, isEmpty, saved, inserted 2021-10-17 12:28:42 +02:00
Gwendal Roué 5f44162abe Rename request.exists(_:) to isEmpty(_:) 2021-10-17 12:27:19 +02:00
Gwendal Roué 55b938a1f5 Test exists(_:), exists(_🔑) and exists(_🆔) 2021-10-17 12:27:19 +02:00
Gwendal Roué 235ea2e689 Test saved(_:) and inserted(_:) 2021-10-17 12:27:19 +02:00
Gwendal Roué 7a046fb27e exists(_:) quality of life improvements 2021-10-17 12:27:19 +02:00
Gwendal Roué cbd68099a9 inserted(_:) and saved(_:) quality of life improvements 2021-10-17 12:27:19 +02:00
Gwendal Roué 6d44c05f3b DatabasePool.erase() prevents concurrent reads until it has completed 2021-10-13 14:46:47 +02:00
Gwendal Roué fe6d4665ee CHANGELOG 2021-10-12 18:32:38 +02:00
Gwendal Roué 0c6c2c7eb4 Merge pull request #1076 from groue/dev/require-swift-5.3
Require Swift 5.3
2021-10-12 18:29:44 +02:00
Gwendal Roué 03fe178439 Bump Xcode compatibility version of projects (Xcode 12+) 2021-10-11 17:13:26 +02:00
Gwendal Roué ff126c1543 SE-0276 Multi-Pattern Catch Clauses 2021-10-11 16:24:38 +02:00
Gwendal Roué 038c320f07 Require Swift 5.3. 2021-10-11 16:18:29 +02:00
Gwendal Roué ba88a150c0 Improve inline doc of database access methods 2021-10-11 15:50:06 +02:00
Gwendal Roué 32df5e27c3 Test for DatabaseRegionObservation tracking DatabaseRegion.fullDatabase 2021-10-01 11:13:41 +02:00
Gwendal Roué 2d4398798a SE-0299 for DatabaseRegionConvertible.fullDatabase 2021-10-01 11:13:20 +02:00
Gwendal Roué 32b2923e89 Merge branch 'development' 2021-09-25 19:44:17 +02:00
Gwendal Roué dbb4668033 v5.12.0 2021-09-25 19:13:10 +02:00
Gwendal Roué abcbf72421 CHANGELOG 2021-09-25 19:13:10 +02:00
Gwendal Roué 6724862eea Bump min iOS version to 11.0
This drops support for 32 bit devices
Fix #1059
Fix #1033
2021-09-25 19:13:10 +02:00
Gwendal Roué 79c5c1d1ba Failing test for #1059
Xcode 13, make test_install_SPM_ios_release
2021-09-25 19:13:10 +02:00
Gwendal Roué bc9ea84bb2 Merge pull request #1052 from jason-gabriele/fix-swift-error
Change init to fix Swift error
2021-09-22 10:34:43 +02:00
Gwendal Roué c0d70f9ef0 Refactor FTS5 tokenization in order to support custom tokenizers 2021-09-21 19:34:06 +02:00
Gwendal Roué bcd65f534b CHANGELOG 2021-09-20 17:55:56 +02:00
Gwendal Roué 7ae5010353 Document the tokenize(_:) method 2021-09-20 17:53:59 +02:00
Gwendal Roué 46eceb5e28 Document prefix-based FTS patterns 2021-09-20 17:47:17 +02:00
Gwendal Roué dfe519ea9b Build FTS patterns from prefixes 2021-09-20 17:35:47 +02:00
Gwendal Roué b0b8872798 Expose FTS tokenization methods 2021-09-20 17:14:07 +02:00
jason fbc0ee77bb Change init to fix Swift error 2021-09-08 13:57:24 -07:00
Gwendal Roué 1acf8e4b1e Merge branch 'development' 2021-09-03 14:59:18 +02:00
Gwendal Roué 042fbe958d v5.11.0 2021-09-03 14:59:02 +02:00
Gwendal Roué e4bc3da4d7 Merge pull request #1029 from sberrevoets/master
Column coding strategies for Codable records
2021-09-03 14:55:20 +02:00
Gwendal Roué cc23263897 Update thank you notice 2021-09-03 14:51:01 +02:00
Gwendal Roué c7e05caf86 CHANGELOG 2021-09-03 14:50:53 +02:00
Gwendal Roué dabdb0d590 Merge branch 'development' into pr-1029 2021-09-03 14:37:29 +02:00
Gwendal Roué 14ca47f84d CHANGELOG 2021-09-03 14:37:14 +02:00
Gwendal Roué d63429ea23 DatabaseMigrator.migrations 2021-09-03 14:31:46 +02:00
Gwendal Roué 87e9a0d0e0 Add license 2021-08-30 19:21:37 +02:00
Gwendal Roué d2e7485b02 Thorough testing of DatabaseColumnDecodingStrategy with including(all:)
We make sure strategies are correctly applied for each involved record type.
2021-08-29 14:14:31 +02:00
Gwendal Roué c23d977759 Thorough testing of DatabaseColumnDecodingStrategy with including(optional:) and including(required:)
We make sure strategies are correctly applied for each involved record type.
2021-08-29 14:12:23 +02:00
Gwendal Roué 0842e11281 Thourough testing of DatabaseColumnDecodingStrategy 2021-08-29 13:53:22 +02:00
Gwendal Roué e6e2536f6b Reverse DatabaseColumnDecodingStrategy
It does not convert coding keys to columns, but columns to CodingKeys, exactly as JSONDecoder.KeyDecodingStrategy
2021-08-29 13:52:36 +02:00
Gwendal Roué 86e4adf860 Spot a design flaw 2021-08-29 10:08:08 +02:00
Gwendal Roué c36aa2bfda Fix typo 2021-08-29 09:59:49 +02:00
Gwendal Roué 427a00582f Rename keyDecodingStrategy to columnDecodingStrategy 2021-08-29 09:55:06 +02:00
Gwendal Roué 6f024373b3 Fix failing test 2021-08-29 09:51:31 +02:00
Gwendal Roué 76f8b5547f Failing test 2021-08-29 09:51:24 +02:00
Gwendal Roué e60a31f401 Fix failing test 2021-08-29 09:40:32 +02:00
Gwendal Roué 8846ea3c25 Failing test 2021-08-29 09:40:16 +02:00
Gwendal Roué d567630966 Column decoding strategy only applies to columns 2021-08-29 08:55:39 +02:00
Gwendal Roué 5a04183baf Fix test name 2021-08-29 08:55:06 +02:00
Gwendal Roué 8aa640f84b Documentation: Column Names Coding Strategies 2021-08-29 08:41:46 +02:00
Gwendal Roué 42045ad8fb Merge remote-tracking branch 'origin/development' into pr1029 2021-08-29 08:37:13 +02:00
Gwendal Roué 0914b56c41 Add mark 2021-08-29 08:31:36 +02:00
Gwendal Roué 33e2c379db Make it clear that strategies apply to columns only
...and not to row scopes or prefetched records
2021-08-28 16:24:53 +02:00
Gwendal Roué 06763e47d2 Share convertToSnakeCase() 2021-08-28 16:05:41 +02:00
Gwendal Roué 5f23d97903 Add the custom strategies 2021-08-28 15:50:34 +02:00
Gwendal Roué 03a8e03a92 Documentation
Doc of cases is copied from JSONDecoder.KeyDecodingStrategy and JSONEncoder.KeyEncodingStrategy
2021-08-28 15:48:31 +02:00
Gwendal Roué 987b8a48e5 Key coding strategies transform keys into columns
They are not String transformers
2021-08-28 15:41:12 +02:00
Gwendal Roué cbc24751d1 Merge pull request #1046 from groue/dev/issue1043
Improve performance of by-index row decoding
2021-08-28 15:28:19 +02:00
Gwendal Roué e0b397fd4e Upgrade versions of compared libraries 2021-08-28 14:55:18 +02:00
Gwendal Roué c26df67e78 Raise the number of iterations for more precise average 2021-08-28 14:54:51 +02:00
Gwendal Roué ae60de399e Inline GRDBPrecondition 2021-08-28 14:54:51 +02:00
Gwendal Roué b06dc5dc77 Do not inline RowDecodingError.valueMismatch creation 2021-08-28 14:54:51 +02:00
Gwendal Roué c0c8eec75d Replace _checkedIndex with _checkIndex
That's what the stdlib Array does
2021-08-28 14:54:51 +02:00
Gwendal Roué 151a457251 Inline StatementColumnConvertible decoding 2021-08-28 14:53:54 +02:00
Gwendal Roué fc4b55dd97 Restore compilation flags to their pristine state
This reverts an undesired change in 0511fec001
2021-08-26 17:30:30 +02:00
Gwendal Roué ba41c22304 Merge branch 'development' 2021-08-22 16:18:55 +02:00
Gwendal Roué 04c18e3fd6 v5.10.0 2021-08-22 16:18:25 +02:00
Gwendal Roué 28f2aa1423 Upgrade performance comparison dependencies 2021-08-22 16:18:25 +02:00
Gwendal Roué 5ecc069bb4 TODO 2021-08-22 13:34:07 +02:00
Gwendal Roué 47934cc858 TODO 2021-08-22 12:44:54 +02:00
Gwendal Roué 0511fec001 SE-0299: enhance access to Column.rowID 2021-08-22 12:42:53 +02:00
Gwendal Roué 14b5eea277 CHANGELOG 2021-08-22 11:12:10 +02:00
Gwendal Roué c7294af809 Merge pull request #1038 from GetToSet/development
Add match operator in ColumnExpression for FTS5.
2021-08-22 11:10:02 +02:00
Gwendal Roué 8eff518850 Documentation for FTS5 column matching 2021-08-22 11:03:54 +02:00
Gwendal Roué 48ef691897 Disallow FTS5 column matching against NULL
SQLite just throws a syntax error
2021-08-22 11:03:18 +02:00
Ethan Wong 836432c4ce Add tests of column matching expression for fts5 2021-08-22 16:30:07 +08:00
Ethan Wong 2f3311cd1e Add match operator in ColumnExpression for FTS5 2021-08-22 16:12:39 +08:00
Gwendal Roué 8f7a2b6a8e Documentation: Combine and Data Consistency 2021-08-21 18:18:57 +02:00
Gwendal Roué 7ae35068c4 Merge pull request #1037 from groue/dev/BUILD_LIBRARY_FOR_DISTRIBUTION
Support BUILD_LIBRARY_FOR_DISTRIBUTION
2021-08-21 17:34:32 +02:00
Gwendal Roué 6639e9c598 CHANGELOG 2021-08-21 15:55:37 +02:00
Gwendal Roué e6cdbb156d FAQ: Does GRDB support library evolution and ABI stability 2021-08-21 15:48:17 +02:00
Gwendal Roué e2c9734df1 Specialize StatementColumnConvertible cursors 2021-08-21 15:48:07 +02:00
Gwendal Roué 18e9b1b9aa Specialize StatementColumnConvertible decoding 2021-08-21 14:53:11 +02:00
Gwendal Roué 59c4d42076 Remove test warnings with BUILD_LIBRARY_FOR_DISTRIBUTION 2021-08-21 14:08:46 +02:00
Gwendal Roué 665770c50c Remove all ABI annotations 2021-08-21 13:14:54 +02:00
Gwendal Roué f36f4aaf74 Deprecate count(_ counted: SQLSelectable) 2021-08-21 12:44:14 +02:00
Gwendal Roué 2858b803d0 Remove useless <Void> qualifiers
SQLRequest and CommonTableExpression are <Row> by default
2021-08-21 12:25:04 +02:00
Gwendal Roué faf100dbba Merge pull request #1036 from groue/dev/github-action
Basic GitHub action
2021-08-21 12:10:53 +02:00
Gwendal Roué 8af2b4bf1b Basic GitHub action 2021-08-21 12:06:09 +02:00
Gwendal Roué 253c878367 Cleanup 2021-08-17 08:30:51 +02:00
Gwendal Roué f5b1219549 SQLStatementCursor no longer allocates a copy of the sql C string
Based on https://forums.swift.org/t/stable-pointer-into-a-c-string-without-copying-it/51244
2021-08-16 18:59:55 +02:00
Gwendal Roué eda960de58 Merge branch 'development' 2021-08-15 19:12:58 +02:00
Gwendal Roué f0443a63eb v5.9.0 2021-08-15 19:12:48 +02:00
Gwendal Roué 24b978c3bb Update thank you notice 2021-08-15 14:33:03 +02:00
Gwendal Roué 3d180183a4 CHANGELOG 2021-08-15 14:32:51 +02:00
Gwendal Roué 98930d7f1d Merge pull request #1025 from DrawboardLtd/value-observer-reducer-locking
Added locking around `reducer` to mitigate Release build crashes.
2021-08-15 14:23:18 +02:00
Gwendal Roué adc16ea7dc Protect mutating TextOutputStream with a lock
This change addresses https://github.com/groue/GRDB.swift/pull/1025#issuecomment-898894618
2021-08-15 13:03:37 +02:00
Scott Berrevoets 79abf62a47 Fix name and convert Decodables as well 2021-08-14 21:45:35 -07:00
Scott Berrevoets 4ab7f1cf3e Add support for encoding as well 2021-08-12 20:12:10 -07:00
Scott Berrevoets cdc7805471 Add option for converting snake case
This adds an option to convert column names from snake case to camel
case, similar to how JSONDecoder works. In fact, the implementation here
is largely based on JSONDecoder's implementation.
2021-08-12 20:11:54 -07:00
Renaud Lienhart 7791e300d2 Use the ValueObserver.synchronized() helper 2021-08-06 09:27:39 +10:00
Matt Gallagher 8350dced55 Added locking around reducer to mitigate Release build crashes. 2021-08-06 09:10:29 +10:00
Gwendal Roué 97221c7bd6 Documentation 2021-07-31 09:39:24 +02:00
Gwendal Roué eb6895207e Remove Swiftlint warnings 2021-07-30 16:14:03 +02:00
Gwendal Roué d93b2f16e4 Remove the promising swiftlint rule that catches urls in doc comments
It yields false positives.

https://github.com/groue/GRDB.swift/pull/1012#issuecomment-889919351
2021-07-30 16:12:47 +02:00
Gwendal Roué f09a5e105d CHANGELOG 2021-07-30 14:34:38 +02:00
Gwendal Roué e6f6a11277 Merge pull request #1019 from groue/dev/merge-statements
Merge prepared statement types, and introduce statement cursor
2021-07-30 14:31:48 +02:00
Gwendal Roué fe95d07062 Documentation 2021-07-30 14:25:49 +02:00
Gwendal Roué dc3fac95db allStatements() can build statements without any arguments 2021-07-30 14:24:08 +02:00
Gwendal Roué be0a2c01e1 More allStatements() documentation 2021-07-30 13:55:59 +02:00
Gwendal Roué f232dfde27 CHANGELOG 2021-07-30 13:44:23 +02:00
Gwendal Roué e1dd96603b Test that cursors can trigger transaction observers
This is important because users will start executing database modifications with fetching methods, now that they have db.allStatement().
2021-07-30 13:41:52 +02:00
Gwendal Roué f2296c065a Test that cursors can invalidate schema cache
This is important because users will start executing DROP statements with fetching methods, now that they have db.allStatement().
2021-07-30 13:02:36 +02:00
Gwendal Roué 096eeffecf More allStatements() documentation 2021-07-30 12:54:52 +02:00
Gwendal Roué 6bbec1495d fix typo 2021-07-30 08:53:31 +02:00
Gwendal Roué a60fe170de Document allStatements() 2021-07-30 08:51:57 +02:00
Gwendal Roué 5cd34da6ca Use allStatements() from makeStatement() 2021-07-30 08:50:15 +02:00
Gwendal Roué a4acbf4854 Tests consuming values from allStatements() 2021-07-29 23:04:02 +02:00
Gwendal Roué c9eb67dae8 Database.allStatements(sql:literal:)
Addresses #1015
2021-07-29 22:41:49 +02:00
Gwendal Roué bf601e6810 Merge SelectStatement and UpdateStatement
Addresses #1015
2021-07-29 20:20:15 +02:00
Gwendal Roué c45f681813 Update thank you notice 2021-07-21 08:41:10 +02:00
Gwendal Roué 6a2645e0be CHANGELOG 2021-07-21 08:40:53 +02:00
Gwendal Roué 96108a5b9b Merge pull request #1012 from ZevEisenberg/add-brackets-to-urls
Add brackets to urls in doc comments to make them clickable
2021-07-21 07:53:58 +02:00
Zev Eisenberg a6e0d47d61 Add lint rule to catch URLs in doc comments that are not wrapped in angle brackets. 2021-07-20 21:10:36 -04:00
Zev Eisenberg 8b060e6b09 Add angle brackets to URLs to make them clickable in Xcode's rendered documentation. 2021-07-20 20:53:58 -04:00
Gwendal Roué f0a99a9100 Merge pull request #1010 from tternes/tt-add-vacuum-into
Add VACUUM INTO Support
2021-07-20 20:15:33 +02:00
Gwendal Roué 6cc45202a0 Enable vacuum(into:) with SQLCipher 2021-07-20 20:02:18 +02:00
Gwendal Roué 368594b051 Disable VACUUM INTO tests when not available 2021-07-20 19:42:40 +02:00
Gwendal Roué 8d4416d02e Update thank you notice 2021-07-20 19:36:49 +02:00
Gwendal Roué 6db245efe5 CHANGELOG 2021-07-20 19:35:59 +02:00
Gwendal Roué c115b6a92d Explain why vacuum(into:) is not available on DatabaseReader 2021-07-20 19:31:22 +02:00
Thaddeus Ternes dc40da1ef2 Improvements based on PR feedback 2021-07-19 21:59:43 -05:00
Gwendal Roué 374595d89e Merge pull request #1009 from kaishin/patch-1
Remove extra dot at the end of reference URL
2021-07-19 18:49:23 +02:00
Gwendal Roué 2d05dd488c Update TODO.md 2021-07-19 11:42:26 +02:00
Thaddeus Ternes 7d0c8c6657 Refactor tests, fix inline documentation parameter value 2021-07-12 02:28:49 -05:00
Thaddeus Ternes ed9fb39982 Add inline documentation 2021-07-12 01:26:34 -05:00
Thaddeus Ternes b28f75c5a2 Add VACUUM INTO support to DatabaseWriter 2021-07-12 01:19:45 -05:00
Reda Lemeden 1ac364defb Remove extra dot at the end of reference URL 2021-07-12 02:11:34 +02:00
Gwendal Roué e19de4e42e Merge branch 'dev/codable-database-value' into development 2021-07-04 19:29:47 +02:00
Gwendal Roué 57cf9b45b6 Add missing Foundation import for SPM 2021-07-04 19:28:27 +02:00
Gwendal Roué d772e8da3a CHANGELOG 2021-07-04 18:37:44 +02:00
Gwendal Roué ad48aa6eec Document the default DatabaseValueConvertible+Codable implementation 2021-07-04 18:36:56 +02:00
Gwendal Roué 620eb6f21c Default DatabaseValueConvertible+Codable implementation uses the JSON format 2021-07-04 17:34:31 +02:00
Gwendal Roué 653837bb02 Merge branch 'master' into development 2021-07-04 12:05:30 +02:00
Gwendal Roué 3de6f51427 Document that cipher_plaintext_header_size disables the salt 2021-07-01 09:12:57 +02:00
Gwendal Roué 9456fe809d Fix for Xcode 11.4 2021-06-27 16:36:18 +02:00
Gwendal Roué e907bc2686 Fix tvOS 14.5 simulator for Travis 2021-06-27 16:11:37 +02:00
Gwendal Roué e386553c18 Update Makefile for Xcode 12.5 2021-06-27 16:04:58 +02:00
Gwendal Roué 3b435d018f Use Xcode 12.5 on Travis 2021-06-27 15:54:56 +02:00
Gwendal Roué b5de7a907a Update link to 0xdead10cc documentation 2021-06-27 15:43:32 +02:00
Gwendal Roué e5bb488b00 CHANGELOG 2021-06-27 15:39:21 +02:00
Gwendal Roué 76852c1f9c Improve documentation about handling of NULL in foreign keys 2021-06-27 15:36:43 +02:00
Gwendal Roué 2f36fc06f5 Fix failing tests for #999 2021-06-27 15:36:12 +02:00
Gwendal Roué ff576d945c Failing tests for #999 2021-06-27 15:35:44 +02:00
Gwendal Roué 0098369e29 Simplify Refinable 2021-06-27 13:11:26 +02:00
Gwendal Roué fb5a3ba388 CHANGELOG 2021-06-22 08:27:38 +02:00
Gwendal Roué 98f398cd75 Deemphasize Table 2021-06-22 08:26:55 +02:00
Gwendal Roué f2dbbee428 Merge pull request #993 from groue/dev/Table
QueryInterfaceRequest builder with dynamic table/view name
2021-06-22 08:15:46 +02:00
Gwendal Roué f54467af3c Fix test for batch deletion of Identifiable type with Optional ID 2021-06-21 18:26:35 +02:00
Gwendal Roué 8c361acd7f Update documentation: batch delete/updates are available on TableRecord 2021-06-21 18:21:04 +02:00
Gwendal Roué bdfd5ce277 Table: batch delete & update
Also, MutablePersistableRecord is no longer necessary for such operations. TableRecord is enough.
2021-06-21 18:08:27 +02:00
Gwendal Roué 120c973e29 Refactor test for association from CTE to Table 2021-06-20 14:31:45 +02:00
Gwendal Roué 17ee1debdc Test associations from TableRecord to Table 2021-06-20 14:26:21 +02:00
Gwendal Roué b154998ae6 Fix documentation 2021-06-20 11:57:53 +02:00
Gwendal Roué eedd3af59b Test association from CTE to Table 2021-06-20 11:54:55 +02:00
Gwendal Roué c5b6325cf6 Table documentation 2021-06-20 11:39:14 +02:00
Gwendal Roué 629840f6f2 Table.fetchCount(_:) 2021-06-20 11:37:59 +02:00
Gwendal Roué e7ef3e1867 Prevent aggregate misuse
I wrote association.max("id") when I meant association.max(Column("id"))
2021-06-20 11:08:24 +02:00
Gwendal Roué 32bbee9c8a Tests for Table Associations 2021-06-20 11:07:38 +02:00
Gwendal Roué 9def48f4f6 Tests for Table 2021-06-19 17:31:40 +02:00
Gwendal Roué 92d10e2713 Table fetching methods 2021-06-19 17:31:23 +02:00
Gwendal Roué 3d855a6a90 Table request methods 2021-06-19 15:25:14 +02:00
Gwendal Roué d7971d76e7 Introduce Table 2021-06-19 14:30:04 +02:00
Gwendal Roué 220d221ea6 CHANGELOG 2021-06-19 14:03:37 +02:00
Gwendal Roué 2ce588ad76 Cached statements from a SQL literal
Addresses https://github.com/groue/GRDB.swift/issues/985#issuecomment-859570434
2021-06-19 13:57:53 +02:00
Gwendal Roué 7050e3cc48 Naive fix for #983 2021-06-19 13:31:30 +02:00
Gwendal Roué fed0b6b136 CHANGELOG 2021-06-19 13:24:27 +02:00
Gwendal Roué e3674ccdf2 Documentation for selectID() 2021-06-19 13:21:13 +02:00
Gwendal Roué 046564dab6 Fix #991 2021-06-19 13:05:24 +02:00
Gwendal Roué d6069888b8 Update thank you notice 2021-06-19 12:24:31 +02:00
Gwendal Roué a9ea79dba9 CHANGELOG 2021-06-19 12:24:23 +02:00
Gwendal Roué 18083165a1 Merge pull request #989 from pp5x/pp5x/fts-synchronize-if-not-exists
FTS: add support of ifNotExists in synchronize()
2021-06-19 12:20:13 +02:00
Gwendal Roué 1aeb10439f synchronize: failing test for FTS5 ifNotExists support 2021-06-17 19:30:24 +02:00
Gwendal Roué 1a2de126ce Fix #988 2021-06-17 19:30:03 +02:00
Pierre Pagnoux d8cb3066a1 synchronize: failing test for ifNotExists support 2021-06-15 17:35:45 +02:00
Gwendal Roué c3b3d2eeb8 Fix Xcode 13 beta 1 compilation warnings 2021-06-08 05:54:45 +02:00
Gwendal Roué 52b1727bb3 Fix Xcode 13 beta 1 compilation error 2021-06-08 05:54:31 +02:00
Gwendal Roué a328349514 Thank you notice 2021-05-31 14:04:02 +02:00
Gwendal Roué 5666ffb4a7 CHANGELOG 2021-05-31 14:03:56 +02:00
Gwendal Roué e6ef8740eb Merge branch 'master' into development 2021-05-31 13:58:51 +02:00
Gwendal Roué df6c2e2b05 Merge pull request #980 from jroselightricks/feature/spelling
Fix spelling succesful -> successful.
2021-05-31 13:58:25 +02:00
Jonathan Rose ae7f83dc40 Fix spelling succesful -> successful. 2021-05-31 14:28:28 +03:00
Gwendal Roué 1693a706e0 Skip tests that do not support encrypted databases 2021-05-29 13:26:17 +02:00
Gwendal Roué af13c91744 Merge branch 'development' 2021-05-16 15:25:33 +02:00
Gwendal Roué b5dea2164f v5.8.0 2021-05-16 15:25:15 +02:00
Gwendal Roué 148897ad73 Simplify 2021-05-04 07:27:21 +02:00
Gwendal Roué 095bfde072 CHANGELOG 2021-05-02 18:05:13 +02:00
Gwendal Roué fabdb73785 Merge pull request #967 from steipete/peter/selectStatement-Debug
Make SelectStatement conform to CustomStringConvertible
2021-05-02 18:03:44 +02:00
Gwendal Roué f30f970cf2 Merge pull request #973 from groue/dev/issue-971
Restore access to attached databases from record types
2021-05-02 10:12:58 +02:00
Gwendal Roué 1c2499528c Merge branch 'development' into dev/issue-971 2021-05-02 10:12:41 +02:00
Gwendal Roué 766e731bf9 Merge pull request #974 from groue/dev/issue-965
Provide access to included associations when root table is not selected
2021-05-02 10:11:12 +02:00
Gwendal Roué b9496a01e1 Simplify FAQ now that Statement conforms to CustomStringConvertible 2021-05-02 10:07:07 +02:00
Gwendal Roué 1554c80fdb Statement.sql checks correct scheduling 2021-05-02 10:02:21 +02:00
Gwendal Roué 61ee7cc3f7 Move SelectStatement.description to Statement 2021-05-02 10:01:44 +02:00
Gwendal Roué 0f481e7867 CHANGELOG 2021-05-01 17:32:02 +02:00
Gwendal Roué ed3397176a Documentation 2021-05-01 17:28:49 +02:00
Gwendal Roué 5f4c64ceda Fix failing tests for #965 2021-05-01 17:00:12 +02:00
Gwendal Roué e5a810105a Failing tests for #965 2021-05-01 16:59:38 +02:00
Gwendal Roué a46b2ad127 Fix "cannot ATTACH database within transaction" error in older versions of SQLite 2021-05-01 15:08:36 +02:00
Gwendal Roué 3ccac4098a CHANGELOG 2021-05-01 15:06:08 +02:00
Gwendal Roué a4e8bbe2da Add test for cross-attached-databases association 2021-05-01 14:55:53 +02:00
Gwendal Roué 52bc7eb7c6 Cleanup 2021-05-01 14:40:20 +02:00
Gwendal Roué e8802fb010 Fix #971 2021-05-01 14:32:01 +02:00
Gwendal Roué 885f43dbad Failing tests for #971 2021-05-01 14:27:44 +02:00
Peter Steinberger 5dfab017e5 Make SelectStatement conform to CustomStringConvertible 2021-04-22 14:12:10 +02:00
Gwendal Roué 35d6ac0041 CHANGELOG 2021-04-18 18:21:22 +02:00
Gwendal Roué eae64b587a Documentation 2021-04-18 17:25:05 +02:00
Gwendal Roué fb6ae07722 Documentation 2021-04-18 17:22:08 +02:00
Gwendal Roué 491e17f62e Documentation 2021-04-18 17:21:13 +02:00
Gwendal Roué f521002e74 Documentation 2021-04-18 17:17:30 +02:00
Gwendal Roué bbaee79618 Documentation 2021-04-18 17:10:47 +02:00
Gwendal Roué 64951c84d7 Documentation 2021-04-18 17:08:02 +02:00
Gwendal Roué 5996b64469 Documentation 2021-04-18 17:00:55 +02:00
Gwendal Roué 65b2fecdfc Documentation 2021-04-18 16:56:38 +02:00
Gwendal Roué 232086e50e Documentation 2021-04-18 16:41:53 +02:00
Gwendal Roué 8f7feda27c Documentation 2021-04-18 16:31:44 +02:00
Gwendal Roué 6aa6c4d4b5 Documentation 2021-04-18 16:19:06 +02:00
Gwendal Roué afc360cf78 Documentation 2021-04-18 16:13:42 +02:00
Gwendal Roué 5673d73738 Documentation 2021-04-18 16:09:22 +02:00
Gwendal Roué 4a894f2b43 Documentation 2021-04-18 16:05:35 +02:00
Gwendal Roué 83cd6d1469 Change Query Interface Organization picture 2021-04-18 14:28:48 +02:00
Gwendal Roué 0b2e5d836f Query Interface Organization 2021-04-18 14:26:46 +02:00
Gwendal Roué b9576aedbe SQLCollection is not public 2021-04-18 11:41:11 +02:00
Gwendal Roué 2f549d21bf Can't articulate distinctive features yet 2021-04-18 11:28:56 +02:00
Gwendal Roué 4d6958b52a Documentation 2021-04-17 20:55:21 +02:00
Gwendal Roué 588b2677e7 Documentation 2021-04-17 20:52:26 +02:00
Gwendal Roué 66e52eea40 Documentation 2021-04-17 20:46:29 +02:00
Gwendal Roué 975cbaa7e8 MyPlayground setup 2021-04-17 20:31:27 +02:00
Gwendal Roué 9e265f7ebc Documentation 2021-04-17 20:19:33 +02:00
Gwendal Roué 37522f3766 Documentation 2021-04-17 19:55:01 +02:00
Gwendal Roué 4980beda69 Documentation 2021-04-17 16:47:28 +02:00
Gwendal Roué 69b9c7331f Documentation 2021-04-17 16:46:16 +02:00
Gwendal Roué 28375f5c1a Organization image 2021-04-17 16:41:37 +02:00
Gwendal Roué e019617a50 Documentation 2021-04-17 16:21:11 +02:00
Gwendal Roué 8ff0c456dc Documentation 2021-04-17 16:13:49 +02:00
Gwendal Roué 744b0c5661 Documentation 2021-04-17 16:10:28 +02:00
Gwendal Roué c6003143c4 Documentation 2021-04-17 16:04:51 +02:00
Gwendal Roué b0545bcfb0 CHANGELOG 2021-04-17 15:52:17 +02:00
Gwendal Roué 3976feb6ab Query Interface Organization 2021-04-17 15:52:11 +02:00
Gwendal Roué 002399ff1a Remove limit(_:offset:) from documentation 2021-04-17 15:44:53 +02:00
Gwendal Roué cdc21531fc Query Interface Organization 2021-04-17 15:41:03 +02:00
Gwendal Roué 7afe011b69 Improve documentation 2021-04-17 15:38:30 +02:00
Gwendal Roué 12809f5891 Fix duplicate file warning 2021-04-17 13:22:27 +02:00
Gwendal Roué 7fd51f440a Warn about DerivableRequest.limit(_:offset:)
We can't deprecate it because the compiler emits a warning on acceptable request.limit() calls :-(
2021-04-17 13:22:08 +02:00
Gwendal Roué 4f0d3b31e1 SQLRequest is SQLRequest<Row> unless stated otherwise 2021-04-17 12:53:20 +02:00
Gwendal Roué 36039fb6a3 Documentation 2021-04-17 12:48:18 +02:00
Gwendal Roué e66e59cd21 Remove misleading documentation
Limiting to-many associations does not do what this false documentation is saying
2021-04-15 18:24:54 +02:00
Gwendal Roué a3279c9f63 Distinctive Features 2021-04-15 18:02:43 +02:00
Gwendal Roué 5ed64ea8f8 CHANGELOG 2021-04-14 20:13:58 +02:00
Gwendal Roué 62763ece52 Documentation for LIKE ESCAPE 2021-04-14 20:12:02 +02:00
Gwendal Roué c50f698eae Add support for the ESCAPE clause of the LIKE operator
Address #962
2021-04-14 20:06:54 +02:00
Gwendal Roué 31e2b01c10 Merge branch 'development' 2021-04-11 16:32:47 +02:00
Gwendal Roué 7fd786955c v5.7.4 2021-04-11 16:17:39 +02:00
Gwendal Roué af13283aa7 Update thank you notice 2021-04-11 15:48:56 +02:00
Gwendal Roué 6a5d196c2d CHANGELOG 2021-04-11 15:47:32 +02:00
Gwendal Roué 6959ac80b5 Merge pull request #960 from MartinP7r/userinfo_tests
adds test for userInfo being applied to database encoder/decoder
2021-04-11 15:40:03 +02:00
Martin Pfundmair 0c4e483e9e adds test for userInfo in EncodableRecord.databaseJSONDecoder()
Making sure that `databaseEncodingUserInfo` is being applied to `FetchableRecord.databaseJSONDecoder()`

This tries to cover the other half of the changes in PR groue#958
2021-04-11 09:29:33 +09:00
Gwendal Roué f9c162b657 CHANGELOG 2021-04-10 18:16:53 +02:00
Gwendal Roué c0f537c5e6 Merge pull request #956 from groue/dev/observation-case-insensitivity
Fix case-sensitivity of region-based database observation
2021-04-10 18:12:03 +02:00
Martin Pfundmair 8895d590a0 adds test for userInfo in FetchableRecord.databaseJSONDecoder()
Making sure that databaseDecodingUserInfo is being applied to FetchableRecord.databaseJSONDecoder()

This tries to cover some of the changes in PR groue#958
2021-04-11 00:02:09 +09:00
Gwendal Roué a44c518e31 Fix DatabaseRegion tests for tvOS 10.2 2021-04-10 16:27:46 +02:00
Gwendal Roué 0571d9b3b8 Fix DatabaseRegion tests for iOS 10.3.1 2021-04-10 16:27:45 +02:00
Gwendal Roué c0a3e61253 DatabaseRegion is now case-preserving and case-insensitive 2021-04-10 16:27:45 +02:00
Gwendal Roué c02901b335 Fix canonicalName(_:ofType:) 2021-04-10 16:27:45 +02:00
Gwendal Roué ee2d6d8074 CaseInsensitiveIdentifier should help 2021-04-10 16:27:45 +02:00
Gwendal Roué b51dc81c3a Failing tests for #954 2021-04-10 16:27:45 +02:00
Gwendal Roué 47199ed72b Merge branch 'master' into development 2021-04-10 16:26:55 +02:00
Gwendal Roué 28bddb04fa Merge pull request #955 from steipete/peter/query-base
Ensure Query can be updated
2021-04-10 16:20:14 +02:00
Gwendal Roué c34615ced3 Document that @steipete's test has turned moot
We don't 100% need to address this now, but we 100% need to remember this in the future.
2021-04-10 16:10:02 +02:00
Gwendal Roué a5ffc52dbe Restore the barebone app setup
Leave the AppView(initialOrdering:) initializer, though, so that readers can get some inspiration.
2021-04-10 15:45:00 +02:00
Gwendal Roué fd61a5f1ea Remove 14.5 IPHONEOS_DEPLOYMENT_TARGET
Tests succeed on 14.4, and 14.0 target does not generate any Xcode warning
2021-04-10 15:37:18 +02:00
Gwendal Roué 0f70e9d9c9 Remove all DEVELOPMENT_TEAM from demo app 2021-04-10 15:35:42 +02:00
Gwendal Roué d4f1102976 Document how AppDatabase.makeShared() supports test
This helps readers understand the purpose of those lines, and remove them if they are not interested.
2021-04-10 15:07:02 +02:00
Martin Pfundmair 1591948c10 Merge pull request #958 from Rightpoint/userinfo-fix
Always add userInfo to databaseJSONDecoder and databaseJSONEncoder
2021-04-10 15:21:52 +09:00
Chris Ballinger 43de1c24a7 Add userInfo to databaseJSONDecoder and databaseJSONEncoder 2021-04-08 13:11:59 -07:00
Peter Steinberger 481f6e93e5 Add UI test to show late-changing of Query 2021-04-08 10:41:20 +02:00
Peter Steinberger 6887441264 Ensure Query can be updated 2021-04-07 15:32:59 +02:00
Gwendal Roué e017eddf4f Merge branch 'development' 2021-04-05 17:00:08 +02:00
Gwendal Roué 53d75c37aa v5.7.3 2021-04-05 16:59:44 +02:00
Gwendal Roué 331990ce33 CHANGELOG 2021-04-05 16:54:56 +02:00
Gwendal Roué 63a52acb34 Merge pull request #953 from groue/dev/refactor-SwiftUI-demo
Refactor the SwiftUI demo app
2021-04-05 16:51:17 +02:00
Gwendal Roué 6958a10a08 Refactor the SwiftUI demo application 2021-04-05 15:28:45 +02:00
Martin Pfundmair 5d14b3d6db Merge pull request #952 from holsety/tiny/typo
Fix a tiny typo
2021-04-05 08:00:44 +09:00
hlst de0709163c Fix a tiny typo 2021-04-05 06:31:56 +08:00
Gwendal Roué 8c872fccfc End of experiment. But we squeezed a few more cycles :-) 2021-04-04 13:50:17 +02:00
Martin Pfundmair 46867877fd Merge pull request #951 from alexwlchan/patch-1
Fix a typo: "bet set" ~> "be set"
2021-04-04 09:25:09 +09:00
Alex Chan 622ecda283 Fix a typo: "bet set" ~> "be set" 2021-04-03 21:06:05 +01:00
Gwendal Roué 5f9911ff0d Performance tests for optimized records 2021-04-03 18:02:15 +02:00
Gwendal Roué eaf830c05c Fix paths in performance report 2021-04-03 16:47:53 +02:00
Gwendal Roué 064dec5095 Upgrade Realm 2021-04-03 16:26:27 +02:00
Gwendal Roué 89521a7288 Improve statement binding performance 2021-04-03 14:52:22 +02:00
Gwendal Roué 76d4e38cd1 CHANGELOG and thank you notice for #950 2021-04-02 08:29:25 +02:00
Gwendal Roué c56a56a2f3 Merge pull request #950 from MartinP7r/fix/json-column-memory
Fix memory consumption when encoding JSON columns
2021-04-02 08:26:21 +02:00
Martin Pfundmair 02d3518194 adds autoreleasepool for databaseJSONEncoder
when encoding json columns in order to prevent memory build up
2021-04-01 18:40:19 +09:00
Gwendal Roué 67892d7cdb CHANGELOG 2021-03-29 06:12:17 +02:00
Gwendal Roué 0e091124a2 v5.7.2 2021-03-29 06:09:24 +02:00
Gwendal Roué 2402185235 Make SQLLiteral public 2021-03-29 06:08:44 +02:00
Gwendal Roué f406062b81 Merge pull request #948 from xAlien95/patch-1
Fix documentation typo
2021-03-29 06:06:17 +02:00
Stefano De Carolis 7bf25925c7 Fix documentation typo 2021-03-29 02:25:10 +02:00
Gwendal Roué 8dd8a57de3 v5.7.1 2021-03-28 15:33:58 +02:00
Gwendal Roué fa8a8f0b87 Add fixit for SQLLiteral 2021-03-28 15:31:23 +02:00
Gwendal Roué fa2c489ee4 Fix typo 2021-03-28 10:20:35 +02:00
Gwendal Roué 2cb0baf88e Merge branch 'development' 2021-03-28 10:17:20 +02:00
Gwendal Roué 1ab23dfa52 v5.7.0 2021-03-28 10:16:20 +02:00
Gwendal Roué bd29585461 Wording 2021-03-28 10:12:55 +02:00
Gwendal Roué f1cd6dbae8 CHANGELOG 2021-03-28 09:56:47 +02:00
Gwendal Roué a91d9b23e0 Merge pull request #947 from Rightpoint/codable-access
Allow access to Encoder from KeyedEncodingContainer
2021-03-28 09:51:57 +02:00
Gwendal Roué 7eb348cb2a [skip travis] New Identifiable Records documentation chapter 2021-03-28 08:39:43 +02:00
Gwendal Roué ab4ae144ac [skip travis] Simplify Record introduction 2021-03-28 07:51:12 +02:00
Gwendal Roué 09899e9bcf filter(id:) does not accept optionals 2021-03-28 06:48:22 +02:00
Gwendal Roué 2625653532 Improve documentation of the EXISTS operator 2021-03-27 22:49:58 +01:00
Gwendal Roué ea26dea687 Fix typo 2021-03-27 22:20:30 +01:00
Gwendal Roué 4a17281bd7 Fix typo 2021-03-27 22:09:11 +01:00
Gwendal Roué e9ba3e6ccc Fix typo 2021-03-27 22:08:20 +01:00
Gwendal Roué 9692410e7d CHANGELOG 2021-03-27 22:07:09 +01:00
Gwendal Roué b69dfb1709 Document the type-safe extensions to Identifiable records 2021-03-27 22:07:04 +01:00
Gwendal Roué 4307eedbc0 Update demo apps with the new type-safe primary key methods 2021-03-27 21:10:34 +01:00
Gwendal Roué 521f9e498a deleteOne(_🆔) and deleteAll(_:ids:) 2021-03-27 21:07:01 +01:00
Gwendal Roué e7ce5f13e7 Tests for rowid filtering of Identifiable types 2021-03-27 21:06:01 +01:00
Gwendal Roué 55c0abef8b Tests for id filtering of Identifiable types 2021-03-27 19:46:03 +01:00
Gwendal Roué 9489174b98 Filter by id for Identifiable types with optional ID type 2021-03-27 18:47:16 +01:00
Gwendal Roué b086b99821 Filter by id for Identifiable types 2021-03-27 17:43:01 +01:00
Chris Ballinger 984dea156c Allow access to Encoder and Decoder from KeyedCodingContainer 2021-03-27 08:57:44 -07:00
Gwendal Roué 1297a781fd Better fatal error messages for unimplemented features 2021-03-27 16:41:23 +01:00
Gwendal Roué c4f9ddd688 Simplify handling of collated expressions 2021-03-27 16:34:37 +01:00
Gwendal Roué fcff9b34ba Make sure empty migrator publisher is async as well 2021-03-27 15:23:30 +01:00
Gwendal Roué 914ad1b882 Address #945 by running a distinctive query
When a user finds this query in the error log, it will be easier for everybody to understand why it happens.
2021-03-27 14:56:08 +01:00
Gwendal Roué b13922b76e Database schema cache distinguishes the main from the temp schema
Addresses https://github.com/groue/GRDB.swift/pull/946#issuecomment-805756799
2021-03-27 14:50:25 +01:00
Gwendal Roué f6f4839e07 Document that WITHOUT ROWID tables can't be tracked (#945) 2021-03-27 11:50:38 +01:00
Gwendal Roué c5aeec3385 Documentation 2021-03-23 18:33:02 +01:00
Gwendal Roué 21b22ab3fb Travis: check old Xcode version first 2021-03-21 16:38:26 +01:00
Gwendal Roué 39eb57fe64 Fix for Xcode 11.4 2021-03-21 16:36:54 +01:00
Gwendal Roué bbacfd5ec1 Wording 2021-03-21 16:32:35 +01:00
Gwendal Roué 7bbec01dec Remove references to GRDBObjc 2021-03-21 14:25:19 +01:00
Gwendal Roué 969f28945c Focus 2021-03-21 14:20:25 +01:00
Gwendal Roué 869f6cb3b3 Focus 2021-03-21 14:19:49 +01:00
Gwendal Roué 607e53b04e Add an "In a glance" usage section 2021-03-21 14:14:15 +01:00
Gwendal Roué 051fdb37b6 Rename SQLLiteral to SQL 2021-03-21 13:33:49 +01:00
Gwendal Roué db963cbbb2 TODO 2021-03-21 13:05:45 +01:00
Gwendal Roué 13120063e0 TODO 2021-03-21 13:01:00 +01:00
Gwendal Roué be02e920d2 Dry up number documentation 2021-03-21 12:58:52 +01:00
Gwendal Roué 901b9c6fe6 More NSNumber/NSDecimalNumber tests 2021-03-21 12:58:11 +01:00
Gwendal Roué 64f5e6bdca Always use Decimal(string:) when decoding strings 2021-03-21 12:57:50 +01:00
Gwendal Roué 178727fd5b CHANGELOG 2021-03-20 20:22:40 +01:00
Gwendal Roué 791a8ed41b Update documentation for NSNumber, NSDecimalNumber, and Decimal 2021-03-20 20:14:31 +01:00
Gwendal Roué d9083a7bf5 Support for Foundation.Decimal 2021-03-20 20:11:26 +01:00
Gwendal Roué e355af3584 Decode NSNumber from textual database values 2021-03-20 17:15:16 +01:00
Gwendal Roué 5b39494125 TODO 2021-03-20 15:51:06 +01:00
Gwendal Roué 4f709e8e4f CHANGELOG 2021-03-20 15:51:01 +01:00
Gwendal Roué 63448fb0bc Documentation for EXISTS 2021-03-20 15:47:00 +01:00
Gwendal Roué 989a0e82eb Test for EXISTS expression 2021-03-20 15:46:46 +01:00
Gwendal Roué 8ba05a011d EXISTS expression 2021-03-20 15:24:32 +01:00
Gwendal Roué 659e6a53bb Documentation 2021-03-20 14:40:17 +01:00
Gwendal Roué 8a7ab17349 TODO 2021-03-20 14:37:54 +01:00
Gwendal Roué 3113e20f69 CHANGELOG 2021-03-20 14:37:13 +01:00
Gwendal Roué e44dc8486a Documentation for asynchronous migrations 2021-03-20 14:33:37 +01:00
Gwendal Roué 21a2206443 Remove asynchronous migration to target identifier
Migrating up to a specific identifier is a test-oriented use case: it does not need any async version.
2021-03-20 14:20:41 +01:00
Gwendal Roué f38c2ff754 Test DatabasePublishers.Migrate 2021-03-20 14:12:09 +01:00
Gwendal Roué 8ad880e20d DatabaseMigrator publisher 2021-03-20 14:11:43 +01:00
Gwendal Roué 50cec3fce7 Asynchronous migrations tests 2021-03-20 13:27:40 +01:00
Gwendal Roué c9c652dddc DatabaseMigrator async migrations 2021-03-20 13:25:43 +01:00
Gwendal Roué edde38837e TODO 2021-03-20 12:21:53 +01:00
Gwendal Roué c4443eead8 SELECT * FROM cte is no longer a special case, because SQLGenerationContext knows about the available CTEs 2021-03-19 19:06:47 +01:00
Gwendal Roué 7c023d5c1f CHANGELOG 2021-03-18 19:30:50 +01:00
Gwendal Roué 99a06f1c05 CHANGELOG 2021-03-18 19:29:02 +01:00
Gwendal Roué 0c2b5318bf Documentation 2021-03-18 19:28:46 +01:00
Gwendal Roué c47316a846 Documentation 2021-03-18 19:25:07 +01:00
Gwendal Roué 529b042b8a Database.makeSelectStatement(literal:) tests 2021-03-18 19:24:37 +01:00
Gwendal Roué 5aa1184e68 Database.makeSelectStatement(literal:) 2021-03-18 19:24:24 +01:00
Gwendal Roué a912c5cbe5 Documentation 2021-03-18 18:53:16 +01:00
Gwendal Roué 3753bd8d6d Database.makeUpdateStatement(literal:) tests 2021-03-18 18:48:22 +01:00
Gwendal Roué a6f7d9ba86 Database.makeUpdateStatement(literal:) accepts all arguments, or no arguments 2021-03-18 18:48:06 +01:00
Gwendal Roué fdc47d7158 Database.makeUpdateStatement(literal:) 2021-03-18 17:08:25 +01:00
Gwendal Roué 8aa4807f9b CHANGELOG 2021-03-17 21:57:49 +01:00
Gwendal Roué 339fbdf1ce Literal column alteration 2021-03-17 21:54:56 +01:00
Gwendal Roué ada972d78d Documentation 2021-03-17 21:31:35 +01:00
Gwendal Roué 085c8f5953 Literal table and constraint definition 2021-03-17 20:26:49 +01:00
Gwendal Roué 1f4db99a37 Documentation fix 2021-03-17 20:26:10 +01:00
Gwendal Roué 076813826f CHANGELOG 2021-03-17 19:01:04 +01:00
Gwendal Roué fcb6049381 Test SQLLiteral protocols in practice 2021-03-17 18:21:44 +01:00
Gwendal Roué 4c88d792f0 Documentation 2021-03-14 14:13:29 +01:00
Gwendal Roué 9d64a32814 Improve SQLLiteral documentation 2021-03-14 13:26:16 +01:00
Gwendal Roué 77db650464 More SQLLiteral interpolation test 2021-03-14 13:08:10 +01:00
Gwendal Roué 0e8a42aedc Tests for interpretations of SQLLiteral
If those tests break, we have introduced a breaking change.
2021-03-14 12:57:15 +01:00
Gwendal Roué 8ad096ae35 Refactor column counting for improved testability 2021-03-14 11:49:35 +01:00
Gwendal Roué ac436a2770 Make SQLLiteral less painful to use 2021-03-14 11:09:29 +01:00
Gwendal Roué 0133ff9056 Merge pull request #938 from michaelkirk/patch-1
fix small typos
2021-03-13 07:56:31 +01:00
Michael Kirk 178fb8688a fix small typos 2021-03-12 15:53:35 -08:00
Gwendal Roué 0b5f7e960b [skip travis] Mention key-value tables as a valid alternative
Inspired from https://twitter.com/dhartbit/status/1370434943956959238
2021-03-12 19:30:42 +01:00
Gwendal Roué ae3c491661 Merge branch 'development' 2021-03-12 17:47:50 +01:00
Gwendal Roué 8548d7a727 v5.6.0 2021-03-12 17:12:41 +01:00
Gwendal Roué daab7aef2c Fix typo 2021-03-12 15:37:29 +01:00
Gwendal Roué ba9b4db197 Fix typo 2021-03-12 15:33:35 +01:00
Gwendal Roué cab795a4a9 Wording 2021-03-12 15:32:00 +01:00
Gwendal Roué b331a715ef CHANGELOG 2021-03-12 15:30:31 +01:00
Gwendal Roué 48e214b4b3 Link to demo app tests 2021-03-12 14:42:51 +01:00
Gwendal Roué 65beb24d41 Simplify 2021-03-12 14:33:01 +01:00
Gwendal Roué e1c7150714 Documentation 2021-03-12 14:26:43 +01:00
Gwendal Roué cc93f43ee4 Better introduction to DerivableRequest
Also reintroduce extensions to QueryInterfaceRequest
2021-03-12 14:24:47 +01:00
Gwendal Roué 33174fce8e Documentation 2021-03-12 14:00:31 +01:00
Gwendal Roué cb8611587c Fix Swiftlint warning 2021-03-12 13:48:41 +01:00
Gwendal Roué 6e7555514a More collection initializers from cursors
- support for minimumCapacity
- support for Dictionary (cursors with unique keys)
2021-03-12 13:48:25 +01:00
Gwendal Roué 8b1efb2c80 Single-Row Tables guide 2021-03-12 11:31:32 +01:00
Gwendal Roué 8388486289 TODO 2021-03-12 08:32:32 +01:00
Gwendal Roué c3dcd7636e Merge pull request #936 from groue/dev/more-eager-loading
Complete Associations and the DerivableRequest Protocol
2021-03-11 19:35:39 +01:00
Gwendal Roué 464b77bdcd Improve "Record Types Hide Intimate Database Details" 2021-03-10 13:25:25 +01:00
Gwendal Roué fe437fb7e3 Improve "Record Types Hide Intimate Database Details" 2021-03-10 13:21:25 +01:00
Gwendal Roué 1a2a6898eb Improve "Record Types Hide Intimate Database Details" 2021-03-10 13:07:16 +01:00
Gwendal Roué de2a37fb89 Improve "Record Types Hide Intimate Database Details" 2021-03-10 13:06:05 +01:00
Gwendal Roué 1d5604815d Improve "Record Types Hide Intimate Database Details" 2021-03-10 13:05:11 +01:00
Gwendal Roué 4de5059373 Improve "Record Types Hide Intimate Database Details" 2021-03-10 12:55:25 +01:00
Gwendal Roué 850040c51e Fix typo 2021-03-10 09:02:00 +01:00
Gwendal Roué eb0983facd Wording 2021-03-10 08:59:40 +01:00
Gwendal Roué 9e974a4c96 Fix typo 2021-03-10 08:58:39 +01:00
Gwendal Roué 609fcf6a6d CHANGELOG 2021-03-10 08:57:46 +01:00
Gwendal Roué 5e61d38272 Add a Record Types Hide Intimate Database Details chapter 2021-03-10 08:56:53 +01:00
Gwendal Roué cdbca5d215 Fix sample code 2021-03-09 08:29:14 +01:00
Gwendal Roué 9bda5fc41b Move the Further Refinements to Associations chapter 2021-03-09 08:27:29 +01:00
Gwendal Roué 04d35381a6 Documentation 2021-03-09 07:57:57 +01:00
Gwendal Roué 1f27e724c9 Open a door 2021-03-09 07:21:43 +01:00
Gwendal Roué b22afd7f17 CHANGELOG 2021-03-08 21:56:47 +01:00
Gwendal Roué ed3d1e1ac4 selectOnly() clears the isDistinct flag 2021-03-08 21:36:09 +01:00
Gwendal Roué 4521e6b37d Make filterPromise an optional promise instead of a promise of optional
This way, filterPromise and havingExpressionPromise have the same type
2021-03-08 21:25:27 +01:00
Gwendal Roué 42718db49d Documentation 2021-03-08 21:11:36 +01:00
Gwendal Roué e08df854dd Lower the tone about record responsabilities 2021-03-08 20:50:17 +01:00
Gwendal Roué f4b7d99aab Remove warning about associations that use CTEs 2021-03-08 19:59:47 +01:00
Gwendal Roué 4dd8042894 Make it possible to decode arrays of scalars from including(all:) 2021-03-08 14:21:35 +01:00
Gwendal Roué 4583bbfa90 Test for joined associations that use CTEs 2021-03-08 14:10:43 +01:00
Gwendal Roué a655974eb0 Let joined associations use CTEs 2021-03-08 14:10:38 +01:00
Gwendal Roué d4fc1d9566 Update documentation for the new Association/DerivableRequest powers 2021-03-08 08:36:32 +01:00
Gwendal Roué f9b554d00a Merge AggregateJoinableRequest into DerivableRequest
Also put distinct(), limit(_:offset:) and with(_:) into DerivableRequest
2021-03-08 07:55:20 +01:00
Gwendal Roué 6b733cfc0a Tests for including(all:) with distinct, limited, grouped, and cte-decorated associations 2021-03-07 20:32:21 +01:00
Gwendal Roué f0aec27095 AssociationToMany: distinct(), limit(_:offset:), with(_:) 2021-03-07 20:25:30 +01:00
Gwendal Roué 092b0d0e44 Move with(cte) methods to the file it belongs to 2021-03-07 19:58:15 +01:00
Gwendal Roué d2a22ddd97 Make sure joined associations do not use prefetched to-many features
One can't join a distinct, grouped, or limited association.
2021-03-07 19:56:04 +01:00
Gwendal Roué 9c6ff6a1c0 Simplifly association aggregates
We don't need any promise. We used to, but SQLExpression.fastPrimaryKey has been introduced since then.
2021-03-07 19:36:08 +01:00
Gwendal Roué a4dca3390a AggregateJoinableRequest is the new protocol that supports aggregate annotations
AssociationToMany is a subprotocol of AggregateJoinableRequest :-)
2021-03-07 19:15:09 +01:00
Gwendal Roué ea6a052b73 Merge all SQLRelation properties 2021-03-07 17:12:44 +01:00
Gwendal Roué f49fab0cff Merge SQLQuery into SQLRelation 2021-03-07 14:37:53 +01:00
Gwendal Roué 37faf0a1fd Upgrade obsolete documentation 2021-03-07 14:20:28 +01:00
Gwendal Roué 4b5a6b503a TODO 2021-03-07 13:12:28 +01:00
Gwendal Roué 2a85b1230b Merge pull request #934 from groue/dev/issue-932
Fix a crash in the ValueObservation publisher
2021-03-07 12:12:44 +01:00
Gwendal Roué 3eb17fdbb7 CHANGELOG 2021-03-07 12:11:50 +01:00
Gwendal Roué 5400217bb6 ReceiveValuesOnSubscription forwards cancellation
Fixes #932
2021-03-07 12:10:35 +01:00
Gwendal Roué 71083a5586 Merge pull request #933 from groue/dev/issue-931
Fix DatabaseMigrator.eraseDatabaseOnSchemaChange in the context of shared databases
2021-03-07 12:09:04 +01:00
Gwendal Roué 37279dfad2 CHANGELOG 2021-03-06 14:20:11 +01:00
Gwendal Roué 8be0976bd1 Fix #931 2021-03-06 14:01:56 +01:00
Gwendal Roué 7623a96034 Failing test for #931 2021-03-06 13:34:27 +01:00
Gwendal Roué 424df6dee3 TODO 2021-03-06 13:25:59 +01:00
Gwendal Roué 48b6faa45e Improve documentation of Configuration.prepareDatabase 2021-03-06 13:25:52 +01:00
Gwendal Roué bac7b6b0e5 Refactor function calls
and make it possible to express other DISTINCT aggregates than COUNT: SUM(DISTINCT ...), etc.
2021-03-06 13:25:25 +01:00
Gwendal Roué 174766925a Remove warning 2021-03-03 20:04:08 +01:00
Gwendal Roué 9d5cb15380 SQLExpression documentation & cleanup 2021-03-03 20:03:56 +01:00
Gwendal Roué 284ebbd3ef [skip travis] Update thank you notice 2021-03-03 14:09:23 +01:00
Gwendal Roué 3b6cf4c12b Merge branch 'development' 2021-03-03 13:00:39 +01:00
Gwendal Roué 2329a5c7b4 v5.5.0 2021-03-03 13:00:21 +01:00
Gwendal Roué 8f50d70703 Merge pull request #930 from groue/dev/issue-929
Fix SQL generation for `COLLATE`, `IN`, `NOT IN`
2021-03-03 07:56:14 +01:00
Gwendal Roué d2d515658e CHANGELOG 2021-03-02 20:21:51 +01:00
Gwendal Roué 72123494ca Add test for NOT IN and collated expressions 2021-03-02 20:16:15 +01:00
Gwendal Roué 7b81fd1bff Fix documentation for #929 2021-03-02 20:12:38 +01:00
Gwendal Roué 5ea7296e7a Add support for subquery.contains(collated expression) 2021-03-02 20:09:24 +01:00
Gwendal Roué 279b00f890 Fix failing tests for #929 2021-03-02 20:03:19 +01:00
Gwendal Roué 01d71d6f35 Failing tests for #929 2021-03-02 20:02:46 +01:00
Gwendal Roué 96df69b3fb Add fundamental test for #929 2021-03-02 19:06:18 +01:00
Gwendal Roué b17fce357d Merge pull request #925 from groue/dev/RowDecodingError
Foundation for decoding errors
2021-03-01 09:03:20 +01:00
Gwendal Roué 37dfd95ae1 Symmetry with StatementColumnConvertible 2021-02-26 19:31:41 +01:00
Gwendal Roué b834b9876d Data.fastDecodeNoCopyIfPresent can not fail 2021-02-26 18:51:14 +01:00
Gwendal Roué 7f48e66fdc Reduce inlined code 2021-02-26 18:50:47 +01:00
Gwendal Roué b7c57dc7f2 Attempt at clarifying the (complex) decoding api
The difficulty is due to fast decoding of StatementColumnConvertible, and non-copied Data, from raw SQLite statement.

We want it to be inlinable, and possible in nested rows.

Added missing tests for nested rows
2021-02-25 20:45:12 +01:00
Gwendal Roué cb2405a8b9 RowDecodingError 2021-02-21 14:21:04 +01:00
Gwendal Roué 4398777f07 TODO 2021-02-20 17:03:17 +01:00
Gwendal Roué 6e8285e4ec CHANGELOG 2021-02-20 13:02:30 +01:00
Gwendal Roué aceaaf24d2 Paranoid: Wrap DatabaseQueue.read in a transaction
This guarantees snapshot isolation even in case of external connections
2021-02-20 12:59:27 +01:00
Gwendal Roué 64bb63e304 CommonTableExpression has an implicit Row RowDecoder 2021-02-20 12:47:13 +01:00
Gwendal Roué a681ccf2b9 Fix: DatabaseQueue.read is throws, not rethrows 2021-02-20 11:55:19 +01:00
Gwendal Roué 8c8a25a73b Spot the possible improvement on SQLRelation children 2021-02-20 11:42:54 +01:00
Gwendal Roué d419d23368 Tests for SQLRelation children 2021-02-19 16:28:22 +01:00
Gwendal Roué 081500b5ce TODO 2021-02-19 13:26:18 +01:00
Gwendal Roué 7dd36ecc0f Tests for SQLRelation children 2021-02-19 07:36:33 +01:00
Gwendal Roué 10a16ac6f0 Rename .allNotPrefetched to .bridge 2021-02-18 08:42:01 +01:00
Gwendal Roué d7f61fa0f5 Documentation 2021-02-18 07:58:10 +01:00
Gwendal Roué 3665a533cf Add missing tests for has-many through association with three steps 2021-02-17 20:04:35 +01:00
Gwendal Roué c9332a8c9e Fix typo 2021-02-17 20:03:59 +01:00
Gwendal Roué e40534942c format 2021-02-17 18:19:52 +01:00
Gwendal Roué de52856cf3 Aliasing is not qualifying 2021-02-17 18:11:00 +01:00
Gwendal Roué 0dd345eb91 SQLQuery no longer depends on SQLExpressible and other high-level protocols 2021-02-17 18:00:53 +01:00
Gwendal Roué c4620aa587 SQLRelation no longer depends on SQLExpressible and _JoinableRequest
Those are one level up
2021-02-17 17:43:57 +01:00
Gwendal Roué bda63c70bf Document the type of variables 2021-02-17 13:51:23 +01:00
Gwendal Roué 3407715599 CHANGELOG 2021-02-17 13:47:15 +01:00
Gwendal Roué 7eaf579c18 Update CommonTableExpression documentation about the implicit Void RowDecoder 2021-02-17 13:44:51 +01:00
Gwendal Roué 488849535e CommonTableExpression has an implicit Void RowDecoder 2021-02-17 13:22:28 +01:00
Gwendal Roué 15b892af6e Implement filters with SQLExpression? instead of [SQLExpression]
Those arrays were introduced so that we can generate nicer sql: `a AND b AND c`, instead of `(a AND b) AND c`.

This flattening is provided by the && operator and `SQLExpression.associativeBinary`, so those arrays are no longer needed.
2021-02-17 08:45:57 +01:00
Gwendal Roué cceb24a1e5 Merge branch 'development' 2021-02-15 19:17:27 +01:00
Gwendal Roué bea454a0b9 v5.4.0 2021-02-15 19:16:06 +01:00
Gwendal Roué 276fb2d698 Performance tests: upgrade dependencies 2021-02-15 18:54:32 +01:00
Gwendal Roué 8e3046b00f Move Sequence.joined(operator:) back to SQLSpecificExpressible
`[1, 2, 3].joined(operator: .add)` is not supported. It would pollute autocompletion.

This commit fixes a regression introduced in 920417b.
2021-02-15 18:16:18 +01:00
Gwendal Roué 8a5790ed8b Move SQLSelectable and SQLOrderingTerm down from SQLExpressible to SQLSpecificExpressible 2021-02-15 14:01:42 +01:00
Gwendal Roué fd6f5ec525 CHANGELOG 2021-02-15 13:55:58 +01:00
Gwendal Roué 987d549ff0 Remove obsolete test in demo app 2021-02-15 07:59:48 +01:00
Gwendal Roué f57e724ef6 Merge pull request #922 from groue/experiments/enums
Refactor query interface implementation
2021-02-15 07:22:42 +01:00
Gwendal Roué 920417beb3 Replace protocols with enums 2021-02-14 18:28:15 +01:00
Gwendal Roué 2a016ac4f5 TODO 2021-02-12 18:47:37 +01:00
Gwendal Roué ba3a3f7c38 Move definition of TableRecord to CTE associations 2021-02-09 18:14:35 +01:00
Gwendal Roué ae6f5dd0f5 Extract ForeignKey 2021-02-09 18:14:35 +01:00
Gwendal Roué 7914805524 Remove TableRecord requirements for QueryInterfaceRequest aggregates 2021-02-09 18:14:35 +01:00
Gwendal Roué 5c2f113631 TODO 2021-02-08 13:07:02 +01:00
Gwendal Roué d3df3ed5ec Makefile: support for Xcode 12.4 and Big Sur
Bump min iOS and tvOS versions to 11.4 because Big Sur does not support older simulators:

$ xcrun simctl list runtimes
iOS 10.3 (10.3.1 - 14E8301) - com.apple.CoreSimulator.SimRuntime.iOS-10-3 (unavailable, The iOS 10.3 simulator runtime is not supported on hosts after macOS 10.15.99.)
tvOS 10.2 (10.2 - 14W260) - com.apple.CoreSimulator.SimRuntime.tvOS-10-2 (unavailable, The tvOS 10.2 simulator runtime is not supported on hosts after macOS 10.15.99.)
2021-02-07 17:23:10 +01:00
Gwendal Roué 40389ee102 Decouple associations from their origin database table
This allows us to create an association without providing the origin table name, and thus to build association without TableRecord.
2021-02-07 16:01:34 +01:00
Gwendal Roué edc8c2aeea Fix sample code 2021-01-30 09:52:35 +01:00
Gwendal Roué f9ad87e54f Documentation 2021-01-29 19:49:55 +01:00
Gwendal Roué a6a10270a0 TODO 2021-01-29 08:11:16 +01:00
Gwendal Roué 9a1ff5e9a0 BRAG 2021-01-28 19:09:46 +01:00
Gwendal Roué 7151648279 Cleanup demo apps 2021-01-28 08:44:34 +01:00
Gwendal Roué 921c629a5e Documentation: Adding support for missing SQL functions or operators 2021-01-28 08:43:14 +01:00
Gwendal Roué 25b2a0392d SQL interpolation supports embedding collations into SQL literals 2021-01-28 08:39:40 +01:00
Gwendal Roué cb7aa3c14f TODO 2021-01-28 08:36:14 +01:00
Gwendal Roué 6ea56060a2 Merge branch 'master' into development 2021-01-27 19:46:16 +01:00
Gwendal Roué 3733648598 [skip travis] Remove all details about SPM installation (#913) 2021-01-27 14:05:08 +01:00
Gwendal Roué 40341d4e98 Merge branch 'master' into development 2021-01-23 17:47:04 +01:00
Gwendal Roué 5393d97033 [skip travis] Update BRAG.md 2021-01-23 17:45:54 +01:00
Gwendal Roué 8bf9e5e30f Decouple associations from TableRecord
Associations is generic for type safety, not for defining the association (just as QueryInterfaceRequest)
2021-01-23 09:48:18 +01:00
Gwendal Roué bc5ba1fda5 Merge branch 'development' 2021-01-21 08:23:18 +01:00
Gwendal Roué 034cf065c1 Merge pull request #912 from groue/dev/demo-test
Add tests to the demo apps
2021-01-21 08:22:47 +01:00
Gwendal Roué d7743d0a56 Documentation 2021-01-21 08:21:48 +01:00
Gwendal Roué 5ed0a4a6ed Test that the SwiftUI demo app feeds on immediate publishers 2021-01-21 08:17:02 +01:00
Gwendal Roué dd2e8bb063 Documentation 2021-01-21 08:04:19 +01:00
Gwendal Roué 790b678c74 Documentation 2021-01-20 19:51:03 +01:00
Gwendal Roué abb50a0786 Restore fileprivate Player.Columns 2021-01-20 19:47:04 +01:00
Gwendal Roué 2862edcea8 Documentation 2021-01-20 19:42:32 +01:00
Gwendal Roué 91c17aca41 GRDBCombineDemo tests 2021-01-20 19:14:27 +01:00
Gwendal Roué fc546e25e2 GRDBDemoiOS tests 2021-01-20 19:14:02 +01:00
Gwendal Roué a5b6a0a51f [skip travis] Merge branch 'development' 2021-01-20 07:52:24 +01:00
Gwendal Roué befeb07234 Clarify FTS5Pattern(matchingPrefixPhrase:) behavior 2021-01-20 07:51:00 +01:00
Gwendal Roué 8fe3d41d18 Cleanup and harmonize demo apps 2021-01-20 07:48:05 +01:00
Gwendal Roué 9628eaffb9 Documentation improvement 2021-01-09 17:55:15 +01:00
Gwendal Roué 7be7e1cade Merge branch 'development' 2021-01-09 17:10:55 +01:00
Gwendal Roué db54c567de Performance tests: upgrade Realm, and set deployment target to macOS 10.15 2021-01-09 16:59:34 +01:00
Gwendal Roué db6ea3b85e Change demo app bundle ID
Xcode would no longer accept the previous one.
2021-01-09 16:33:12 +01:00
Gwendal Roué 33f3e868da v5.3.0 2021-01-09 15:47:00 +01:00
Gwendal Roué d4e380c35b Update thank you notice 2021-01-09 14:44:23 +01:00
Gwendal Roué 0dd78f1580 CHANGELOG 2021-01-09 14:43:40 +01:00
Gwendal Roué 267bfb29fe Merge pull request #892 from eburns-vmware/dev/data_passphrase
Provide SQLCipher passphrase as Data
2021-01-09 14:33:46 +01:00
Gwendal Roué 4e551c8c6e Fix Swiftlint errors 2021-01-09 13:09:44 +01:00
Gwendal Roué 554a84cf28 CHANGELOG 2021-01-09 12:57:26 +01:00
Gwendal Roué 2cfd51401a Merge pull request #903 from chrisballinger/patch-2
Fix SPM installation instructions
2021-01-06 09:06:06 +01:00
Chris Ballinger 948f9d3f22 Fix SPM installation instructions 2021-01-05 14:00:20 -08:00
Gwendal Roué 728efd3d67 Update the thank you notice 2021-01-01 13:59:42 +01:00
Gwendal Roué 1b0dd4ae25 CHANGELOG 2021-01-01 13:59:32 +01:00
Gwendal Roué e1b91e0642 Makefile documentation 2021-01-01 13:57:52 +01:00
Gwendal Roué 74b71b024b Merge pull request #901 from wuyuehyang/development
Fix creation of FTS5 tokenizer with arguments
2021-01-01 13:55:08 +01:00
wuyueyang c86d2d654f Fix failed to create unicode61 tokenizer as a wrapped tokenizer 2021-01-01 02:13:11 +08:00
wuyueyang ff6bdc38ef Add test case for custom tokenizer with a unicode61 tokenizer of multiple arguments wrapped 2021-01-01 00:44:00 +08:00
Gwendal Roué ef5b284f11 Remove TODO warning 2020-12-23 12:39:57 +01:00
Gwendal Roué 836efb120f Xcode 12.3 formatting 2020-12-23 12:13:05 +01:00
Gwendal Roué 3a76b84eae Documentation 2020-12-23 11:16:09 +01:00
Gwendal Roué ae17e9f893 Documentation 2020-12-23 11:11:27 +01:00
Gwendal Roué 6ea1e6aeaf Test that pragma tables are not tracked 2020-12-23 10:41:03 +01:00
Gwendal Roué ed32e44bc2 DRY 2020-12-23 10:31:16 +01:00
Gwendal Roué 60a9494434 Fix Swiftlint warnings 2020-12-23 10:10:10 +01:00
Gwendal Roué 51991213ef Stop observing pragma tables 2020-12-23 10:09:00 +01:00
Gwendal Roué dc16fae72e Documentation 2020-12-23 10:08:30 +01:00
Gwendal Roué b485d4d3dc forSingleResult is no longer mandatory 2020-12-23 10:08:16 +01:00
Gwendal Roué 7634d3f950 Documentation 2020-12-23 09:23:37 +01:00
Gwendal Roué 6abbf82a89 So long, visitor pattern! 2020-12-23 09:02:17 +01:00
Ed Burns 2de9b2d9ed Cleaned up documentation and addressed review comments. 2020-12-22 11:29:26 -06:00
Gwendal Roué cc0611847d Remove the CocoaPods lint job from Travis
It's too slow, and nearly always fails
2020-12-20 08:52:12 +01:00
Gwendal Roué c844438dd6 Xcode 12.2 touch 2020-12-20 08:51:42 +01:00
Gwendal Roué 0d6f68646c Turn warning into a TODO 2020-12-19 13:07:24 +01:00
Gwendal Roué af55215356 Travis: test with Xcode 12.2 2020-12-19 13:02:24 +01:00
Gwendal Roué f4f44c51d9 Makefile: support for Xcode 12.3 2020-12-19 11:18:46 +01:00
Ed Burns 77a1becba1 Fixed error in README. Sorry. 2020-12-17 17:17:26 -06:00
Ed Burns 5546961c8c Test fixes and cleanup. 2020-12-17 17:10:39 -06:00
Ed Burns d09571c0ad Added option to specify passphrase as a Data object, added section to README. 2020-12-17 11:19:05 -06:00
Gwendal Roué 9b15011f17 Move singularity test to SQLAssociationCardinality 2020-12-13 18:29:48 +01:00
Gwendal Roué e72007c1dd Make SQLiteral.subquery a promise
This allows us to postpone CTEs definition until a db connection is available
2020-12-13 18:29:43 +01:00
Gwendal Roué ab502baa20 CommonTableExpression.contains(_:) 2020-12-13 18:29:28 +01:00
Gwendal Roué eb0e0d4cdd Merge pull request #885 from groue/dev/cte+871
Robustness of eager loading of to-many associations based on compound foreign keys
2020-12-12 13:31:28 +01:00
Gwendal Roué c8818c1d44 CTEs are experimental 2020-12-12 12:47:44 +01:00
Gwendal Roué 1ff825c861 CHANGELOG 2020-12-12 12:41:10 +01:00
Gwendal Roué 13946f1d8d Remove unclear recommentation 2020-12-12 12:40:50 +01:00
Gwendal Roué 6a68e31903 Clarify handling of NULL in foreign keys 2020-12-12 12:40:50 +01:00
Gwendal Roué 618be9b5e4 Do not support null in foreign keys more than SQLite itself 2020-12-12 12:40:50 +01:00
Gwendal Roué 4a6a2c5495 Fix typo 2020-12-12 12:40:50 +01:00
Gwendal Roué 6082fc4e54 Tests for nullable compound foreign keys 2020-12-12 12:40:50 +01:00
Gwendal Roué 4e8d129162 Only use the CTE technique if foreign key columns are not null 2020-12-12 12:40:50 +01:00
Gwendal Roué 472b5bc604 Test two levels of include(all:) with compound foreign keys 2020-12-12 12:40:50 +01:00
Gwendal Roué cad788e59e Revert "Prefer CommonTableExpression.contains(_:)"
This reverts commit 87a0921586e319ccd4ee02e991ec555c6a915c13.
2020-12-12 12:40:49 +01:00
Gwendal Roué 2cb4cf51c3 TODO 2020-12-12 12:40:49 +01:00
Gwendal Roué 5eff2448bb Documentation 2020-12-12 12:40:49 +01:00
Gwendal Roué aabf6e6247 Prefer CommonTableExpression.contains(_:) 2020-12-12 12:40:49 +01:00
Gwendal Roué 23c93eebdf Remove fixed caveat from documentation 2020-12-12 12:40:49 +01:00
Gwendal Roué 732ec36b67 Documentation 2020-12-12 12:40:49 +01:00
Gwendal Roué f1196bf924 Limit availability of _SQLRowValue.isAvailable 2020-12-12 12:40:49 +01:00
Gwendal Roué fcd6a453f0 Replace CTE request with its table name 2020-12-12 12:40:49 +01:00
Gwendal Roué 85af2deced Document TODOs with row values 2020-12-12 12:40:49 +01:00
Gwendal Roué b70f85d94b Fix #871 2020-12-12 12:40:49 +01:00
Gwendal Roué b715206502 Row values 2020-12-12 12:40:49 +01:00
Gwendal Roué 18885d4ca1 CHANGELOG 2020-12-12 12:40:32 +01:00
Gwendal Roué 555ed025bc CHANGELOG 2020-12-12 12:30:45 +01:00
Gwendal Roué d0e4d536d9 Merge pull request #880 from groue/dev/cte
Common Table Expressions
2020-12-12 11:56:01 +01:00
Gwendal Roué 8c225105c2 Documentation 2020-12-12 11:21:49 +01:00
Gwendal Roué c36539adb3 CTEs can enter UPDATE and DELETE queries 2020-12-12 11:06:51 +01:00
Gwendal Roué b636c391df Fix typo 2020-12-11 08:33:13 +01:00
Gwendal Roué 659af2cd2a Documentation 2020-12-11 08:28:44 +01:00
Gwendal Roué f70e2b4e37 Mention that recursive CTEs require SQL 2020-12-11 08:24:05 +01:00
Gwendal Roué b16e12cb6e Documentation 2020-12-11 08:18:33 +01:00
Gwendal Roué df5c62d2d9 Documentation
Mention the CTE blog post found by @bellebethcooper
2020-12-11 08:17:12 +01:00
Gwendal Roué b89d11f8ec TODO 2020-12-09 09:23:42 +01:00
Gwendal Roué 992f2a2d83 Revert "CommonTableExpression.contains(_:)"
This reverts commit f94cecb329.

We can't expose a raw table name like that, because it may be used several times, and need an alias.
2020-12-08 18:36:51 +01:00
Gwendal Roué f94cecb329 CommonTableExpression.contains(_:) 2020-12-06 19:22:30 +01:00
Gwendal Roué 89c117425e Mention minimal SQLite version in README 2020-12-06 16:40:40 +01:00
Gwendal Roué 26c7441b49 Documentation 2020-12-06 13:16:27 +01:00
Gwendal Roué a6d80ce208 Update Makefile for Xcode 12.2 2020-12-06 13:11:36 +01:00
Gwendal Roué c287449258 Documentation 2020-12-05 20:50:58 +01:00
Gwendal Roué f9c98b4a1f Fix documentation typo 2020-12-05 20:47:59 +01:00
Gwendal Roué 86cfee4e23 Fix typo 2020-12-05 19:57:54 +01:00
Gwendal Roué a3351513ce Optimize inclusion of CTE association
In order to count the selected columns of a CTE, we do not need to have SQLite compile the whole CTE request when we have information about the selected columns.
2020-12-05 19:50:47 +01:00
Gwendal Roué 95be9b7bb6 Documentation 2020-12-05 19:17:47 +01:00
Gwendal Roué 1c2dd8617b Fix Documentation typo 2020-12-05 19:15:20 +01:00
Gwendal Roué 7f71174159 Fix typo 2020-12-05 18:26:46 +01:00
Gwendal Roué 098ddf27ec Documentation 2020-12-05 18:25:51 +01:00
Gwendal Roué bbce741688 Documentation 2020-12-05 18:22:26 +01:00
Gwendal Roué c56382f04a Documentation 2020-12-05 18:19:01 +01:00
Gwendal Roué 71841f0a07 Documentation 2020-12-05 18:16:20 +01:00
Gwendal Roué e43fae2a63 Fix sample code 2020-12-05 18:13:42 +01:00
Gwendal Roué 022a06b4bc Documentation 2020-12-05 18:10:13 +01:00
Gwendal Roué 7df77aa2d0 Documentation 2020-12-05 18:05:52 +01:00
Gwendal Roué f18bcb67e4 Documentation 2020-12-05 17:56:39 +01:00
Gwendal Roué cc68ef5872 Caveat documentation 2020-12-05 16:13:48 +01:00
Gwendal Roué 5b3eee53c2 SQL interpolation of CTEs 2020-12-05 16:13:24 +01:00
Gwendal Roué 63255cabf8 SQL interpolation of CTEs 2020-12-05 13:40:56 +01:00
Gwendal Roué 9d1bcec132 Cleanup filtering of trivially true joining conditions 2020-12-05 12:49:31 +01:00
Gwendal Roué b60f39e7cc Merge branch 'development' into dev/cte
# Conflicts:
#	GRDB/QueryInterface/Request/Association/Association.swift
#	GRDB/QueryInterface/Request/QueryInterfaceRequest.swift
#	GRDB/QueryInterface/SQL/SQLQuery.swift
#	GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift
#	GRDB/QueryInterface/SQLGeneration/SQLQueryGenerator.swift
2020-12-05 12:31:52 +01:00
Gwendal Roué 5464d64180 Prevent an infinite loop of self-proxying TableAlias I saw once 2020-12-05 12:24:05 +01:00
Gwendal Roué 1e2d07a16f Simplify SQLSource
SQLSource used to be more or less able to deal with subqueries, as in SELECT ... FROM (SELECT ...).

But we had only one use case for it, the "trivial count query": SELECT COUNT(*) FROM (SELECT ...). And many opportunities for fatal errors, because such subqueries were not generally supported.

So we simplify SQLSource, and implement the trivial count query in another way.
2020-12-05 12:21:14 +01:00
Gwendal Roué 66b23d423f Cleanup JoinAssociation 2020-12-05 10:54:31 +01:00
Gwendal Roué 3094c274df Enhance error message 2020-12-05 10:34:32 +01:00
Gwendal Roué 378279ee1a Move the isRecursive flag where it belongs 2020-12-05 10:32:46 +01:00
Gwendal Roué e509d7af65 Merge branch 'development' into dev/cte 2020-12-04 07:10:12 +01:00
Gwendal Roué 9da4bc09c3 Fix typos 2020-12-04 07:09:54 +01:00
Gwendal Roué 462461c1c9 Merge pull request #883 from professordeng/patch-1
Update README.md
2020-12-04 05:34:41 +01:00
peofessordeng 7ded56dfc4 Update README.md 2020-12-04 11:07:37 +08:00
Gwendal Roué 836a0a5e37 Documentation 2020-12-03 19:15:57 +01:00
Gwendal Roué 91dd13e2be Merge cte support into AllColumns 2020-12-03 18:51:26 +01:00
Gwendal Roué a1f0f2c9b7 TODO 2020-12-03 09:24:56 +01:00
Gwendal Roué 6f409f2140 Fix typo 2020-12-03 09:22:15 +01:00
Gwendal Roué 64776682fe Drop USING clause until actually needed 2020-12-03 09:21:19 +01:00
Gwendal Roué a21e6575d8 _AllCTEColumns delegates to AllColumns and _SQLQualifiedAllColumns 2020-12-03 08:37:55 +01:00
Gwendal Roué 4ee6f3293a CTE columns are provided as strings 2020-12-03 08:34:43 +01:00
Gwendal Roué 17b884b3dc Recursive CTEs 2020-12-03 08:28:14 +01:00
Gwendal Roué 0f6d36bfc2 Cleanup 2020-12-03 07:07:39 +01:00
Gwendal Roué 0dc9215df6 Documentation 2020-12-02 22:15:50 +01:00
Gwendal Roué 333ffc1ebe Documentation 2020-12-02 21:55:51 +01:00
Gwendal Roué 181c930e39 Cleanup 2020-12-02 19:29:35 +01:00
Gwendal Roué 65337e74d9 Solve #856 with a CTE :-) 2020-12-02 19:14:53 +01:00
Gwendal Roué 69c116507b Fetch straight from a CTE 2020-12-02 18:40:58 +01:00
Gwendal Roué 2b82de42d8 Merge branch 'development' into dev/cte 2020-12-02 18:30:31 +01:00
Gwendal Roué 10dfa3fba9 Merge pull request #881 from felixscheinost/patch-1
Fix try-catch blocks in documentation
2020-12-02 10:41:06 +01:00
Felix Scheinost 339062f01f Fix try-catch blocks in documentation 2020-12-02 10:08:55 +01:00
Gwendal Roué eb2346dfce Couting requests with CTE uses trivial SQL 2020-12-02 08:26:35 +01:00
Gwendal Roué 1d0adaacf6 including(all:) accepts associations based on the .using condition 2020-12-02 08:20:50 +01:00
Gwendal Roué 5e8f95ca09 Improve CTE columns counting 2020-12-02 08:09:07 +01:00
Gwendal Roué b085a29c8c Cleanup 2020-12-02 08:02:42 +01:00
Gwendal Roué 992e8f3423 Remove header 2020-12-02 06:25:18 +01:00
Gwendal Roué 49e6923156 Prepare recursive CTEs 2020-12-02 06:22:55 +01:00
Gwendal Roué a7a4858364 Refactor CommonTableExpression initializers 2020-12-02 06:12:55 +01:00
Gwendal Roué 3a38cbe87f Create CTE without request 2020-12-02 06:00:04 +01:00
Gwendal Roué 2c42d0129c CTE columns: WITH cte(a, b) AS ... 2020-12-02 05:36:56 +01:00
Gwendal Roué da5ef961d6 Expose CTE creation method at a documented level 2020-12-02 05:14:26 +01:00
Gwendal Roué d35373dcdf Fix typo 2020-12-01 20:48:40 +01:00
Gwendal Roué adc6ba1226 Delete dead code 2020-12-01 20:45:11 +01:00
Gwendal Roué b1d162c14e Filter, order, alias CTE 2020-12-01 20:38:37 +01:00
Gwendal Roué 2b6c3fb868 Remove misleading comment 2020-12-01 20:38:19 +01:00
Gwendal Roué a70b42cbf5 Extract SQLAssociationCondition.using 2020-12-01 20:30:36 +01:00
Gwendal Roué 06000abbfd Type-safe CTE associations, part 2 2020-12-01 20:04:35 +01:00
Gwendal Roué 67bc47c3b5 Type-safe CTE associations 2020-12-01 20:00:04 +01:00
Gwendal Roué 5c34ab19e2 API rationalization 2020-12-01 19:50:16 +01:00
Gwendal Roué 6d14f792e6 Remove dead code 2020-12-01 19:36:50 +01:00
Gwendal Roué 1238843a44 Cleanup 2020-12-01 19:33:43 +01:00
Gwendal Roué 8000332ec4 Gather CTE methods 2020-12-01 19:29:39 +01:00
Gwendal Roué 9896607dff Test for filtered CTE 2020-12-01 19:17:47 +01:00
Gwendal Roué 1be0a6cd5c Add JoinAssociation to GRDBCustom 2020-12-01 19:17:34 +01:00
Gwendal Roué 0191676063 Using clause for CTE associations 2020-12-01 09:17:05 +01:00
Gwendal Roué c16da693df More cte association api experiments 2020-12-01 08:38:39 +01:00
Gwendal Roué f31dd0033c Remove non-composable cte association methods 2020-12-01 08:21:04 +01:00
Gwendal Roué b7b89c5fa9 CTE associations 2020-11-30 21:51:17 +01:00
Gwendal Roué c776ee8d47 Association: remove TableRecord requirement 2020-11-30 21:50:18 +01:00
Gwendal Roué c36fc2813b Include a raw SQL CTE 2020-11-30 19:29:54 +01:00
Gwendal Roué ec2640a459 CommonTableExpression is a table, after all 2020-11-30 19:21:46 +01:00
Gwendal Roué 755782759a Cleanup 2020-11-30 18:14:03 +01:00
Gwendal Roué 9275d4ddf8 Need to deal with CTE subqueries 2020-11-30 18:10:21 +01:00
Gwendal Roué 96951b3d4e Remove dead code 2020-11-30 18:10:06 +01:00
Gwendal Roué 36a8cd1352 CTE merging WIP: we need to postpone TableAlias creation 2020-11-29 19:33:46 +01:00
Gwendal Roué 2bb9f5ce0d First joins with CommonTableExpression 2020-11-29 19:05:12 +01:00
Gwendal Roué e1d3c1d7dc Give CommonTableExpression a key, for joins 2020-11-29 18:23:41 +01:00
Gwendal Roué 00a7eb53e8 First successful SQL generation with CTE 2020-11-29 16:51:52 +01:00
Gwendal Roué e7dcf25063 CTE aliases 2020-11-29 15:49:55 +01:00
Gwendal Roué d2b7b4240a CTE basis 2020-11-29 15:06:45 +01:00
Gwendal Roué b6ef89c116 Prefetch cleanup 2020-11-29 11:58:15 +01:00
Gwendal Roué 2a917823ed Merge branch 'development' 2020-11-29 06:59:23 +01:00
Gwendal Roué 2135f8e768 v5.2.0 2020-11-28 13:46:26 +01:00
Gwendal Roué 2c45ecf56c CHANGELOG 2020-11-28 13:41:50 +01:00
Gwendal Roué 52f831936e Document the including(all:) caveat with compound foreign keys 2020-11-28 13:26:21 +01:00
Gwendal Roué 28f6b64f67 Document the including(all:) caveat with compound foreign keys 2020-11-28 13:24:25 +01:00
Gwendal Roué cc0365d794 Document the including(all:) caveat with compound foreign keys 2020-11-28 13:21:12 +01:00
Gwendal Roué 59ad47d640 Merge pull request #872 from groue/dev/timezone
Parse time zones
2020-11-14 18:33:42 +01:00
Gwendal Roué 27662f99b0 [skip travis] profile date parsing 2020-11-14 13:18:21 +01:00
Gwendal Roué 4c5c2dfb6c [skip travis] CHANGELOG 2020-11-14 13:16:38 +01:00
Gwendal Roué 517a7b2984 Update documentation 2020-11-14 11:16:47 +01:00
Gwendal Roué 10bb596b7c Update documentation 2020-11-14 11:15:09 +01:00
Gwendal Roué 6913f1e39b Update documentation 2020-11-14 10:51:30 +01:00
Gwendal Roué fe8e32586b Parse time zones 2020-11-14 10:35:04 +01:00
Gwendal Roué e0c91ed2ee Merge pull request #868 from groue/dev/varying-region
ValueObservation optimization is opt-in
2020-11-08 11:15:41 +01:00
Gwendal Roué 428433672c Documentation 2020-11-07 13:55:57 +01:00
Gwendal Roué f71a2f7cd8 CHANGELOG 2020-11-07 13:39:49 +01:00
Gwendal Roué 102b037c7d Update documentation 2020-11-07 13:02:47 +01:00
Gwendal Roué 46c3839ea0 ValueObservation tracks a varying database region by defaut 2020-11-07 13:01:51 +01:00
Gwendal Roué 2c51c04708 Merge branch 'development' 2020-11-01 13:27:29 +01:00
Gwendal Roué d0a7a49c19 v5.1.0 2020-11-01 13:27:04 +01:00
Gwendal Roué 0024a4e654 Merge pull request #864 from groue/dev/filter-ergonomics
Prevent filter misuse with a deprecation warning
2020-11-01 13:18:05 +01:00
Gwendal Roué d66a3f4ab3 Fix Swiftlint warning 2020-11-01 10:39:48 +01:00
Gwendal Roué 645aa1d67b CHANGELOG 2020-11-01 10:34:21 +01:00
Gwendal Roué 06db4af649 Enhance warning 2020-11-01 10:33:05 +01:00
Gwendal Roué baf1ef32d1 Document why filter(_:) prefers SQLSpecificExpressible over SQLExpressible 2020-11-01 10:29:07 +01:00
Gwendal Roué d5638f8e53 Update tests and replace filter(value) with filter(databaseValue) 2020-11-01 09:44:13 +01:00
Gwendal Roué c65b5b28b9 Update tests and replace filter(value) with filter { _ in value }
We just want to make sure that no nasty overload alters the meaning of expressions such as `2 + 2`
2020-11-01 09:43:37 +01:00
Gwendal Roué 1301e16f6e Update tests and replace filter(false) with none() 2020-11-01 09:42:00 +01:00
Gwendal Roué caa382f41b Deprecate filter(value)
Some people use Player.filter(id) instead of Player.filter(key: id). This is what this commit prevents.
2020-11-01 09:41:16 +01:00
Gwendal Roué 24fd69a9be [skip travis] CHANGELOG 2020-10-31 19:56:25 +01:00
Gwendal Roué 2389ec691b Merge pull request #855 from mallman/generated_columns
SQLite 3.33.0 + Support for generated columns
2020-10-31 18:56:34 +01:00
Gwendal Roué b8dd2ce2f4 Generate columns from query interface expressions
This allows to avoid SQL injection
2020-10-31 14:16:04 +01:00
Gwendal Roué 5114cc4d6d Fix documentation 2020-10-31 13:56:22 +01:00
Gwendal Roué 57036c4470 Use SQLite ergonomics, and create virtual generated columns by default 2020-10-31 13:55:07 +01:00
Gwendal Roué 81166432a8 Documentation for generatedAs(sql:) 2020-10-31 13:45:58 +01:00
Gwendal Roué 5dc8502c8b Test that update(_:) and insert(_:) throw when persisting generated columns 2020-10-31 13:23:42 +01:00
Gwendal Roué 67e10926db Restore logic 2020-10-31 13:09:49 +01:00
Gwendal Roué e971e210a3 Update documentation about PRAGMA table_info and table_xinfo 2020-10-31 13:09:05 +01:00
Gwendal Roué f7e6169c23 Test that TableRecord.numberOfSelectedColumns(_:) includes generated columns 2020-10-31 13:07:58 +01:00
Gwendal Roué 6fc4e31dfb Test that Database.columns(in:) returns generated columns 2020-10-31 12:55:56 +01:00
Gwendal Roué dfc22bdf00 Skip tests for generated columns unless custom SQLite build 2020-10-31 12:14:52 +01:00
Gwendal Roué 54b5f47ffa Upgrade custom SQLite builds to v3.33.0 2020-10-31 12:09:49 +01:00
Gwendal Roué 62a4251f90 Merge pull request #862 from groue/dev/fix-861
Improve documentation of observations of varying regions
2020-10-31 11:34:07 +01:00
Gwendal Roué a41c12252a Documentation 2020-10-30 09:12:47 +01:00
Gwendal Roué e7cf816062 Documentation 2020-10-30 06:25:20 +01:00
Gwendal Roué ff28cadd57 More tests for optimized regions 2020-10-30 06:20:50 +01:00
Gwendal Roué 9039b18b84 Documentation 2020-10-30 06:05:52 +01:00
Gwendal Roué 480381deb5 Documentation 2020-10-30 05:59:20 +01:00
Gwendal Roué 84dbace4af Documentation 2020-10-30 05:56:58 +01:00
Gwendal Roué 44f80f4c7c Wording 2020-10-30 05:49:42 +01:00
Gwendal Roué 1cb9e52123 Legibility 2020-10-29 19:12:29 +01:00
Gwendal Roué 4d7ddb9c26 Wording 2020-10-29 19:07:31 +01:00
Gwendal Roué 1b29d7eca3 CHANGELOG 2020-10-29 19:02:00 +01:00
Gwendal Roué 5c779b11db Improve documentation of observations of a varying region 2020-10-29 18:47:34 +01:00
Gwendal Roué dc344c07de Wording 2020-10-29 18:16:37 +01:00
Gwendal Roué b7b3c3ab32 Wording 2020-10-29 18:15:23 +01:00
Gwendal Roué 6fa20284ec Wording 2020-10-29 18:14:14 +01:00
Gwendal Roué 978b570826 FAQ: Why is ValueObservation not publishing value changes? 2020-10-29 18:13:06 +01:00
Gwendal Roué 688e393ed1 Don't track prefetched associations when the parent is provably empty 2020-10-29 17:05:26 +01:00
Gwendal Roué 8ede868068 More tests for empty regions of empty requests 2020-10-29 16:05:35 +01:00
Gwendal Roué 667d42eeb4 [skip travis] Fix release date 2020-10-28 07:43:01 +01:00
Michael Allman 1f87d5a375 Add rudimentary tests for the generated column table definition API 2020-10-25 12:19:01 -07:00
Michael Allman 4f0a6cf9e1 Extract common filter predicate in AssociationPrefetchingSQLTests into a
reusable method
2020-10-25 11:55:49 -07:00
Michael Allman 3318858b80 Wrap the generatedAs column definition API with the GRDBCUSTOMSQLITE
Swift compiler flag
2020-10-25 11:44:09 -07:00
Michael Allman 9c6f19f55f Condition table column info query on SQLite version 2020-10-25 11:42:43 -07:00
Gwendal Roué 48ee93c244 CHANGELOG 2020-10-25 10:38:22 +01:00
Gwendal Roué ee4197bcc0 Merge branch 'development' 2020-10-25 10:33:57 +01:00
Gwendal Roué 079c476148 v5.0.3 2020-10-25 10:33:32 +01:00
Gwendal Roué aa909b7635 Merge branch 'master' into development 2020-10-25 10:33:21 +01:00
Gwendal Roué 9167ebda98 Merge pull request #859 from groue/dev/deinit-change
Database.close() is idempotent
2020-10-25 10:15:49 +01:00
Gwendal Roué 38682c69da CHANGELOG 2020-10-25 10:15:27 +01:00
Gwendal Roué 2a7f41c494 Database.close() is idempotent
This change addresses https://bugs.swift.org/browse/SR-13746
2020-10-25 10:12:42 +01:00
Michael Allman 071bbc7905 Initial commit for generated column support 2020-10-19 21:25:36 -07:00
Gwendal Roué ca18f509e7 Merge pull request #850 from DiligentRobot/development
Add buildActiveScheme to playground settings so they'll build under Xcode 12
2020-10-15 17:57:34 +02:00
Matt Tancock 5e2bb1d57a Add buildActiveScheme to playground settings so they'll build under Xcode 12 2020-10-15 15:10:28 +01:00
Gwendal Roué dd2950e4ca [skip travis] Merge pull request #849 from MarshalGeazipp/MarshalGeazipp-fix-grammar
Fix grammar mistake AssociationsBasics.md
2020-10-08 17:42:40 +02:00
Sebastian Nicklas 34f3097616 Update AssociationsBasics.md 2020-10-08 17:19:17 +02:00
Gwendal Roué 948e91126a Merge branch 'development' 2020-10-06 19:21:43 +02:00
Gwendal Roué 85b781bf0e v5.0.2 2020-10-06 14:10:06 +02:00
Gwendal Roué bd853a8bc0 CHANGELOG 2020-10-06 14:08:21 +02:00
Gwendal Roué bfc76b96f3 Fix #844 2020-10-06 14:03:41 +02:00
Gwendal Roué 99ea59ee06 Demo app builds in Debug configuration 2020-10-06 14:03:41 +02:00
Gwendal Roué f8a0e8e4b5 Merge pull request #847 from groue/dev/remove-snapshots
Remove dependency on SQLITE_ENABLE_SNAPSHOT
2020-10-06 13:32:26 +02:00
Gwendal Roué 14e32a2bd1 [skip travis] CHANGELOG 2020-10-06 13:31:52 +02:00
Gwendal Roué f84e25f929 Remove dependency on SQLITE_ENABLE_SNAPSHOT
Address #845 and #846
2020-10-06 08:30:41 +02:00
Gwendal Roué 6884bf10b0 Merge branch 'development' 2020-09-27 15:52:03 +02:00
Gwendal Roué 8803eafe31 v5.0.1 2020-09-27 15:20:42 +02:00
Gwendal Roué 9909ca4c96 [skip travis] CHANGELOG 2020-09-27 15:17:12 +02:00
Gwendal Roué 5d36d5735d [skip travis] Update GRDBCombineDemo for iOS 14
Address both #842 and #843
2020-09-27 14:46:43 +02:00
Gwendal Roué ef368a2bc2 Merge pull request #841 from groue/dev/840
Fix GRDB 5 regression with indexes on expressions
2020-09-27 12:06:02 +02:00
Gwendal Roué 8433b09650 [skip travis] CHANGELOG 2020-09-27 12:04:40 +02:00
Gwendal Roué d2eb92d1a2 Travis: test Xcode 12 2020-09-26 15:27:49 +02:00
Gwendal Roué ba98aab046 Fix failing test for #840 2020-09-26 14:46:39 +02:00
Gwendal Roué 00d15339b6 Failing test for #840 2020-09-26 14:45:49 +02:00
Gwendal Roué 1ea4a44bb8 Merge branch 'development' 2020-09-20 16:47:45 +02:00
Gwendal Roué 5119c065bd v5.0.0 2020-09-20 15:54:56 +02:00
Gwendal Roué 8be6aa7358 Fix GRDBCombineDemo on the device 2020-09-20 15:35:25 +02:00
Gwendal Roué 438f99deff GRDBCombineDemo Xcode 12 changes 2020-09-20 15:27:52 +02:00
Gwendal Roué c556c056d8 GRDBCombineDemo: animate list changes 2020-09-20 15:27:36 +02:00
Gwendal Roué 613baf30f9 GRDBCombineDemo: fix compiler error 2020-09-20 15:27:10 +02:00
Gwendal Roué 0ac7e2d299 Xcode 12 2020-09-20 15:05:20 +02:00
Gwendal Roué 929465eb52 UIKit demo: use UITableViewDiffableDataSource 2020-09-20 15:05:07 +02:00
Gwendal Roué 13de0a5cce Demo apps: move from unfamiliar World-based dependency injection to plain shared global 2020-09-20 14:37:01 +02:00
Gwendal Roué c12f42b385 Fix warnings 2020-09-20 14:11:29 +02:00
Gwendal Roué 2ccd01299c In performance report, the hardware model and Xcode version are dynamic 2020-09-20 14:05:08 +02:00
Gwendal Roué fb2efb8df9 Upgrade Realm 2020-09-20 14:04:24 +02:00
Gwendal Roué 795daf284f Remove performance database resources 2020-09-20 13:31:11 +02:00
Gwendal Roué 354b815835 Remove obsolete todos 2020-09-20 11:38:37 +02:00
Gwendal Roué 7d8e20685d CHANGELOG 2020-09-20 11:19:11 +02:00
Gwendal Roué 5050c36c4e Fix wording of root key decoding error 2020-09-19 15:52:50 +02:00
Gwendal Roué 6348c6f151 Merge branch 'dev/decodingErrorAmbiguity' into development 2020-09-19 15:50:35 +02:00
Gwendal Roué 8cb468cf05 Fix failing test for #836 2020-09-19 15:50:21 +02:00
Gwendal Roué 55c9e48a21 Failing test for #836 2020-09-19 15:50:07 +02:00
Gwendal Roué db3ae357ea Merge branch 'dev/indexIfNotExists' into development 2020-09-19 13:12:30 +02:00
Gwendal Roué f62b952d70 Fix failing test for #838 2020-09-19 13:11:44 +02:00
Gwendal Roué bf1c025612 Failing test for #838 2020-09-19 13:11:30 +02:00
Gwendal Roué ba253dcbf2 [skip travis] fix indentation 2020-09-11 14:36:41 +02:00
Gwendal Roué 1829706faa [skip travis] don’t talk about "misuse" when it’s all about an SQLite misfeature 2020-09-11 14:34:55 +02:00
Gwendal Roué f9f16df065 [skip travis] don’t talk about "misuse" when it’s all about an SQLite misfeature 2020-09-11 14:33:40 +02:00
Gwendal Roué 66173b345f [skip travis] wording 2020-09-11 14:30:25 +02:00
Gwendal Roué ac54c808c5 [skip travis] fix documentation layout 2020-09-11 13:37:52 +02:00
Gwendal Roué 7761b137ba Fix wording 2020-09-11 13:37:04 +02:00
Gwendal Roué 3d144b9e5d [skip travis] FAQ about SQLite error 1 "no such column" 2020-09-11 13:27:30 +02:00
Gwendal Roué b2f5d425b6 Merge branch 'development' 2020-09-07 13:42:58 +02:00
Gwendal Roué 64028e03dc v5.0.0-beta.11 2020-09-07 13:36:44 +02:00
Gwendal Roué e52047d82e Fix #828 2020-09-07 13:29:13 +02:00
Gwendal Roué 5adbd9b3e3 Merge pull request #831 from groue/dev/more-preparation
Improve Configuration.prepareDatabase
2020-09-07 13:26:50 +02:00
Gwendal Roué fd21f97007 Update migration guide 2020-09-06 18:40:15 +02:00
Gwendal Roué d74c5264d3 Update documentation for functions, collations, and tokenizers 2020-09-06 18:28:22 +02:00
Gwendal Roué 654611c365 Fix OTHER_SWIFT_FLAGS 2020-09-06 14:38:30 +02:00
Gwendal Roué 18e09ec061 Configuration.prepareDatabase updates 2020-09-06 14:06:25 +02:00
Gwendal Roué 8e2fb1fb22 Update tests 2020-09-06 13:57:16 +02:00
Gwendal Roué 7a2c1413fe Fix DatabaseSnapshot 2020-09-06 13:40:03 +02:00
Gwendal Roué 3c38aa1996 Functions, Collations, and tokenizers are no longer available on DatabaseQueue, Pool, and Snapshot 2020-09-06 13:18:58 +02:00
Gwendal Roué 886f75bbea Configuration.prepareDatabase in now a method 2020-09-06 13:15:51 +02:00
Gwendal Roué 5820b30cc6 DatabaseError.description: output SQLite message before statement #820 2020-08-25 19:48:00 +02:00
Gwendal Roué ce4bfb9df6 [skip travis] Explain that date and uuid strategies do not apply to requests (#821) 2020-08-23 11:07:02 +02:00
Gwendal Roué be787d3e8a [skip travis] Tell that demo apps are not templates. Addresses #823 2020-08-23 10:36:44 +02:00
Gwendal Roué ededd8668a Merge branch 'development' 2020-07-30 08:29:47 +02:00
Gwendal Roué 7b788e3988 v5.0.0-beta.10 2020-07-30 08:29:27 +02:00
Gwendal Roué 0eb854cebd Merge pull request #817 from groue/dev/boolean-checks
Allow query planner to optimize some boolean tests
2020-07-30 08:24:36 +02:00
Gwendal Roué 9529939262 Documentation 2020-07-27 06:40:18 +02:00
Gwendal Roué 6ee7db48c8 Take care of indexes on expressions as well
sqlite> create table t(a,b);
sqlite> create index i on t(a like '%a', a, b);
sqlite> explain query plan select * from t where a like '%a';
QUERY PLAN
`--SCAN TABLE t
sqlite> explain query plan select * from t where a not like '%a';
QUERY PLAN
`--SCAN TABLE t
sqlite> explain query plan select * from t where (a like '%a') = 1;
QUERY PLAN
`--SEARCH TABLE t USING COVERING INDEX i (<expr>=?)
sqlite> explain query plan select * from t where (a like '%a') = 0;
QUERY PLAN
`--SEARCH TABLE t USING COVERING INDEX i (<expr>=?)
2020-07-26 16:04:02 +02:00
Gwendal Roué 8cc82ae2b7 Update migration guide 2020-07-26 15:16:19 +02:00
Gwendal Roué 474c2c3a76 Thank you notice 2020-07-26 15:09:43 +02:00
Gwendal Roué 843624044c CHANGELOG 2020-07-26 15:08:21 +02:00
Gwendal Roué 454b9d5546 More tests for boolean tests 2020-07-26 14:19:46 +02:00
Gwendal Roué c532b8709c Refactor boolean tests (fix #816) 2020-07-26 14:19:31 +02:00
Gwendal Roué bf1d6038e1 Failing tests for #816 2020-07-26 13:33:35 +02:00
Gwendal Roué 86b9616dd7 DatabasePool readers don't invalidate their database schema cache until schema is actually changed. 2020-07-25 18:20:43 +02:00
Gwendal Roué bc993f63f5 Merge branch 'development' 2020-07-24 06:07:54 +02:00
Gwendal Roué 531d732437 Travis: bump to Xcode 11.6 2020-07-23 20:38:19 +02:00
Gwendal Roué 24f9b2c01b Makefile: add support for Xcode 11.6 2020-07-23 20:27:05 +02:00
Gwendal Roué c4991176f4 v5.0.0-beta.9 2020-07-23 19:04:58 +02:00
Gwendal Roué 0ea70d6bfc CHANGELOG 2020-07-23 19:00:58 +02:00
Gwendal Roué 845ae7e0e4 Merge pull request #814 from groue/dev/views
Fix regression with views
2020-07-23 18:59:16 +02:00
Gwendal Roué dc8d74b609 Merge pull request #813 from groue/dev/SQLite3.31.1
Expose SQLite 3.31.1 APIs to iOS, macOS, tvOS, watchOS
2020-07-23 18:58:56 +02:00
Gwendal Roué 2f54eda08a Fix #812 2020-07-23 08:46:05 +02:00
Gwendal Roué a526351b4c Failing test for #812 2020-07-23 08:31:53 +02:00
Gwendal Roué d08d3b311f Fix for GRDB+SQLCipher 2020-07-23 07:55:34 +02:00
Gwendal Roué 25baecdc39 CHANGELOG 2020-07-22 20:36:32 +02:00
Gwendal Roué e2816905bb OSX 11 is OSX 10.16 2020-07-22 20:22:03 +02:00
Gwendal Roué ee2d8eae50 Expose ascNullLast and descNullFirst
This is because iOS 14 runs SQLite 3.31.1
2020-07-22 20:17:52 +02:00
Gwendal Roué 1823e11090 Expose remove_diacritics=2 option of unicode61 FTS5 tokenizer
This is because iOS 14 runs SQLite 3.31.1
2020-07-22 20:07:27 +02:00
Gwendal Roué 294ed772c1 Expose remove_diacritics=2 option of unicode61 FTS tokenizer
This is because iOS 14 runs SQLite 3.31.1
2020-07-22 20:07:27 +02:00
Gwendal Roué 62f33e1d55 Dictionary(grouping:by:) with Cursor 2020-07-22 08:39:45 +02:00
Gwendal Roué e3f1992536 [skip travis] Mention update with primary key 2020-07-19 13:42:12 +02:00
Gwendal Roué baf3a8ec26 [skip travis] Simplify introduction to record protocols 2020-07-19 13:26:56 +02:00
Gwendal Roué a9ca4450f8 [skip travis] Mention unadapted 2020-07-19 13:09:27 +02:00
Gwendal Roué 54ceba6dfa [skip travis] Update observation usage 2020-07-19 13:00:29 +02:00
Gwendal Roué fc64d868ef [skip travis] Update observation usage 2020-07-19 12:53:48 +02:00
Gwendal Roué 45fdb50dc2 [skip travis] Mention RenameColumnAdapter in the migration guide 2020-07-19 12:27:49 +02:00
Gwendal Roué e704ffeba1 Merge branch 'development' 2020-07-19 12:09:50 +02:00
Gwendal Roué 2fb2cee5db v5.0.0-beta.8 2020-07-19 10:04:05 +02:00
Gwendal Roué 3fa8c15c33 Merge pull request #811 from groue/dev/RenameColumAdapter
Introduce RenameColumAdapter
2020-07-19 09:59:05 +02:00
Gwendal Roué 70b70a069a Fix typo 2020-07-19 09:54:39 +02:00
Gwendal Roué f16dcc56ae Add SQLLiteral.isEmpty 2020-07-19 09:41:45 +02:00
Gwendal Roué 4bf21cc5ce Introduce RenameColumAdapter 2020-07-19 09:33:13 +02:00
Gwendal Roué b9bb514709 Merge branch 'development' 2020-07-14 20:44:11 +02:00
Gwendal Roué 67db8a0f3e v5.0.0-beta.7 2020-07-14 20:43:38 +02:00
Gwendal Roué 606cc2cb37 Give more time to SQLCipher4 Travis tests 2020-07-14 18:25:31 +02:00
Gwendal Roué bed1f28b30 Give more time to SQLCipher4 Travis tests 2020-07-14 16:41:05 +02:00
Gwendal Roué 5c6130fbed More Xcode 12 adaptation 2020-07-14 14:02:24 +02:00
Gwendal Roué c1079ac1a9 Remove xcconfig-based settings from target 2020-07-14 13:55:37 +02:00
Gwendal Roué ef7d2e06f6 Restore FTS5 tests from GRDB.xcodeproj 2020-07-14 09:35:03 +02:00
Gwendal Roué 08d235bdc3 Documentation 2020-07-14 09:34:19 +02:00
Gwendal Roué ac8af6bbf0 CHANGELOG 2020-07-14 09:34:05 +02:00
Gwendal Roué 1729c0b967 Merge pull request #802 from GetToSet/development
Add tokenchars support for ascii tokenizer in FTS5.
2020-07-14 09:24:09 +02:00
Gwendal Roué b02b995b76 Give more time to SQLCipher4 Travis tests 2020-07-13 20:15:27 +02:00
Gwendal Roué 7f229468d2 Documentation 2020-07-12 15:12:04 +02:00
Gwendal Roué ebae30342b Defining custom RowAdapter types is no longer supported. 2020-07-12 14:22:53 +02:00
Gwendal Roué 07092169bf Documentation 2020-07-12 14:17:58 +02:00
Bunny Wong 838a03c0ef Added tests for ascii tokenizer. 2020-07-12 19:43:23 +08:00
Bunny Wong 4565c1fff9 Add tokenchars support for ascii tokenizer in FTS5. 2020-07-12 19:43:23 +08:00
Gwendal Roué 519410fc3a Fix availability 2020-07-12 12:03:46 +02:00
Gwendal Roué 9743c89c56 Documentation 2020-07-12 11:59:01 +02:00
Gwendal Roué 94d1134ec2 fetchSet 2020-07-12 10:49:47 +02:00
Gwendal Roué df92e350c0 Documentation 2020-07-11 20:29:47 +02:00
Gwendal Roué 065913f6ab Remove useless makeSelectStatement(literal:) 2020-07-11 19:52:33 +02:00
Gwendal Roué a75a7b82ce Work around an SQLite bug which prevents rollbacking a transaction with sqlite3_commit_hook 2020-07-11 19:47:12 +02:00
Gwendal Roué 90e7449d6a Documentation 2020-07-11 19:21:33 +02:00
Gwendal Roué f9bd457cbd Cleanup 2020-07-11 18:33:43 +02:00
Gwendal Roué 2f6f8f88f8 Cleanup 2020-07-11 17:43:51 +02:00
Gwendal Roué 604ac92a6d Move PreparedRequest where it belongs 2020-07-11 17:40:22 +02:00
Gwendal Roué 4718de0f6c CHANGELOG 2020-07-11 17:36:41 +02:00
Gwendal Roué 002287ca28 Close FetchRequest, make it visitable 2020-07-11 17:30:11 +02:00
Gwendal Roué 31e8d926a8 Remove _SQLExpressionVisitor default handling of _SQLExpressionCollate 2020-07-11 13:41:44 +02:00
Gwendal Roué 99ed742555 "row id" -> "rowid" 2020-07-11 13:21:14 +02:00
Gwendal Roué 67d3fa1e68 Document removal of query interface internals from public interface 2020-07-11 11:44:50 +02:00
Gwendal Roué 8a8518a961 Update playgrounds 2020-07-11 11:17:23 +02:00
Gwendal Roué ae41859bbb Cleanup 2020-07-11 10:57:24 +02:00
Gwendal Roué 813950f832 Avoid SQLITE_BUSY when opening a DatabaseSnapshot. 2020-07-09 17:45:57 +02:00
Gwendal Roué cce8c832c7 [nil].contains(expr) now generates expr = NULL 2020-07-06 20:40:37 +02:00
Gwendal Roué fc3e64989d Cleanup _SQLExpressionContains 2020-07-06 20:18:21 +02:00
Gwendal Roué d05f11293e NULL is falsey 2020-07-06 15:14:43 +02:00
Gwendal Roué b36a92c853 Towards increased SQLCollection.contains robustness 2020-07-06 15:13:55 +02:00
Gwendal Roué 995d90ae86 Cleanup SQLExpression.identifyingRowIDs(_:for:) 2020-07-06 12:01:18 +02:00
Gwendal Roué 229fb36074 Fix test 2020-07-05 16:23:19 +02:00
Gwendal Roué 68785d1c2d Hide _SQLAssociation 2020-07-05 16:21:28 +02:00
Gwendal Roué ed7faa3714 Documentation 2020-07-05 16:14:44 +02:00
Gwendal Roué 90f2642ec6 Make good use of the visitor pattern 2020-07-05 15:07:52 +02:00
Gwendal Roué 4c3029e5c1 Not a bug after all
But add comments, and an extra test for compound primary keys
2020-07-02 19:09:46 +02:00
Gwendal Roué 46e9e28a3f Spot a bug in JoinMapping.joinExpression(leftRows:) 2020-07-02 08:49:55 +02:00
Gwendal Roué effdc8df6c Remove a debugging print() 2020-07-02 08:31:25 +02:00
Gwendal Roué 268a45a635 Prepare for different kinds of SQLAssociationCondition 2020-07-02 08:29:49 +02:00
Gwendal Roué 97cb1d595e Improve groupByPrimaryKey()
Using the rowID when possible yields better performance
2020-07-01 21:25:33 +02:00
Gwendal Roué a328faa834 Allow grouping by FastPrimaryKeyExpression 2020-07-01 21:24:27 +02:00
Gwendal Roué 2201026ce8 Introduce FastPrimaryKeyExpression, drop SQLPrimaryKeyExpression
Also, don't let the user access this expression, so that he does not attempt at decoding it. Its only purpose is to generate efficient SQL.
2020-07-01 20:40:11 +02:00
Gwendal Roué bd4a76d5de TODO 2020-06-30 19:31:03 +02:00
Gwendal Roué 63d5fb1d2b Merge pull request #803 from groue/dev/RemoveFetchedRecordsController
Remove FetchedRecordsController
2020-06-29 19:15:38 +02:00
Gwendal Roué cea8c1708f BRAG 2020-06-29 19:15:08 +02:00
Gwendal Roué ad7b044e20 CHANGELOG 2020-06-29 18:49:40 +02:00
Gwendal Roué 1123fdbb23 Mention that FetchedRecordsController is removed in the Migration Guide 2020-06-29 18:49:32 +02:00
Gwendal Roué baa86102ff Fix typo 2020-06-29 18:49:07 +02:00
Gwendal Roué 0d514b56f6 Remove more references to FetchedRecordsController 2020-06-29 18:45:58 +02:00
Gwendal Roué 138cc752a6 Remove FetchedRecordsController 2020-06-29 18:29:29 +02:00
Gwendal Roué 924a596873 Merge branch 'development' 2020-06-29 08:18:06 +02:00
Gwendal Roué 4266b1fb45 v5.0.0-beta.6 2020-06-29 08:17:17 +02:00
Gwendal Roué f58c7f6701 Documentation tweaks 2020-06-29 08:13:00 +02:00
Gwendal Roué a9b02a2d2e Merge pull request #801 from groue/dev/Combine
Combine support
2020-06-29 08:04:47 +02:00
Gwendal Roué 74459be4f7 Delete obsolete file 2020-06-28 23:40:37 +02:00
Gwendal Roué bcf912079b Merge branch 'development' into dev/Combine
# Conflicts:
#	CHANGELOG.md
2020-06-28 23:18:22 +02:00
Gwendal Roué 2a640823c7 Backport https://github.com/groue/GRDBCombine/pull/42 2020-06-28 22:50:37 +02:00
Gwendal Roué 9e77083d40 Relax profiling test 2020-06-28 21:53:34 +02:00
Gwendal Roué e4fbeb1c81 CHANGELOG 2020-06-28 21:23:45 +02:00
Gwendal Roué 733b405f79 Combine + SwiftUI demo 2020-06-28 21:23:39 +02:00
Gwendal Roué 66f0314542 CHANGELOG 2020-06-27 16:08:01 +02:00
Gwendal Roué 039f2661b6 2x faster SQLiteDateParser
GRDBPerformance > DateParsingTests

testParseDateComponents
old 0.296
new 0.073

testParseDate
old 0.431
new 0.181
2020-06-27 16:04:37 +02:00
Gwendal Roué 48bc859801 Add Xcode 12 to Makefile 2020-06-27 14:38:11 +02:00
Gwendal Roué 672e10a0ff Add missing imports for SPM 2020-06-26 06:36:22 +02:00
Gwendal Roué 0fe7b2985b Cleanup SQLCipher test projects 2020-06-25 22:53:09 +02:00
Gwendal Roué 9b24c8213e Skip unavailable tests 2020-06-25 22:16:51 +02:00
Gwendal Roué a193ac1474 Documentation for Combine support 2020-06-25 21:24:17 +02:00
Gwendal Roué 7066980f7b CHANGELOG 2020-06-25 20:11:31 +02:00
Gwendal Roué f27a297e95 Run GRDBCombine tests 2020-06-25 20:08:11 +02:00
Gwendal Roué 11fcb4c749 Embed GRDBCombine tests 2020-06-25 19:25:30 +02:00
Gwendal Roué 22bb800f2e Embed CombineExpectations 2020-06-25 19:25:30 +02:00
Gwendal Roué a0ce362197 Combine publishers 2020-06-25 19:25:29 +02:00
Gwendal Roué 329b010bfa Merge pull request #800 from groue/dev/Xcode12
Xcode 12 support
2020-06-25 19:24:57 +02:00
Gwendal Roué 6470141f17 CHANGELOG 2020-06-25 19:24:36 +02:00
Gwendal Roué 994893951d Temporary disable savepoint tests 2020-06-25 18:52:15 +02:00
Gwendal Roué 4573e80e1c #file vs. #filePath dance 2020-06-25 18:49:58 +02:00
Gwendal Roué 4cdb71bfda Thread-safe SQLite error logging 2020-06-25 08:32:07 +02:00
Gwendal Roué 7820b59996 Fix Swift 5.3 warnings 2020-06-25 08:27:57 +02:00
Gwendal Roué 8be9acf9a6 Fix Xcode 12 project warnings 2020-06-25 08:27:05 +02:00
Gwendal Roué 3a4ab7a6aa ValueObservation.print() tweaks 2020-06-22 19:01:29 +02:00
Gwendal Roué 115f293e26 Merge pull request #798 from groue/dev/ValueObservation-debug
Debugging operators for ValueObservation
2020-06-22 18:43:13 +02:00
Gwendal Roué 4e8b231c42 Rename handleEvents arguments 2020-06-22 14:23:33 +02:00
Gwendal Roué 54adc18988 Fix buggy test 2020-06-21 12:15:43 +02:00
Gwendal Roué e7b17ea0a9 Fix typo 2020-06-21 11:38:40 +02:00
Gwendal Roué 0e12a9acba Fix typo 2020-06-21 11:36:46 +02:00
Gwendal Roué 099d5a311e Cleanup 2020-06-21 11:32:43 +02:00
Gwendal Roué d199f0da83 Cleanup 2020-06-21 11:30:50 +02:00
Gwendal Roué 9e37b6b68e CHANGELOG 2020-06-21 11:20:07 +02:00
Gwendal Roué 006492a02c CHANGELOG 2020-06-21 11:17:34 +02:00
Gwendal Roué 07de1d0105 More ValueObservation event tests 2020-06-21 11:13:59 +02:00
Gwendal Roué 42cd8881a2 ValueObserver.observedRegion can now be private 2020-06-21 10:14:41 +02:00
Gwendal Roué 5c4b282e27 Refactor ValueObservation events handling 2020-06-21 09:17:12 +02:00
Gwendal Roué 7e7c232fc0 Tests for ValueObservation.print() 2020-06-20 22:09:28 +02:00
Gwendal Roué 2c90820f0f ValueObservation.handleEvents and .print documentation 2020-06-20 20:15:07 +02:00
Gwendal Roué dd76cdffec ValueObservation.handleEvents 2020-06-20 19:57:51 +02:00
Gwendal Roué 276c6a4acf Merge pull request #796 from Timac/setupMemoryManagementDocumentation
Fix inline documentation for the setupMemoryManagement() function
2020-06-20 13:17:44 +02:00
Alexandre Colucci f97e0cc540 Fix inline documentation for the setupMemoryManagement() function. In GRDB 5.0.0 and later, the parameter 'application' has been removed. 2020-06-20 12:09:59 +02:00
Gwendal Roué 0fedc0cdbb TODO 2020-06-16 08:59:33 +02:00
Gwendal Roué 0390c3ae93 Documentation 2020-06-16 08:56:48 +02:00
Gwendal Roué 4cdb45e012 Merge branch 'development' 2020-06-15 20:06:34 +02:00
Gwendal Roué 4e182a511f v5.0.0-beta.5 2020-06-15 20:05:13 +02:00
Gwendal Roué a4443b8ebb FAQ Navigation 2020-06-15 19:57:50 +02:00
Gwendal Roué 0f55f76caa Demo app tweaks 2020-06-15 19:45:00 +02:00
Gwendal Roué e3e1feee2b Demo app tweaks 2020-06-15 19:36:43 +02:00
Gwendal Roué 1a1c0cd3d1 Demo app tweaks 2020-06-15 19:23:21 +02:00
Gwendal Roué dd63ddf7f2 CHANGELOG 2020-06-15 17:04:16 +02:00
Gwendal Roué c4ab23761e QueryInterfaceRequest.selectPrimaryKey(as:) 2020-06-15 17:02:00 +02:00
Gwendal Roué 86a8439473 Fix typo 2020-06-15 14:14:09 +02:00
Gwendal Roué 47cf3b0108 Update FAQ sample code with TableRecord.primaryKey, and add tests for FAQ 2020-06-15 14:09:15 +02:00
Gwendal Roué ab97ceb784 TableRecord.primaryKey 2020-06-15 14:08:50 +02:00
Gwendal Roué ae7cdb1f5b Precision 2020-06-14 20:58:04 +02:00
Gwendal Roué c0cf3c0525 Fix wording 2020-06-14 20:51:38 +02:00
Gwendal Roué 82feed42c2 Fix wording 2020-06-14 20:50:46 +02:00
Gwendal Roué 5c697659b4 Foster SQLITE_ENABLE_SNAPSHOT in the "Custom SQLite Builds" guide 2020-06-14 20:49:22 +02:00
Gwendal Roué efc12c2ef9 CHANGELOG 2020-06-14 20:39:31 +02:00
Gwendal Roué 280c9f0155 Fix sample code 2020-06-14 20:33:49 +02:00
Gwendal Roué 9608b5edd5 Fix typo 2020-06-14 20:32:36 +02:00
Gwendal Roué 7662e53dce Fix typo 2020-06-14 20:31:29 +02:00
Gwendal Roué 1f5cc801e1 Fix typos 2020-06-14 20:29:38 +02:00
Gwendal Roué 2c6ca91985 Fix inner links 2020-06-14 20:28:16 +02:00
Gwendal Roué 023a04aff9 Associations FAQ 2020-06-14 20:25:22 +02:00
Gwendal Roué ffe40dbf79 Fix indentation 2020-06-14 17:10:24 +02:00
Gwendal Roué cf9b9206bd Fix typo 2020-06-14 17:06:36 +02:00
Gwendal Roué 0f70af7a22 Fix typo 2020-06-14 17:05:56 +02:00
Gwendal Roué 7068a4f149 Update the demo app for better alignment with "Good Practices for Designing Record Types" 2020-06-14 17:03:24 +02:00
Gwendal Roué 70714768d9 Always use snapshots apis through grdb_xxx shims 2020-06-14 15:38:16 +02:00
Gwendal Roué ec0e8672be Documentation, cleanup 2020-06-14 11:03:24 +02:00
Gwendal Roué 9215f88e7f Documentation, cleanup, and checkpoint prevention 2020-06-14 10:47:27 +02:00
Gwendal Roué 510daa84a7 This is hard 2020-06-14 06:36:53 +02:00
Gwendal Roué eacf48fef3 More snapshot-based optimization of ValueObservation with DatabasePool
This time, for the .immediate scheduler.
2020-06-14 06:34:08 +02:00
Gwendal Roué 0dee6425d1 Fix free function 2020-06-14 05:36:33 +02:00
Gwendal Roué 842846dbc4 Documentation 2020-06-14 05:36:12 +02:00
Gwendal Roué 8b800ecbe1 CHANGELOG 2020-06-13 20:19:00 +02:00
Gwendal Roué f1e65fbb2c Optimization of ValueObservation with DatabasePool thanks to SQLITE_ENABLE_SNAPSHOT
The difficulty is that system <sqlite3.h> does not contain the expected declarations, even when SQLite is compiled with SQLITE_ENABLE_SNAPSHOT :-(

Since snapshots are not exposed in any public API, we don't bother dealing with availability checks. We just add the missing declarations, and rely on the linker in order to spot eventual errors.

This commit is likely to break Linux builds, though.
2020-06-13 20:14:40 +02:00
Gwendal Roué 372996deb3 TODO
# Conflicts:
#	TODO.md
2020-06-13 13:36:51 +02:00
Gwendal Roué 45f5ece534 CHANGELOG 2020-06-12 14:22:47 +02:00
Gwendal Roué a95b3264de Fix documentation 2020-06-12 14:20:29 +02:00
Gwendal Roué 8d44ad7256 Database.maximumStatementArgumentCount 2020-06-12 14:19:31 +02:00
Gwendal Roué a136384c7d Merge pull request #795 from groue/dev/more-checkpoint
Enhanced support for WAL Checkpoints
2020-06-12 12:46:52 +02:00
Gwendal Roué b15999e4c9 TODO 2020-06-12 12:45:12 +02:00
Gwendal Roué e8235f8d6a Database.columnsForUniqueKey(_:in:) does not hit the database for empty column sequences 2020-06-11 12:49:22 +02:00
Gwendal Roué e31f7a4763 CHANGELOG 2020-06-07 17:07:31 +02:00
Gwendal Roué 3103e6e373 Fix Swiftlint warning 2020-06-07 17:07:31 +02:00
Gwendal Roué 3a42a4bf9f Rename checkpoint tuple members 2020-06-07 17:07:31 +02:00
Gwendal Roué 3e5a21b49b Tests for Database.checkpoint(_🔛) 2020-06-07 17:07:31 +02:00
Gwendal Roué 6f3ec89bcd Update checkpointing tests 2020-06-07 17:07:31 +02:00
Gwendal Roué 56f6984f9d Introduce Database.checkpoint(_🔛) 2020-06-07 17:07:31 +02:00
Gwendal Roué 5f88a400d5 DatabasePool.checkpoint(_:) is unavailable 2020-06-07 17:07:31 +02:00
Gwendal Roué 91ed7d762b Setup busy handler as soon as possible 2020-06-07 17:07:30 +02:00
Gwendal Roué 668c1d632e f67f9ebd4b did spot an oddity
This is a temp fix
2020-06-07 17:07:02 +02:00
Gwendal Roué 20f693c508 Disable two SQLCipher tests until we understand what is happening 2020-06-07 16:36:55 +02:00
Gwendal Roué f67f9ebd4b Add a sanity transaction assertion 2020-06-07 15:57:50 +02:00
Gwendal Roué 53dade2740 Merge branch 'development' 2020-06-06 15:12:27 +02:00
Gwendal Roué 9ec9880889 v5.0.0-beta.4 2020-06-06 15:11:56 +02:00
Gwendal Roué eb27b0cfc5 BRAG 2020-06-06 15:11:28 +02:00
Gwendal Roué d3cc23d5a3 Harmonize GRDB, GRDBCombine, RxGRDB for next beta 2020-06-06 15:04:13 +02:00
Gwendal Roué e129463bae Maybe fix a broken link in the generated jazzy doc 2020-06-06 13:46:32 +02:00
Gwendal Roué b567d64489 fix typo 2020-06-05 20:49:21 +02:00
Gwendal Roué d94fcc398b Date modifiers, more julianDay(), and dateTime() 2020-06-05 20:48:12 +02:00
Gwendal Roué 3c48a434f1 Tests for default SQLExpressible conformance for RawRepresentable 2020-06-05 12:27:58 +02:00
Gwendal Roué d04dda1888 Default SQLExpressible conformance for RawRepresentable 2020-06-05 12:27:42 +02:00
Gwendal Roué 842c6ced0c Documentation for julianDay function 2020-06-05 12:14:46 +02:00
Gwendal Roué 59c5d2e43b test for julianDay function 2020-06-05 12:14:40 +02:00
Gwendal Roué 2aeddda77d julianDay function 2020-06-05 12:14:34 +02:00
Gwendal Roué 9aeccce227 Makefile: support for Xcode 11.5 2020-06-05 08:33:20 +02:00
Gwendal Roué 45e5333c2c Test optimized SQLCipher 2020-06-05 08:32:05 +02:00
Gwendal Roué f4581b993b Merge pull request #794 from groue/dev/Database-description
Name of Database Connections
2020-06-04 18:20:18 +02:00
Gwendal Roué d2b1853b7b Database.debugDescription 2020-06-04 18:15:48 +02:00
Gwendal Roué 800b9ffc3d Name the temporary database used by DatabaseMigrator.eraseDatabaseOnSchemaChange 2020-06-03 20:09:22 +02:00
Gwendal Roué a93f75a6fc CHANGELOG 2020-06-03 20:01:59 +02:00
Gwendal Roué 04df4ba157 Documentation 2020-06-03 19:57:43 +02:00
Gwendal Roué d55e16de3c Database.description tests 2020-06-03 19:37:34 +02:00
Gwendal Roué 780ba744f1 Database.description 2020-06-03 19:37:24 +02:00
Gwendal Roué 8027925ae6 TODO 2020-06-03 19:07:03 +02:00
Gwendal Roué b29695b024 Link to statement profiling FAQ from SharingADatabase.md 2020-06-03 19:06:09 +02:00
Gwendal Roué d98904727f Thank you 2020-06-01 21:12:53 +02:00
Gwendal Roué 4cd421ff7c Merge branch 'development' 2020-06-01 20:21:22 +02:00
Gwendal Roué a8b58cb7e7 v5.0.0-beta.3 2020-06-01 20:20:52 +02:00
Gwendal Roué 578fa162f1 Merge pull request #791 from groue/dev/trace
Extend tracing of statement execution
2020-06-01 20:14:35 +02:00
Gwendal Roué 7333b1a080 Travis: no more stages 2020-06-01 18:20:02 +02:00
Gwendal Roué 961e5e46c1 Fix SQLCipher tests 2020-06-01 14:09:22 +02:00
Gwendal Roué a2dce4a238 Come on, Travis 2020-06-01 09:02:25 +02:00
Gwendal Roué 996c1c994f Documentation 2020-06-01 07:41:46 +02:00
Gwendal Roué 9540df84cf Documentation 2020-06-01 07:39:43 +02:00
Gwendal Roué b47680638d Trace statements by default 2020-06-01 07:16:48 +02:00
Gwendal Roué 5f7a9de8a5 Fix statement profiling test for slow setups 2020-06-01 06:28:46 +02:00
Gwendal Roué b80814a77e CHANGELOG 2020-05-31 20:16:00 +02:00
Gwendal Roué b95d7cb647 More Tests for Database.trace(options:_:) 2020-05-31 20:13:45 +02:00
Gwendal Roué 3e25faabba Update the migration guide 2020-05-31 19:16:35 +02:00
Gwendal Roué 2677cf8de8 Update documentation 2020-05-31 19:16:23 +02:00
Gwendal Roué 81213f2649 Tests for Database.trace(options:_:) 2020-05-31 19:08:42 +02:00
Gwendal Roué 30f619ca2c Refactor database tracing
- Make it possible to log the database label along with the executed SQL
- Make it possible to avoid arguments expansion
- Make it possible to profile statements
2020-05-31 19:08:08 +02:00
Gwendal Roué 9552a5ce40 Merge pull request #790 from groue/dev/iOS10
Bump required iOS version to 10.0
2020-05-31 14:20:33 +02:00
Gwendal Roué 318564a13c CHANGELOG 2020-05-31 14:02:18 +02:00
Gwendal Roué 9ee3fd38b5 Remove mentions of unsupported iOS versions 2020-05-31 13:54:02 +02:00
Gwendal Roué 03a66af35e Bump iOS requirement to iOS10+
iOS9 simulator is no longer available with the Xcode 11.4+ requirement. https://twitter.com/xenadu02/status/1140093901438689280
2020-05-31 13:48:59 +02:00
Gwendal Roué 00c2f61535 TODO 2020-05-30 13:54:45 +02:00
Gwendal Roué 289394c7ac Turn LockedBox and ReadWriteBox into property wrappers.
Also fix an old concurrency bug in tests, regarding query recording
2020-05-30 13:52:39 +02:00
Gwendal Roué a5de2b9288 Breaking: AnyFetchRequest.asRequest(of:) 2020-05-30 10:30:07 +02:00
Gwendal Roué e0266bdde3 Merge pull request #784 from groue/dev/fix-783
Fix observation of eager-loaded to-many associations
2020-05-25 18:34:30 +02:00
Gwendal Roué e82ecfee9f CHANGELOG 2020-05-25 13:41:41 +02:00
Gwendal Roué 80f0379d71 Remove database content unused by test 2020-05-25 13:39:35 +02:00
Gwendal Roué 449c0e37b1 Update regression tests for #783 2020-05-25 13:24:25 +02:00
Gwendal Roué f825c52ecf Update request region tests for both DatabaseRegionConvertible and statement region 2020-05-25 13:04:48 +02:00
Gwendal Roué 4c2042c3ce Cleanup 2bb53026ef 2020-05-25 13:04:10 +02:00
Gwendal Roué af0946fd21 Regression tests for #783 (WIP) 2020-05-25 09:34:35 +02:00
Gwendal Roué 2bb53026ef Fix #783 2020-05-25 09:34:11 +02:00
Gwendal Roué 0929fe72b8 Cleanup detection of queries that return a single row 2020-05-14 12:28:52 +02:00
Gwendal Roué e0a40776ee Makefile update for Travis 2020-05-12 07:21:13 +02:00
Gwendal Roué e99015bcff Merge branch 'development' 2020-05-11 18:50:35 +02:00
Gwendal Roué abd7ee9f17 v5.0.0-beta.2 2020-05-11 18:49:57 +02:00
Gwendal Roué 364c624a37 Update sample code for sharing databases 2020-05-11 18:44:38 +02:00
Gwendal Roué 00e10324d8 Merge pull request #775 from groue/dev/superseded-migrator
DatabaseMigrator can check if it has been superseded
2020-05-11 13:35:10 +02:00
Gwendal Roué 0539c41d17 CHANGELOG 2020-05-11 09:10:14 +02:00
Gwendal Roué 212a6f7e53 Documentation 2020-05-11 09:06:04 +02:00
Gwendal Roué cff769ddd5 Documentation 2020-05-11 08:54:31 +02:00
Gwendal Roué ed6ad9d373 Clean up DatabaseMigrator tests 2020-05-11 08:50:04 +02:00
Gwendal Roué 44772f89d7 More tests for DatabaseMigrator.hasBeenSuperseded(_:) 2020-05-11 08:46:41 +02:00
Gwendal Roué 2aa61c3403 Tests for DatabaseMigrator.hasBeenSuperseded(_:) 2020-05-11 08:28:02 +02:00
Gwendal Roué 3fea5db763 DatabaseMigrator.hasBeenSuperseded(_:) 2020-05-11 08:27:41 +02:00
Gwendal Roué b2bc0e7941 Merge pull request #774 from groue/dev/request-as-expression-and-collection
All requests are usable as SQL expressions and collections
2020-05-11 08:10:45 +02:00
Gwendal Roué c7d98e0231 CHANGELOG 2020-05-10 15:34:38 +02:00
Gwendal Roué 6fcf4f565a Relax test for various SQLite versions 2020-05-10 15:34:38 +02:00
Gwendal Roué 8c11a751ff TODO 2020-05-10 15:34:38 +02:00
Gwendal Roué c0217d56ca Remove doubt about how SQLRequest uses singleResult 2020-05-10 15:34:38 +02:00
Gwendal Roué 89ba8c3398 Remove unclear rationale 2020-05-10 15:34:38 +02:00
Gwendal Roué d814ab216d Documentation 2020-05-10 15:34:38 +02:00
Gwendal Roué 284ec22dd5 Documentation 2020-05-10 15:34:38 +02:00
Gwendal Roué 57e5735e9a Documentation 2020-05-10 15:34:38 +02:00
Gwendal Roué 5786d19ff4 Documentation 2020-05-10 15:34:38 +02:00
Gwendal Roué c73872549a Fix typo 2020-05-10 15:34:38 +02:00
Gwendal Roué f799d5f30c Documentation 2020-05-10 15:34:38 +02:00
Gwendal Roué e94be4a06e Upgrade path for FetchRequest 2020-05-10 15:34:38 +02:00
Gwendal Roué e9a68d82e6 Remove FetchRequest documentation from the main README 2020-05-10 15:34:38 +02:00
Gwendal Roué b16a0da88c Documentation 2020-05-10 15:34:37 +02:00
Gwendal Roué a318d4cc82 Test upgrade path from GRDB4 to GRDB5 2020-05-10 15:34:37 +02:00
Gwendal Roué 4f500de04b Expose SQLLiteral.sql(_:)
This is needed for custom FetchRequest types
2020-05-10 15:34:37 +02:00
Gwendal Roué a77b195c7c Reopen FetchRequest 2020-05-10 15:34:37 +02:00
Gwendal Roué d2928a9929 requestSQL(_:forSingleResult:) is experimental 2020-05-10 15:34:37 +02:00
Gwendal Roué 476e72cca2 requestSQL(_:forSingleResult:) is experimental 2020-05-10 15:34:37 +02:00
Gwendal Roué 375ed0135c PreparedRequest is still documented 2020-05-10 15:34:37 +02:00
Gwendal Roué 17e745f52b SQLRequestProtocol, close FetchRequest 2020-05-10 15:34:37 +02:00
Gwendal Roué a3cc5745ac Revert "Test for the immutable flag"
This reverts commit 8a595be54f.
2020-05-10 15:31:56 +02:00
Gwendal Roué 8a595be54f Test for the immutable flag
https://sqlite.org/uri.html#uriimmutable
2020-05-10 12:38:04 +02:00
Gwendal Roué 68203b5373 Merge pull request #773 from groue/dev/subqueries-and-aliases
Allow subqueries to refer to outer tables
2020-05-09 08:20:49 +02:00
Gwendal Roué a79fc34071 CHANGELOG 2020-05-08 20:57:50 +02:00
Gwendal Roué 7f66f41026 TODO 2020-05-08 20:43:10 +02:00
Gwendal Roué 956f419b20 TODO 2020-05-08 20:41:21 +02:00
Gwendal Roué e414aca05b Cleanup 2020-05-08 20:41:18 +02:00
Gwendal Roué 76e0a9f6b6 AnyFetchRequest is now generic on RowDecoder 2020-05-08 16:43:02 +02:00
Gwendal Roué 94b4131ce4 TODO 2020-05-08 15:07:18 +02:00
Gwendal Roué a26901cb80 Allow subqueries to refer to table aliases from parent query 2020-05-08 15:06:16 +02:00
Gwendal Roué a4d7f39ad8 Merge pull request #772 from groue/dev/SQLITE_FCNTL_PERSIST_WAL
Update the Database Sharing Guide with mention of the persistent WAL mode
2020-05-06 19:39:53 +02:00
Gwendal Roué 6f02a90a7a Remove link to deleted chapter 2020-05-06 19:38:24 +02:00
Gwendal Roué ae3c06f761 Remove the obsolete "Performance" chapter
It contained outdated information, and removing it helps GitHub preserve Markdown rendering of our looooong README.
2020-05-06 19:37:08 +02:00
Gwendal Roué f29a98aac3 Fix inner documentation links 2020-05-06 19:33:39 +02:00
Gwendal Roué a641b1efd4 Documentation 2020-05-06 19:29:48 +02:00
Gwendal Roué fc6c46e628 CHANGELOG 2020-05-06 19:25:11 +02:00
Gwendal Roué cb8c9f5ba3 SQLITE_FCNTL_PERSIST_WAL is always recommended 2020-05-06 19:13:16 +02:00
Gwendal Roué a8122b44f1 Wording 2020-05-06 18:52:39 +02:00
Gwendal Roué 6b86e61056 Cool URIs don't change 2020-05-06 18:38:36 +02:00
Gwendal Roué 97bbb5bced Rename AppGroupContainers.md to SharingADatabase.md 2020-05-06 18:34:45 +02:00
Gwendal Roué b3b155459f Document the "persistent WAL mode" and SQLITE_FCNTL_PERSIST_WAL 2020-05-06 18:24:06 +02:00
Gwendal Roué e4803c1e0c Cleanup SQLITE_FCNTL_PERSIST_WAL tests 2020-05-06 13:25:59 +02:00
Gwendal Roué db7fb96142 Tests for persistent WAL mode
Tests for SQLITE_FCNTL_PERSIST_WAL: https://www.sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlpersistwal
2020-05-06 08:55:27 +02:00
Gwendal Roué 3eb7d57754 [skip travis] Documentation 2020-05-04 12:57:42 +02:00
Gwendal Roué 7af96a69a0 Merge pull request #753 from groue/GRDB5
GRDB 5
2020-05-02 18:07:54 +02:00
Gwendal Roué 00e6d4ed0e Give *even* more time to tests 2020-05-02 16:23:31 +02:00
Gwendal Roué f4b2c2d40a [skip travis] Bump release date 2020-05-02 15:36:10 +02:00
Gwendal Roué 75e9056ac8 [skip travis] Fix inner links 2020-05-02 15:22:19 +02:00
Gwendal Roué a69be48066 Give more time to tests 2020-05-02 15:13:02 +02:00
Gwendal Roué 420fb93356 Fix testErrorCompletesTheObservation 2020-05-02 12:30:54 +02:00
Gwendal Roué 425e506862 Make all ValueObservation tests deterministic (avoid inverted expectations)
Inverted expectations were just too flaky on Travis
2020-05-02 12:19:23 +02:00
Gwendal Roué f09a62415d Restore disabled Travis jobs
We'll need some stronger cure. All timeout-based tests are flaky on Travis :-(
2020-05-02 09:04:51 +02:00
Gwendal Roué 90028ee9f5 Give more time for Travis 2020-05-02 08:41:56 +02:00
Gwendal Roué e37d2ae18c [skip travis] Fix inner links 2020-05-02 05:51:14 +02:00
Gwendal Roué 0322537b63 [skip travis] Fix inner links 2020-05-02 05:42:33 +02:00
Gwendal Roué 7b6bd84ac2 Disable flaky tvOS tests
https://travis-ci.org/github/groue/GRDB.swift/jobs/682070292
2020-05-02 05:28:42 +02:00
Gwendal Roué 6a98a46c85 Speed up slow tests 2020-05-01 20:11:02 +02:00
Gwendal Roué 0ab974e1b7 [skip travis] Rename Travis jobs 2020-05-01 19:47:46 +02:00
Gwendal Roué 85b84f217d Fix for Travis 2020-05-01 19:27:17 +02:00
Gwendal Roué 5e9cbf41a5 Let people find the non-beta version 2020-05-01 19:02:24 +02:00
Gwendal Roué 773db56d79 Sort the section of moved chapters 2020-05-01 18:59:28 +02:00
Gwendal Roué f68cbb03ee Update link to migration guide 2020-05-01 18:57:32 +02:00
Gwendal Roué 15f1e5259d Extract the Migration guide from the main README
README is too big, and Github stops rendering Markdown
2020-05-01 18:56:05 +02:00
Gwendal Roué 7ede3edf0c v5.0.0-beta 2020-05-01 18:44:13 +02:00
Gwendal Roué 14d16ffd20 My 🦋 keyboard is 💩 2020-05-01 17:34:08 +02:00
Gwendal Roué a7df6cc7df CHANGELOG 2020-05-01 17:30:11 +02:00
Gwendal Roué aaa5986e33 CHANGELOG 2020-05-01 17:26:43 +02:00
Gwendal Roué 3173dd20fe CHANGELOG 2020-05-01 17:18:14 +02:00
Gwendal Roué a29ca8348f CHANGELOG: documentation diff 2020-05-01 17:15:44 +02:00
Gwendal Roué 278e72ecc8 Fix typo 2020-05-01 17:15:35 +02:00
Gwendal Roué cf738588f2 Fix typo 2020-05-01 16:30:41 +02:00
Gwendal Roué 146b06f27a bugfix 2020-05-01 16:15:54 +02:00
Gwendal Roué fa4a90f720 Improve SQLQueryGenerator.expectsSingleResult 2020-05-01 16:06:56 +02:00
Gwendal Roué 93f4d43ee6 Cleanup 2020-05-01 15:43:57 +02:00
Gwendal Roué da4b96c2ca Cleanup handling of subquery sources 2020-05-01 15:42:01 +02:00
Gwendal Roué 420a257650 Test for case insensitivity in association requests 2020-05-01 15:07:40 +02:00
Gwendal Roué 39f327fcb3 Optimize SQLAssociationCondition.filteringExpression(_:leftRows:)
And make sure we compute a correct database region for association requests
2020-05-01 15:06:47 +02:00
Gwendal Roué 27ffb2a418 Rename index(ofColumn:) to index(forColumn:) 2020-05-01 15:01:01 +02:00
Gwendal Roué 0dc18cdaab CHANGELOG 2020-05-01 13:17:23 +02:00
Gwendal Roué 1ac9051384 Merge pull request #770 from groue/dev/subqueries
Subqueries
2020-05-01 12:36:19 +02:00
Gwendal Roué 691bb73d3e Bump iOS version in Makefile 2020-05-01 12:07:32 +02:00
Gwendal Roué 61d7740767 Fix FTS5 2020-05-01 11:27:08 +02:00
Gwendal Roué 7f7554f601 Document support for subqueries 2020-05-01 11:12:44 +02:00
Gwendal Roué ee68550052 Fix typo 2020-05-01 10:59:10 +02:00
Gwendal Roué 4de63ca9a2 Documentation fix 2020-05-01 10:47:23 +02:00
Gwendal Roué ef42035fe4 Documentation 2020-05-01 10:36:36 +02:00
Gwendal Roué eb93b25301 Fix typo 2020-05-01 10:28:19 +02:00
Gwendal Roué 2502747a7b Update the "Joined Queries Support" chapter 2020-05-01 10:25:44 +02:00
Gwendal Roué de5477d8f0 Documentation 2020-05-01 09:47:27 +02:00
Gwendal Roué fae562f20d Documentation 2020-05-01 09:43:48 +02:00
Gwendal Roué 307c3d5a13 Documentation 2020-05-01 09:01:10 +02:00
Gwendal Roué 7a1afba26e Documentation 2020-05-01 08:59:00 +02:00
Gwendal Roué b2370dd597 TODO 2020-05-01 08:58:52 +02:00
Gwendal Roué 513b7e9379 Tests for interpolation of TableRecord selection 2020-05-01 08:58:46 +02:00
Gwendal Roué 9392722bab Restore and fix test for TableRecord selection interpolation 2020-04-30 19:47:35 +02:00
Gwendal Roué 321b6a3488 Fixits for renamed generic parameter 2020-04-30 19:37:02 +02:00
Gwendal Roué 443d44cc7a Restore TableRecord.selectionSQL in the form of SQL interpolation 2020-04-30 19:33:33 +02:00
Gwendal Roué df2cc0af36 Test for SQLCollection qualification 2020-04-30 19:01:14 +02:00
Gwendal Roué dfcc6f99a5 SQLCollection can be qualified, now 2020-04-30 18:49:20 +02:00
Gwendal Roué 664c1ed281 Documentation 2020-04-30 18:35:05 +02:00
Gwendal Roué 057679a2ba We don't need to prevent requests that select several columns 2020-04-30 18:22:59 +02:00
Gwendal Roué e05b8b2b47 Unify SQLGenerationContext 2020-04-30 17:56:15 +02:00
Gwendal Roué d67f4802d3 Documentation 2020-04-30 15:21:41 +02:00
Gwendal Roué 72e4fc620b Remove LIMIT 1 from aggregated requests 2020-04-30 15:16:00 +02:00
Gwendal Roué 9c53ed94a7 Documentation 2020-04-30 15:13:33 +02:00
Gwendal Roué cac605749d Cleanup SQLExpressionBinaryReduce.truthComponents 2020-04-30 14:21:25 +02:00
Gwendal Roué 9006c701b3 Replace the expectsSingleResult hint with an analysis of the query 2020-04-30 14:14:07 +02:00
Gwendal Roué 05c001865b Cleanup 2020-04-30 09:12:57 +02:00
Gwendal Roué cb7a7633b1 TODO 2020-04-30 09:04:17 +02:00
Gwendal Roué 1e92b98165 TODO 2020-04-30 08:40:35 +02:00
Gwendal Roué 0bf23477f8 Less TODO 2020-04-30 08:36:10 +02:00
Gwendal Roué 359df39b7e Make it easier to look for subquery tests 2020-04-30 08:36:04 +02:00
Gwendal Roué cfd4141469 CHANGELOG 2020-04-30 08:32:51 +02:00
Gwendal Roué 90415fa936 Documentation 2020-04-30 08:31:59 +02:00
Gwendal Roué 1d89d184fd Fix subqueries semantics 2020-04-30 08:19:00 +02:00
Gwendal Roué 026e5b288f Documentation 2020-04-29 23:46:42 +02:00
Gwendal Roué be249bc697 SQLRequestExpressible is a sub protocol of SQLSpecificExpressible 2020-04-29 23:40:37 +02:00
Gwendal Roué 69641ff7d6 Undo undesired change 2020-04-29 22:29:53 +02:00
Gwendal Roué 4245e8f09e Cleanup 2020-04-29 22:24:58 +02:00
Gwendal Roué 94fed7965b Cleanup 2020-04-29 22:16:19 +02:00
Gwendal Roué a15233eff1 SQLGenerationContext no longer needs to be mutated 2020-04-29 21:59:04 +02:00
Gwendal Roué e47a584c3e TableRecord.selectionSQL can no longer be implemented 🤷 2020-04-29 21:51:02 +02:00
Gwendal Roué 188f51c513 Refactor handling of arguments during SQL generation 2020-04-29 21:27:14 +02:00
Gwendal Roué e800c71cbc Refactor SQLLiteral so that subqueries are no longer a special case 2020-04-29 20:20:13 +02:00
Gwendal Roué 3d86f45aa2 SQLRequestExpressible
This protocol makes it possible to write request.filter(column == subRequest)
2020-04-29 20:18:00 +02:00
Gwendal Roué 473bc3a88e SQLQueryGenerator handles the single result optimization. Make sure a single column is selected for expression/collection requests 2020-04-29 18:30:46 +02:00
Gwendal Roué 4b9336f5c5 TODO 2020-04-29 15:21:22 +02:00
Gwendal Roué 8bcf9257f6 TODO 2020-04-29 14:32:53 +02:00
Gwendal Roué ca59d706e9 Cleanup 2020-04-29 14:27:58 +02:00
Gwendal Roué 82ff6cb4c5 Cleanup 2020-04-29 14:24:25 +02:00
Gwendal Roué 21552d8838 SQLRequest & QueryInterfaceRequest are SQLExpression 2020-04-29 14:24:18 +02:00
Gwendal Roué 26f40efece TODO 2020-04-29 13:54:00 +02:00
Gwendal Roué c82dbb35ad SQLLiteral and SQLRequest no longer have sql and arguments properties 2020-04-29 13:52:29 +02:00
Gwendal Roué 84ca69d27c Value quoting can now require a database connection 2020-04-29 11:03:51 +02:00
Gwendal Roué 6dca9e1068 Cleanup 2020-04-29 09:49:24 +02:00
Gwendal Roué 8cb75dd814 Subqueries wip 2020-04-28 21:03:58 +02:00
Gwendal Roué 59e81f70bd Cleanup aggregates 2020-04-28 19:49:41 +02:00
Gwendal Roué 399766fe10 Fix #739 2020-04-28 19:19:30 +02:00
Gwendal Roué f543784241 TODO 2020-04-28 14:20:05 +02:00
Gwendal Roué 0b0f0e53da TODO 2020-04-26 18:04:57 +02:00
Gwendal Roué f738fdfa8e Cleanup Decodable behavior regarding missing keys and optionals 2020-04-26 14:19:29 +02:00
Gwendal Roué a8f7978ec4 Update documention after d0ba9e342c 2020-04-26 11:55:53 +02:00
Gwendal Roué d1af9dbdf1 Fix documentation comment 2020-04-25 20:27:25 +02:00
Gwendal Roué d0ba9e342c Turn selection and having clauses into promises. Give association aggregates access to the actual primary key, for better support for WITHOUT ROW ID tables. 2020-04-25 19:51:03 +02:00
Gwendal Roué b38ccb5f40 TODO 2020-04-25 15:15:06 +02:00
Gwendal Roué 605aad79ad Replace use of rowid by primary key when possible. Cleanup management of association cardinality
This is a backport of enhancements brought by the failed pull request https://github.com/groue/GRDB.swift/pull/767
2020-04-25 15:15:01 +02:00
Gwendal Roué 6fd3a7b225 Merge branch 'development' into GRDB5
# Conflicts:
#	CHANGELOG.md
#	README.md
2020-04-25 13:21:20 +02:00
Gwendal Roué 6b1910fce7 [skip travis] fix typo in CHANGELOG 2020-04-23 09:08:27 +02:00
Gwendal Roué 5ee47c3c27 Merge branch 'development' 2020-04-23 08:56:55 +02:00
Gwendal Roué 5652a01366 v4.14.0 2020-04-23 08:55:38 +02:00
Gwendal Roué 132d01f9f7 Complete #766: use json objects in DatabaseDateComponents tests 2020-04-22 19:33:31 +02:00
Gwendal Roué 1d760ff9ce Extend congrats list 2020-04-22 18:45:34 +02:00
Gwendal Roué dc4d516493 Merge pull request #766 from DiligentRobot/development
Add Codable support to DatabaseDateComponents
2020-04-20 19:17:07 +02:00
Matt Tancock 62c6187ad4 Remove Format's Codable conformance. Use a singleValueContainer 2020-04-20 14:42:02 +01:00
Matt Tancock 18154f29be Simplify encoding format and add tests 2020-04-20 13:36:23 +01:00
Gwendal Roué a715c6328d Merge branch 'master' into GRDB5
# Conflicts:
#	CHANGELOG.md
#	GRDB/QueryInterface/Request/QueryInterfaceRequest.swift
#	Makefile
#	README.md
#	Tests/Performance/GRDBPerformance/GRDBPerformance.xcodeproj/project.pbxproj
2020-04-18 16:36:26 +02:00
Matt Tancock bffe4d32f5 Add Codable support to DatabaseDateComponents 2020-04-17 16:16:34 +01:00
Gwendal Roué 3fd00012d1 Update obsolete observation usage in README 2020-04-17 09:03:03 +02:00
Gwendal Roué 6d901b06e9 TODO 2020-04-16 19:27:09 +02:00
Gwendal Roué f677310703 Merge branch 'development' 2020-04-15 08:27:35 +02:00
Gwendal Roué 0200f64e6c v4.13.0 2020-04-14 19:14:15 +02:00
Gwendal Roué c6b5c935bb Merge pull request #761 from groue/dev/deprecate-assignment-operator
Deprecate the batch update `<-` operator
2020-04-14 19:03:43 +02:00
Gwendal Roué 2d30f06f54 Update regression test introduced after commit cherry-picked from #750 2020-04-14 19:01:42 +02:00
Gwendal Roué a98350d206 CHANGELOG 2020-04-14 18:55:40 +02:00
Gwendal Roué 6918bda82d CHANGELOG 2020-04-14 18:51:21 +02:00
Gwendal Roué a065926fb1 Update documentation 2020-04-14 18:51:21 +02:00
Gwendal Roué 0569b95a5a Operator <- was ill-advised
# Conflicts:
#	GRDB/QueryInterface/Request/QueryInterfaceRequest.swift
2020-04-14 18:51:21 +02:00
Gwendal Roué d17866d3fd Update Realm path 2020-04-14 18:50:51 +02:00
Gwendal Roué 6c0f1dc389 Merge pull request #759 from groue/dev/fix-758
Fix batch updates of complex requests
2020-04-14 18:50:26 +02:00
Gwendal Roué e7750e6fe0 Merge pull request #760 from andreasschmitz/development
README Typo Fixes
2020-04-14 17:33:01 +02:00
Andreas Schmitz e4addc4243 Fixes typos 2020-04-14 17:18:27 +02:00
Gwendal Roué d35ad59f9c Fix failing test for #758 2020-04-14 12:51:24 +02:00
Gwendal Roué 07609e8a3f Failing test for #758 2020-04-14 12:51:24 +02:00
Gwendal Roué f4e2645e13 CHANGELOG 2020-04-14 12:47:00 +02:00
Gwendal Roué c352ca70b2 A new kind tweet :-) 2020-04-14 12:17:38 +02:00
Gwendal Roué b182a26759 Fix compilation error with Xcode 10.1 2020-04-14 12:14:25 +02:00
Gwendal Roué c493b17232 Merge branch 'development' 2020-04-13 11:52:21 +02:00
Gwendal Roué 94d34a744d v4.12.2 2020-04-13 11:51:28 +02:00
Gwendal Roué 0cda88bd28 Merge pull request #757 from groue/dev/lazy-inflections
Don't load association inflections unless necessary
2020-04-13 11:47:20 +02:00
Gwendal Roué c62ccf1de7 Make sure Inflections.default is lazily loaded, even in optimized release builds
This commit addresses #755
2020-04-13 11:31:03 +02:00
Gwendal Roué 5760b9c0cc Migration Guide 2020-04-12 20:10:03 +02:00
Gwendal Roué 75525bdb56 Migration Guide 2020-04-12 17:33:04 +02:00
Gwendal Roué 2fa57cdafa Make CSQLite a system module
Attempt at fixing this GRDBCombine error:

$ swift build
...
'CSQLite' /.../GRDBCombine/.build/checkouts/CSQLite: error: configuration of package 'CSQLite' is invalid; the 'providers' property can only be used with a System Module Package
2020-04-12 15:07:39 +02:00
Gwendal Roué 2319572552 Remove unused file 2020-04-12 13:04:45 +02:00
Gwendal Roué 5f26a71c5b Migration Guide 2020-04-12 10:24:44 +02:00
Gwendal Roué d0558ee2f0 Migration Guide 2020-04-12 10:15:09 +02:00
Gwendal Roué fc09fd6654 Merge pull request #756 from groue/dev/export-SQLite
Export the underlying SQLite library
2020-04-12 10:05:19 +02:00
Gwendal Roué 1ea5d1713a Cleanup 2020-04-12 10:04:09 +02:00
Gwendal Roué aa0ae00c56 CHANGELOG 2020-04-12 09:44:11 +02:00
Gwendal Roué 0372c1dd63 Complete #747: export the underlying SQLite library 2020-04-12 07:27:50 +02:00
Gwendal Roué c052b44999 Cleanup 2020-04-11 20:56:36 +02:00
Gwendal Roué f27d6b07c0 Cleanup 2020-04-11 20:45:00 +02:00
Gwendal Roué 4f8b681737 Documentation 2020-04-11 18:26:42 +02:00
Gwendal Roué 5b9ae9371b Documentation 2020-04-11 17:37:12 +02:00
Gwendal Roué 68f4db468a Documentation 2020-04-11 17:25:16 +02:00
Gwendal Roué 62dbc78090 More migration guide 2020-04-11 13:57:19 +02:00
Gwendal Roué bd7bec22a1 More migration guide 2020-04-11 13:52:36 +02:00
Gwendal Roué 722e74db6a More migration guide 2020-04-11 13:49:26 +02:00
Gwendal Roué e9439a1d58 Fix typo 2020-04-11 13:39:02 +02:00
Gwendal Roué 3c70814cdc More ValueObservation migration doc 2020-04-11 13:38:01 +02:00
Gwendal Roué fea89100d9 Improve ValueObservation.trackingVaryingRegion example 2020-04-11 13:10:15 +02:00
Gwendal Roué 2c3d0b1e17 Organize migration guide 2020-04-11 13:05:11 +02:00
Gwendal Roué 478ae7bc24 Improve migration guide 2020-04-11 12:43:28 +02:00
Gwendal Roué da81c8b87c Fix typo 2020-04-11 10:33:12 +02:00
Gwendal Roué 4088a477ec Improve migration guide 2020-04-10 20:07:19 +02:00
Gwendal Roué 85dcd32c8d Improve the description of ValueObservation change 2020-04-10 18:52:24 +02:00
Gwendal Roué 62c72c20e9 CHANGELOG 2020-04-10 18:38:16 +02:00
Gwendal Roué 1b4e26f61c Cleanup 2020-04-10 12:35:33 +02:00
Gwendal Roué 474310e00b More inspiration from CocoaError 2020-04-10 09:30:34 +02:00
Gwendal Roué 7a475ad476 Cleanup 2020-04-10 08:58:29 +02:00
Gwendal Roué 65ac210dfb Merge pull request #754 from groue/dev/ResultCode-match
Match DatabaseError on ResultCode
2020-04-09 20:42:23 +02:00
Gwendal Roué f19e5bf67c CHANGELOG 2020-04-09 19:56:12 +02:00
Gwendal Roué 419bedd73b Update documentation for DatabaseError catching 2020-04-09 19:53:21 +02:00
Gwendal Roué 8eb58926a4 Test for ResultCode error matching 2020-04-09 19:53:02 +02:00
Gwendal Roué ccacbc9706 ResultCode match errors 2020-04-09 19:52:39 +02:00
Gwendal Roué 7db59867cb Documentation 2020-04-09 19:08:53 +02:00
Gwendal Roué 37aa7feee9 Rename KeyPathRefining to Refinable 2020-04-09 18:50:36 +02:00
Gwendal Roué e49800d21d Fix build warnings 2020-04-09 17:55:49 +02:00
Gwendal Roué 078aa83e3b Rename count(where:) to countElements(where:) 2020-04-09 17:47:07 +02:00
Gwendal Roué 8ef4c9b241 Remove convenience Result.tryMap 2020-04-09 17:45:12 +02:00
Gwendal Roué f9157da590 TODO 2020-04-09 17:44:41 +02:00
Gwendal Roué 27120643b9 SE-0255: Implicit returns from single-expression functions 2020-04-09 17:16:23 +02:00
Gwendal Roué 306033b63b Update Migration Guide 2020-04-09 13:43:56 +02:00
Gwendal Roué d988be49a6 Revert #748 2020-04-09 13:42:37 +02:00
Gwendal Roué 1a5661c890 Lift resolved attention point about custom SQLite builds 2020-04-09 08:55:40 +02:00
Gwendal Roué ccaad8d860 Restore backward compatibility for setup of custom SQLite builds
User only has to rename the `import` Swift statement
2020-04-09 08:50:24 +02:00
Gwendal Roué c9d95af646 Merge pull request #752 from groue/dev/drop-observation-combination
Remove ValueObservation.combine
2020-04-08 19:55:18 +02:00
Gwendal Roué 3e081f0dd6 Remove GRDBPerformance project from workspace
This avoids painful Xcode management of SPM packages
2020-04-08 19:13:08 +02:00
Gwendal Roué 444525d748 CHANGELOG 2020-04-08 18:54:08 +02:00
Gwendal Roué c778e1ac0c Add fixits 2020-04-08 18:53:08 +02:00
Gwendal Roué bfe037c61d Update documentation 2020-04-08 18:33:56 +02:00
Gwendal Roué e2790c863f Remove ValueObservation combine operator 2020-04-08 18:16:05 +02:00
Gwendal Roué 3c3df9ad24 Miigration Guide WIP 2020-04-08 08:40:54 +02:00
Gwendal Roué 3c30e6d0c1 Miigration Guide WIP 2020-04-08 08:30:10 +02:00
Gwendal Roué a5ad4dd23d Miigration Guide WIP 2020-04-07 22:24:25 +02:00
Gwendal Roué 0505b1cef9 Miigration Guide WIP 2020-04-07 22:20:35 +02:00
Gwendal Roué 2ac6f9766a Miigration Guide WIP 2020-04-07 22:16:44 +02:00
Gwendal Roué 10fcd1092f Miigration Guide WIP 2020-04-07 22:08:17 +02:00
Gwendal Roué cbcbbe9c8f Miigration Guide WIP 2020-04-07 22:04:47 +02:00
Gwendal Roué 2b7b03846e Miigration Guide WIP 2020-04-07 22:00:00 +02:00
Gwendal Roué 05f9854cea Miigration Guide WIP 2020-04-07 20:59:34 +02:00
Gwendal Roué 8cb67f1c22 Miigration Guide WIP 2020-04-07 20:47:56 +02:00
Gwendal Roué 48987f39c3 Miigration Guide WIP 2020-04-07 20:17:11 +02:00
Gwendal Roué e5f711f68c Miigration Guide WIP 2020-04-07 20:01:55 +02:00
Gwendal Roué ac92fc95e3 Merge branch 'development' into GRDB5 2020-04-06 20:16:53 +02:00
Gwendal Roué ed15498871 Merge branch 'master' into development 2020-04-06 20:16:19 +02:00
Gwendal Roué 97a05b97d9 [skip travis] Fix typo 2020-04-06 19:56:32 +02:00
Gwendal Roué 0b69aa82fd [skip travis] Add a Brag Document 2020-04-06 19:54:47 +02:00
Gwendal Roué bf07c49171 Merge pull request #750 from groue/dev/assignment-without-operator
Batch updates do not need any operator
2020-04-05 17:24:09 +02:00
Gwendal Roué c59d42dfca CHANGELOG 2020-04-05 16:43:00 +02:00
Gwendal Roué 80b15f7f07 Ignore GRDB.xcworkspace spm stuff 2020-04-05 16:28:04 +02:00
Gwendal Roué 9647a78ed6 Update documentation 2020-04-05 16:26:29 +02:00
Gwendal Roué 2c743531d0 Operator <- was ill-advised 2020-04-05 16:25:18 +02:00
Gwendal Roué 9e967ccc93 Merge pull request #749 from groue/dev/submodules
Drop submodules used by performance tests
2020-04-05 14:07:49 +02:00
Gwendal Roué 86330000db CHANGELOG 2020-04-05 13:36:41 +02:00
Gwendal Roué af597736f6 Wait before we look into the Xcode checkouts 2020-04-05 13:14:09 +02:00
Gwendal Roué 119ce30ad1 Pin versions GRDBPerformance of dependencies 2020-04-05 12:29:03 +02:00
Gwendal Roué 85c3f12b86 Extract versions of GRDBPerformance dependencies from Xcode SPM checkouts 2020-04-05 11:57:55 +02:00
Gwendal Roué f95e01cbd5 Remove submodule dependencies from Makefile 2020-04-05 10:34:21 +02:00
Gwendal Roué 21eb87fa49 Use SPM for GRDBPerformance dependencies 2020-04-05 10:25:54 +02:00
Gwendal Roué 4614cfda06 Removed test submodules 2020-04-05 09:58:53 +02:00
Gwendal Roué a4bda6da96 Merge pull request #748 from groue/dev/Request
Rename QueryInterfaceRequest to Request
2020-04-04 20:55:18 +02:00
Gwendal Roué 2d2b8494d0 CHANGELOG 2020-04-04 20:13:50 +02:00
Gwendal Roué 7ce6a8a094 Rename QueryInterfaceRequest to Request 2020-04-04 20:12:03 +02:00
Gwendal Roué 3756c43691 Merge pull request #747 from groue/dev/fix-743
Rename GRDBCustomSQLite to GRDB
2020-04-04 18:52:14 +02:00
Gwendal Roué bfc4738097 CHANGELOG 2020-04-04 18:48:35 +02:00
Gwendal Roué afcb9183ad Rename GRDBCustom schemes 2020-04-04 18:37:36 +02:00
Gwendal Roué c3474471f7 Don't include <sqlite3.h> for custom SQLite builds 2020-04-04 18:03:29 +02:00
Gwendal Roué 65c009a018 Rename GRDBCustomSQLite module to GRDB 2020-04-04 17:42:00 +02:00
Gwendal Roué d60fe3c22f Replace import GRDBCustomSQLite with import GRDB 2020-04-04 16:44:01 +02:00
Gwendal Roué 5727163966 SPM: export CSQLite package 2020-04-04 14:20:07 +02:00
Gwendal Roué d72000c6a3 Use scheduling paramater name for consistency with GRDBCombine and RxGRDB 2020-03-31 20:25:36 +02:00
Gwendal Roué 381f716e4b AnyDatabaseCancellable is public
This helps GRDBCombine defaulting to a default cancellable when database connection has been closed before the ValueObservation publisher has been subscribed to.
2020-03-29 20:31:02 +02:00
Gwendal Roué eee2c65c14 Merge branch 'development' into GRDB5
# Conflicts:
#	CHANGELOG.md
#	README.md
2020-03-29 18:55:06 +02:00
Gwendal Roué c01c4d6de5 Looks like jazzy and Xcode 11.4 go well together 2020-03-29 18:49:54 +02:00
Gwendal Roué f4c763dc31 Merge branch 'development' 2020-03-29 17:44:31 +02:00
Gwendal Roué 66989f2ff7 v4.12.1 2020-03-29 17:43:49 +02:00
Gwendal Roué 73aada9194 Merge pull request #745 from groue/dev/ValueObservation-cancellation
Explicit ValueObservation cancellation
2020-03-29 17:30:09 +02:00
Gwendal Roué 5665a2428a CHANGELOG 2020-03-29 16:49:21 +02:00
Gwendal Roué ba0c771346 Merge pull request #744 from groue/dev/fix-741
Fix DatabaseMigrator deadlock with serial target queues
2020-03-29 16:37:55 +02:00
Gwendal Roué 66dc482b02 Don't pretend database deallocation is a cancel event 2020-03-29 16:30:29 +02:00
Gwendal Roué 3c20adb0c6 Add test for explicit cancellation 2020-03-29 16:11:54 +02:00
Gwendal Roué 1bffc4f628 ValueObservation is cancellable 2020-03-29 16:06:24 +02:00
Gwendal Roué 97a84c6470 Fix failing test for #741 2020-03-29 12:09:58 +02:00
Gwendal Roué 70c6f3ec44 Failing test for #741 2020-03-29 12:09:24 +02:00
Gwendal Roué ccd73bf63d Don't parallelize SQLCipher tests 2020-03-29 11:45:52 +02:00
Gwendal Roué d4327faf0a Merge pull request #742 from groue/dev/ValueObservation-scheduling
ValueObservation scheduling is no longer an attribute of the observation
2020-03-29 11:14:48 +02:00
Gwendal Roué 87b54f5da2 Protect ValueObserver state behind a lock 2020-03-29 10:28:37 +02:00
Gwendal Roué a28ae9a523 Stronger tests 2020-03-28 20:50:40 +01:00
Gwendal Roué 055a4882f8 Fix compilation error 2020-03-28 20:14:30 +01:00
Gwendal Roué 90d5316781 Hide ValueObservationScheduler implementation 2020-03-28 19:53:18 +01:00
Gwendal Roué 303a0cc150 immediateInitialValue is a better name 2020-03-28 19:49:07 +01:00
Gwendal Roué 08ef740002 Optimize ValueObservation tests 2020-03-28 19:31:27 +01:00
Gwendal Roué 5d196c449d Value Observation does no longer retain DatabaseWriter 2020-03-28 17:11:57 +01:00
Gwendal Roué fdb2f63e60 Add missing file to iOS/tvOS/watchOS compilation 2020-03-28 14:26:08 +01:00
Gwendal Roué c83d390e60 More test rationalization 2020-03-28 14:07:36 +01:00
Gwendal Roué a6ac69eded Move view optimization test 2020-03-28 13:54:18 +01:00
Gwendal Roué 1914ace5f9 Test as much as possible value observations 2020-03-28 13:43:18 +01:00
Gwendal Roué 88ddce5fac Make sure the observer is cancelled on error 2020-03-28 11:42:53 +01:00
Gwendal Roué 23d428290b Assume that error ends the observation, and have database pool always perform a concurrent initial fetch 2020-03-28 10:30:36 +01:00
Gwendal Roué ff104686f6 Read-only observation: support for cancellation 2020-03-28 07:45:55 +01:00
Gwendal Roué a9ea6dd8bf CHANGELOG 2020-03-27 21:06:13 +01:00
Gwendal Roué 9866ed1dfc Remove useless change 2020-03-27 21:04:23 +01:00
Gwendal Roué 65a347fd98 Fix obsolete comment 2020-03-27 21:03:01 +01:00
Gwendal Roué 7e50869d39 Remove useless change 2020-03-27 21:01:34 +01:00
Gwendal Roué 703ce643b5 Remove useless change 2020-03-27 20:59:38 +01:00
Gwendal Roué 42d2891df8 Fix typo 2020-03-27 20:53:16 +01:00
Gwendal Roué f0effaa4fa Fix typo 2020-03-27 20:51:42 +01:00
Gwendal Roué 022fee8788 Remove dead code 2020-03-27 20:48:12 +01:00
Gwendal Roué 25a2bd653c Fix compiler warning 2020-03-27 20:48:03 +01:00
Gwendal Roué c03de9cc16 Fix documentation 2020-03-27 20:45:24 +01:00
Gwendal Roué 97d06a0fae Fix typo 2020-03-27 20:36:29 +01:00
Gwendal Roué 154125d3ae Update documentation 2020-03-27 20:19:55 +01:00
Gwendal Roué c4b7e0017b The main thread is enough 2020-03-27 20:19:44 +01:00
Gwendal Roué 469814985e Decrease nesting 2020-03-27 19:55:36 +01:00
Gwendal Roué f16105ad03 Add missing cancellation checks 2020-03-27 19:53:01 +01:00
Gwendal Roué 4309eaba64 Scheduling of fresh values is no longer an attribute of ValueObservation 2020-03-27 19:49:11 +01:00
Gwendal Roué 1580be3883 Update tests 2020-03-27 08:27:46 +01:00
Gwendal Roué b4b5d9b602 Simplify ValueObservation scheduling 2020-03-27 08:27:30 +01:00
Gwendal Roué 27dd08f945 Merge pull request #738 from groue/dev/drop-ObservationFor
Remove all observationForCount/All/First methods
2020-03-25 22:53:08 +01:00
Gwendal Roué b9c4d26731 Documentation 2020-03-25 22:36:33 +01:00
Gwendal Roué 7217f696b6 More row comparison technique 2020-03-25 22:23:12 +01:00
Gwendal Roué 880f8c8bdd More row comparison technique 2020-03-25 22:21:52 +01:00
Gwendal Roué 6f7efa2b9a CHANGELOG 2020-03-25 22:08:03 +01:00
Gwendal Roué 3a11d94bee Document the row comparison technique 2020-03-25 22:07:12 +01:00
Gwendal Roué e68bd077ee Remove all observationForCount/All/First methods 2020-03-25 21:44:10 +01:00
Gwendal Roué e84e984c23 Merge pull request #737 from groue/dev/ValueObservation-recording
Force implicit database region for ValueObservation
2020-03-25 19:41:12 +01:00
Gwendal Roué 12de05dc9b ValueObservation.trackingVaryingRegion documentation 2020-03-25 19:19:22 +01:00
Gwendal Roué ea8110110c Remove obsolete documentation 2020-03-25 14:04:42 +01:00
Gwendal Roué 79d6b02a2f Cleanup 2020-03-25 13:57:49 +01:00
Gwendal Roué 1195439226 Cleanup 2020-03-25 13:53:22 +01:00
Gwendal Roué ff2629a31c Cleanup 2020-03-25 13:05:39 +01:00
Gwendal Roué 61e74f9ad4 ValueObservation.trackingVaryingRegion documentation 2020-03-25 08:48:34 +01:00
Gwendal Roué f711978145 Documentation 2020-03-25 08:25:05 +01:00
Gwendal Roué a647e200d9 Replace Never with ValueReducers.Auto 2020-03-25 08:19:47 +01:00
Gwendal Roué 294a04e9f6 Rename tracking(value:) to tracking(_:) 2020-03-25 08:11:43 +01:00
Gwendal Roué 9792edc008 Rename trackingVolatile to trackingVaryingRegion 2020-03-25 00:13:51 +01:00
Gwendal Roué 143f3d1673 CHANGELOG 2020-03-25 00:03:09 +01:00
Gwendal Roué 121f7be847 ValueObservation is now fully based on region recording
And we introduce ValueObservation.trackingVolatile
2020-03-24 23:52:05 +01:00
Gwendal Roué 4af7fda4f2 Fix outdated documentation 2020-03-24 23:49:24 +01:00
Gwendal Roué 56f332122d The observed region is always recorded 2020-03-24 22:59:07 +01:00
Gwendal Roué d494d12293 Fix typo 2020-03-24 22:59:07 +01:00
Gwendal Roué ce6afd680d Merge pull request #736 from groue/dev/relax-ValueObservation
Relax ValueObservation Guarantees
2020-03-24 22:56:16 +01:00
Gwendal Roué dfd5dd2478 Add missing import for SPM 2020-03-24 22:55:18 +01:00
Gwendal Roué 327f07422f Add missing FailableTestCase.swift to custom SQLite tests 2020-03-24 22:35:32 +01:00
Gwendal Roué 6b33e656be CHANGELOG 2020-03-24 17:01:14 +01:00
Gwendal Roué 97a7117564 Rewrite ValueObservation documentation 2020-03-24 16:58:59 +01:00
Gwendal Roué e8fefc82a1 Drop obsolete warning against DatabaseRegionObservation 2020-03-24 16:29:56 +01:00
Gwendal Roué 0963b162e7 Rewrite ValueObservation documentation 2020-03-24 14:57:23 +01:00
Gwendal Roué 5210ae8385 Rewrite ValueObservation documentation 2020-03-24 14:36:29 +01:00
Gwendal Roué 78dc7aee15 Rewrite ValueObservation documentation 2020-03-24 14:35:43 +01:00
Gwendal Roué cf1360701c Rewrite ValueObservation documentation 2020-03-24 14:09:45 +01:00
Gwendal Roué b3fb61858a Rewrite ValueObservation documentation 2020-03-24 13:52:43 +01:00
Gwendal Roué 8d6708a12e Rewrite ValueObservation documentation 2020-03-24 13:49:09 +01:00
Gwendal Roué 06f6b31368 Rewrite ValueObservation documentation 2020-03-24 13:04:25 +01:00
Gwendal Roué 9562e8eac4 Rewrite ValueObservation documentation 2020-03-24 13:01:58 +01:00
Gwendal Roué 1325a3a6a2 Rewrite ValueObservation documentation 2020-03-24 11:47:55 +01:00
Gwendal Roué 89058f4447 Rewrite ValueObservation documentation 2020-03-24 11:39:21 +01:00
Gwendal Roué f6da862145 Rewrite ValueObservation documentation 2020-03-24 08:54:46 +01:00
Gwendal Roué 0c464def7f Fix documentation 2020-03-23 18:00:45 +01:00
Gwendal Roué e824c70e7d Fix SQLCipher tests 2020-03-22 13:46:34 +01:00
Gwendal Roué 7a583e02e8 Refactor ValueObservation tests around a common pattern 2020-03-22 13:31:05 +01:00
Gwendal Roué 98d381ed67 Cleanup 2020-03-22 10:27:10 +01:00
Gwendal Roué e16d29f277 More test refactoring with assertValueObservationRecordingMatch 2020-03-21 18:44:02 +01:00
Gwendal Roué 6bf322f79e More test refactoring with assertValueObservationRecordingMatch 2020-03-21 18:16:35 +01:00
Gwendal Roué c42aab26e3 Remove redundant test 2020-03-21 17:48:24 +01:00
Gwendal Roué e16b320cda More test refactoring with assertValueObservationRecordingMatch 2020-03-21 17:42:22 +01:00
Gwendal Roué 9d4bef1c9a More test refactoring with assertValueObservationRecordingMatch 2020-03-21 17:04:18 +01:00
Gwendal Roué b392458c1c More test refactoring with assertValueObservationRecordingMatch 2020-03-21 16:23:41 +01:00
Gwendal Roué 031b55eca6 More test refactoring with assertValueObservationRecordingMatch 2020-03-21 15:50:36 +01:00
Gwendal Roué 3e0486743b More test refactoring with assertValueObservationRecordingMatch 2020-03-21 15:21:24 +01:00
Gwendal Roué 7ab9a8b29a More test refactoring with assertValueObservationRecordingMatch 2020-03-21 14:36:48 +01:00
Gwendal Roué 22086c088f More test refactoring with assertValueObservationRecordingMatch 2020-03-21 14:36:48 +01:00
Gwendal Roué 3ee231afd3 Cleanup _OptionalProtocol 2020-03-21 14:36:48 +01:00
Gwendal Roué 4ffced0b7b assertValueObservationRecordingMatch 2020-03-21 14:36:48 +01:00
Gwendal Roué ed6673f2f5 ValueObservation test refactoring WIP 2020-03-21 14:36:48 +01:00
Gwendal Roué 7935168379 ValueObservation test refactoring WIP 2020-03-21 14:36:48 +01:00
Gwendal Roué 3c891b7ebd ValueObservationRecorder cleanup 2020-03-21 14:36:48 +01:00
Gwendal Roué 8f5c7985e5 ValueObservationRecorder 2020-03-21 14:36:48 +01:00
Gwendal Roué 2150b6688a Fix ValueObserver cancellation 2020-03-21 14:36:48 +01:00
Gwendal Roué 65b8fbb361 Remove useless print() statements 2020-03-21 14:36:48 +01:00
Gwendal Roué 2bb894108c Use the prependingConcurrentFetch flag 2020-03-21 14:36:48 +01:00
Gwendal Roué 26d2245ae8 Asynchronouslu remove observer when it is cancelled 2020-03-21 14:36:48 +01:00
Gwendal Roué 2b78a646ed Mor preparation for initiial concurrent fetch of ValueObservation in a DatabasePool 2020-03-21 14:36:48 +01:00
Gwendal Roué 1c59278115 Prefer dbResult argument name for async read closures 2020-03-21 14:36:48 +01:00
Gwendal Roué 2824636650 Prepare for initiial concurrent fetch of ValueObservation in a DatabasePool 2020-03-21 14:36:48 +01:00
Gwendal Roué 5a884ad93d Common ValueObservation code for all read-only database accessors 2020-03-21 14:36:48 +01:00
Gwendal Roué dab8e28f6d Merge branch 'master' into GRDB5
# Conflicts:
#	GRDB/Migration/DatabaseMigrator.swift
#	GRDB/QueryInterface/Request/QueryInterfaceRequest.swift
#	README.md
2020-03-21 14:35:57 +01:00
Gwendal Roué e831c64e93 Merge branch 'development' 2020-03-21 12:54:52 +01:00
Gwendal Roué 50f64dc45d v4.12.0 2020-03-21 12:54:30 +01:00
Gwendal Roué 24872373c4 TODO 2020-03-21 12:26:35 +01:00
Gwendal Roué f04efea09c CHANGELOG 2020-03-18 20:47:04 +01:00
Gwendal Roué cda254bb2d Update documentation for eraseDatabaseOnSchemaChange 2020-03-18 20:43:09 +01:00
Gwendal Roué c1d1797576 Address #725 2020-03-18 20:36:56 +01:00
Gwendal Roué a0faf6aa68 Support for nil assignment 2020-03-18 19:34:43 +01:00
Gwendal Roué c6db8962b3 Merge pull request #732 from groue/dev/ValueObservation-mandatory-first-element
Remove ValueObservation.compactMap
2020-03-12 08:37:16 +01:00
Gwendal Roué 5a9085c34d CHANGELOG 2020-03-12 07:46:04 +01:00
Gwendal Roué c698b30c0a Add fixits 2020-03-12 07:43:57 +01:00
Gwendal Roué dfa40ea18f Rename ValueObservation.fetchFirst to fetchValue
"First", in Swift, hints that the result is optional. But the result of this function is no longer optional.
2020-03-12 07:34:43 +01:00
Gwendal Roué 936c92eba6 All value reducers must emit an initial value
This disqualifies compactMap as a valid ValueObservation transformation: it has been removed.

This simplifies implementation as well.
2020-03-12 07:18:40 +01:00
Gwendal Roué b0155b8aca Merge branch 'development' into GRDB5 2020-03-11 22:44:20 +01:00
Gwendal Roué 84eef52cb0 Merge branch 'master' into development 2020-03-11 22:44:05 +01:00
Gwendal Roué 46fba47efb Merge pull request #731 from groue/dev/private-ValueReducer
Hide ValueObservation implementation details
2020-03-11 22:43:10 +01:00
Gwendal Roué bf3f97b64d Fix compiler warning 2020-03-11 22:42:48 +01:00
Gwendal Roué b605076bd0 Remove value reducers from README 2020-03-11 22:15:04 +01:00
Gwendal Roué 329b034423 CHANGELOG 2020-03-11 22:13:51 +01:00
Gwendal Roué 5e0535d511 ValueReducer creation does not need database access 2020-03-11 22:00:07 +01:00
Gwendal Roué b96d71d937 Remove public ValueObservation factory methods that accept a _ValueReducer 2020-03-11 21:38:48 +01:00
Gwendal Roué 28c32c6af8 _ValueReducer is the only protocol accepted by ValueObservation
Also, we now use Never as the bottom reducer which helps us define the ValueObservation factory methods.
2020-03-11 21:38:41 +01:00
Gwendal Roué f80c5ce348 Make the ValueReducer protocol unavailable
# Conflicts:
#	GRDB/ValueObservation/ValueReducer/ValueReducer.swift
2020-03-11 21:38:20 +01:00
Gwendal Roué 6a582869c6 Merge pull request #730 from jackalcooper/patch-1
fix typo
2020-03-11 12:45:58 +01:00
Shenghang Tsai 813f28e5da fix typo 2020-03-11 19:35:48 +08:00
Gwendal Roué cc16a00f5a Merge pull request #729 from groue/dev/ValueObservation-initial-value
ValueObservation always emits an initial value
2020-03-10 23:03:39 +01:00
Gwendal Roué 4f74997235 Restore old disabled tests for cancelled ValueObservation 2020-03-10 22:06:41 +01:00
Gwendal Roué 2f4187b084 DatabaseWriter.remove(transactionObserver:) can run from the writer queue 2020-03-10 22:06:08 +01:00
Gwendal Roué 9a6d6cf9c0 Update documentation for ValueObservation scheduling 2020-03-10 22:04:58 +01:00
Gwendal Roué 26e2db02aa CHANGELOG 2020-03-10 21:04:38 +01:00
Gwendal Roué d66f2c8cfd Simplify ValueObservation starting process 2020-03-10 20:50:06 +01:00
Gwendal Roué 6f239a5ad3 All ValueObservationScheduling cases now trigger an initial fetch 2020-03-10 19:42:58 +01:00
Gwendal Roué 2224042114 Rename ValueScheduling to ValueObservationScheduling 2020-03-10 19:10:38 +01:00
Gwendal Roué 4fe201f8aa Merge branch 'development' into GRDB5 2020-03-10 19:05:29 +01:00
Gwendal Roué 3973b66ab3 Fix and test throwingFirstError 2020-03-10 09:16:24 +01:00
Gwendal Roué e48b654ad6 Merge pull request #728 from groue/dev/ValueObservation-error-handling
Make ValueObservation error handling mandatory
2020-03-10 08:26:09 +01:00
Gwendal Roué 3467376d7a Remove unused ErrorCatcher 2020-03-10 08:19:27 +01:00
Gwendal Roué 1b6f9f9971 CHANGELOG 2020-03-10 08:12:17 +01:00
Gwendal Roué c70b627f92 ValueObservation.start(in:onChange:) is unavailable
Hiding errors from user's sight was not a good idea
2020-03-10 08:09:53 +01:00
Gwendal Roué 435f5ff559 TODO: fix throwingFirstError 2020-03-10 07:41:15 +01:00
Gwendal Roué 0b34ad55b6 Merge pull request #724 from groue/dev/SE-0242
SE-0242: Synthesize default values for the memberwise initializer
2020-03-09 09:02:03 +01:00
Gwendal Roué 262cdc5b9a CHANGELOG 2020-03-09 08:50:43 +01:00
Gwendal Roué 19061934ce SE-0242: Synthesize default values for the memberwise initializer
...and more initializers cleanup
2020-03-09 08:49:06 +01:00
Gwendal Roué 7614f36bbd Merge pull request #723 from groue/dev/SE-0255
SE-0255: Implicit returns from single-expression functions
2020-03-09 08:17:24 +01:00
Gwendal Roué f48180549d make smokeTest
For "quick" sanity checks
2020-03-09 08:03:26 +01:00
Gwendal Roué 93aa9bf3e5 Comment out debugging configuration 2020-03-09 07:56:02 +01:00
Gwendal Roué 4d60dc6cbb Remove more redundant return keywords 2020-03-09 07:52:35 +01:00
Gwendal Roué 1698afadb9 CHANGELOG 2020-03-09 07:33:30 +01:00
Gwendal Roué 9aa67f9db9 SE-0255: Implicit returns from single-expression functions 2020-03-08 23:12:46 +01:00
Gwendal Roué 57d12e6c47 Merge pull request #722 from groue/dev/SE-0253
SE-0253: Callable values of user-defined nominal types
2020-03-08 20:40:17 +01:00
Gwendal Roué cc9fbed07e CHANGELOG 2020-03-08 20:39:54 +01:00
Gwendal Roué 8718d525d4 SE-0253: Callable values of user-defined nominal types 2020-03-08 20:36:49 +01:00
Gwendal Roué 3beba2b578 Merge pull request #721 from groue/dev/SE-0249
SE-0249: Key Path Expressions as Functions
2020-03-08 20:10:27 +01:00
Gwendal Roué 1b08a822ee CHANGELOG 2020-03-08 20:09:15 +01:00
Gwendal Roué 7865b0a2ee SE-0249: Key Path Expressions as Functions 2020-03-08 19:58:51 +01:00
Gwendal Roué a31984724e Merge pull request #720 from groue/dev/GRDB5-removeDeprecated
Turn deprecated APIs into unavailable ones
2020-03-08 19:15:41 +01:00
Gwendal Roué a504452846 CHANGELOG 2020-03-08 19:10:48 +01:00
Gwendal Roué 00b0dc2a04 Remove availability checks for macOS 10.10 (forgotten in #719) 2020-03-08 19:08:15 +01:00
Gwendal Roué 41e0885bce Fix deprecation warning 2020-03-08 18:10:02 +01:00
Gwendal Roué 694adcec64 Remove other deprecated methods 2020-03-08 18:03:11 +01:00
Gwendal Roué 5dd86d2453 Remove deprecated ValueObservation methods 2020-03-08 17:53:39 +01:00
Gwendal Roué b9d4a5215a Remove deprecated DatabaseMigrator methods 2020-03-08 17:13:31 +01:00
Gwendal Roué 456d2aee75 Remove deprecated SQLExpressionLiteral 2020-03-08 16:57:29 +01:00
Gwendal Roué 02890a6d3a Remove deprecated SQLLiteral.mapSQL(_:) 2020-03-08 16:28:44 +01:00
Gwendal Roué 0f503fe0db Remove deprecated FetchRequest.prepare(_: forSingleResult:) 2020-03-08 16:18:55 +01:00
Gwendal Roué bfdd0696da Remove deprecated setupMemoryManagement methods 2020-03-08 16:08:12 +01:00
Gwendal Roué 130e510f8c Remove deprecated passphrase methods 2020-03-08 16:00:19 +01:00
Gwendal Roué 512764403f Prepare for fixits for removed deprecated methods 2020-03-08 15:39:40 +01:00
Gwendal Roué b85eca3260 Merge pull request #719 from groue/dev/swift5.2
Bump required Swift version to 5.2
2020-03-08 14:59:53 +01:00
Gwendal Roué 73975e4462 CHANGELOG 2020-03-08 14:53:35 +01:00
Gwendal Roué 816887b811 Fix typo in README 2020-03-08 14:53:27 +01:00
Gwendal Roué 20baaf9a7f Update README for the new requirements 2020-03-08 13:54:00 +01:00
Gwendal Roué 9578f984ec Remove useless #if compiler/swift checks 2020-03-08 13:42:44 +01:00
Gwendal Roué 3b7f232aef WIP 2020-03-08 13:01:15 +01:00
Gwendal Roué df1ed3cf2f Apply requirements to .travis.yml
osx_image xcode11.4 is not yet shipped, according to https://docs.travis-ci.com/user/reference/osx/#xcode-version
2020-03-08 12:59:33 +01:00
Gwendal Roué 59eceb9af1 Apply requirements to Makefile 2020-03-08 12:57:09 +01:00
Gwendal Roué d7e821785d Fix podfiles of CocoaPods tests 2020-03-08 12:35:59 +01:00
Gwendal Roué b264087a3b Fixes for GRDBDemoWatchOS
Hide WKRefreshBackgroundTask use behind an availability check

Bump IPHONEOS_DEPLOYMENT_TARGET = 13.0, so that we can use CollectionDifference
2020-03-08 12:22:09 +01:00
Gwendal Roué 759bb8cd25 Fix dependencies of GRDBtvOSTests
It used to depend on the iOS version of GRDB - WTF
2020-03-08 11:28:04 +01:00
Gwendal Roué 4486f73432 Apply requirements to podspec and podfiles 2020-03-08 10:55:48 +01:00
Gwendal Roué 224e0b7d58 Apply requirements to Xcode projects
Update:
SWIFT_VERSION
IPHONEOS_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET
TVOS_DEPLOYMENT_TARGET
WATCHOS_DEPLOYMENT_TARGET
2020-03-08 10:55:26 +01:00
Gwendal Roué 9db86ff2d6 Apply Swift version requirement to Tests/SPM/PlainPackage 2020-03-08 10:45:40 +01:00
Gwendal Roué f3af89cb6a Apply requirements to Package.swift 2020-03-08 10:26:01 +01:00
Gwendal Roué 98e9cc7861 Bump required macOS version to 10.10
This guarantees SQLite 3.7.16+, so that all migrations can recreate tables when needed
2020-03-08 10:24:27 +01:00
Gwendal Roué 30f7b39a42 Update requirements for Swift 5.2 2020-03-08 09:54:13 +01:00
Gwendal Roué 6b9e7e7eb3 Kick off GRDB5 2020-03-08 09:50:08 +01:00
Gwendal Roué f6e6758525 Merge branch 'master' into development 2020-03-07 15:13:33 +01:00
Gwendal Roué 039dd37759 [skip travis] Enhancements to WhyAdoptGRDB.md 2020-03-07 15:13:14 +01:00
Gwendal Roué e9dd8b2b09 Enhance DatabaseMigrator querying methods
// New
dbQueue.read(migrator.hasCompletedMigrations)
dbQueue.read(migrator.completedMigrations).contains("v2")
dbQueue.read(migrator.completedMigrations).last == "v2"
dbQueue.read(migrator.appliedMigrations)

// Deprecated
migrator.hasCompletedMigrations(in: dbQueue)
migrator.hasCompletedMigrations(in: dbQueue, through: "v2")
migrator.lastCompletedMigration(in: dbQueue) == "v2"
migrator.appliedMigrations(in: dbQueue)
2020-03-07 13:59:46 +01:00
Gwendal Roué ee64f8ff9d Rename statement argument methods 2020-03-04 08:43:31 +01:00
Gwendal Roué db546bf478 Merge branch 'development' 2020-03-02 08:01:55 +01:00
Gwendal Roué 5a7c6fb33f v4.11.0 2020-03-02 07:59:48 +01:00
Gwendal Roué fa7ae31894 TODO 2020-03-02 07:53:25 +01:00
Gwendal Roué 48097ba7e7 Update thank you notice 2020-03-01 18:42:05 +01:00
Gwendal Roué 7c684d06c1 Simplify schema cache management
We don't need EmptyDatabaseSchemaCache. It does not help unsafe reads to work better if concurrent writes modify the schema anyway.
2020-03-01 15:51:37 +01:00
Gwendal Roué c8321201d8 Merge pull request #713 from groue/dev/barrierMigrations
Enhance DatabaseMigrator isolation
2020-03-01 15:41:27 +01:00
Gwendal Roué ea421865aa Improve barrierWriteWithoutTransaction documentation 2020-03-01 11:34:58 +01:00
Gwendal Roué f5019eeb60 Merge branch 'development' into dev/barrierMigrations
# Conflicts:
#	GRDB/Migration/DatabaseMigrator.swift
2020-03-01 09:13:45 +01:00
Gwendal Roué 62222f441d Merge pull request #710 from groue/dev/unappliedMigrations
Check if all migrations have been applied
2020-03-01 09:00:20 +01:00
Gwendal Roué 0e43f1b95a appliedIdentifiers always filters out unknown migrations 2020-03-01 08:58:50 +01:00
Gwendal Roué 50cd4418d2 CHANGELOG 2020-02-29 17:32:15 +01:00
Gwendal Roué e1b14d4ee5 DatabaseMigrator uses barrierWriteWithoutTransaction
This prevents concurrent reads from reading right in between two migration transactions
2020-02-29 17:26:59 +01:00
Gwendal Roué ce0df653f4 Expose Database.erase() 2020-02-29 17:19:08 +01:00
Gwendal Roué 11f8807545 Make barrierWriteWithoutTransaction a requirement of DatabaseWriter 2020-02-29 16:01:45 +01:00
Gwendal Roué 7af846c87f Rename new DatabaseMigrator methods 2020-02-29 15:07:36 +01:00
Gwendal Roué 9f46f34d16 Merge branch 'development' into dev/unappliedMigrations
# Conflicts:
#	CHANGELOG.md
2020-02-29 14:46:50 +01:00
Gwendal Roué e62df26a53 Disable flaky testDatabasePoolReleaseMemoryClosesReaderConnections
See https://github.com/groue/GRDB.swift/issues/489
2020-02-29 14:45:06 +01:00
Gwendal Roué b71de1559a Disable flaky testCachedStatementsAreNotShared
See https://github.com/groue/GRDB.swift/issues/679
2020-02-29 14:43:17 +01:00
Gwendal Roué c2c587752c Disable flaky testBusyModeTimeoutTooShort
It just ruins Travis builds :-(
2020-02-29 14:41:46 +01:00
Gwendal Roué fd029ff230 Merge pull request #712 from pakko972/automatic-ios-memory-management
Automatic ios memory management
2020-02-29 14:38:00 +01:00
Gwendal Roué c534193f5c CHANGELOG 2020-02-29 14:36:07 +01:00
Gwendal Roué 7b29156664 Fix typo and improve wording 2020-02-29 14:33:02 +01:00
Gwendal Roué 9ed8cb3eff Fix Swiftlint warnings 2020-02-29 14:30:05 +01:00
Gwendal Roué a7d02b90a5 Update license year 2020-02-29 14:09:29 +01:00
Gwendal Roué 522639282d Update JSONSynchronization playground 2020-02-29 14:03:12 +01:00
Pakkito eb98f50891 Avoid breaking changes
- Deprecate setupMemoryManagement(application:)
- UIApplication is not available on watchOS, so instead of checking against `#if canImport(UIKit)` we use `#if os(iOS)`

Signed-off-by: Pakkito <pe@pierlis.com>
2020-02-28 18:00:16 +01:00
Pakkito f07735f05f Add support for xcode 11.4
Signed-off-by: Pakkito <pe@pierlis.com>
2020-02-28 17:21:53 +01:00
Pakkito 32675b38f1 Automatically setup memory management when UIKit is available
Signed-off-by: Pakkito <pe@pierlis.com>
2020-02-28 17:21:27 +01:00
Gwendal Roué d35d6fc2f8 Rename isMigrated(in:upTo:) to isMigrated(in:beyond:), introduce lastAppliedMigration(in:) 2020-02-28 14:27:52 +01:00
Gwendal Roué fa26faa6fd CHANGELOG 2020-02-28 07:42:38 +01:00
Gwendal Roué 91a3557281 Rename hasUnappliedMigrations to isMigrated 2020-02-28 07:40:19 +01:00
Gwendal Roué f09e0b5ed2 CHANGELOG 2020-02-27 21:19:57 +01:00
Gwendal Roué 0580705b1e Enhance App Group Container documentation with database schema check 2020-02-27 21:10:35 +01:00
Gwendal Roué 0c7e14eb9b Documentation for DatabaseMigrator.hasUnappliedMigrations 2020-02-27 21:02:17 +01:00
Gwendal Roué 92e8ef9b87 More DatabaseMigrator tests 2020-02-27 21:01:56 +01:00
Gwendal Roué 692af926be Tests for DatabaseMigrator.hasUnappliedMigrations 2020-02-27 20:51:44 +01:00
Gwendal Roué a17669b082 DatabaseMigrator.hasUnappliedMigrations 2020-02-27 20:50:25 +01:00
Gwendal Roué 2ff8c66b9e TODO 2020-02-27 19:29:21 +01:00
Gwendal Roué be53b0d403 Merge pull request #709 from groue/dev/migration
Simplify DatabaseMigrator API
2020-02-27 19:28:12 +01:00
Gwendal Roué ba02ba4237 CHANGELOG 2020-02-27 19:25:55 +01:00
Gwendal Roué 0d2ede4440 Document that migrations run with deferred foreign key checks 2020-02-27 08:43:51 +01:00
Gwendal Roué bf89883ff5 Import SQLite C functions for SPM 2020-02-26 22:26:29 +01:00
Gwendal Roué efcc3a3dfb Merge branch 'development' into dev/migration
# Conflicts:
#	CHANGELOG.md
2020-02-26 19:31:38 +01:00
Gwendal Roué fefeb1e9e2 Merge pull request #706 from groue/dev/690-improvement
Enhance SQLLiteral and SQL interpolation again
2020-02-26 19:28:39 +01:00
Gwendal Roué f12436e55b CHANGELOG 2020-02-26 14:09:24 +01:00
Gwendal Roué 98c4356638 Cleanup 2020-02-26 14:07:38 +01:00
Gwendal Roué e5c4fb7e30 Update DatabaseMigrator documentation 2020-02-26 13:59:04 +01:00
Gwendal Roué 4f9878a1da Update tests for the deprecated registerMigrationWithDeferredForeignKeyCheck method 2020-02-26 13:57:49 +01:00
Gwendal Roué 8557d113a3 Deprecate registerMigrationWithDeferredForeignKeyCheck
This method is now equivalent to registerMigration, starting SQLite 3.7.16
2020-02-26 13:57:14 +01:00
Gwendal Roué 9400e7f5d5 Fix tests for Xcode 10.3 2020-02-26 08:17:48 +01:00
Gwendal Roué 193509db58 Merge pull request #707 from haikusw/pr_docs_typos_fixes
Docs: Fix a collection of typos
2020-02-26 08:05:22 +01:00
Tyler Morrison d7ce175b8e Documentation: Fixes for some typos 2020-02-25 14:43:39 -08:00
Gwendal Roué 0a8001a128 CHANGELOG 2020-02-25 22:25:36 +01:00
Gwendal Roué b46a8c897a Update SQLLiteral documentation 2020-02-25 22:21:32 +01:00
Gwendal Roué bad8d85729 Add test for legacy literal expression function 2020-02-25 22:18:16 +01:00
Gwendal Roué eb6f6e57ff Fix failing test for literal expression function 2020-02-25 22:13:17 +01:00
Gwendal Roué cc495e3fd5 Failing test for literal expression function 2020-02-25 22:11:18 +01:00
Gwendal Roué d190a26737 More precise documentation vocabulary 2020-02-25 15:05:11 +01:00
Gwendal Roué 7ee4e269c3 Fix sample code 2020-02-25 15:02:18 +01:00
Gwendal Roué f7465896fa Enhance documentation for features brought by #690 2020-02-25 14:59:11 +01:00
Gwendal Roué 4c8574aa4c Merge branch 'development' 2020-02-23 14:09:57 +01:00
Gwendal Roué 7475c25fa7 v4.10.0 2020-02-23 13:17:32 +01:00
Gwendal Roué 3379bf3b08 Merge pull request #690 from groue/dev/qualifiedSQLLiteral
Enhance SQLLiteral and SQL interpolation
2020-02-15 09:34:23 +01:00
Gwendal Roué 7af3f48150 TODO 2020-02-15 07:04:50 +01:00
Gwendal Roué 1b8511ab51 Documentation 2020-02-14 12:59:06 +01:00
Gwendal Roué 355ae49bc2 CHANGELOG 2020-02-14 12:46:01 +01:00
Gwendal Roué 8c3274bd3c Cleanup 2020-02-14 12:36:36 +01:00
Gwendal Roué 591384576f SQLOrderingLiteral (and prevent reversing of requests ordered by literal) 2020-02-14 12:31:54 +01:00
Gwendal Roué cdda2852d3 Merge branch 'development' into dev/qualifiedSQLLiteral 2020-02-14 11:43:15 +01:00
Gwendal Roué 03992ab45c CHANGELOG 2020-02-14 11:41:37 +01:00
Gwendal Roué 1f4b374bce Documentation for #689 2020-02-14 11:40:17 +01:00
Gwendal Roué a5b2757128 Merge pull request #689 from groue/rename-column
Add support for renaming columns within a table
2020-02-14 11:25:42 +01:00
Gwendal Roué b961962f93 Cleanup 2020-01-25 16:29:04 +01:00
Gwendal Roué c64b2d1032 Cleanup 2020-01-25 16:18:12 +01:00
Gwendal Roué 3ccfcb61ce Cleanup SQLLiteral elements 2020-01-25 16:11:17 +01:00
Gwendal Roué e4c6029e72 Cleanup internal APIs 2020-01-25 14:37:32 +01:00
Gwendal Roué d448bd8bd5 Test SQLLiteral.mapSQL qualification 2020-01-25 14:32:13 +01:00
Gwendal Roué e999ab5ecb Don't deprecate SQLLiteral.mapSQL, after all 2020-01-25 13:46:00 +01:00
Gwendal Roué db8585aa85 Test for SQLLiteral(expression) 2020-01-25 12:34:22 +01:00
Gwendal Roué e2545b3427 Test for more complex SQLLiteral generation 2020-01-25 12:15:14 +01:00
gjeck 38a161f92b Fix imports for SPM tests 2020-01-24 10:53:34 -08:00
gjeck d14ac3e8d3 Resolve test issues with SQLCipher
Note: SQLCipher3 will have the new column rename method exposed, but it
will throw an error at runtime if used.
2020-01-24 09:22:43 -08:00
gjeck 09087bdbf9 Adjust available checks 2020-01-24 08:46:55 -08:00
gjeck 538252a4bf Allow column rename on custom sqlite target 2020-01-24 08:46:55 -08:00
gjeck 371e8f0dbe Add support for renaming columns within a table
SQLite introduced enhancements to the `ALTER TABLE` command in 3.25.0.
iOS 13.0+, macOS 10.15+, tvOS 13.0+, and watchOS 6.0+ have a SQLite
library bundled higher than 3.25.0.

For more information see https://www.sqlite.org/lang_altertable.html
2020-01-24 08:46:55 -08:00
Gwendal Roué b8c5af5cef Fix availability test 2020-01-24 09:03:06 +01:00
Gwendal Roué ddd22a1dfb Restore Swift 4.2 by default 2020-01-24 09:00:51 +01:00
Gwendal Roué 2d3a9991d4 Test documented use case 2020-01-24 08:55:55 +01:00
Gwendal Roué 7f513cbc1d SQLLiteral cleanup 2020-01-24 08:55:55 +01:00
Gwendal Roué 812f30fb75 Remove SQLLiteral.generate() 2020-01-24 08:55:55 +01:00
Gwendal Roué 86e32cdc23 Cleanup SQLGenerationContext 2020-01-24 08:55:55 +01:00
Gwendal Roué 554cbaa307 Stop using SQLExpression.sqlLiteral 2020-01-24 08:55:55 +01:00
Gwendal Roué 6a0cc838da Deprecate SQLLiteral.mapSQL and SQLExpression.sqlLiteral 2020-01-24 08:55:55 +01:00
Gwendal Roué 4811bc3c5b Test SQLLiteral qualification 2020-01-24 08:55:55 +01:00
Gwendal Roué 65c94590eb Make SQLLiteral able to be qualified with a table alias 2020-01-24 08:55:55 +01:00
Gwendal Roué 5e67ca5566 Deprecate SQLExpressionLiteral, hide SQLSelectionLiteral, introduce SQLLiteral.sqlExpression and .sqlSelectable 2020-01-24 08:55:55 +01:00
Gwendal Roué d7ef314a15 SQLLiteral is now a promise that needs an SQLGenerationContext 2020-01-24 08:55:55 +01:00
Gwendal Roué a3c43efb85 Fix KeyPathRefining for Xcode 10.0 2020-01-24 07:50:12 +01:00
Gwendal Roué 9dcd0b8f42 Fix KeyPathRefining for compiler(<5.1) 2020-01-24 07:45:20 +01:00
Gwendal Roué 349e34b1c1 Internal API experiment: KeyPathRefining 2020-01-21 19:37:19 +01:00
Gwendal Roué 66bce33a36 SPM installation technique: warn against #642 2020-01-19 12:27:30 +01:00
Gwendal Roué f67232b80f Merge branch 'development' 2020-01-17 07:41:27 +01:00
Gwendal Roué 6b32c3aeec v4.9.0 2020-01-17 07:40:42 +01:00
Gwendal Roué f3bc08160d Merge pull request #683 from groue/dev/concat
String concatenation
2020-01-17 07:34:44 +01:00
Gwendal Roué 1cca8a2303 Merge branch 'development' into dev/concat
# Conflicts:
#	CHANGELOG.md
2020-01-16 20:04:38 +01:00
Gwendal Roué ac215430c2 CHANGELOG and thank you notice 2020-01-16 19:48:29 +01:00
Gwendal Roué 7f8a088306 Merge pull request #685 from gjeck/defaultDatabaseTableName
Add cache for TableRecord.defaultDatabaseTableName
2020-01-16 19:42:12 +01:00
gjeck 2717b52e97 Add cache for TableRecord.defaultDatabaseTableName
Resolves cpu/memory impact from repeated calls by cacheing the name in a
private global NSCache.
2020-01-16 09:59:18 -08:00
Gwendal Roué 25cf030498 CHANGELOG 2020-01-16 18:51:47 +01:00
Gwendal Roué 4bfab90750 Restore and deprecate SQLLogicalBinaryOperator 2020-01-16 18:50:48 +01:00
Gwendal Roué 95ddae7968 More tests for associative operators 2020-01-16 09:08:30 +01:00
Gwendal Roué 62fad30af5 Documentation associative operator joining for add and multiply operations 2020-01-16 08:57:07 +01:00
Gwendal Roué c9373929ca Documentation for the || string concatenation operator 2020-01-16 08:50:40 +01:00
Gwendal Roué 01b47a833a Introduce the || string concatenation operator 2020-01-16 08:38:17 +01:00
Gwendal Roué a398c6dc99 Flattten stricly associative operators 2020-01-16 08:17:11 +01:00
Gwendal Roué 32a40b18fd Introduce associative binary operators 2020-01-16 08:01:48 +01:00
Gwendal Roué c7fcde83cf Merge branch 'development' 2020-01-12 12:53:40 +01:00
Gwendal Roué a9cd4faff0 v4.8.1 2020-01-12 12:53:18 +01:00
Gwendal Roué ddccbaacdb Merge pull request #677 from groue/dev/fixAssociationFiltering
Fix associations altered by another association
2020-01-12 09:52:51 +01:00
Gwendal Roué 6a7ecb2c63 CHANGELOG 2020-01-11 20:43:43 +01:00
Gwendal Roué 0b07a6a696 Cleanup 2020-01-11 20:43:37 +01:00
Gwendal Roué 58a36ec509 Add including(all:) test fixed by ebdfa9e52a 2020-01-11 19:00:57 +01:00
Gwendal Roué ebdfa9e52a Fix failiing tests for children relations 2020-01-11 18:36:36 +01:00
Gwendal Roué 4c145b11a5 OrderedDictionary.filter(_:) 2020-01-11 18:12:30 +01:00
Gwendal Roué c14739cb4a Failiing tests for children relations 2020-01-11 18:11:05 +01:00
Gwendal Roué 5b841cf4cb Cleanup 2020-01-09 08:24:00 +01:00
Gwendal Roué 8fa17c578c Fix typo 2020-01-08 08:46:17 +01:00
Gwendal Roué 183612a4e3 Merge branch 'development' 2020-01-08 08:25:30 +01:00
Gwendal Roué e3fbfe6541 v4.8.0 2020-01-08 07:49:12 +01:00
Gwendal Roué 69b9d04aad Less TODO 2020-01-07 08:01:25 +01:00
Gwendal Roué ffd1222990 Fix comment 2020-01-06 09:14:57 +01:00
Gwendal Roué 07266d0b31 Remove useless captures 2020-01-06 09:12:55 +01:00
Gwendal Roué eb8ec327a8 Cleanup 2020-01-06 09:09:27 +01:00
Gwendal Roué f79b60083e Remove TODO and document why 2020-01-06 08:36:53 +01:00
Gwendal Roué fc50302e14 Remove unwise TODO 2020-01-06 08:14:46 +01:00
Gwendal Roué 4896741706 Remove code smell 2020-01-06 08:13:32 +01:00
Gwendal Roué fd7783c39d Fix uses of throwingFirstError(execute:finally:) 2020-01-06 08:12:49 +01:00
Gwendal Roué c60a945610 Fix SQL 2020-01-05 20:36:49 +01:00
Gwendal Roué ef9bab627d Fix markdown 2020-01-05 14:28:41 +01:00
Gwendal Roué 9ca2a2e782 Add context to the "Refining Association Requests" chapter 2020-01-05 14:27:17 +01:00
Gwendal Roué 3613b6ed45 Add missing documentation for annotated(with: expression) 2020-01-05 13:56:25 +01:00
Gwendal Roué adc7079943 Cleanup 2020-01-05 13:55:10 +01:00
Gwendal Roué cd8fbbe8f2 Add a test for foreign column annotation 2020-01-05 13:45:23 +01:00
Gwendal Roué e5726f3993 throwingFirstError(execute:finally:) 2020-01-05 13:30:12 +01:00
Gwendal Roué 14c3c7865e Move association initialization where they belong 2020-01-03 08:27:15 +01:00
Gwendal Roué 9dd5fd198b Fix documentation bug - #672 2020-01-03 08:09:54 +01:00
Gwendal Roué 2595729c8c Documentation 2020-01-03 08:04:22 +01:00
Gwendal Roué 6b6a422ead Travis: only build master and development branches 2019-12-30 18:26:17 +01:00
Gwendal Roué 72a4e2073f Update make doc so that it works with Xcode 11 2019-12-30 18:23:26 +01:00
Gwendal Roué 1fa93abb5b Merge pull request #676 from groue/dev/moreDeleteAndUpdate
More batch delete and update
2019-12-30 13:37:44 +01:00
Gwendal Roué 81c763750f CHANGELOG 2019-12-29 19:14:28 +01:00
Gwendal Roué 944f4309a8 Cleanup 2019-12-29 19:06:29 +01:00
Gwendal Roué b302051f87 Cleanup 2019-12-29 18:46:06 +01:00
Gwendal Roué 070f85b541 More tests for batch update and delete 2019-12-29 18:26:47 +01:00
Gwendal Roué 71d97b04a5 Move code 2019-12-29 18:26:27 +01:00
Gwendal Roué b1edf78f13 Add missing reference to updateAll 2019-12-29 18:26:05 +01:00
Gwendal Roué fa5198354a Fix failing tests for deleteAll and updateAll for grouped and joined queries 2019-12-29 17:50:53 +01:00
Gwendal Roué e8803804ec Failing tests for deleteAll and updateAll for grouped and joined queries 2019-12-29 17:50:47 +01:00
Gwendal Roué baa9695678 SQLQueryGenerator.grouping(_:) 2019-12-29 17:18:17 +01:00
Gwendal Roué a42a5cc2ca SQLQualifiedRelation.selectOnly(_:) 2019-12-29 16:57:26 +01:00
Gwendal Roué db7edd389f rowid is a unique key 2019-12-29 16:40:57 +01:00
Gwendal Roué 985794e733 Merge pull request #670 from groue/development
GRDB 4.7.0
2019-12-18 08:01:17 +01:00
Gwendal Roué 5d0e37e2cc v4.7.0 2019-12-17 18:59:12 +01:00
Gwendal Roué e69fb4a0db Remove unused code 2019-12-17 18:58:51 +01:00
Gwendal Roué 8512607fb6 Merge pull request #668 from groue/dev/suspend
Database Suspension
2019-12-15 18:18:58 +01:00
Gwendal Roué 299bfef7b5 Busy timeouts are really weird 2019-12-15 13:17:47 +01:00
Gwendal Roué a7f99b83f9 fix busy timeout tests on macOS 2019-12-15 10:54:13 +01:00
Gwendal Roué e7f1153c85 [skip travis] FUNDING.yml 2019-12-15 10:44:45 +01:00
Gwendal Roué f873bb1cfb fix busy timeout tests on Xcode 10.3 2019-12-15 10:00:57 +01:00
Gwendal Roué aadc58d349 [skip travis] documentation tweak 2019-12-14 19:49:26 +01:00
Gwendal Roué 5e75f0e0aa [skip travis] remove outdated documentation 2019-12-14 19:45:33 +01:00
Gwendal Roué a450df823b [skip travis] fix typo 2019-12-14 19:44:16 +01:00
Gwendal Roué af305afc2a LastUpgradeVersion 1130 2019-12-14 18:33:00 +01:00
Gwendal Roué 3d15751e44 Don't code sign performance tests 2019-12-14 18:28:28 +01:00
Gwendal Roué a09b8522ad Update make test_performance 2019-12-13 09:06:55 +01:00
Gwendal Roué 16186b6ac7 Extract performance tests to their own project 2019-12-13 09:02:47 +01:00
Gwendal Roué 1c2bd4134c Upgrade performance tests for Xcode 11.3 2019-12-13 08:39:24 +01:00
Gwendal Roué c4b6fbec76 Interrupt documentation 2019-12-13 08:24:42 +01:00
Gwendal Roué 974055b90b Suspension is experimental 2019-12-13 08:24:27 +01:00
Gwendal Roué 4bf5724543 Can't issue ROLLBACK on suspension
This is because this would allow a database modification to run in an aborted transaction
2019-12-13 08:14:49 +01:00
Gwendal Roué 19ba7d67e8 Suspension is fully experimental 2019-12-12 19:26:08 +01:00
Gwendal Roué 34eff46e56 Sharing a Datatase in an App Group Container 2019-12-12 19:23:41 +01:00
Gwendal Roué 0529869617 Fix busyMode tests for encrypted databases 2019-12-12 18:57:37 +01:00
Gwendal Roué 81ce5c9134 CHANGELOG 2019-12-12 08:53:16 +01:00
Gwendal Roué 6656f72782 Rename "lock prevention" to "suspension" 2019-12-12 08:47:49 +01:00
Gwendal Roué dfb013bf78 #664 is not quite easy to fix with optionals :-/ 2019-12-09 19:54:06 +01:00
Gwendal Roué 2b37e28691 remove debugging code 2019-12-09 19:20:02 +01:00
Gwendal Roué 69fc6a0496 Test that RowDecoder won't decode several sub-records from the root row - addresses #664 2019-12-09 19:09:27 +01:00
Gwendal Roué daba7e13fc Merge branch 'master' into development 2019-12-09 08:08:36 +01:00
Gwendal Roué 580fa6a554 Merge pull request #662 from groue/dev/SQLite3.30.1
Upgrade custom SQLite builds to version 3.30.1
2019-12-09 08:06:45 +01:00
Gwendal Roué e90ef7aa6e Fix acceptsDoubleQuotedStringLiterals tests 2019-12-08 18:07:41 +01:00
Gwendal Roué d1e1dcd097 Fix test for SPM 2019-12-08 08:55:05 +01:00
Gwendal Roué 16354be1c5 Merge pull request #656 from groue/dev/request-selection-inference
Type inference of selected columns
2019-12-07 19:36:08 +01:00
Gwendal Roué a0fddfe7ec Documentation 2019-12-07 13:47:00 +01:00
Gwendal Roué d6a459ad78 CHANGELOG 2019-12-07 13:42:52 +01:00
Gwendal Roué 7b4dc14485 [breaking] disable double-quoted string literals by default 2019-12-07 13:32:33 +01:00
Gwendal Roué 7208f53176 Support for NULLS FIRST and NULLS LAST 2019-12-07 12:31:58 +01:00
Gwendal Roué 2c9bef6440 "*" is no longer a valid FTS5 pattern 2019-12-07 12:07:06 +01:00
Gwendal Roué 820772fc6d SQlite 3.30.1 2019-12-07 12:01:51 +01:00
Gwendal Roué 710cea5437 CHANGELOG 2019-12-07 11:56:37 +01:00
Gwendal Roué b6ede15b18 Static tests for QueryInterfaceRequest type inference 2019-12-07 10:37:02 +01:00
Gwendal Roué aa536813d9 Add request type inference - cc @pakko972 2019-12-07 10:24:15 +01:00
Gwendal Roué 2b9932c1ee [skip travis] demo app icon, dark mode, content category adjustment 2019-12-07 10:03:53 +01:00
Gwendal Roué 2efb4e0d7d [skip travis] logo 2019-12-06 19:57:12 +01:00
Gwendal Roué 64935e78e3 Update TODO.md 2019-12-04 11:53:43 +01:00
Gwendal Roué 831ded3ec2 beginReadOnly only increments _readOnlyDepth if it succeeds 2019-12-03 19:18:05 +01:00
Gwendal Roué bbf8e773f8 Remove useless code 2019-12-03 19:17:35 +01:00
Gwendal Roué e4073cbe9a Test for stopPreventingLock 2019-12-03 19:12:41 +01:00
Gwendal Roué 6d0bdd3a4d CHANGELOG 2019-12-03 19:09:35 +01:00
Gwendal Roué 698dc262e0 Merge pull request #660 from groue/dev/startPreventingExclusiveLock
Database Lock Prevention
2019-12-03 19:08:09 +01:00
Gwendal Roué 41cd4c2140 Check for aborted transactions before checking for lock prevention 2019-12-03 09:01:03 +01:00
Gwendal Roué 12106387d1 Cleanup 2019-12-03 08:51:10 +01:00
Gwendal Roué 17864d3dcc Documentation 2019-12-03 08:15:57 +01:00
Gwendal Roué 4e26e8e744 Lock prevention: better error message 2019-12-03 08:13:19 +01:00
Gwendal Roué 7f66c85e67 Cleanup 2019-12-03 08:11:14 +01:00
Gwendal Roué 9efd5965ea Cleanup 2019-12-02 20:56:06 +01:00
Gwendal Roué 2b4a920732 Cleanup 2019-12-02 20:39:55 +01:00
Gwendal Roué 16025356bf Adapt lock prevention to the journal mode 2019-12-02 20:27:39 +01:00
Gwendal Roué 7015b66636 Update TODO.md 2019-12-02 09:50:57 +01:00
Gwendal Roué f604005b4c Improve interrupt() documentation 2019-12-01 19:03:47 +01:00
Gwendal Roué 1c318892c9 Documentation 2019-12-01 18:56:06 +01:00
Gwendal Roué f66cf92bba CHANGELOG 2019-12-01 18:54:21 +01:00
Gwendal Roué 559aae0263 CHANGELOG 2019-12-01 18:54:01 +01:00
Gwendal Roué 74bb9c11d7 Documentatioon 2019-12-01 18:52:51 +01:00
Gwendal Roué 98dc5df039 Avoid race condition in assertExclusiveLockPrevention 2019-12-01 18:44:23 +01:00
Gwendal Roué d85a7883bb Database.assertExclusiveLockPrevention mirrors assertNotInsideAbortedTransactionBlock 2019-12-01 18:34:51 +01:00
Gwendal Roué d1db8406f4 SQLITE_ABORT_EXCLUSIVE had no real purpose. 2019-12-01 18:26:52 +01:00
Gwendal Roué c8bb6873be Add SQLITE_CREATE_VTABLE to authorizer codes that invalidate schema cache 2019-12-01 17:59:49 +01:00
Gwendal Roué b54a8f7fe8 DatabaseWriter.startPreventingExclusiveLock() 2019-12-01 17:59:49 +01:00
Gwendal Roué 9cdebc45c0 Better assertNotInsideAbortedTransactionBlock 2019-12-01 17:59:49 +01:00
Gwendal Roué f8b6c1a285 More aborted transaction tests 2019-12-01 17:59:49 +01:00
Gwendal Roué 1fb12a2fdf Merge pull request #659 from groue/dev/interrupt
Database interruption
2019-12-01 11:54:04 +01:00
Gwendal Roué e3d25bda61 CHANGELOG 2019-12-01 05:23:19 +01:00
Gwendal Roué eb05c9b87d Documentation 2019-12-01 05:19:56 +01:00
Gwendal Roué 8145915d19 Fix aborted transaction tests for iOS 10.3.1 2019-12-01 04:01:03 +01:00
Gwendal Roué 62ef81c5fb Remove useless code 2019-11-30 21:16:48 +01:00
Gwendal Roué d4fa4c9d5e CHANGELOG 2019-11-30 21:14:06 +01:00
Gwendal Roué 64cb3091cf white space 2019-11-30 21:12:53 +01:00
Gwendal Roué b5ff80e858 Documentation 2019-11-30 21:12:47 +01:00
Gwendal Roué cae66fd5e0 Documentation 2019-11-30 20:51:24 +01:00
Gwendal Roué 79871e2d00 Documentation 2019-11-30 20:26:18 +01:00
Gwendal Roué fa1abdff2b Fix Swiftlint warnings 2019-11-30 19:56:26 +01:00
Gwendal Roué af00fd0f30 Less TODO 2019-11-30 19:53:04 +01:00
Gwendal Roué f90a408630 Tests for aborted transactions 2019-11-30 19:52:25 +01:00
Gwendal Roué f3e9c29f82 Monitor aborted transactions 2019-11-30 19:51:55 +01:00
Gwendal Roué 3ed7174838 DatabaseReader.interrupt() tests 2019-11-30 15:35:29 +01:00
Gwendal Roué 0a83848cfc DatabaseReader.interrupt() 2019-11-30 15:35:11 +01:00
Gwendal Roué 047ada75c7 Thank @MaxDesiatov 2019-11-29 09:02:04 +01:00
Gwendal Roué 129d2fae06 Fix documentation typo 2019-11-29 09:00:45 +01:00
Gwendal Roué 15a97f2b2b Merge pull request #658 from MaxDesiatov/patch-1
Fix typo in README.md
2019-11-27 17:01:52 +01:00
Max Desiatov 975d15733f Fix typo in README.md
> One want to build
2019-11-27 15:57:27 +00:00
Gwendal Roué 62f091a40b Fix typo 2019-11-23 11:45:21 +01:00
Max Desiatov 078f259061 Fix typo in README.md
> `concurrenRead`
2019-11-22 18:25:36 +01:00
Gwendal Roué a67070dd9a Merge branch 'development' 2019-11-20 18:51:03 +01:00
Gwendal Roué f257fb7a4e v4.6.2 2019-11-20 18:47:28 +01:00
Gwendal Roué 3f79892fdb Merge pull request #653 from signalapp/mkirk/empty-migrations
Fix: `appliedMigrations` throws error on new install
2019-11-20 09:04:35 +01:00
Michael Kirk cd6d46e349 move fix to private 2019-11-18 11:33:35 -07:00
Michael Kirk 9ea160b116 Fix: appliedMigrations throws error on new install
Before setup, the grdb_migrations table doesn't exist, so calling
`appliedMigrations` would throw an error.

To avoid this, if the table to track migrations doesn't exist yet, we can be
sure no migrations have been run, and we retun the empty set.

FIXES https://github.com/groue/GRDB.swift/issues/652
2019-11-18 09:09:46 -07:00
Gwendal Roué 8f03b5c8f3 Improve Configuration.targetQueue documentation - #651 2019-11-17 17:41:55 +01:00
Gwendal Roué 3ce3f2fa71 Xcode 11.3 in the Makefile 2019-11-17 17:31:42 +01:00
Gwendal Roué d9c26a40b4 Fix Swiftlint warning 2019-11-14 08:21:50 +01:00
Gwendal Roué 09e271de77 TODO 2019-11-13 19:25:09 +01:00
Gwendal Roué 205dea122f Upgrade performance tests 2019-11-13 04:37:08 +01:00
Gwendal Roué 2eb10aa19a Upgrade performance tests 2019-11-13 04:37:08 +01:00
Gwendal Roué 63fc59fd7c Merge pull request #649 from AnthonyEgerton/patch-1
Fix typo in Release Notes
2019-11-13 04:34:57 +01:00
Anthony Egerton bf6ee31491 Fix typo 2019-11-13 10:44:05 +11:00
Gwendal Roué 146151ffd7 Merge branch 'development' 2019-11-10 17:07:35 +01:00
Gwendal Roué 5b24f598a5 v4.6.1 2019-11-10 17:07:12 +01:00
Gwendal Roué 51a1c418a6 Merge pull request #647 from groue/dev/batch-update-policy
Honor conflict resolution for batch updates
2019-11-10 16:58:32 +01:00
Gwendal Roué e1ff862ffc CHANGELOG 2019-11-10 13:12:42 +01:00
Gwendal Roué 630a2c358a Document conflict resolution for batch updates 2019-11-10 13:05:33 +01:00
Gwendal Roué e0ea30041f Batch update: customization of conflict resolution 2019-11-10 13:00:19 +01:00
Gwendal Roué 58263e9b60 Fix failing test for batch update policy 2019-11-10 12:42:01 +01:00
Gwendal Roué 1e80aecfbd Failing test for batch update policy 2019-11-10 12:34:33 +01:00
Gwendal Roué d5c6dde3d9 Merge branch 'development' 2019-11-10 08:24:32 +01:00
Gwendal Roué 7819c9026a v4.6.0 2019-11-09 17:44:26 +01:00
Gwendal Roué e6617c8e12 Fix typo 2019-11-09 17:24:25 +01:00
Gwendal Roué d03a01a84a Fix typo 2019-11-09 16:23:51 +01:00
Gwendal Roué 90735fb3a7 CHANGELOG 2019-11-09 16:22:42 +01:00
Gwendal Roué 264906221e New Ordered vs. Unordered Associations chapter 2019-11-09 15:51:12 +01:00
Gwendal Roué be21704633 More usage tests for ordered to-many associations: reordering 2019-11-09 15:50:14 +01:00
Gwendal Roué b68bb00033 Simplify association to property type documentation 2019-11-09 14:52:32 +01:00
Gwendal Roué 1dd5c17bc7 Simplify Refining Association Requests chapter 2019-11-09 14:48:49 +01:00
Gwendal Roué c8a2c68728 Typo fix 2019-11-09 14:46:59 +01:00
Gwendal Roué f40c6511ef Usage tests for ordered to-many associations 2019-11-09 14:01:15 +01:00
Gwendal Roué 60aa6c2bf2 Less TODO 2019-11-09 13:11:25 +01:00
Gwendal Roué fe7446431b More NSDecimalNumber tests 2019-11-09 13:07:47 +01:00
Gwendal Roué abe2a62d47 Less TODO 2019-11-09 12:37:00 +01:00
Gwendal Roué 65d0f1edcc Merge pull request #646 from groue/dev/batch-update
Batch updates
2019-11-09 08:49:30 +01:00
Gwendal Roué c09615bab0 Fix bad tests 2019-11-08 20:32:54 +01:00
Gwendal Roué 218afa72c3 Test that order without limit is unused and harmless with updateAll() and deleteAll() 2019-11-08 18:09:11 +01:00
Gwendal Roué cb77fe2ed3 Don't check for ENABLE_UPDATE_DELETE_LIMIT: let SQLite emit syntax errors 2019-11-08 18:08:27 +01:00
Gwendal Roué 7345c5f2dd Fix Swiftlint warnings 2019-11-08 09:04:34 +01:00
Gwendal Roué efdebf59d3 CHANGELOG 2019-11-08 09:04:34 +01:00
Gwendal Roué 35d7490092 Fix SQLCipher tests (it misses ENABLE_UPDATE_DELETE_LIMIT) 2019-11-08 09:04:34 +01:00
Gwendal Roué dd4a2c5d9c Better error message when ENABLE_UPDATE_DELETE_LIMIT is missing 2019-11-08 09:04:34 +01:00
Gwendal Roué eae70f426e URIs don't change: people change them. 2019-11-08 09:04:34 +01:00
Gwendal Roué c7a6ca964c Doc cleanup 2019-11-08 09:04:34 +01:00
Gwendal Roué acb0004cea Move Full-Text documentation in its own file 2019-11-08 09:04:34 +01:00
Gwendal Roué 995d1b851a Rename setter to assignment 2019-11-08 09:04:34 +01:00
Gwendal Roué beab493dd5 Batch update documentation 2019-11-08 09:04:34 +01:00
Gwendal Roué 1c76eb7e9f Test encapsulation of batch update 2019-11-08 09:04:34 +01:00
Gwendal Roué 205398b65a Batch update 2019-11-08 09:04:34 +01:00
Gwendal Roué 61a6c5785f More request.deleteAll() tests 2019-11-08 09:04:34 +01:00
Gwendal Roué d983c6407c Update the list of extended result codes 2019-11-08 09:03:55 +01:00
Gwendal Roué 7cb78a4c86 Makefile: support for Xcode 11.2.1 GM seed 2019-11-08 09:03:47 +01:00
Gwendal Roué 733f6883d0 More TODO 2019-11-07 12:01:07 +01:00
Gwendal Roué 594874656a TODO 2019-11-06 08:24:22 +01:00
Gwendal Roué 6142020c50 Test association aggregate + inner join 2019-11-06 08:24:16 +01:00
Gwendal Roué 6f5b18854d TODO: enhance SQLRequest documentation - #617 2019-11-05 19:05:54 +01:00
Gwendal Roué b39c678a3d Remove dead code 2019-11-05 08:55:30 +01:00
Gwendal Roué a8a85d9a1f Disable some Travis tests
WTF? Travis has removed some simulators in the Xcode 11 setup?

https://travis-ci.org/groue/GRDB.swift/jobs/604303972
https://travis-ci.org/groue/GRDB.swift/jobs/604303975
2019-10-30 08:20:35 +01:00
Gwendal Roué 182b92f010 Opt in for more Swiftlint rules 2019-10-27 19:27:53 +01:00
Gwendal Roué a78f3699eb Help compiling GRDB with SWIFT_VERSION 5.0 and all opt-in APIs 2019-10-27 19:20:21 +01:00
Gwendal Roué 89bc509170 Merge branch 'development' 2019-10-15 18:55:25 +02:00
Gwendal Roué cfa615444e v4.5.0 2019-10-15 08:27:56 +02:00
Gwendal Roué 35389ed978 Fix demo app paths 2019-10-15 07:45:05 +02:00
Gwendal Roué caacecfd83 Remove obsolete GRDBPlus.podspec 2019-10-14 08:07:19 +02:00
Gwendal Roué 924b460c7a Move playgrounds to the Documentation folder 2019-10-14 08:05:50 +02:00
Gwendal Roué 60a9cf4942 Move the demo app to the Documentation folder 2019-10-14 08:03:54 +02:00
Gwendal Roué f9f3080819 Merge pull request #635 from groue/dev/sunsetFetchedRecordsController
Sunset FetchedRecordsController
2019-10-13 19:41:19 +02:00
Gwendal Roué 02c024e819 CocoaPods test apps don't rely on demo app, which requires Swift 5.1 2019-10-13 12:53:09 +02:00
Gwendal Roué 10249675ff CHANGELOG 2019-10-12 15:19:50 +02:00
Gwendal Roué b6553c0b59 Demo app: replace FetchedRecordsController with ValueObservation 2019-10-12 14:49:18 +02:00
Gwendal Roué dfd3e50b9c Sunset FetchedRecordsController 2019-10-12 14:10:56 +02:00
Gwendal Roué 79b8f7ed1d Merge pull request #633 from groue/dev/CocoaPodsOptions
SQLITE_ENABLE_PREUPDATE_HOOK support with CocoaPods
2019-10-12 13:00:22 +02:00
Gwendal Roué f184c626e0 SQLITE_ENABLE_PREUPDATE_HOOK documentation 2019-10-12 12:56:39 +02:00
Gwendal Roué 24ba40a77e GRDB_SQLITE_ENABLE_PREUPDATE_HOOK exposes missing SQLITE_ENABLE_PREUPDATE_HOOK declarations 2019-10-10 20:16:15 +02:00
Gwendal Roué 66326d79a2 Minor doc fix 2019-10-10 19:50:30 +02:00
Gwendal Roué fcd6c100ee Fix Xcode 11.1 tvOS destination in Makefile 2019-10-10 18:33:53 +02:00
Gwendal Roué 95b7879e33 CHANGELOG 2019-10-10 18:33:17 +02:00
Gwendal Roué 404532f6f0 Add LockedBox to GRDBCustom 2019-10-10 13:52:33 +02:00
Gwendal Roué 751262cdb3 Better DatabaseReader tests 2019-10-10 13:51:44 +02:00
Gwendal Roué 0ac0d31796 Better snapshot tests 2019-10-10 13:51:33 +02:00
Gwendal Roué 9d5d7f0216 Database.withSchemaCache 2019-10-10 13:51:00 +02:00
Gwendal Roué b59521e247 ReadWriteBox(value:) initializer 2019-10-10 13:50:42 +02:00
Gwendal Roué 7dd90c4af3 Don’t return Void 2019-10-10 13:49:55 +02:00
Gwendal Roué b06e4ad298 Make DatabaseSnapshot.reentrantRead actually reentrant 2019-10-10 13:49:39 +02:00
Gwendal Roué ff21f86341 DatabasePool setup: handle #102 in a savepoint 2019-10-10 13:49:12 +02:00
Gwendal Roué c89d41adbb Rename readerConfig to readerConfiguration 2019-10-10 13:48:20 +02:00
Gwendal Roué b3e1bf6f05 Database.checkpoint 2019-10-10 13:45:01 +02:00
Gwendal Roué fc57a69672 Rename beginSnapshotTransaction to beginSnapshotTransaction 2019-10-10 13:43:10 +02:00
Gwendal Roué fdbc0c8ec8 LockedBox: for when one does not need single writer/multiple readers 2019-10-10 13:41:58 +02:00
Gwendal Roué e3edf6daec Snapshot documentation improvements 2019-10-10 13:38:43 +02:00
Gwendal Roué 1b8f7b95f4 CHANGELOG and thank you notice 2019-10-10 08:20:32 +02:00
Gwendal Roué f756f39772 Merge pull request #632 from runhum/bugfix/readme-typos
Fix Accout -> Account
2019-10-09 17:28:45 +02:00
Runar Hummelsund 836f34297d Fix Accout -> Account 2019-10-09 17:19:44 +02:00
Gwendal Roué cd6d2579a5 Merge pull request #631 from groue/dev/issue630
Fix custom SQLite builds
2019-10-07 06:31:00 +02:00
Gwendal Roué 2892424006 CHANGELOG 2019-10-06 13:51:03 +02:00
Gwendal Roué 856792d688 Travis: test custom SQLite installation 2019-10-06 13:03:43 +02:00
Gwendal Roué 00115ba60c More explicit documentation for the Pre-action script 2019-10-06 12:57:03 +02:00
Gwendal Roué 1cdddd35c8 Fix Xcode warnings 2019-10-06 12:55:35 +02:00
Gwendal Roué ccaf4c942f Test installation procedure for custom SQLite 2019-10-06 12:55:21 +02:00
Gwendal Roué 9f9fcb1a8e Address #630 2019-10-06 12:21:49 +02:00
Gwendal Roué b6955377c9 CHANGELOG 2019-10-06 11:49:45 +02:00
Gwendal Roué 5f085f2df8 Merge pull request #627 from groue/dev/SPM
Swift Package Manager: define SQLite as a system library target
2019-10-04 19:01:49 +02:00
Gwendal Roué 3cc5bb7c98 Test SPM integration from Xcode 2019-10-02 18:27:40 +02:00
Gwendal Roué 3dc4567233 SPM: Replace groue/CSQLite with a systemLibrary target 2019-10-02 18:02:49 +02:00
Gwendal Roué 37477adada Merge pull request #622 from groue/dev/620
Allow observation of FTS4 virtual tables
2019-09-27 06:04:03 +02:00
Gwendal Roué a44afd79e0 Makefile: support for Xcode 11.1 2019-09-26 13:15:32 +02:00
Gwendal Roué 61088ee2e7 Makefile: use iPhone 11 simulator with Xcode 11.0 2019-09-26 13:07:47 +02:00
Gwendal Roué a721917d95 CHANGELOG 2019-09-26 09:03:10 +02:00
Gwendal Roué a08b078c3e Fix a swiftlint warning 2019-09-26 08:49:57 +02:00
Gwendal Roué aa1cfb9020 Fix testSynchronizedFTS4Observation 2019-09-26 08:49:44 +02:00
Gwendal Roué 0d961ce48e Simplify DatabaseRegion.iisModified(by:)
There is no "fast path" any longer. Performance impact should be minimal since most observers call `stopObservingDatabaseChangesUntilNextTransaction` on first impactful change anyway.
2019-09-26 06:55:54 +02:00
Gwendal Roué 1b753802dd Address #620, but a failing test remains 2019-09-25 20:03:00 +02:00
Gwendal Roué 3f3bdde10c #620 explorations 2019-09-25 17:08:02 +02:00
Gwendal Roué b2ea9e51d2 Help debugging authorization issues like #620 2019-09-25 17:04:26 +02:00
Gwendal Roué 27a05028db SQLRequest+SQLLiteral: added literal initialization tests 2019-09-17 08:54:34 +02:00
Gwendal Roué 725e16390b Fix failing test for eraseDatabaseOnSchemaChange 2019-09-17 08:22:36 +02:00
Gwendal Roué 6b83ba3585 Failing test for eraseDatabaseOnSchemaChange 2019-09-17 08:18:45 +02:00
Gwendal Roué 62e50b1a73 Simplify eraseDatabaseOnSchemaChange implementation 2019-09-17 08:10:28 +02:00
Gwendal Roué bf7192cef1 Siimplify Row: Swift has better ARC optimizations now 2019-09-13 19:39:45 +02:00
Gwendal Roué 18d634b171 Update performance tests for Xcode 11 2019-09-13 19:11:21 +02:00
Gwendal Roué a5b5bccc61 Update TODO.md 2019-09-13 14:04:43 +02:00
Gwendal Roué 988852a438 Makefile/Travis: min tvOS 10.2 on Xcode 10.3 2019-09-13 04:59:51 +02:00
Gwendal Roué 2313713603 Makefile/Travis: min iOS 10.3.1 on Xcode 10.3 2019-09-13 04:56:32 +02:00
Gwendal Roué 6a5ce71c12 Makefile/Travis: Don't code sign 2019-09-12 07:09:27 +02:00
Gwendal Roué 9872e945ba Makefile/Travis: Xcode 11 use iPhone Xs + iOS 13.0 2019-09-11 19:48:50 +02:00
Gwendal Roué b3341cc552 Makefile/Travis: Xcode 11 min iOS is 10.3.1 2019-09-11 19:42:41 +02:00
Gwendal Roué 0a1e3afa82 Makefile/Travis: Xcode 11 2019-09-11 08:52:18 +02:00
Gwendal Roué 483728bfbf Fix typo 2019-09-09 08:43:29 +02:00
Gwendal Roué b459536b66 TODO 2019-09-07 15:55:07 +02:00
Gwendal Roué d990b47814 Fix compiler warnings 2019-09-07 12:51:46 +02:00
Gwendal Roué aa157a77d2 Merge branch 'development' 2019-09-06 08:07:49 +02:00
Gwendal Roué 254f3760b4 v4.4.0 2019-09-06 08:06:15 +02:00
Gwendal Roué 896ec284e1 Merge pull request #602 from groue/dev/passphrase-refactoring
Don't keep the sqlCipher passphrase in memory longer than necessary
2019-09-06 07:59:35 +02:00
Gwendal Roué 036178a55a CHANGELOG 2019-09-06 07:52:18 +02:00
Gwendal Roué 3ff94c7607 CHANGELOG 2019-09-06 07:44:15 +02:00
Gwendal Roué 5c125fae8b Add a "Managing the lifetime of the passphrase string" security consideration 2019-09-05 13:28:19 +02:00
Gwendal Roué 642089f41a Suggest using Data Protection 2019-09-04 19:16:14 +02:00
Gwendal Roué 6285a59926 Fix sample code 2019-09-04 19:09:32 +02:00
Gwendal Roué 4ba199f0aa Organization 2019-09-04 18:53:11 +02:00
Gwendal Roué 75f3540b8f Typo 2019-09-04 18:50:16 +02:00
Gwendal Roué bfa1689d7d Typo 2019-09-04 18:49:47 +02:00
Gwendal Roué a1c96f9093 Another suggestion by @michaelkirk-signal 2019-09-04 18:46:44 +02:00
Gwendal Roué 32842c22f0 Wording 2019-09-04 18:38:37 +02:00
Gwendal Roué 8e764aadd2 Fix typo 2019-09-04 18:36:53 +02:00
Gwendal Roué ad9b32f9a2 Fix ambiguous wording 2019-09-04 18:35:52 +02:00
Gwendal Roué cb9323480c Fix typo 2019-09-04 18:31:32 +02:00
Gwendal Roué cc7d19d925 Apply wording by @michaelkirk-signal 2019-09-04 18:24:25 +02:00
Gwendal Roué c2e68d95fe Passphrase documentation 2019-09-04 08:54:22 +02:00
Gwendal Roué 7b3275ce45 Make lastErrorCode and lastErrorMessage public 2019-09-04 08:54:06 +02:00
Gwendal Roué 9a69dbd8a1 Remove testDatabaseQueueWithPassphraseToDatabaseQueueWithWrongPassphraseAndRetry 2019-09-03 13:26:16 +02:00
Gwendal Roué f2198f5af7 Passphrase documentation (WIP) 2019-09-03 09:11:52 +02:00
Gwendal Roué 8150dda951 Passphrase documentation (WIP) 2019-09-03 09:10:02 +02:00
Gwendal Roué d4928eff99 Test that prepareDatabase errors are rethrown 2019-09-03 09:07:14 +02:00
Gwendal Roué 1f48405b5c Rewrite passphrase documentation (WIP) 2019-09-03 08:56:41 +02:00
Gwendal Roué 55d4a9c029 Test for attempting several passphrases 2019-09-03 08:56:16 +02:00
Gwendal Roué e6bc1c40fe CHANGELOG 2019-09-03 08:55:57 +02:00
Gwendal Roué b9e2f35728 Deprecate change(passphrase:), and provide an alternative solution 2019-09-02 09:05:37 +02:00
Gwendal Roué 6fc7794e64 Restore testDeprecatedPassphrase 2019-09-02 08:38:15 +02:00
Gwendal Roué 1d71b9f311 Update testPrepareDatabase for snapshots 2019-09-02 08:38:15 +02:00
Gwendal Roué 9f26777cc3 prepareDatabase did not need to be deprecated, after all 2019-09-02 08:38:15 +02:00
Gwendal Roué 0b9fe9ae92 Documentation 2019-09-02 08:38:15 +02:00
Gwendal Roué 1ba4e8c771 Fix failing test for change(passphrase:) 2019-09-02 08:38:15 +02:00
Gwendal Roué aded6d206d Failing test for change(passphrase:) 2019-09-02 08:38:15 +02:00
Gwendal Roué d644f01557 Deprecate Configuration.passphrase, introduce Database.usePassphrase(_:) 2019-09-02 08:38:15 +02:00
Gwendal Roué eb112c912c Fix Xcode 11 warnings in SQLCipher test projects 2019-09-02 08:37:28 +02:00
Gwendal Roué d8b0b95842 DatabaseConfiguration.onConnect 2019-09-02 08:37:28 +02:00
Gwendal Roué 8f66114042 Deprecate Configuration.prepareDatabase 2019-09-02 08:37:28 +02:00
Gwendal Roué 943eca10a6 TODO 2019-09-02 08:37:28 +02:00
Gwendal Roué 82f56ee596 Merge pull request #603 from groue/dev/pool-barrier
DatabasePool write barrier
2019-09-02 08:36:01 +02:00
Gwendal Roué 00e2c2a626 Fix testBarrierIsLockedByOneUnfinishedRead for Swift 4.2 2019-09-02 05:39:38 +02:00
Gwendal Roué c7e4492846 Fix DatabasePool.change(passphrase:) 2019-09-01 19:33:03 +02:00
Gwendal Roué 04a6e969a5 DatabasePool.barrierWriteWithoutTransaction documentation 2019-09-01 17:30:01 +02:00
Gwendal Roué 5b4a225dc3 DatabasePool.barrierWriteWithoutTransaction tests 2019-09-01 17:19:12 +02:00
Gwendal Roué e3efcc0d87 CHANGELOG 2019-09-01 17:03:22 +02:00
Gwendal Roué 8580023eda DatabasePool.barrierWriteWithoutTransaction 2019-09-01 16:46:17 +02:00
Gwendal Roué 473f6ff0d8 Tests for Pool.barrier 2019-09-01 16:32:39 +02:00
Gwendal Roué e495df0114 Pool.barrier 2019-09-01 16:32:18 +02:00
Gwendal Roué 06d6c3866b ReadWriteBox Cleanup 2019-09-01 16:28:16 +02:00
Gwendal Roué da459386a0 Merge branch 'development' 2019-08-28 08:25:35 +02:00
Gwendal Roué 1023f260b7 v4.3.0 2019-08-28 08:22:38 +02:00
Gwendal Roué a6fa76a954 More TODO 2019-08-28 08:07:19 +02:00
Gwendal Roué 3e48eb703e CHANGELOG 2019-08-24 10:57:24 +02:00
Gwendal Roué 7cf10bfb67 Merge pull request #600 from outfoxx/tvos-support
Add support for tvOS
2019-08-24 10:49:20 +02:00
Kevin Wooten 055e33b381 Add missing tvOS stages to Xcode 10.1 2019-08-23 10:54:58 -07:00
Kevin Wooten 7fffc2791e Bump min tvOS to 10.0
tvOS 9.0 appears to have issues with running tests
2019-08-23 10:54:27 -07:00
Kevin Wooten 4d3f0bd88b Add support for tvOS
## Xcode Project
- [x] tvOS Target
- [x] tvOS Unit Test Target
- [x] tvOS Scheme

## Makefile
- [x] tvOS Target Min/Max
- [x] tvOS Actions (copies iOS)

## CI
- [x] tvOS Travis stages

## Packaging
- [x] CocoaPods - Podfile Updated
- [x] ~SwiftPM - Not Changes Required~

## Documentation
- [x] Readme Updated
2019-08-22 13:15:31 -07:00
Gwendal Roué 881d4c6bfc TODO 2019-08-22 05:34:43 +02:00
Gwendal Roué ba02713d78 TODO 2019-08-14 07:55:49 +02:00
Gwendal Roué 6f6e382948 Merge branch 'development' 2019-08-13 07:58:27 +02:00
Gwendal Roué b7c7892a74 v4.2.1 2019-08-13 07:56:28 +02:00
Gwendal Roué a6112a5ca2 Merge pull request #592 from groue/dev/issue-591
Fix Data interpolation
2019-08-12 12:34:24 +02:00
Gwendal Roué d219f5589e CHANGELOG 2019-08-11 13:14:44 +02:00
Gwendal Roué 01a1a7c962 Fix typo 2019-08-11 13:04:24 +02:00
Gwendal Roué 8e38af9aae Fix #591 2019-08-11 13:03:43 +02:00
Gwendal Roué d28847bf3d Failing test for https://github.com/groue/GRDB.swift/issues/591 2019-08-11 12:56:29 +02:00
Gwendal Roué 24c25dfd04 Explicit tests for DatabaseValueConvertible interpolation 2019-08-11 12:25:48 +02:00
Gwendal Roué 18e09cda11 TODO 2019-08-11 12:04:03 +02:00
Gwendal Roué fb54c2ae45 Merge branch 'development' 2019-08-06 12:10:28 +02:00
Gwendal Roué a08e8f0ef6 Merge pull request #587 from groue/GRDB-4.2
GRDB 4.2.0
2019-08-06 12:09:28 +02:00
Gwendal Roué bd81f6e7a6 v4.2.0 2019-08-06 06:58:13 +02:00
Gwendal Roué eea8f7b1e9 Use ValueObservation.tracking(value:) in demo app 2019-08-06 06:54:39 +02:00
Gwendal Roué c734eba245 Upgrade performance tests
Upgrade Realm to v3.17.3
Upgrade FMDB to v2.7.4
Upgrade SQLite.swift to v0.12.2
2019-08-05 20:56:49 +02:00
Gwendal Roué 71bf6fdbcf TODO 2019-08-05 20:30:29 +02:00
Gwendal Roué 226410caf8 TODO cleanup 2019-08-05 20:19:48 +02:00
Gwendal Roué 82d80d4120 Merge pull request #586 from groue/dev/value-observation-variable-region
Automatic region tracking for ValueObservation
2019-08-05 19:47:59 +02:00
Gwendal Roué 80baa798d6 CHANGELOG 2019-08-05 12:39:37 +02:00
Gwendal Roué ba1142ac58 Fix typo 2019-08-05 12:34:23 +02:00
Gwendal Roué e279d287b9 Even more fostering of ValueObservation.tracking(fetch:) in README 2019-08-05 12:32:12 +02:00
Gwendal Roué 87b474029e Test that observations of tuples are easy to consume. 2019-08-05 12:31:39 +02:00
Gwendal Roué 8af3b58e54 Fix documentation 2019-08-05 09:04:14 +02:00
Gwendal Roué a770d46843 Rename ValueObservation.tracking(fetch:) to ValueObservation.tracking(value:) 2019-08-05 09:03:05 +02:00
Gwendal Roué efaa387ee2 Remove useless documentation paragraph 2019-08-05 08:38:25 +02:00
Gwendal Roué f849c38f43 Foster ValueObservation.tracking(fetch:) in README 2019-08-05 08:34:47 +02:00
Gwendal Roué ea43468a6f Documentation 2019-08-05 07:52:32 +02:00
Gwendal Roué fd18a7b75d Fix for Xcode < 10.2 2019-08-05 07:48:34 +02:00
Gwendal Roué fe9c4381e0 Makefile: support for Xcode 10.3, and fix test_performance target 2019-08-04 14:59:48 +02:00
Gwendal Roué 0f2c5cd8a0 Fix failling test for rowid optimization in Database.recordingSelectedRegion 2019-08-04 14:37:40 +02:00
Gwendal Roué 9c864bc768 Failling test for rowid optimization in Database.recordingSelectedRegion 2019-08-04 14:37:10 +02:00
Gwendal Roué dc146a431c Tests for Database.recordingSelectedRegion 2019-08-04 14:36:20 +02:00
Gwendal Roué c718889418 Update ValueObservation documentation 2019-08-04 11:45:43 +02:00
Gwendal Roué d61522ee5f Update ValueObservation documentation 2019-08-04 11:42:54 +02:00
Gwendal Roué c4481f4e79 Fix ValueObservationRegionRecordingTests for SQLite < 3.19.0 2019-08-04 10:44:08 +02:00
Gwendal Roué 731a83908d Test automatic ValueObservation region tracking with various schedulings 2019-08-03 18:03:05 +02:00
Gwendal Roué 62a12d94ce CHANGELOG 2019-08-03 17:41:39 +02:00
Gwendal Roué 4f025e59af Documentation 2019-08-03 17:21:42 +02:00
Gwendal Roué 2039cd4874 Documentation 2019-08-03 17:18:47 +02:00
Gwendal Roué 1b94c38b4f Documentation 2019-08-03 17:16:03 +02:00
Gwendal Roué f556fc39ab Documentation 2019-08-03 17:01:16 +02:00
Gwendal Roué a5c8f23ba4 Support for variable observed region of ValueObservation based on actual selection 2019-08-03 16:32:33 +02:00
Gwendal Roué af0ac156aa More explicit observation initializers 2019-08-03 14:21:46 +02:00
Gwendal Roué 8d5cddd293 Merge pull request #585 from groue/dev/issue-583
Fix use of SQLite authorizers
2019-08-03 13:37:50 +02:00
Gwendal Roué 38599b007f CHANGELOG 2019-08-03 07:15:55 +02:00
Gwendal Roué 5908c26a79 Fix Makefile so that it can checkoutt the FMDB submodule 2019-08-03 06:48:08 +02:00
Gwendal Roué d32b5271bd Performance tests: update paths for Xcode 10.3 2019-08-03 06:43:31 +02:00
Gwendal Roué 55803b29b0 Keep a memory of how to trigger #583 error 2019-08-02 17:56:47 +02:00
Gwendal Roué 870d22fd95 Explain why we call sqlite3_set_authorizer once per database connection 2019-08-02 16:06:19 +02:00
Gwendal Roué c6cb92d757 Cleanup 2019-08-02 15:40:19 +02:00
Gwendal Roué 3ab8a34d58 Fix a Swiftlint warning 2019-08-02 15:34:49 +02:00
Gwendal Roué bd9104d29f Cleanup 2019-08-02 15:34:25 +02:00
Gwendal Roué e351b79526 Database only exposes its current authorizer with the withAuthorizer(_:_:) wrapper method. 2019-08-02 15:16:48 +02:00
Gwendal Roué a59f4ef096 Fix #583 by keeping a single authorizer active for the whole lifetime of a database connection
SQLite invalidates statements when authorizer changes, which can lead to undesired behaviors. This is why we now call sqlite3_set_authorizer only once. See http://sqlite.1065341.n5.nabble.com/Issue-report-sqlite3-set-authorizer-triggers-error-4-516-SQLITE-ABORT-ROLLBACK-during-statement-itern-td107972.html
2019-08-02 14:17:48 +02:00
Gwendal Roué bb959fa5c3 Add failing test for #583 2019-08-02 14:14:48 +02:00
Gwendal Roué 2b3e5a06db CONTRIBUTING: mention GRDBCombine 2019-07-31 08:07:52 +02:00
Gwendal Roué e58b652970 CONTRIBUTING: static libray is possible since #570 2019-07-31 08:04:38 +02:00
Gwendal Roué 62f5bd1940 CONTRIBUTING: fix inner link 2019-07-31 08:03:04 +02:00
Gwendal Roué 63cb9f2ad2 CONTRIBUTING: mention #575 2019-07-31 08:01:39 +02:00
Gwendal Roué 19cf569036 Add @chrisballinger to the thank you notice 2019-07-31 07:43:16 +02:00
Gwendal Roué e23cb4ed76 Merge pull request #570 from Rightpoint/fix-issue-360-modulemap
Allow Swift static library integration via CocoaPods
2019-07-31 06:59:05 +02:00
Chris Ballinger bdf802ab34 Update CHANGELOG and README 2019-07-30 16:34:19 -07:00
Gwendal Roué 507ae0dfdc Tests for framework & static CocoaPods integration 2019-07-30 16:33:20 -07:00
Chris Ballinger 56af3ceff6 Remove modulemap from podspec 2019-07-30 16:33:20 -07:00
Gwendal Roué 4ffb59719a Fix #580 2019-07-30 06:57:03 +02:00
Gwendal Roué bb0c11f7d5 TODO 2019-07-29 09:11:47 +02:00
Gwendal Roué 82c8958c44 Merge pull request #576 from groue/dev/fullltext
Expose table name and full-text filtering methods to DerivableRequest
2019-07-28 14:00:59 +02:00
Gwendal Roué e8ad3871f7 Fix for Xcode 10.0, 10.1 2019-07-28 08:59:23 +02:00
Gwendal Roué 53aaca480e Merge branch 'development' into dev/fullltext
# Conflicts:
#	CHANGELOG.md
2019-07-27 23:11:00 +02:00
Gwendal Roué 23678ab9da Update documentatiion for #577 2019-07-27 23:06:36 +02:00
Gwendal Roué 2996a24de9 Merge pull request #577 from groue/dev/renameAliased
Rename aliased(_:) methods to forKey(_:)
2019-07-27 22:59:09 +02:00
Gwendal Roué dba8d636bb Less TODO 2019-07-27 17:10:31 +02:00
Gwendal Roué faa7bf7e53 Less TODO 2019-07-27 17:10:01 +02:00
Gwendal Roué 05fdf5cfdd CHANGELOG 2019-07-27 17:08:53 +02:00
Gwendal Roué b4ef6a3dad CHANGELOG 2019-07-27 17:08:11 +02:00
Gwendal Roué 0c709294a0 Fix documentation 2019-07-27 16:45:06 +02:00
Gwendal Roué d15bb190eb Enable Code Coverage in GRDBCustomSQLiteOSX target 2019-07-27 16:36:53 +02:00
Gwendal Roué ede4572da3 Update tests for the new forKey(_:) methods 2019-07-27 16:34:17 +02:00
Gwendal Roué b4929bb638 Rename aliased(_:) to forKey(_:) 2019-07-27 16:29:09 +02:00
Gwendal Roué 52cd98547d Fix DerivableRequest.matching(_:) tests so that OSX 10.0 is not required 2019-07-27 15:58:33 +02:00
Gwendal Roué 5cced46a61 API diff 2019-07-27 15:23:29 +02:00
Gwendal Roué 3f8e994501 API diff 2019-07-27 15:23:29 +02:00
Gwendal Roué ae60bc6e18 CHANGELOG 2019-07-27 15:23:29 +02:00
Gwendal Roué 462e5eee24 Cleanup 2019-07-27 15:23:29 +02:00
Gwendal Roué c1a0b7f9e2 Add missing Foundation imports (https://github.com/openbitapp/GRDB.swift/commit/9669e3007f42359e4165759208c5df8455531b12) 2019-07-27 15:23:29 +02:00
Gwendal Roué 89001f11c3 Spot that annotations are another challenge on the way to optional + required join chaining 2019-07-27 15:23:29 +02:00
Gwendal Roué 026db8f19a Tests for TableRequest requirement on DerivableRequest, including the new support for full-text search 2019-07-27 15:23:29 +02:00
Gwendal Roué 2d1f218ec5 Force TableRecord on Association origin & destination, append TableRequest to DerivableRequest requirements 2019-07-27 15:23:29 +02:00
Gwendal Roué 4d558488c0 Expose matching(_:) on TableRequest&FilteredRequest 2019-07-27 15:23:29 +02:00
Gwendal Roué bf73f0ded2 CHANGELOG 2019-07-27 15:22:13 +02:00
Gwendal Roué b8cc4c30f9 TODO 2019-07-27 12:47:39 +02:00
Gwendal Roué cf2a6763b5 Merge pull request #574 from groue/dev/swiftlint
SwiftLint
2019-07-27 12:46:53 +02:00
Gwendal Roué e65e2a3bd1 CHANGELOG 2019-07-26 21:18:51 +02:00
Gwendal Roué 56d355c903 The kiss of Xcode 10.3 2019-07-26 21:09:19 +02:00
Gwendal Roué 35ceeebb3d Style tweaks 2019-07-26 20:56:33 +02:00
Gwendal Roué d9e1a04cc2 Fix FTS3 & FTS4 regressions 2019-07-26 19:52:34 +02:00
Gwendal Roué d7a51c39ca Remove Swiift 5 conversion warning 2019-07-26 19:30:59 +02:00
Gwendal Roué 756f1b9387 swiftlint: remove large_tuple, add unused_declaration 2019-07-26 19:30:52 +02:00
Gwendal Roué df6bb8761c Swiftlint + whitespace 2019-07-01 08:57:53 +02:00
Gwendal Roué b3215cc471 Less TODO 2019-06-30 13:43:12 +02:00
Gwendal Roué 7defc8ea07 Merge pull request #563 from groue/dev/eager-loading-from-optional-to-one
More tests for eager loading of hasMany associations
2019-06-30 10:24:33 +02:00
Gwendal Roué 2b401fe745 We don't really care about useless LEFT JOINs 2019-06-29 15:32:13 +02:00
Gwendal Roué 3e4c6fd102 Add more eager loading SQL tests (and spot a possible optimization) 2019-06-29 15:21:24 +02:00
Gwendal Roué 9946880c5e Add tests for including(optional: hasOne.including(all: hasMany)) 2019-06-29 14:12:46 +02:00
Gwendal Roué 738ea4ed10 Merge pull request #562 from groue/dev/fix-561
Fix crash when using more than one DatabaseCollation
2019-06-29 10:31:53 +02:00
Gwendal Roué 498c65a64c CHANGELOG 2019-06-28 19:06:49 +02:00
Gwendal Roué fbc50dd2d1 CHANGELOG 2019-06-28 19:06:11 +02:00
Gwendal Roué 7802eb356d Fix failing test for #561 2019-06-28 19:02:21 +02:00
Gwendal Roué 036e236dc0 Failing test for #561 2019-06-28 19:01:58 +02:00
Gwendal Roué ff2f8bd88e More TODO 2019-06-28 17:18:00 +02:00
Gwendal Roué 1d47fb16be TODO: predicates 2019-06-26 09:34:50 +02:00
Gwendal Roué 5345ccd53e Merge pull request #560 from bellebethcooper/patch-1
Minor typo fix
2019-06-26 09:31:29 +02:00
bellebethcooper e1ee2afba1 Minor typo fix 2019-06-26 17:24:26 +10:00
Gwendal Roué d290102d9c v4.1.1 2019-06-22 09:14:48 +02:00
Gwendal Roué de3f32b6ad Merge pull request #552 from groue/GRDB-4.1
GRDB 4.1
2019-06-20 08:13:03 +02:00
Gwendal Roué cb517dc5c9 Update release date 2019-06-20 08:08:32 +02:00
Gwendal Roué 49d098eb7b Merge pull request #555 from groue/dev/readOnlyError
Avoid a crash when read-only access can't be established
2019-06-19 08:04:00 +02:00
Gwendal Roué caa624f56b Readonly: avoid hitting the db if unnecessary 2019-06-19 04:16:07 +02:00
Gwendal Roué c190b1355e CHANGELOG 2019-06-18 20:45:23 +02:00
Gwendal Roué 335850c5fe Fix #554 2019-06-18 20:40:49 +02:00
Gwendal Roué 2730f8f806 Fix DatabasePool.concurrentRead for Swift < 5 2019-06-18 08:37:21 +02:00
Gwendal Roué dc2871d5eb DatabaseWriter.spawnConcurrentRead (experimental method) 2019-06-18 08:21:55 +02:00
Gwendal Roué cdccac8c86 Documentation 2019-06-17 19:52:55 +02:00
Gwendal Roué 173c8af3ef asyncConcurrentRead documentation 2019-06-17 19:48:25 +02:00
Gwendal Roué 3cea3db2b4 DatabasePool.asyncConcurrentRead 2019-06-17 19:35:11 +02:00
Gwendal Roué 7526276f98 Documentation 2019-06-16 14:54:42 +02:00
Gwendal Roué b9925d1620 Avoid iPhone XS/iPhone Xs ambiguity 2019-06-15 14:16:52 +02:00
Gwendal Roué 68d4889864 Ignore various Podfile.lock 2019-06-15 14:14:45 +02:00
Gwendal Roué c5cb8f44f3 Fix Xcode warnings and update GRDBDemoiOS to latest APIs 2019-06-15 13:29:24 +02:00
Gwendal Roué 309fa97606 Prepare 4.1.0: README.md 2019-06-15 12:44:52 +02:00
Gwendal Roué a2ba53ab26 Prepare 4.1.0: Info.plist 2019-06-15 12:37:18 +02:00
Gwendal Roué 3a98f337bd Prepare 4.1.0: GRDB.swift.podspec 2019-06-15 12:36:40 +02:00
Gwendal Roué 8663a1bf3f Prepare 4.1.0: CustomSQLiteBuilds.md 2019-06-15 12:35:39 +02:00
Gwendal Roué fc13454f29 Prepare 4.1.0: Makefile 2019-06-15 12:34:53 +02:00
Gwendal Roué 8cadb97b2f Prepare 4.1.0: CHANGELOG 2019-06-15 12:33:13 +02:00
Gwendal Roué 278e4190db Enhance SQLite error 10/23 FAQ with sample code 2019-06-15 04:55:53 +02:00
Gwendal Roué d3fe40127c Forget SR-1570 2019-06-15 04:44:16 +02:00
Gwendal Roué 3f9b94f95e Group SQLite error FAQs together 2019-06-15 04:39:07 +02:00
Gwendal Roué 02e1793cc9 Move configuration requirement to DatabaseReader 2019-06-15 04:32:14 +02:00
Gwendal Roué e40e37bd04 FetchRequest.makePreparedRequest 2019-06-15 04:24:29 +02:00
Gwendal Roué 65de31a335 Polishing 2019-06-14 22:01:57 +02:00
Gwendal Roué 66552ebc77 Merge pull request #550 from groue/dev/async
Asynchronous Database Access Methods
2019-06-14 18:58:06 +02:00
Gwendal Roué 4a79a20116 Foster asyncWrite over asyncWriteWithoutTransaction 2019-06-14 08:10:16 +02:00
Gwendal Roué f03fd276f1 asyncWrite's completion handler accepts a database connection
This guarantees that the asyncWrite method provides exclusive write access for the whole duration of (transaction + result handling).
2019-06-14 08:03:13 +02:00
Gwendal Roué 0e031cd5a9 CHANGELOG 2019-06-13 22:40:51 +02:00
Gwendal Roué cd3c84d19e Stop fostering ValueObservation.start(in:onChange:) without error handling 2019-06-13 22:37:21 +02:00
Gwendal Roué 29cfebdec0 GRDBCombine is a companion library 2019-06-13 20:26:44 +02:00
Gwendal Roué d0e839c2b4 Note about availability of asynchronous APIs 2019-06-13 20:13:19 +02:00
Gwendal Roué d18c65fbe5 Documentation for asynchronous APIs 2019-06-13 20:06:58 +02:00
Gwendal Roué 07ade5ee75 Merge branch 'development' into dev/async 2019-06-13 19:20:57 +02:00
Gwendal Roué 3897e9824c CHANGELOG 2019-06-13 19:20:46 +02:00
Gwendal Roué 0c2875a310 TODO 2019-06-13 14:39:50 +02:00
Gwendal Roué f7946834f1 Fix compiler checks for async methods 2019-06-13 14:14:35 +02:00
Gwendal Roué 0ad819902d Tests for asyncRead, asyncWrite, asyncWriteWithoutTransaction 2019-06-13 13:42:31 +02:00
Gwendal Roué b715ca5eb8 DatabaseWriter.asyncWrite 2019-06-13 13:20:59 +02:00
Gwendal Roué bc7c3e5eb1 DatabaseReader.asyncRead 2019-06-13 08:45:49 +02:00
Gwendal Roué 9650783ea4 Update code snippets for ValueObservation.start 2019-06-13 06:13:26 +02:00
Gwendal Roué 4b0e43f884 TODO 2019-06-13 05:29:05 +02:00
Gwendal Roué f120632e36 Rename unsafeAsyncWrite to asyncWriteWithoutTransaction
Hold on: a more complete set of async APIs will come eventually.
2019-06-13 05:25:56 +02:00
Gwendal Roué d42b515fb6 Documentation 2019-06-13 04:56:05 +02:00
Gwendal Roué 47b813057a Merge pull request #549 from groue/dev/CombineSupport
Support for Combine
2019-06-13 04:28:09 +02:00
Gwendal Roué 1db76a9d85 Merge pull request #540 from groue/dev/SQLite-3.28.0
Update SQLite to 3.28.0
2019-06-13 04:24:29 +02:00
Gwendal Roué a59546203f CHANGELOG 2019-06-12 19:54:39 +02:00
Gwendal Roué 085f4c9597 removeDuplicates 2019-06-12 19:48:32 +02:00
Gwendal Roué bec731d763 Rename file 2019-06-12 19:40:07 +02:00
Gwendal Roué b0be32be71 Merge branch 'development' into dev/SQLite-3.28.0 2019-06-12 19:09:40 +02:00
Gwendal Roué d774d353e7 Upgrade swiftlyfalling/SQLiteLib 2019-06-12 19:09:19 +02:00
Gwendal Roué 44138c433f Refactor ValueObservation scheduling 2019-06-11 21:45:27 +02:00
Gwendal Roué f502db40b0 combine instance method 2019-06-10 23:24:02 +02:00
Gwendal Roué 86f7ab74a7 More ValueReducers namespacing 2019-06-10 22:18:20 +02:00
Gwendal Roué cea22f261e observationForCount, observationForAll, observationForFirst documentation 2019-06-10 20:19:08 +02:00
Gwendal Roué da34694663 observationForCount, observationForAll, observationForFirst 2019-06-10 20:19:00 +02:00
Gwendal Roué 085fd13ef6 CHANGELOG 2019-06-09 12:05:05 +02:00
Gwendal Roué 50c9792eb2 Merge pull request #546 from openbitapp/master
fix errors for Xcode 11 beta
2019-06-09 11:57:59 +02:00
Gwendal Roué 795056a3b6 Restore swift-tools-version:4.2 2019-06-09 11:47:08 +02:00
Gwendal Roué aca4db2c96 Move reducers to the ValueReducers namespace 2019-06-09 11:43:44 +02:00
Gwendal Roué cdec1a4318 Remove ImmediateValueReducer 2019-06-09 11:43:21 +02:00
Gwendal Roué 3971058dd8 Hide request from DatabaseValue reducers 2019-06-08 17:28:01 +02:00
Roberto Casula b6f988194c fix errors for Xcode 11 beta 2019-06-08 15:46:48 +02:00
Gwendal Roué ad24bd8021 RawValueReducer is an ImmediateValueReducer 2019-06-08 14:07:29 +02:00
Gwendal Roué 096096684e SPM requires Swift 5: don't test Xcode 10.1 and 10 2019-06-07 07:35:00 +02:00
Gwendal Roué 038a8d2d88 SPM requires Swift 5 2019-06-06 21:06:43 +02:00
Gwendal Roué 5abd21fa4a swift-tools-version:5.0 2019-06-06 21:01:52 +02:00
Gwendal Roué a80d6731a8 swift-tools-version:5.0 2019-06-06 20:57:08 +02:00
Gwendal Roué e7ed67d41d Introduce ImmediateValueReducer 2019-06-06 20:05:25 +02:00
Gwendal Roué da042eaae9 Clean up ValueObservation fetching system 2019-06-06 19:56:41 +02:00
Gwendal Roué 416d2cae1e Make sure ValueObservation.combine results can be splatted 2019-06-06 19:08:22 +02:00
Gwendal Roué ac85ffff84 Database.readOnly is reentrant 2019-06-06 18:58:44 +02:00
Gwendal Roué e3d2559b9d Add tests for combining up to 8 ValueObservation 2019-06-05 08:58:42 +02:00
Gwendal Roué c1a926e6dc Combine up to 8 ValueObservation 2019-06-05 08:39:38 +02:00
Gwendal Roué b31f46cbc0 Cleanup 2019-06-05 08:31:20 +02:00
Gwendal Roué 6b236ceb5c Import ValueObservation combine reducers from #541 2019-06-05 08:14:36 +02:00
Gwendal Roué 30812792df Merge branch 'development' into dev/SQLite-3.28.0
# Conflicts:
#	CHANGELOG.md
2019-06-04 18:46:07 +02:00
Gwendal Roué c1cbe51747 Merge pull request #542 from groue/dev/FetchRequest-cleanup
Move eager loading of hasMany associations to FetchRequest
2019-06-04 18:41:27 +02:00
Gwendal Roué 1416c6e179 CHANGELOG 2019-06-01 17:20:20 +02:00
Gwendal Roué 91ff9ce0b8 Documentation 2019-06-01 17:16:04 +02:00
Gwendal Roué 5099305257 Documentation 2019-06-01 17:11:09 +02:00
Gwendal Roué 92c13c3ea8 Documentation 2019-06-01 17:01:42 +02:00
Gwendal Roué 872f394339 Move eager loading of hasMany associations to FetchRequest 2019-06-01 16:08:05 +02:00
Gwendal Roué deaf60263d TODO 2019-05-31 08:44:54 +02:00
Gwendal Roué 7e53901544 New example of record definition 2019-05-31 08:19:25 +02:00
Gwendal Roué ce95590b8a New example of record definition 2019-05-31 07:59:33 +02:00
Gwendal Roué c42cf38fc2 TODO 2019-05-30 20:32:18 +02:00
Gwendal Roué dc4a66fe2c Changelog 2019-05-30 14:10:47 +02:00
Gwendal Roué c9ab5eb551 Update SQLite version in documentation 2019-05-30 14:10:40 +02:00
Gwendal Roué 4e33b06f0b Wait for https://github.com/swiftlyfalling/SQLiteLib/pull/41 to be merged 2019-05-30 14:03:30 +02:00
Gwendal Roué ff45864454 Merge pull request #539 from groue/dev/JoinableRequest
Expose joining methods of both requests and associations
2019-05-30 08:50:05 +02:00
Gwendal Roué fb3c722724 Merge branch 'development' into dev/JoinableRequest
# Conflicts:
#	CHANGELOG.md
2019-05-29 20:04:54 +02:00
Gwendal Roué 6c93e1509d Merge pull request #538 from Timac/#530
Add FAQ to clarify "Wrong number of statement arguments" error with "like '%?%'"
2019-05-29 19:59:27 +02:00
Gwendal Roué 0680e5abd7 Thank you notice 2019-05-29 19:55:32 +02:00
Gwendal Roué aefaa86302 CHANGELOG 2019-05-29 19:54:40 +02:00
Gwendal Roué ed509c5349 Merge branch 'development' into #530 2019-05-29 19:50:40 +02:00
Gwendal Roué 0232c8e792 Slight rewriting: focus on what's wrong, and provide a single fix because choices are complicated 2019-05-29 19:48:33 +02:00
Gwendal Roué cba1113a03 Wording 2019-05-29 19:27:04 +02:00
Gwendal Roué 1b4c3808d1 CHANGELOG 2019-05-29 19:23:09 +02:00
Gwendal Roué ac583e8fdf Fix link 2019-05-29 19:18:23 +02:00
Gwendal Roué fff7d1c49e Rewrite the request chapter 2019-05-29 19:17:09 +02:00
Gwendal Roué 0fe96619bf Layout 2019-05-29 14:13:04 +02:00
Gwendal Roué 0440736f3b The case of singletons 2019-05-29 14:08:48 +02:00
Gwendal Roué 35e1aeb7a8 The case of singletons 2019-05-29 14:07:03 +02:00
Gwendal Roué 8fe3b18121 Remove ambiguity 2019-05-29 14:00:22 +02:00
Gwendal Roué 26259ef0f9 didInsert(with:for:) is not always well understood 2019-05-29 13:58:56 +02:00
Gwendal Roué fb9244e5bb Foster DerivableRequest in GoodPracticesForDesigningRecordTypes.md 2019-05-29 13:48:06 +02:00
Gwendal Roué 03d9727f61 Add tests for joining methods added on DerivableRequest 2019-05-29 09:00:28 +02:00
Gwendal Roué e7a590b82b Extract joining methods to the JoinableRequest protocol 2019-05-29 08:36:55 +02:00
Gwendal Roué 1b5e94a050 Merge branch 'master' into development 2019-05-29 08:14:44 +02:00
Alexandre Colucci 3669fadecb Provide one example that lets Swift build the pattern and an example with the query interface. Then provide the second approach using the || operator. 2019-05-28 22:53:33 +02:00
Alexandre Colucci 7ed4b799b7 Use an SQLite query with the correct GRDB style 2019-05-28 22:51:29 +02:00
Alexandre Colucci bba9d42433 Remove the line "[? as a parameter]" in the "Good to Know" section 2019-05-28 22:41:28 +02:00
Gwendal Roué 6a5d3fe85b Update the List of Record Methods 2019-05-28 20:15:09 +02:00
Gwendal Roué 957d7b4c86 Update the List of Record Methods 2019-05-28 20:11:51 +02:00
Gwendal Roué 2dd5058878 Update the List of Record Methods 2019-05-28 19:46:21 +02:00
Gwendal Roué a02bbc5748 Update the List of Record Methods 2019-05-28 19:43:15 +02:00
Gwendal Roué bef13a7d0e Update the List of Record Methods 2019-05-28 19:41:51 +02:00
Gwendal Roué b0e140d4bb Add two safety tests for parenthesis 2019-05-28 08:03:33 +02:00
Alexandre Colucci ca9ecd7f66 #530: Wrong number of statement arguments with "like '%?%'"
- Rewrite the paragraph as an FAQ
- Explicitly mention the error "Wrong number of statement arguments" and give an example causing such issue.
- Improve the wording and add a link to the SQLite documentation
2019-05-27 21:22:55 +02:00
Gwendal Roué 4729405625 Merge branch 'master' into development 2019-05-27 18:24:03 +02:00
Gwendal Roué 7d92c665f0 Update link to migration guide 2019-05-27 18:23:37 +02:00
Gwendal Roué 4f4a5d92c7 Merge pull request #537 from groue/dev/remove-parenthesis
Remove useless parenthesis from generated SQL
2019-05-27 12:29:15 +02:00
Gwendal Roué 5bb54f0049 Less parenthesis in SQL interpolation 2019-05-27 07:59:11 +02:00
Gwendal Roué 543dfe9e69 CHANGELOG 2019-05-26 22:03:08 +02:00
Gwendal Roué 8b8722f376 Document that generated SQL can change without notice 2019-05-26 21:57:19 +02:00
Gwendal Roué 1d75863c9a Also turn SQLAssociationCondition SQL expression into an array 2019-05-26 21:46:19 +02:00
Gwendal Roué 6fa452b68c Fix joined(operator:) 2019-05-26 20:46:11 +02:00
Gwendal Roué ab000d7a4f Remove useless expression parenthesis from SQL 2019-05-26 20:08:13 +02:00
Gwendal Roué 680f3ad20c Nicer WHERE, HAVING and ON output 2019-05-26 15:32:00 +02:00
Gwendal Roué b6b1f9b3e8 Remove useless comment 2019-05-26 07:33:38 +02:00
Gwendal Roué 05a547f2df Fix typo 2019-05-26 07:21:36 +02:00
Gwendal Roué 1602a37d08 Small improvement 2019-05-26 06:22:28 +02:00
Gwendal Roué 49a7b2091c v4.0.1 2019-05-25 23:16:00 +02:00
Gwendal Roué bf94fc168e Merge pull request #534 from groue/dev/cocoapods-1.7.0
Support for CocoaPods 1.7.0
2019-05-25 23:09:08 +02:00
Gwendal Roué d2aea2e3a7 Wording 2019-05-25 20:20:03 +02:00
Gwendal Roué 0159d75b38 Wording 2019-05-25 20:10:43 +02:00
Gwendal Roué c8755a91e8 Wording 2019-05-25 20:01:25 +02:00
Gwendal Roué b0e4f286cb Wording 2019-05-25 19:59:58 +02:00
Gwendal Roué f641e2fc39 A wild comparison 2019-05-25 19:39:13 +02:00
Gwendal Roué 1402100d26 Link Good Practices for Designing Record Types from Why Adopt GRDB? 2019-05-25 19:03:31 +02:00
Gwendal Roué eda36829d0 CHANGELOG 2019-05-25 18:56:36 +02:00
Gwendal Roué 48017b2de2 Update tests for GRDB/SQLCipher 2019-05-25 18:55:09 +02:00
Gwendal Roué 862886fa0a Use CocoaPods 1.7.0 on Travis 2019-05-25 18:55:09 +02:00
Gwendal Roué 68221af5c3 Podspec swift_versions = ['4.2', '5'] 2019-05-25 18:55:09 +02:00
Gwendal Roué b3e547a347 Merge pull request #535 from groue/dev/record-good-practices
Update the Good Practices for Designing Record Types
2019-05-25 18:53:39 +02:00
Gwendal Roué 498c153be1 CHANGELOG 2019-05-25 18:50:28 +02:00
Gwendal Roué 7ed8168f11 Wording 2019-05-25 18:32:23 +02:00
Gwendal Roué 547fc98358 Wording 2019-05-25 18:28:28 +02:00
Gwendal Roué 6397d5757e Wording 2019-05-25 18:26:07 +02:00
Gwendal Roué 6d71f8b17c Relationship between view controllers and database managers 2019-05-25 18:18:53 +02:00
Gwendal Roué cafb329d6e Link to conventions 2019-05-25 17:44:42 +02:00
Gwendal Roué 071fdd3711 Improve Good Practices for Designing Record Types 2019-05-25 17:15:34 +02:00
Gwendal Roué 0cca73cdfc CHANGELOG 2019-05-25 08:41:23 +02:00
Gwendal Roué 31e59f3968 Merge pull request #533 from groue/dev/fix-has-many-through
Fix eager loading of HasManyThrough associations
2019-05-25 08:37:07 +02:00
Gwendal Roué d6e0dcafcb Fix two README typos 2019-05-25 08:35:56 +02:00
Gwendal Roué 203130da31 Test that merging of HasManyThrough happens on the pivot key 2019-05-24 19:02:15 +02:00
Gwendal Roué af4a83115b Ttest for parallel inclusion of hasManyThrough(_, through: hasOne, via: hasMany) 2019-05-24 18:56:54 +02:00
Gwendal Roué 0ad7d5e894 Fix failing test for parallel inclusion of hasManyThrough(_, through: belongsTo, via: hasMany) 2019-05-24 13:18:00 +02:00
Gwendal Roué 6e7a923d6e Failing test for parallel inclusion of hasManyThrough(_, through: belongsTo, via: hasMany) 2019-05-24 13:17:47 +02:00
Gwendal Roué d7d3f87921 Merge pull request #479 from groue/GRDB-4.0
GRDB 4.0
2019-05-23 19:39:32 +02:00
Gwendal Roué 3e7df8c774 Update badge name 2019-05-23 19:34:38 +02:00
Gwendal Roué db4598d881 performance tests update 2019-05-23 19:26:30 +02:00
Gwendal Roué 60312f63d7 v4.0.0 2019-05-23 18:56:22 +02:00
Gwendal Roué f54297d488 Make it possible to build GRDBDemo app on a (my) device 2019-05-23 14:21:59 +02:00
Gwendal Roué 4368c529fa Realm 3.15.0 2019-05-23 13:49:01 +02:00
Gwendal Roué bf40e77d9c stephencelis/SQLite.swift 0.12.0 2019-05-23 13:38:25 +02:00
Gwendal Roué 4ce4b2e0d1 Performance tests: updates for Swift 5.0.1 2019-05-23 13:36:51 +02:00
Gwendal Roué a3c86e343b Less @inlinable methods 2019-05-23 13:27:23 +02:00
Gwendal Roué 962ab13da9 TODO 2019-05-23 13:13:26 +02:00
Gwendal Roué 4085050e96 API diff 2019-05-23 08:56:26 +02:00
Gwendal Roué a80a2571f6 API diff 2019-05-23 08:52:34 +02:00
Gwendal Roué 2a43377079 API diff 2019-05-23 08:48:43 +02:00
Gwendal Roué 2a0bd93795 API diff 2019-05-23 08:42:31 +02:00
Gwendal Roué 05747a62ea API diff 2019-05-23 08:29:08 +02:00
Gwendal Roué e201dd21ac Enhance Inflections setup APIs 2019-05-23 08:23:30 +02:00
Gwendal Roué c04f3c7faa API diff 2019-05-23 07:34:17 +02:00
Gwendal Roué 83409e3dec API diff 2019-05-23 07:33:35 +02:00
Gwendal Roué def9997698 Reduce Travis coverage 2019-05-23 07:25:43 +02:00
Gwendal Roué bb7f4b2f86 Documentation diff 2019-05-22 23:35:26 +02:00
Gwendal Roué ee703142ce CHANGELOG 2019-05-22 23:16:59 +02:00
Gwendal Roué 324db50668 API diff 2019-05-22 23:04:21 +02:00
Gwendal Roué 2e84e11bfa API diff 2019-05-22 22:59:52 +02:00
Gwendal Roué 6062beb9f4 API diff 2019-05-22 22:58:05 +02:00
Gwendal Roué 1d8c924c4e API diff 2019-05-22 22:57:31 +02:00
Gwendal Roué 8b35343f3d API diff 2019-05-22 22:56:22 +02:00
Gwendal Roué 35ead1d4c1 API diff 2019-05-22 22:50:23 +02:00
Gwendal Roué 2c3e639f39 API diff 2019-05-22 22:49:28 +02:00
Gwendal Roué 0f9fb9a3e0 API diff 2019-05-22 22:48:27 +02:00
Gwendal Roué 567547a205 API diff 2019-05-22 22:44:54 +02:00
Gwendal Roué 9a28c0ae03 Fix a decoding error diagnostic 2019-05-22 22:28:13 +02:00
Gwendal Roué 82ccc121dd Cleanup 2019-05-22 22:25:24 +02:00
Gwendal Roué 472063c7c1 API diff 2019-05-22 22:25:15 +02:00
Gwendal Roué f23e41a866 Fix wrong Columns enums 2019-05-22 20:28:07 +02:00
Gwendal Roué faae864699 Query Interface code organization 2019-05-22 20:13:33 +02:00
Gwendal Roué d2b9137548 Stop fostering CodingKeys that adopt ColumnExpression. Expose Column(CodingKey) initializer instead 2019-05-22 13:42:26 +02:00
Gwendal Roué dec80ac300 Give a default name to the isEmpty aggregate 2019-05-22 13:19:47 +02:00
Gwendal Roué b471488a83 Documentation 2019-05-22 09:08:52 +02:00
Gwendal Roué 21d2df9ade New SQL interpolation "... \(tableOf: record) ..." (addresses #524) 2019-05-22 08:53:50 +02:00
Gwendal Roué 7461342089 Fix doc: Record Comparison only requires EncodableRecord conformance 2019-05-22 08:40:03 +02:00
Gwendal Roué e4498b2784 contains operator generates SQL equality test when collection contains a single element 2019-05-22 08:13:42 +02:00
Gwendal Roué 2734bd1266 Fix for Swift 4.2 2019-05-21 23:14:52 +02:00
Gwendal Roué 77a677296b Migration guide menu 2019-05-21 20:41:39 +02:00
Gwendal Roué c90560fda9 Documentation 2019-05-21 20:35:13 +02:00
Gwendal Roué f5be0e176d Fix failing test for observation of QueryInterfaceRequest with prefetched rows 2019-05-21 20:27:08 +02:00
Gwendal Roué 9691adc0bb Failing test for observation of QueryInterfaceRequest with prefetched rows 2019-05-21 20:26:30 +02:00
Gwendal Roué b1c953c536 Better error reporting for missing scopes or prefetched rows 2019-05-21 19:56:55 +02:00
Gwendal Roué 059ae19974 QueryInterfaceRequest unconditionnally conforms to TableRequest 2019-05-21 19:18:26 +02:00
Gwendal Roué 65c6360d0c Fix typo and add a TODO 2019-05-21 19:02:01 +02:00
Gwendal Roué 25526472b3 Test Xcode 10.2 with Travis 2019-05-21 09:01:51 +02:00
Gwendal Roué a4a26e01e7 SelectionRequest.annotated(with:) 2019-05-21 08:05:07 +02:00
Gwendal Roué e163b91cf0 Merge pull request #525 from groue/feature/including-all
Eager Loading of HasMany associations
2019-05-21 07:35:03 +02:00
Gwendal Roué c19b3ad305 Documentation 2019-05-20 20:19:30 +02:00
Gwendal Roué 6628c09db7 Documentation 2019-05-20 20:17:34 +02:00
Gwendal Roué 7674f2f522 Association prefetching: add support for composite foreign keys 2019-05-20 19:35:50 +02:00
Gwendal Roué c841120d3b Cleanup 2019-05-20 19:18:27 +02:00
Gwendal Roué 81476e58b8 Improve SQLAssociationKey documentation 2019-05-20 19:03:57 +02:00
Gwendal Roué 69baff31ef Remove a hack: merging hasMany and hasManyThrough with include(all:) is simply not supported yet 2019-05-20 19:03:43 +02:00
Gwendal Roué 6f6a8e3c3b Migration Guide: Associations 2019-05-20 14:31:55 +02:00
Gwendal Roué 403e5ab058 Fix SPM tests 2019-05-20 14:29:54 +02:00
Gwendal Roué bc1e74a73e Migration Guide: Associations 2019-05-20 14:25:56 +02:00
Gwendal Roué 1fdd0bc428 Migration Guide: fix links 2019-05-20 14:22:27 +02:00
Gwendal Roué 940e9c3871 Migration Guide: Associations 2019-05-20 14:21:29 +02:00
Gwendal Roué 844fb3ca8b Fix iOS9 test 2019-05-20 12:15:50 +02:00
Gwendal Roué 721fd52d12 Association documentation 2019-05-20 11:56:49 +02:00
Gwendal Roué 85a86424c9 Association documentation 2019-05-20 11:54:49 +02:00
Gwendal Roué 7d4306d383 Association documentation 2019-05-20 11:53:42 +02:00
Gwendal Roué 96780419e9 Association documentation 2019-05-20 11:50:15 +02:00
Gwendal Roué 332f42bba3 English table names is recommended 2019-05-20 11:46:48 +02:00
Gwendal Roué bab21d4c59 CHANGELOG 2019-05-20 08:14:05 +02:00
Gwendal Roué 2c7b3e7667 Association documentation 2019-05-20 07:55:59 +02:00
Gwendal Roué 30839bd19d Association documentation 2019-05-20 07:54:36 +02:00
Gwendal Roué 304fdabd88 Association documentation 2019-05-20 07:31:27 +02:00
Gwendal Roué fde53b13c6 Association documentation 2019-05-20 07:28:59 +02:00
Gwendal Roué 62557343a1 Restore the Convention for Database Table Names chapter 2019-05-20 07:25:43 +02:00
Gwendal Roué 4b565ae262 Association documentation 2019-05-20 06:22:07 +02:00
Gwendal Roué 64bcbde1ab Association documentation 2019-05-20 06:17:30 +02:00
Gwendal Roué 76891a351d Association documentation 2019-05-20 06:14:35 +02:00
Gwendal Roué b29b5215b9 Character.uppercased() and lowercased() come with the Swiift 5 compiller 2019-05-20 06:12:51 +02:00
Gwendal Roué 507d603a4e At last 2019-05-19 23:44:27 +02:00
Gwendal Roué a38850ab00 Association documentation 2019-05-19 23:40:34 +02:00
Gwendal Roué 6af4b180df Association documentation 2019-05-19 23:31:54 +02:00
Gwendal Roué 8f3036b090 Association documentation 2019-05-19 22:42:38 +02:00
Gwendal Roué 8fd4108463 Association documentation 2019-05-19 22:11:30 +02:00
Gwendal Roué 40260c2316 Association documentation 2019-05-19 20:59:16 +02:00
Gwendal Roué 7268085692 Association documentation 2019-05-19 20:54:14 +02:00
Gwendal Roué 5f3b879efd Association documentation and tests 2019-05-19 20:27:13 +02:00
Gwendal Roué 5b15a88974 Fix HasManyThrough row scopes 2019-05-19 19:59:28 +02:00
Gwendal Roué 95c7c10f35 Association documentation 2019-05-19 19:06:37 +02:00
Gwendal Roué d5943962b3 Documentation: associations no longer need a convention for database table names 2019-05-19 18:58:38 +02:00
Gwendal Roué ada6002c91 Cleanup 2019-05-19 18:50:13 +02:00
Gwendal Roué 09afd2fadf Tests for singularization of hasMany relationship 2019-05-19 18:20:55 +02:00
Gwendal Roué 4f17444a7e Cleanup 2019-05-19 17:38:15 +02:00
Gwendal Roué 87b77768ec Documentation 2019-05-19 17:18:37 +02:00
Gwendal Roué fe0198f453 Cleanup 2019-05-19 16:22:39 +02:00
Gwendal Roué ae6a224122 Documentation 2019-05-19 16:08:29 +02:00
Gwendal Roué 73773358c9 Tests for non-inflected singular 2019-05-19 16:06:36 +02:00
Gwendal Roué 8e2a8fe9d8 More Associations and inflections 2019-05-19 15:03:54 +02:00
Gwendal Roué a1b0baaca9 leaf, foot, hero 2019-05-19 13:55:38 +02:00
Gwendal Roué 15dd4fc477 Inflections Cleanup 2019-05-19 13:36:29 +02:00
Gwendal Roué 52add837e5 More inflections 2019-05-19 13:06:56 +02:00
Gwendal Roué 637c94b265 Pluralize/Singularize last word 2019-05-19 08:38:11 +02:00
Gwendal Roué ca76032b8b Association name is turned into singularized or pluralized keys 2019-05-19 07:33:18 +02:00
Gwendal Roué 35027a825f Add Rails license 2019-05-18 20:19:18 +02:00
Gwendal Roué 98a7f94248 Cleanup 2019-05-18 20:09:03 +02:00
Gwendal Roué cdcaaa4b77 Irregularity 2019-05-18 19:49:30 +02:00
Gwendal Roué d2c33715d0 String.pluralized, String.singularized 2019-05-18 19:48:51 +02:00
Gwendal Roué 5113d08ce3 AssociationPrefetchingSQLTests: no need for association keys 2019-05-18 16:02:00 +02:00
Gwendal Roué cd53e0102b Simplify PrefetchedRowsDecoder 2019-05-18 15:53:06 +02:00
Gwendal Roué c95e9fafb1 Cleanup 2019-05-18 15:43:57 +02:00
Gwendal Roué 1a368d30b0 Cleanup 2019-05-18 15:03:17 +02:00
Gwendal Roué ebd393f52a Cleanuo 2019-05-18 14:18:35 +02:00
Gwendal Roué 27cbe18c51 Pass tests for database region of prefetching requests 2019-05-18 14:09:00 +02:00
Gwendal Roué 670bca00b0 Failing tests for database region of prefetching requests 2019-05-17 18:23:28 +02:00
Gwendal Roué 2a85d89364 Cleanup 2019-05-17 18:16:01 +02:00
Gwendal Roué c5ac0ea941 Cleanup 2019-05-17 18:13:32 +02:00
Gwendal Roué d23f4c3ac7 Prevent fetching cursor of prefetched rows with a "Not implemented" fatal error 2019-05-17 18:10:26 +02:00
Gwendal Roué 604a51bb79 Cleanup 2019-05-17 17:58:57 +02:00
Gwendal Roué 3786482368 Add unordered() to OrderedRequest 2019-05-17 17:53:25 +02:00
Gwendal Roué f98502a136 Association: remove pivot/destination relation ambiguity 2019-05-17 17:24:02 +02:00
Gwendal Roué 7703741f25 Cleanup 2019-05-17 17:10:26 +02:00
Gwendal Roué 5f36b43441 Tests for Row.debugDescription with prefetched rows 2019-05-17 16:55:25 +02:00
Gwendal Roué eb977e9391 Make Row.PrefetchedView order predictible 2019-05-17 16:53:43 +02:00
Gwendal Roué ad1bdd7f01 Rename Row.prefetches to Row.prefetchedRows 2019-05-17 14:08:33 +02:00
Gwendal Roué c1ed3aa094 Better error messages 2019-05-17 13:46:54 +02:00
Gwendal Roué 901015368c Failing tests for copied prefetched rows 2019-05-17 13:42:58 +02:00
Gwendal Roué ae18041861 Pass tests for prefetched rows and equality check 2019-05-17 08:58:35 +02:00
Gwendal Roué a6d348fc57 Failing tests for prefetched rows and equality check 2019-05-17 08:58:29 +02:00
Gwendal Roué 70b948b1c8 Row subscript accepts any RangeReplaceableCollection 2019-05-16 22:30:35 +02:00
Gwendal Roué 8038a9db05 Tests for consumption of prefetched rows into sets 2019-05-16 22:21:52 +02:00
Gwendal Roué 3337e49f64 Tests for consumption of prefetched rows into FetchableRecord 2019-05-16 22:02:02 +02:00
Gwendal Roué 67ec70a117 Row prefetch subscript 2019-05-16 22:00:30 +02:00
Gwendal Roué c4be3e527d Split AssociationPrefetchingTests.swift 2019-05-16 20:35:03 +02:00
Gwendal Roué f5177a5612 Cleanup 2019-05-16 19:54:00 +02:00
Gwendal Roué d18c00231e Remove Swift 5 migration warning 2019-05-16 19:44:56 +02:00
Gwendal Roué 644064aa08 More tests for consumption of prefetched rows into Decodable records 2019-05-16 19:44:43 +02:00
Gwendal Roué 881bb45fae More tests for consumption of prefetched rows into Decodable records 2019-05-16 19:35:24 +02:00
Gwendal Roué 46b7618f38 More tests for consumption of prefetched rows into Decodable records 2019-05-16 19:21:12 +02:00
Alexandre Colucci 490a124cbf #530: Wrong number of statement arguments with "like '%?%'"
Add "? as a parameter" in the "Good to Know" section to explain how to build like pattern like '%?%'.
2019-05-14 08:59:41 +02:00
Gwendal Roué a7ea0913fa Fix SPM 2019-05-08 07:59:34 +02:00
Gwendal Roué c0616c6a26 More tests for consumption of prefetched rows into Decodable records 2019-05-07 08:37:39 +02:00
Gwendal Roué 9fc5cda92b Rename PrefetchesTreeView to PrefetchesView 2019-05-06 08:19:12 +02:00
Gwendal Roué 1c47f01e9a More tests for consumption of prefetched rows into Decodable records 2019-05-05 22:47:16 +02:00
Gwendal Roué 04ffc71dbb TODO 2019-05-05 22:35:37 +02:00
Gwendal Roué 2634a0918d More tests for consumption of prefetched rows into Decodable records 2019-05-05 22:00:41 +02:00
Gwendal Roué c7fed1c0b3 More tests for consumption of prefetched rows into Decodable records 2019-05-05 21:20:10 +02:00
Gwendal Roué 17e8df2d25 Tests for consumption of prefetched rows into Decodable records 2019-05-05 21:09:23 +02:00
Gwendal Roué 8786a60d31 More tests for consumption of prefetched rows 2019-05-05 20:31:56 +02:00
Gwendal Roué acb7432610 TODO 2019-05-05 20:23:23 +02:00
Gwendal Roué 560676a4bb More tests for consumption of prefetched rows 2019-05-05 19:54:15 +02:00
Gwendal Roué a45065c340 Fix failing tests for consumption of prefetched rows 2019-05-05 19:31:43 +02:00
Gwendal Roué bd0884503e Failing tests for consumption of prefetched rows 2019-05-05 18:19:19 +02:00
Gwendal Roué f6b2c7e9f3 More tests for consumption of prefetched rows 2019-05-05 17:46:05 +02:00
Gwendal Roué 814ed0e4f1 Fix failing tests for consumption of prefetched rows 2019-05-05 17:44:11 +02:00
Gwendal Roué 5eff7755fe More tests for consumption of prefetched rows 2019-05-05 17:37:05 +02:00
Gwendal Roué b1bcf637ab Fix failing tests for consumption of prefetched rows 2019-05-05 17:25:17 +02:00
Gwendal Roué f199dc3cbe Rubber duck debugging 2019-05-05 16:36:56 +02:00
Gwendal Roué 40b11f9f2f TODO: light HasManyThrough 2019-05-05 16:36:22 +02:00
Gwendal Roué 8f678c94cc Failing tests for consumption of prefetched rows 2019-05-05 16:03:10 +02:00
Gwendal Roué 171cdcb36e More tests for consumption of prefetched rows 2019-05-05 15:37:25 +02:00
Gwendal Roué 1dce152f95 Introduce Row.prefetchTree 2019-05-05 15:26:40 +02:00
Gwendal Roué 90dd8d19bc More tests for consumption of prefetched rows 2019-05-05 15:10:55 +02:00
Gwendal Roué efe89f000d More tests for consumption of prefetched rows 2019-05-05 14:52:54 +02:00
Gwendal Roué 590f6c2b2a More tests for consumption of prefetched rows 2019-05-05 14:23:45 +02:00
Gwendal Roué 623f2eaf43 First tests for consumption of prefetched rows 2019-05-05 13:54:55 +02:00
Gwendal Roué 8d759898d3 Cleanup 2019-05-04 23:07:45 +02:00
Gwendal Roué 5fb6c40036 Almost ready to use prefetched rows 2019-05-04 22:54:10 +02:00
Gwendal Roué 91ec3bada3 Group prefetched rows 2019-05-04 22:29:07 +02:00
Gwendal Roué 217b7eee9f AssociationHasManyPrefetchingSQLTests cleanup 2019-05-04 22:04:22 +02:00
Gwendal Roué f1522c09b5 AssociationHasManyPrefetchingSQLTests cleanup 2019-05-04 22:00:37 +02:00
Gwendal Roué b00271ad80 AssociationHasManyPrefetchingSQLTests cleanup 2019-05-04 21:45:29 +02:00
Gwendal Roué d7b4cf364d More passing prefetch tests 2019-05-04 21:35:06 +02:00
Gwendal Roué 7ef5669710 More passing prefetch tests 2019-05-04 21:28:59 +02:00
Gwendal Roué 73d622a074 Don't prefetch when there is no row 2019-05-04 21:28:47 +02:00
Gwendal Roué ce782cecac More passing prefetch tests 2019-05-04 21:04:55 +02:00
Gwendal Roué a7431403a5 AssociationHasManyPrefetchingSQLTests cleanup 2019-05-04 20:39:56 +02:00
Gwendal Roué 4b82656d3a More passing prefetch tests 2019-05-04 17:20:56 +02:00
Gwendal Roué 2ca2f11883 First prefetch and passing tests 2019-05-04 17:02:19 +02:00
Gwendal Roué 1fbe7cfecf Type constraint: check Row equality, not subtyping 2019-05-04 17:01:23 +02:00
Gwendal Roué 331938c647 More including(all:) 2019-05-04 15:48:58 +02:00
Gwendal Roué 995657108d Not all relation children impact parent's count 2019-05-04 14:34:49 +02:00
Gwendal Roué f6a5279ac9 Use "join" for actual SQL joins, and refactor SQLRelation around "children" 2019-05-04 14:15:53 +02:00
Gwendal Roué a88f20fb50 Introduce including(all:) 2019-05-04 12:24:43 +02:00
Gwendal Roué cfb1b2fc4d QueryInterfaceRequest is not a FetchRequest like others: it will prefetch 2019-05-04 12:20:36 +02:00
Gwendal Roué 0e2daff329 More Association cleanup 2019-05-04 12:17:47 +02:00
Gwendal Roué 18bd025e1c SQLAssociation clarification 2019-05-03 20:32:21 +02:00
Gwendal Roué dd87a8d42c SQLAssociation clarification 2019-05-03 20:16:05 +02:00
Gwendal Roué 96c10f017e TODO 2019-05-02 20:38:24 +02:00
Gwendal Roué 95ccb511db Fix typo 2019-05-02 20:38:15 +02:00
Gwendal Roué 820db3f07d Refactor SQLAssociation
# Conflicts:
#	GRDB/QueryInterface/Association/Association.swift
2019-05-02 20:34:10 +02:00
Gwendal Roué 1317dc5db0 Fix typo 2019-04-28 16:34:45 +02:00
Gwendal Roué 76971c44f6 Merge pull request #521 from groue/feature/join-condition-cleanup
Associations: join condition cleanup
2019-04-28 16:29:58 +02:00
Gwendal Roué 708538bcf0 Refactor join conditions 2019-04-28 14:46:20 +02:00
Gwendal Roué 1e3de49251 Rename SQLJoin.Condition to SQLJoinCondition 2019-04-28 13:25:56 +02:00
Gwendal Roué 73f4a9fb23 whitespace 2019-04-28 13:23:53 +02:00
Gwendal Roué aec26c66be Merge pull request #519 from Lutzifer/patch-1 2019-04-26 12:06:56 +02:00
Wolfgang Lutz 8fcabb5b73 fix typos in documentation 2019-04-26 11:50:22 +02:00
Gwendal Roué 9090c54c93 Migrating From GRDB 3 to GRDB 4 2019-04-24 13:50:49 +02:00
Gwendal Roué 425debd0db Migrating From GRDB 3 to GRDB 4 2019-04-24 13:39:08 +02:00
Gwendal Roué f335005efd Migrating From GRDB 3 to GRDB 4 2019-04-24 13:30:55 +02:00
Gwendal Roué 8084e83760 Migrating From GRDB 3 to GRDB 4 2019-04-24 13:28:54 +02:00
Gwendal Roué bdbcf682c4 Merge pull request #517 from groue/SQLCipher-4
Support for SQLCipher 4
2019-04-22 17:03:01 +02:00
Gwendal Roué 29188a0606 CHANGELOG 2019-04-21 14:21:21 +02:00
Gwendal Roué fba553bbb9 Fix typo 2019-04-21 14:00:08 +02:00
Gwendal Roué 2932b72200 Update documentation for SQLCipher and raw SQLite pointers 2019-04-21 13:56:13 +02:00
Gwendal Roué e6bbdeab2c SQLCipher installation documentation 2019-04-21 13:51:03 +02:00
Gwendal Roué c37ccb6448 Test for PRAGMA cipher_compatibility 2019-04-21 13:46:05 +02:00
Gwendal Roué 330005596a Carthage: don't beat around the bush 2019-04-21 13:08:40 +02:00
Gwendal Roué a336cf6ca4 Drop obsolete documentation 2019-04-21 13:04:07 +02:00
Gwendal Roué 801e8bb23c Remove remaining references to Carthage 2019-04-21 13:03:28 +02:00
Gwendal Roué 235ce0aba2 Remove remaining references to GRDBCipher 2019-04-21 13:01:54 +02:00
Gwendal Roué 2a72d08334 Restore Database.logError 2019-04-21 12:59:12 +02:00
Gwendal Roué 6b04996290 Remove remaining references to GRDBCipher 2019-04-21 12:55:24 +02:00
Gwendal Roué d2b65d9fb8 Travis 2019-04-21 12:47:26 +02:00
Gwendal Roué 1b9a1d3e30 SQLCipher tests: don't sign code 2019-04-20 22:03:48 +02:00
Gwendal Roué 5730dd5414 Refactor Makefile and .travis.yml for new SQLCipher tests 2019-04-20 20:44:52 +02:00
Gwendal Roué 322039d490 Drop GRDBCipher project 2019-04-20 20:24:34 +02:00
Gwendal Roué c0c2a40c22 SQLCipher3 tests 2019-04-20 20:15:45 +02:00
Gwendal Roué 7d50825bff SQLCipher4 tests 2019-04-20 20:10:50 +02:00
Gwendal Roué da55d09960 Travis cleanup - and disable flaky Carthage test nobody cares about 2019-04-20 16:40:33 +02:00
Gwendal Roué f9b0af5f7b Remove obsolete make test_CocoaPodsLint_GRDBCipher 2019-04-20 16:24:14 +02:00
Gwendal Roué d1fa479b31 Ignore test Podfile.lock 2019-04-20 16:10:29 +02:00
Gwendal Roué 6b3f2e844c Fix make test_install_GRDBCipher_CocoaPods 2019-04-20 16:06:25 +02:00
Gwendal Roué 9370036baf make test_install_GRDBCipher is obsolete 2019-04-20 16:05:44 +02:00
Gwendal Roué 95274c57dd SQLCipher 4: adapt tests for past-error Cursor.next() 2019-04-20 15:32:01 +02:00
Gwendal Roué e55a5bd1d0 SQLCipher can't backup encrypted databases 2019-04-20 15:29:43 +02:00
Gwendal Roué 97173dea60 Fix Xcode 10.2.1 warnings 2019-04-20 14:49:43 +02:00
Gwendal Roué 7e3e91ac99 Update Makefile for SQLCipher via CocoaPods 2019-04-20 11:08:43 +02:00
Gwendal Roué 1c1ee4e92a GRDBCipher is no longer. Long live GRDB.swift/SQLCipher. 2019-04-19 13:11:55 +02:00
Gwendal Roué 1e06ff24ec cocoapods ~> 1.6 2019-04-19 08:49:24 +02:00
Gwendal Roué ba91a79798 Instruct Travis to honor Gemfile 2019-04-19 08:41:11 +02:00
Gwendal Roué 3c977d7bf8 Add cocapods to the Travis gems 2019-04-19 08:36:55 +02:00
Gwendal Roué 261e9481b2 Fix share schemes 2019-04-19 08:33:19 +02:00
Gwendal Roué 1f50b4fefe Integrate SQLCipher as a CocoaPod 2019-04-19 08:33:19 +02:00
Gwendal Roué cbb1b27830 Delete SQLCipher/src submodule 2019-04-19 08:33:19 +02:00
Gwendal Roué bdf8d0bcd5 Merge pull request #515 from alextrob/feature/fetchOne-limit-1
Add "LIMIT 1" to `fetchOne` requests
2019-04-18 07:04:56 +02:00
Gwendal Roué 5af1686677 Thank you notice 2019-04-18 07:02:42 +02:00
Gwendal Roué 2711b9bb04 Merge branch 'GRDB-4.0' into feature/fetchOne-limit-1 2019-04-18 07:01:03 +02:00
Gwendal Roué a172473e37 CHANGELOG 2019-04-17 21:35:23 +02:00
Gwendal Roué 3f8047fc0e Tests for the singleResult hint and SQLRequest.init(_:request:) 2019-04-17 21:32:47 +02:00
Gwendal Roué a12830050b Tests for the singleResult hint and databaseRegion 2019-04-17 21:32:13 +02:00
Gwendal Roué 21c0175a71 Tests for the singleResult hint and fetchCount 2019-04-17 21:31:53 +02:00
Gwendal Roué 65fe2bb50c Tests for the singleResult hint and fetching methods 2019-04-17 21:31:30 +02:00
Gwendal Roué e3a0935914 Add SQL tests for all record testFetchOne…() methods
We usually update all those tests together
2019-04-17 14:01:16 +02:00
Gwendal Roué 693e6da773 Do not test that fetchOne does not add LIMIT 1 to raw SQL requests
We do not add LIMIT 1 to raw SQL requests because it is difficult. But it would not be wrong to do so.
2019-04-17 13:08:51 +02:00
Gwendal Roué 4716f91d8b Bake the single result expectation right into filter(key:) methods
This better hides this flag inside SQLSelectQuery, and avoids explicit support from FetchableRecord and TableRecord
2019-04-16 08:47:50 +02:00
Gwendal Roué 46791c8f74 Remove QueryInterfaceRequest.init(query:) 2019-04-16 07:56:44 +02:00
Alex Robinson 1b3f0e8ece Update FetchRequest protocol in README 2019-04-16 11:11:37 +10:00
Alex Robinson e2211aca21 Exclude LIMIT 1 in more cases
Adds a flag to SQLSelectQuery indicating that it expects a single record (for example when querying by primary or unique key).

Ensures that this example doesn't add an unnecessary LIMIT 1 to the resulting query:

    let request = Player.filter(key: 123) // or Player.filter(key: ["email": "me@example.com"])
    let player = try dbQueue.read { db in try request.fetchOne(db) }
2019-04-16 11:10:43 +10:00
Alex Robinson 235a612ce0 Remove LIMIT 1 from expected SQL when filtering by key
Tests now fail
2019-04-16 10:29:40 +10:00
Alex Robinson 7070dedf1a Replace FetchRequestHint with a boolean for single results
Fixes previous test failure
2019-04-16 10:20:36 +10:00
Alex Robinson 20aecd5328 Add failing test for fetchOne with a non-zero offset 2019-04-16 10:20:36 +10:00
Gwendal Roué 1af55653d3 Fix typo 2019-04-13 17:06:41 +02:00
Gwendal Roué 9efc20fa51 Association: introduce request(for:) before using it 2019-04-13 13:55:15 +02:00
Gwendal Roué f847be98f5 Associations: aggregates are available on HasManyThrough, too 2019-04-13 13:48:12 +02:00
Gwendal Roué ff00dabcd1 Associations documentation 2019-04-13 13:46:28 +02:00
Gwendal Roué 72f00ccd9a Associations: delay introduction of request(for:) 2019-04-13 13:34:34 +02:00
Gwendal Roué 5995f468e3 Associations: improve "Required Protocols" chapter 2019-04-13 06:55:28 +02:00
Gwendal Roué 023afce21b Put #514 in TODO 2019-04-11 08:31:16 +02:00
Gwendal Roué 9b24671043 Disable #514 failing tests 2019-04-11 08:14:04 +02:00
Alex Robinson 088f6c92c7 Update inline docs 2019-04-11 13:50:57 +10:00
Alex Robinson 207b90f1b5 Update FetchRequest protocol in README 2019-04-11 13:27:32 +10:00
Alex Robinson dd139b6268 Fix testing lastSQLQuery when a cursor hasn't retrieved a record
This problem was masked by the fact all queries in the test expected the same SQL query.
2019-04-11 13:19:04 +10:00
Alex Robinson 072fa2583a Add hints for use in request preparation
Hints are ignored by SQLRequest. When you write raw SQL you probably don't want GRDB to modify your query.
2019-04-11 13:14:41 +10:00
Alex Robinson af1fd6b90c More tests for presence of LIMIT 1 2019-04-11 13:08:29 +10:00
Alex Robinson f9868bd8b5 Update tests to expect "LIMIT 1" where appropriate
Tests currently fail
2019-04-11 11:51:16 +10:00
Gwendal Roué 00ae2de14e Another failing test for #514 2019-04-10 19:54:44 +02:00
Gwendal Roué a6cbd242e6 Add a failing test forr #514 2019-04-10 19:29:50 +02:00
Gwendal Roué be950162d0 Merge pull request #508 from michaelkirk-signal/mkirk/GRDB-4.0-sqlcipher-cipher_compatibility
Allow Database Connection Configuration
2019-04-10 13:47:03 +02:00
Gwendal Roué db34d9537b Remove more useless failing tests 2019-04-10 07:49:06 +02:00
Gwendal Roué 1682df5c4e Thank you notice 2019-04-09 20:26:28 +02:00
Gwendal Roué 3ca7647110 Merge branch 'GRDB-4.0' into mkirk/GRDB-4.0-sqlcipher-cipher_compatibility
# Conflicts:
#	CHANGELOG.md
2019-04-09 20:25:22 +02:00
Gwendal Roué 2c4a449c5b Fix prepareDatabase sample code and markdown layout 2019-04-09 20:23:08 +02:00
Gwendal Roué 49d92dc6ce Three slashes for documentation comment 2019-04-09 20:21:34 +02:00
Gwendal Roué d52fcbe0c9 Fixits for Configuration.cipherPageSize and kdfIterations 2019-04-09 20:21:17 +02:00
Gwendal Roué 5bf54dc5c9 Update README for cipher_page_size and kdf_iter SQLCipher pragmas 2019-04-09 20:15:46 +02:00
Gwendal Roué 0a814ee1e7 CHANGELOG 2019-04-09 20:04:20 +02:00
Gwendal Roué 94316540de Remove useless failing tests
They were failing because database initialization now uses high level methods which throw detailed errors.
2019-04-09 20:01:22 +02:00
Gwendal Roué b67a53e645 whitespace 2019-04-09 19:57:22 +02:00
Gwendal Roué a0f37c6e85 Simplify Database.validateFormat() 2019-04-09 19:56:01 +02:00
Gwendal Roué 82dc51c554 Document prepareDatabase call site
Because it willl be easy to forget the context of #508 when we read this code in the future
2019-04-09 19:55:45 +02:00
Gwendal Roué 6115078e95 Simplify Database.validateSQLCipher() 2019-04-09 19:46:58 +02:00
Gwendal Roué 8d35330e12 whitespace 2019-04-09 19:40:27 +02:00
Gwendal Roué e0e07a7454 Merge pull request #510 from signalapp/charlesmchen/tableRegionVisibility
Expose DatabaseRegion(table:) initializer
2019-04-09 19:31:57 +02:00
Gwendal Roué 7a42bb42f5 README: make DatabaseRegion documentation less detailed 2019-04-09 19:29:38 +02:00
Gwendal Roué 212290bbf9 Make DatabaseRegion documentation less detailed 2019-04-09 19:23:50 +02:00
Gwendal Roué 6f20d8b406 CHANGELOG 2019-04-09 19:17:24 +02:00
Matthew Chen 0561b7de5d Respond to CR. 2019-04-05 09:50:07 -04:00
Matthew Chen 9f41277bd4 Make more DatabaseRegion initializers public; elaborate docs. 2019-04-05 09:47:08 -04:00
Matthew Chen 9f4cad4134 Make DatabaseRegion initializer public to enable observation of tables. 2019-04-05 09:47:08 -04:00
Gwendal Roué bf012614bc CHANGELOG and thank you notice 2019-04-05 07:49:16 +02:00
Gwendal Roué aeeb59601a Merge pull request #511 from signalapp/charlesmchen/fixPoolNotificationName
Fix notification name.
2019-04-05 07:43:02 +02:00
Michael Kirk 747a6352d6 example docs 2019-04-04 16:03:30 -06:00
Matthew Chen 325b376f4c Fix notification name. 2019-04-04 18:01:12 -04:00
Michael Kirk dcc3db2730 Revert "update sqlcipher"
This reverts commit 26b8682e63.
2019-04-04 15:57:21 -06:00
Michael Kirk 29c1c5481c inline setupConnection, re-order method calls to call validateFormat later, convert static->instance methods where possible 2019-04-04 15:55:53 -06:00
Michael Kirk ebc7a9d8e0 fix #if scope 2019-04-04 15:42:19 -06:00
Michael Kirk 99065a4faf prepareDB block 2019-04-02 10:47:31 -06:00
Michael Kirk 26b8682e63 update sqlcipher 2019-03-31 14:27:46 -06:00
Gwendal Roué d41f6b4466 Makefile: support for Xcode 10.2 2019-03-28 07:08:18 +01:00
Gwendal Roué bfa5fbe8ce Documentation tweaks 2019-03-20 16:50:03 +01:00
Gwendal Roué 900134729a Where has count(where:) gone? 2019-03-16 15:31:00 +01:00
Gwendal Roué d888423676 Fix outdated documentation 2019-03-16 14:32:10 +01:00
Gwendal Roué eac38be34b Fix for Swift 5 2019-03-16 14:26:06 +01:00
Gwendal Roué f42a184401 Merge pull request #503 from groue/feature/aggregate-ifnull
IFNULL support for association aggregates
2019-03-15 13:06:56 +01:00
Gwendal Roué 5fbf56c373 KISS 2019-03-15 08:51:02 +01:00
Gwendal Roué 784ebcc8e9 Tighten SQLJoin 2019-03-15 08:41:57 +01:00
Gwendal Roué df84654554 Delete unused code 2019-03-15 08:23:08 +01:00
Gwendal Roué 53e513f1f8 Merge branch 'GRDB-4.0' into feature/aggregate-ifnull
# Conflicts:
#	CHANGELOG.md
2019-03-15 07:58:42 +01:00
Gwendal Roué 0074adc023 Merge pull request #502 from groue/feature/rename-future
Rename Future to DatabaseFuture
2019-03-15 07:56:56 +01:00
Gwendal Roué ca8987ad98 Remove ill-advised TODOs 2019-03-14 07:57:30 +01:00
Gwendal Roué 6460f639ee Cleanup: SQLRelation, JoinOperator, JoinCondition are no longer public 2019-03-14 07:54:45 +01:00
Gwendal Roué 41d93f546c Document aggregate operations 2019-03-14 07:46:49 +01:00
Gwendal Roué 80a642260f CHANGELOG 2019-03-14 07:29:47 +01:00
Gwendal Roué 39800b1257 IFNULL support for aggregates 2019-03-14 07:21:09 +01:00
Gwendal Roué d04fc07337 CHANGELOG 2019-03-14 07:02:39 +01:00
Gwendal Roué 11fd8d6b87 Update documentation 2019-03-14 07:01:39 +01:00
Gwendal Roué 7183457217 Rename Future to DatabaseFuture 2019-03-14 06:43:40 +01:00
Gwendal Roué cf4e512894 Documentation 2019-03-13 21:24:54 +01:00
Gwendal Roué cf837855f2 HasManyThroughAssociation and HasOneThroughAssociation doc 2019-03-13 21:19:13 +01:00
Gwendal Roué 916d3931aa Cleanup SQLAssociation 2019-03-13 20:47:55 +01:00
Gwendal Roué 9d9bbc5f5d Documentation 2019-03-13 10:24:00 +01:00
Gwendal Roué 153233ace4 Documentation 2019-03-13 10:16:46 +01:00
Gwendal Roué 4bae8e9ac5 More request(for:association) tests 2019-03-13 08:33:14 +01:00
Gwendal Roué 1e617381a8 AssociationsBasics.md: remove inner link 2019-03-13 07:57:01 +01:00
Gwendal Roué 6d5215c8cb One less contribution needed #499 2019-03-11 09:02:48 +01:00
Gwendal Roué 4ce6271f6d Merge pull request #499 from groue/feature/EndodableRecord
Extract EncodableRecord from MutablePersistableRecord
2019-03-10 23:01:24 +01:00
Gwendal Roué 10c75d1e5e CHANGELOG 2019-03-10 15:25:39 +01:00
Gwendal Roué 05258b1098 Fix SPM build 2019-03-10 15:21:39 +01:00
Gwendal Roué 1a513e8e6e EncodableRecord documentation 2019-03-10 15:07:05 +01:00
Gwendal Roué 4ae1fb11cc Extract EncodableRecord from MutablePersistableRecord
This fixes issue #426
2019-03-10 14:00:01 +01:00
Gwendal Roué 9500a74744 Merge branch 'development' into GRDB-4.0
# Conflicts:
#	.travis.yml
#	CHANGELOG.md
#	GRDB/QueryInterface/SQLSelectQueryGenerator.swift
#	GRDB/Utils/OrderedDictionary.swift
#	README.md
2019-03-10 12:16:08 +01:00
Gwendal Roué 973e82b139 Fix a typo 2019-03-10 05:48:25 +01:00
Gwendal Roué d88fb4d96f Fix typo 2019-03-09 15:27:09 +01:00
Gwendal Roué cd6c4a4232 CHANGELOG 2019-03-09 15:11:48 +01:00
Gwendal Roué aeb41dc1eb v3.7.0 2019-03-09 14:21:28 +01:00
Gwendal Roué d2b2e12a10 Remove CHANGELOG.md requirement from PULL_REQUEST_TEMPLATE.md 2019-03-09 14:05:57 +01:00
Gwendal Roué 9040970c8d CHANGELOG 2019-03-09 14:04:49 +01:00
Gwendal Roué 211ac7aada Make Configuration.cipherPageSize an Int
As said in https://github.com/groue/GRDB.swift/issues/498#issuecomment-471156347
2019-03-09 13:38:28 +01:00
Gwendal Roué d60b68ab8a Document the BusyMode.timeout unit (#498) 2019-03-09 12:45:11 +01:00
Gwendal Roué 82423c41f2 Disable Travis check for CocoaPods GRDBCipher until we figure out what has turned wrong 2019-03-08 12:55:05 +01:00
Gwendal Roué 2b460083af GRDBPlus CocoaPod is deprecated 2019-03-08 12:52:17 +01:00
Gwendal Roué bad862ba16 Remove all mentions of GRDBPlus 2019-03-08 12:40:00 +01:00
Gwendal Roué adc4aa7c41 Merge pull request #497 from Marus/sqlcipher_config_options
Add additional SQLCipher configuration options
2019-03-08 08:40:39 +01:00
Gwendal Roué 53d2e6b895 Fix typo 2019-03-08 08:26:18 +01:00
Gwendal Roué c46dbdd97e Turn WARNING into a Note 2019-03-08 08:25:02 +01:00
Marcel Ball 6543d75f6d Updated based upon feedback from @groue
- Renamed `KDFIternations` to `kdfIterations` to better fit naming conventions
- In case of errors setting values return the sqlite error code and message instead of .SQLITE_MISUSE and a generic message
- Fixed formatting/typos in documentation
2019-03-07 17:51:16 -04:00
Gwendal Roué 32f6a45e8f SE-0209: support both swift 4.2 and 5 2019-03-07 20:54:42 +01:00
Gwendal Roué 519fa9a41a Don't codesign GRDBCipherMacOS test app 2019-03-07 18:34:19 +01:00
Gwendal Roué 7d0b5cf03c Don't codesign GRDBFTS5MacOS test app 2019-03-07 18:32:30 +01:00
Gwendal Roué 35ffe9a9fd Merge pull request #496 from groue/feature/fix-495
Fix crash when trying to perform fetchCount or ValueObservation.trackCount on joined query
2019-03-07 07:54:04 +01:00
Gwendal Roué b063870739 Too much future: firstIndex is not available on Xcode 9.4- 2019-03-07 05:06:58 +01:00
Marcel Ball 8ca9839433 Cleanup of some things leftover from debugging/testing 2019-03-06 21:31:37 -04:00
Marcel Ball 47f9b0f4a9 Added inline comments for new configuration options. 2019-03-06 21:21:43 -04:00
Marcel Ball 349ef328c7 Updated documentation to cover new configuration options 2019-03-06 21:01:08 -04:00
Marcel Ball 8415e8c2a0 Rename parameter to better align with the SQLCipher PRAGMA 2019-03-06 20:58:55 -04:00
Marcel Ball d4eb7ba27b Added configuration options to GRDBcipher for kdf_iterations 2019-03-06 20:41:38 -04:00
Marcel Ball 090eea9923 Update naming for the enumeration to be clearer 2019-03-06 20:41:01 -04:00
Gwendal Roué d566838dc5 Restore missing comment 2019-03-06 22:22:35 +01:00
Gwendal Roué 5bed0ac58e Too much future 2019-03-06 22:12:54 +01:00
Gwendal Roué ee481b2327 Fix #495 2019-03-06 22:09:31 +01:00
Gwendal Roué 8fbc3ca875 From future import OrderedDictionary 2019-03-06 22:09:01 +01:00
Gwendal Roué 4aecad3649 Failing test for https://github.com/groue/GRDB.swift/issues/495 2019-03-06 21:58:36 +01:00
Marcel Ball cf128ac800 Added configuration option to set cipher_page_size on connection
* Defaults to 1024 - which is the default in SQLCipher
2019-03-06 16:50:55 -04:00
Marcel Ball 1a51eb6b52 Merge pull request #2 from groue/development
Down merge changes from @groue
2019-03-06 16:41:30 -04:00
Gwendal Roué a355b9eb03 Merge pull request #490 from groue/feature/HasOneThroughAssociation
Indirect Associations
2019-03-06 21:40:47 +01:00
Gwendal Roué a3c2cb7f1c Merge branch 'GRDB-4.0' into feature/HasOneThroughAssociation 2019-03-06 18:58:05 +01:00
Gwendal Roué 4ba16067d0 Merge branch 'development' into GRDB-4.0 2019-03-06 18:57:06 +01:00
Gwendal Roué 605b6f7593 Merge branch 'master' into development 2019-03-06 18:55:07 +01:00
Gwendal Roué 43fff32156 Thank you notice for davidkraus :-) 2019-03-06 18:51:08 +01:00
Gwendal Roué 9f776a119f Merge pull request #494 from davidkraus/master
improve fts5 documentation
2019-03-06 18:49:10 +01:00
Gwendal Roué 658c9d34cb Remove GRDBPlus from ReleaseProcess.md 2019-03-06 18:43:21 +01:00
Gwendal Roué 2f447cc237 Wording and formatting 2019-03-06 18:42:45 +01:00
Gwendal Roué 403c4a894f Apply lovely advice from @glessard 2019-03-06 18:18:15 +01:00
David Kraus ccf339d6ef improve fts5 documentation 2019-03-06 14:55:11 +01:00
Gwendal Roué 7ff21981f0 Restore tests by disabling a sanity check 2019-03-06 09:08:59 +01:00
Gwendal Roué 5d9fa76754 Fix fetchCount(_:) for joined queries 2019-03-06 08:59:06 +01:00
Gwendal Roué bd633e25ee Aggregate tests for HasManyThroughAssociation 2019-03-06 08:17:47 +01:00
Gwendal Roué 87cd76a468 Association aggregates are defined on AssociationToMany 2019-03-06 08:17:20 +01:00
Gwendal Roué fca6420053 Documentation 2019-03-06 06:10:18 +01:00
Gwendal Roué ec51f4dbdf CHANGELOG 2019-03-05 18:54:06 +01:00
Gwendal Roué 916311a851 Remove outdated information 2019-03-05 18:51:58 +01:00
Gwendal Roué d6b6028e42 Typo fix 2019-03-05 18:49:51 +01:00
Gwendal Roué c756d27808 Documentation 2019-03-05 18:48:03 +01:00
Gwendal Roué 13985d0553 Merge branch 'GRDB-4.0' into feature/HasOneThroughAssociation 2019-03-05 18:40:12 +01:00
Gwendal Roué 0363ca406d Merge pull request #493 from groue/feature/SQLite-3.27.2
Bump SQLite to 3.27.2
2019-03-05 18:29:46 +01:00
Gwendal Roué c20b7e5799 Bump swiftlyfalling/SQLiteLib 2019-03-05 18:29:07 +01:00
Gwendal Roué 7642eb054b Documentation 2019-03-05 08:33:17 +01:00
Gwendal Roué f3c68420a0 CHANGELOG 2019-03-05 08:05:39 +01:00
Gwendal Roué 223ed4c73c Merge branch 'GRDB-4.0' into feature/SQLite-3.27.2 2019-03-05 08:00:53 +01:00
Gwendal Roué 99d010cded SQLite 3.27.2 2019-03-05 07:58:07 +01:00
Gwendal Roué 5bf1e6f818 Association documentation: contextualize schema recommendations 2019-03-04 20:37:47 +01:00
Gwendal Roué 06f0961b13 Association documentation: avoid painful repetition 2019-03-04 20:13:12 +01:00
Gwendal Roué addfa45d3a hasMany(_:through:using:) 2019-03-04 08:52:07 +01:00
Gwendal Roué 6489c80846 hasOne(_:through:using:) 2019-03-04 08:49:03 +01:00
Gwendal Roué 9e8e00ff99 AssociationHasManySQLTests 2019-03-04 08:06:50 +01:00
Gwendal Roué 9ee25fdec1 Rename ToOneAssociation to AssociationToOne 2019-03-04 08:01:45 +01:00
Gwendal Roué 4d5e5e1de3 HasManyThroughAssociation 2019-03-03 18:35:05 +01:00
Gwendal Roué 1188969144 Cleanup 2019-03-03 17:34:23 +01:00
Gwendal Roué 66c72e7bd2 HasOneThroughAssociation request tests 2019-03-03 15:29:27 +01:00
Gwendal Roué eed30c0954 AssociationHasOneThroughDecodableRecordTests 2019-03-03 09:21:49 +01:00
Gwendal Roué 8dd9f5fd40 AssociationHasOneThroughFetchableRecordTests cleanup 2019-03-03 09:21:34 +01:00
Gwendal Roué 7cab5dbf2b Cleanup 2019-03-02 20:42:52 +01:00
Gwendal Roué 6fd14d0a70 AssociationHasOneThroughFetchableRecordTests 2019-03-02 20:41:52 +01:00
Gwendal Roué 51c0b7a2f8 Renamed AssociationHasOneThroughRowscopeTests 2019-03-02 20:26:31 +01:00
Gwendal Roué 679f989e96 More AssociationHasOneThroughSQLDerivationTests 2019-03-02 17:35:00 +01:00
Gwendal Roué 1a24f61723 HasOneThroughAssociation adopts TableRequest 2019-03-02 17:24:17 +01:00
Gwendal Roué 1ff5552d5e AssociationHasOneThroughSQLDerivationTests 2019-03-02 17:14:58 +01:00
Gwendal Roué 4815807f09 More AssociationHasOneThroughSQLTests 2019-03-02 17:01:27 +01:00
Gwendal Roué 8fc23e1771 Complete AssociationHasOneThroughSQLTests 2019-03-02 15:48:17 +01:00
Gwendal Roué 5cf2d4920d TODO 2019-03-02 15:37:44 +01:00
Gwendal Roué 3d6d1c89b2 HasOneThroughAssociation 2019-03-02 14:46:31 +01:00
Gwendal Roué 08451dfced Rename AssociationImpl to SQLAssociation 2019-03-02 14:46:12 +01:00
Gwendal Roué b506838519 ToOneAssociation 2019-03-01 19:13:46 +01:00
Gwendal Roué 1511981dc7 AssociationImpl is no longer a protocol 2019-03-01 19:13:28 +01:00
Gwendal Roué 661cca9f80 Merge pull request #488 from groue/feature/ValueObservationCleanup
ValueObservation Cleanup
2019-03-01 16:55:24 +01:00
Gwendal Roué 4ee2523d59 CHANGELOG 2019-03-01 13:51:22 +01:00
Gwendal Roué 997be18718 Update ValueObservation documentation 2019-03-01 13:51:15 +01:00
Gwendal Roué e966544aeb Remove ValueObservation.extent 2019-03-01 13:17:48 +01:00
Gwendal Roué 4935c6f258 Rename ValueScheduling.onQueue(_:startImmediately:) to .async(onQueue:startImmediately:) 2019-03-01 08:24:00 +01:00
Gwendal Roué 03fafa437c Cleanup 2019-03-01 08:05:46 +01:00
Gwendal Roué 0fe7db2694 Assume NSUUID.fromDatabaseValue no longer needs special care in Release configuration, since we target Xcode 10+ now 2019-02-28 13:28:06 +01:00
Gwendal Roué 22edb91796 Merge pull request #487 from groue/feature/SR-6067
Remove SR-6067 workaround
2019-02-28 12:15:41 +01:00
Gwendal Roué 5ffc35a955 Remove SR-6067 workaround 2019-02-28 08:35:16 +01:00
Gwendal Roué 1084fe0425 Cleanup 2019-02-26 20:45:58 +01:00
Gwendal Roué 8d867320b0 Remove DatabaseValue.losslessConvert methods
They were used by RxGRDB until 0.13.0.
2019-02-26 20:40:13 +01:00
Gwendal Roué 34dd011e90 TODO: replace ValueObservation.extent 2019-02-26 20:23:14 +01:00
Gwendal Roué 8fce4faeea Fix typo 2019-02-26 09:00:29 +01:00
Gwendal Roué 8faff704d5 Merge pull request #486 from groue/feature/RecordNotFound
Refactor PersistenceError.recordNotFound
2019-02-26 08:09:04 +01:00
Gwendal Roué 2d71679476 Cleanup 2019-02-26 08:07:13 +01:00
Gwendal Roué 715b7a7867 CHANGELOG 2019-02-25 20:48:35 +01:00
Gwendal Roué 8ef28b0683 Fix PersistenceError.description 2019-02-25 20:43:40 +01:00
Gwendal Roué 31bdb2eeaa PersistenceError.recordNotFound documentation 2019-02-25 20:21:20 +01:00
Gwendal Roué 63192e2b75 Refactor PersistenceError.recordNotFound 2019-02-25 20:17:49 +01:00
Gwendal Roué fcbbe17909 Documentation 2019-02-25 18:53:32 +01:00
Gwendal Roué a1e809cbc7 Cleanup TODO 2019-02-25 17:23:02 +01:00
Gwendal Roué 93b429cca4 CHANGELOG 2019-02-24 18:02:57 +01:00
Gwendal Roué 3aaa5e74ec Update README 2019-02-24 17:48:10 +01:00
Gwendal Roué 27156fd215 Support for remove_diacritics=2 in FTS5 2019-02-24 17:38:04 +01:00
Gwendal Roué bcac197910 [whitespace] FTS5 files indentation 2019-02-24 17:12:10 +01:00
Gwendal Roué 336081a78a Support for remove_diacritics=2 in FTS3/4 2019-02-24 17:06:44 +01:00
Gwendal Roué 6306bd31e3 Update SQLiiteCustom/src to branch 3.27.1 of groue/SQLiteLib 2019-02-24 16:00:17 +01:00
Gwendal Roué 690e980018 Fix double inclusion of GRDB-4.0.swift in GRDBWatchOS target 2019-02-24 15:40:15 +01:00
Gwendal Roué f9fbd42962 CHANGELOG 2019-02-24 15:22:40 +01:00
Gwendal Roué 919f6095c6 Merge pull request #484 from groue/feature/SE-0193
SE-0193 Cross-module inlining and specialization
2019-02-24 15:18:49 +01:00
Gwendal Roué 83f62eed79 CHANGELOG 2019-02-24 15:18:04 +01:00
Gwendal Roué 96b971b0da PersistenceContainer specialization 2019-02-24 14:42:00 +01:00
Gwendal Roué 05fe018fed GRDBProfiling enhancements 2019-02-24 06:28:35 +01:00
Gwendal Roué 921c5d636a Remove SQLite.swift dependency from GRDBOSXPerformanceTests target 2019-02-24 06:26:51 +01:00
Gwendal Roué 61ae460525 Persistence methods specialization, PersistenceContainer optimizations 2019-02-24 06:26:08 +01:00
Gwendal Roué caaf2365e0 Fix compiler warning: make SQLiteValue @usableFromInline 2019-02-23 20:31:56 +01:00
Gwendal Roué bed9164bcd Allow specialization of fetching methods 2019-02-23 18:34:42 +01:00
Gwendal Roué f3621da329 @inlinable remaining Row subscripts 2019-02-23 17:37:04 +01:00
Gwendal Roué 2c75582c22 @inlinable RecordCursor 2019-02-23 17:23:30 +01:00
Gwendal Roué aa4f7c3d78 @inlinable StatementCursor 2019-02-23 17:19:56 +01:00
Gwendal Roué 9906cf799c @inlinable DatabaseValueCursor and NullableDatabaseValueCursor 2019-02-23 17:04:32 +01:00
Gwendal Roué 304937161c Performance comparison: Realm 3.13.1 2019-02-23 16:17:23 +01:00
Gwendal Roué 789497da75 FMDatabaseQueue(path:) is a failable initializer 2019-02-23 16:08:24 +01:00
Gwendal Roué 14371cd7c6 Performance comparison: update Realm location 2019-02-23 15:57:56 +01:00
Gwendal Roué b9dbce47a2 Performance comparison: FMDB 2.7.5 2019-02-23 15:46:09 +01:00
Gwendal Roué eb1672dec3 Revert wrong Xcode refactoring 2019-02-23 15:41:38 +01:00
Gwendal Roué dd0926ebfb ValueConversionContext does not need to be @usableFromInline 2019-02-23 15:35:23 +01:00
Gwendal Roué e80f3639af Revert wrong Xcode refactoring 2019-02-23 15:34:25 +01:00
Gwendal Roué 944b3ac07d @inlinable RowCursor, and Row subscript returning StatementColumnConvertible 2019-02-23 15:27:12 +01:00
Gwendal Roué 746c22e950 @inlinable FastDatabaseValueCursor and FastNullableDatabaseValueCursor 2019-02-23 14:28:44 +01:00
Gwendal Roué a0c85f093c Remove all @inline(__always) 2019-02-23 13:37:00 +01:00
Gwendal Roué 728c3b28ed Typo fix 2019-02-22 14:28:36 +01:00
Gwendal Roué 03b8df2fe1 Merge pull request #478 from groue/feature/SQLInterpolation2
Swift 5: SQL interpolation
2019-02-22 13:43:11 +01:00
Gwendal Roué dae55e4105 Merge branch 'GRDB-4.0' into feature/SQLInterpolation2 2019-02-22 13:37:44 +01:00
Gwendal Roué f8a1ecb644 Use query variable name when an SQLLiteral contains a full SQL query 2019-02-22 13:34:30 +01:00
Gwendal Roué 22c2cfb4ea Test SQLRequest interpolation 2019-02-22 13:28:58 +01:00
Gwendal Roué b15eaa826b TODO 2019-02-22 13:07:27 +01:00
Gwendal Roué 32b8d87a64 Use sqlite3_prepare_v3 on iOS 12.0, OSX 10.14, watchOS 5.0 2019-02-22 13:06:24 +01:00
Gwendal Roué 62ba97f517 Inline documentation 2019-02-22 12:59:44 +01:00
Gwendal Roué e81a514f29 SQLInterpolation.md 2019-02-22 09:15:05 +01:00
Gwendal Roué e36ca9f645 Foster SQL interpolation 2019-02-21 23:23:35 +01:00
Gwendal Roué d9dc21a073 Merge branch 'GRDB-4.0' into feature/SQLInterpolation2 2019-02-21 23:11:58 +01:00
Gwendal Roué 59cc1fef67 SQLInterpolation.md 2019-02-21 23:10:06 +01:00
Gwendal Roué 8df8129743 SQLInterpolation.appendInterpolation(SQLRequest) 2019-02-21 14:20:50 +01:00
Gwendal Roué b6481e8a68 SQLInterpolation.md 2019-02-21 12:20:16 +01:00
Gwendal Roué 65b65f4d70 SQL Interpolation documentation 2019-02-21 08:51:01 +01:00
Gwendal Roué 870ef6bac8 CHANGELOG 2019-02-21 08:48:22 +01:00
Gwendal Roué f7f0810c17 Documentation 2019-02-20 14:08:31 +01:00
Gwendal Roué 17c3ac1911 Link to #482 2019-02-20 08:54:35 +01:00
Gwendal Roué d74340a317 GRDB 4 development process 2019-02-20 08:17:23 +01:00
Gwendal Roué e54410b608 Swift 5: link to the GRDB-4.0 branch 2019-02-20 07:56:52 +01:00
Gwendal Roué 58dc1c67d6 Fix some sample code 2019-02-17 13:28:41 +01:00
Gwendal Roué 7e9e50e52d Up to date playgrounds 2019-02-17 13:28:41 +01:00
Gwendal Roué df05e940e8 Minor 2019-02-17 13:28:41 +01:00
Gwendal Roué 8d6a2fb4f1 Documentation, support for interpolation of empty sequences 2019-02-17 13:28:41 +01:00
Gwendal Roué afa8360397 Restore SQLExpressionLiteral.sql and arguments 2019-02-17 13:28:41 +01:00
Gwendal Roué 50f8bcec34 Fixit for SQLExpression.literal 2019-02-17 13:28:41 +01:00
Gwendal Roué d13968b753 Documentation 2019-02-17 13:28:41 +01:00
Gwendal Roué 086e3e918e joined(separator:) for SQLLiteral sequences 2019-02-17 13:28:41 +01:00
Gwendal Roué e986f0d6e5 Test for interpolation of empty sequence 2019-02-17 13:28:41 +01:00
Gwendal Roué 36ce78bd37 Explicit sql argument label when building prepared statements 2019-02-17 13:28:41 +01:00
Gwendal Roué e2a11eeb05 Update some inline documentation 2019-02-17 13:28:41 +01:00
Gwendal Roué 2d40b86a50 Rename SQLLiteral.append(literal:) to append(_:) 2019-02-17 13:28:41 +01:00
Gwendal Roué 4f350631ff Remove fetching methods from SQLLiteral. 2019-02-17 13:28:41 +01:00
Gwendal Roué db67d3840b Principle of least astonishment: rrename argument label rawSQL to sql 2019-02-17 13:28:41 +01:00
Gwendal Roué 2cd20b79f7 Fix typo 2019-02-17 13:28:40 +01:00
Gwendal Roué b296e9824a SQLGenerationContext.append(arguments:) cleanup 2019-02-17 13:28:40 +01:00
Gwendal Roué b0d9c519e1 Fix SPM test 2019-02-17 13:28:40 +01:00
Gwendal Roué 6937193d28 Fix SPM compilation 2019-02-17 13:28:40 +01:00
Gwendal Roué 500a5eea28 SQLRequest(rawSQL:arguments:adapter:) 2019-02-17 13:28:40 +01:00
Gwendal Roué 9758e1783e [whitespace] 2019-02-17 13:28:40 +01:00
Gwendal Roué a57aa2e346 rawSQL migration complete 2019-02-17 13:28:40 +01:00
Gwendal Roué 4bd5ace2ee Use rawSQL as parameter name for raw SQL 2019-02-17 13:28:40 +01:00
Gwendal Roué 85f618e16e SQLLiteral.mapSQL 2019-02-17 13:28:40 +01:00
Gwendal Roué e7995b9cd4 SQLExpressionLiteral(rawSQL:) 2019-02-17 13:28:40 +01:00
Gwendal Roué 6e80c748d2 SQLRequest(rawSQL:arguments:adapter:) 2019-02-17 13:28:40 +01:00
Gwendal Roué c546c578ce fetchCursor/All/One(_:rawSQL:arguments:adapter:) 2019-02-17 13:28:40 +01:00
Gwendal Roué 59162d93de Rename Database.execute(_:String) to Database.execute(rawSQL:String) 2019-02-17 13:27:54 +01:00
Gwendal Roué 354d22d70d Update documentation for literal interpolation 2019-02-17 13:24:38 +01:00
Gwendal Roué f15b2e12d6 Remove support for check constraint defined with a literal
That's because we can't support it until SQLLiteral is able to quote values
2019-02-17 13:24:38 +01:00
Gwendal Roué 4ecef0ea11 Don't be shy on interpolation 2019-02-17 13:24:38 +01:00
Gwendal Roué 637de8b6fa SQLiteral are passed via a literal parameter 2019-02-17 13:24:38 +01:00
Gwendal Roué aa6f55d72f Statement arguments are generally non optional 2019-02-17 13:24:38 +01:00
Gwendal Roué f018c7f823 Rename SQLString to SQLLiteral 2019-02-17 13:24:38 +01:00
Gwendal Roué 98e2d009c6 SQLString tests 2019-02-17 13:24:38 +01:00
Gwendal Roué 09e85ba341 SQLString everywhere 2019-02-17 13:24:38 +01:00
Gwendal Roué f27a1e9504 request.select(SQLString) 2019-02-17 13:24:38 +01:00
Gwendal Roué 86409687a4 TODO: Documentation 2019-02-17 13:24:38 +01:00
Gwendal Roué ff439c2dbc Documentation 2019-02-17 13:24:37 +01:00
Gwendal Roué 9b6c9b421a Update CustomizedDecodingOfDatabaseRows for SQLString 2019-02-17 13:24:37 +01:00
Gwendal Roué b5bcdd9df4 Fetch FetchableRecord from SQLString 2019-02-17 13:24:37 +01:00
Gwendal Roué b36cf84b23 Fetch StatementColumnConvertible from SQLString 2019-02-17 13:24:37 +01:00
Gwendal Roué fb89b540cd Fetch DatabaseValueConvertible from SQLString 2019-02-17 13:24:37 +01:00
Gwendal Roué 86b8c35c04 Fetch rows from SQLString 2019-02-17 13:24:37 +01:00
Gwendal Roué e7497e707e SQLRequest.init(SQLString) 2019-02-17 13:24:37 +01:00
Gwendal Roué b7089bb025 Database.execute(SQLString) 2019-02-17 13:24:37 +01:00
Gwendal Roué 612bd70710 Test SQLString in Swift 4.2 mode 2019-02-17 13:24:37 +01:00
Gwendal Roué 8affc8abe4 Remove dead code 2019-02-17 13:24:37 +01:00
Gwendal Roué d9cf760a25 SQLString 2019-02-17 13:24:37 +01:00
Gwendal Roué 5b6d882d67 SQLRequest adopts ExpressibleByStringInterpolation 2019-02-17 13:24:37 +01:00
Gwendal Roué 87ee00c2c5 SQLInterpolation 2019-02-17 13:24:37 +01:00
Gwendal Roué e100287bd8 Fixits for ValueObservation 2019-02-17 13:09:19 +01:00
Gwendal Roué 323b8de3dc Fixits for ColumnCursor and NullableColumnCursor 2019-02-17 13:02:48 +01:00
Gwendal Roué 06ec4580be Fixit for DatabaseWriter.readFromCurrentState 2019-02-17 12:59:32 +01:00
Gwendal Roué efd69a628a Add fixit for Cursor.flatMap 2019-02-17 12:50:29 +01:00
Gwendal Roué cc80daec99 Fixit/GRDB-4.0.swift 2019-02-17 12:48:13 +01:00
Gwendal Roué fd398aa434 Fix cocapods lint tests 2019-02-17 11:09:56 +01:00
Gwendal Roué 4b8ea08f4f Simplify Statement preparation now that SR-2347 is solved 2019-02-10 14:20:12 +01:00
Gwendal Roué e57cf49dc4 Remove useless check 2019-02-09 20:27:15 +01:00
Gwendal Roué 111dcbcad4 Fix warnings 2019-02-09 20:10:11 +01:00
Gwendal Roué 4174896225 Fix DataMemoryTests 2019-02-09 16:05:03 +01:00
Gwendal Roué 5738edc1bb CHANGELOG 2019-02-09 14:25:33 +01:00
Gwendal Roué 192bd71c12 SQLRequest.arguments is no longer optional 2019-02-09 14:14:07 +01:00
Gwendal Roué 5ee3b9c878 SE-0235 Add Result to the Standard Library 2019-02-09 12:54:30 +01:00
Gwendal Roué d3020dbd8f Workaround SR-9893
https://bugs.swift.org/browse/SR-9893
2019-02-09 11:10:27 +01:00
Gwendal Roué 493575a47b SE-0220 count(where:) 2019-02-09 10:21:34 +01:00
Gwendal Roué fa4febfa93 GRDB 4.0 TODO 2019-02-09 10:04:24 +01:00
Gwendal Roué 8cd49082ec SE-0205 withUnsafePointer(to:_:) and withUnsafeBytes(of:_:) for immutable values 2019-02-09 09:56:12 +01:00
Gwendal Roué 0dbfe7d9e3 GRDB 4.0 TODO 2019-02-09 09:50:32 +01:00
Gwendal Roué bbc64e38c7 SE-0207 Add an allSatisfy algorithm to Sequence 2019-02-09 09:50:04 +01:00
Gwendal Roué d7188f4b93 TODO: Rename Future 2019-02-08 10:19:01 +01:00
Gwendal Roué bb045235bf Remove tests for deprecated methods 2019-02-08 10:16:17 +01:00
Gwendal Roué ca4879c496 Remove deprecated ValueObservation methods 2019-02-08 10:16:17 +01:00
Gwendal Roué a466a8b253 Remove deprecated Cursor types 2019-02-08 10:16:17 +01:00
Gwendal Roué 5cd66c1be8 Remove deprecated Cursor.flatMap 2019-02-08 10:16:17 +01:00
Gwendal Roué 4489106bd6 Remove deprecated DatabaseWriter.readFromCurrentState 2019-02-08 10:16:17 +01:00
Gwendal Roué 485d42373b GRDB 4 is the latest version for Swift 4.2 2019-02-08 09:00:34 +01:00
Gwendal Roué 249484a21f SE-0204 Add last(where:) and lastIndex(where:) Methods 2019-02-08 08:47:45 +01:00
Gwendal Roué fb8946254d Swift 5: update calls to Data.withUnsafeBytes 2019-02-08 08:22:23 +01:00
Gwendal Roué b8a2592737 TODO future support for SQLite 3.27.0 2019-02-08 07:55:07 +01:00
Gwendal Roué 3029949731 Add () to forward @autoclosure parameters 2019-02-08 05:30:57 +01:00
Gwendal Roué 91061ee669 Remove redundant public modifiers 2019-02-08 05:27:50 +01:00
Gwendal Roué 90a9aa3523 Fix SPM compilation 2019-02-07 12:57:09 +01:00
Gwendal Roué ad04ccc094 Drop all fixits for GRDB < 3.0 2019-02-07 12:52:52 +01:00
Gwendal Roué a230fe400d Availability checks: assume iOS >= 9.0 2019-02-07 08:52:38 +01:00
Gwendal Roué 62ef344a6c Simplify FTS5, assuming swift(>=4.2) 2019-02-07 08:39:06 +01:00
Gwendal Roué 3eb36768c6 Simplify iOS memory management, assuming swift(>=4.2) 2019-02-07 08:25:31 +01:00
Gwendal Roué b6f79f176c SE-0206 : Hashable Enhancements 2019-02-07 08:21:48 +01:00
Gwendal Roué e2d151e748 Travis: test Xcode 10.1 2019-02-06 21:30:49 +01:00
Gwendal Roué 54ddd3e025 Set IPHONEOS_DEPLOYMENT_TARGET to 9.0 2019-02-06 20:05:53 +01:00
Gwendal Roué 2d7857f45b Package.swift uses swift-tools-version:4.2 2019-02-06 20:04:39 +01:00
Gwendal Roué 81892491f2 Set default SWIFT_VERSION to 4.2 2019-02-06 19:53:00 +01:00
Gwendal Roué 0493a9646f GRDB 4.0 kickoff 2019-02-06 19:45:19 +01:00
Gwendal Roué e99823dbcc Make DatabasePromise a proper monad 2019-02-04 19:27:18 +01:00
Gwendal Roué a1c99425cc SQLQualifiedSource.init(_:) bugfix, and cleanup 2019-02-04 08:18:20 +01:00
Gwendal Roué dc6db13134 Merge pull request #476 from groue/feature/cleanup
SQL Generation Winter Cleaning
2019-02-04 07:41:56 +01:00
Gwendal Roué 699c63e913 Explain how SQLSelectQueryGenerator uses RowAdapter 2019-02-03 19:55:26 +01:00
Gwendal Roué e924587236 Extract generation of SQL SELECT queries into SQLSelectQueryGenerator 2019-02-03 14:56:28 +01:00
Gwendal Roué c776801c4a Document "merging" and "finalization" 2019-02-03 11:58:16 +01:00
Gwendal Roué 73782d5e9d BelongsTo, HasOne and HasMany share the same JoinAssociationImpl 2019-02-03 10:23:34 +01:00
Gwendal Roué 659171902e Move join-related types to SQLRelation.swift 2019-02-03 10:09:34 +01:00
Gwendal Roué 4a209fcbc4 Rename SQLSource to SQLRelation.Source 2019-02-03 10:06:23 +01:00
Gwendal Roué 91b68ffa4f Trim 2019-02-03 09:29:52 +01:00
Gwendal Roué 5ea914ce0a YAGNI: JoinCondition.sqlExpression is not optional 2019-02-03 08:42:37 +01:00
Gwendal Roué 950fa607a1 Hide implementation details of associations 2019-02-03 08:26:58 +01:00
Gwendal Roué c9ff5a53a1 JoinCondition: Equatable 2019-02-03 00:03:04 +01:00
Gwendal Roué f42d5f202d White space 2019-02-02 17:57:01 +01:00
Gwendal Roué 27c6390635 More Association trimming 2019-02-02 17:53:01 +01:00
Gwendal Roué e62cfe086c Documentation 2019-02-02 17:23:50 +01:00
Gwendal Roué 40f6b351ea Rename QueryInterfaceQuery to SQLSelectQuery 2019-02-02 17:15:29 +01:00
Gwendal Roué 89dda44364 Extract and document DatabasePromise 2019-02-02 17:04:16 +01:00
Gwendal Roué 9addac6f54 Rename QueryOrdering to SQLRelation.Ordering 2019-02-02 16:43:10 +01:00
Gwendal Roué 5a942d7213 More trimming: QueryInterfaceQuery now embeds a SQLRelation 2019-02-02 16:20:43 +01:00
Gwendal Roué bb972a351a Refactor JoinQuery into SQLRelation 2019-02-02 15:39:18 +01:00
Gwendal Roué 5f037c7e4e Replace JoinQuery initializer with QueryInterfaceRequest.asJoinQuery() 2019-02-02 14:54:31 +01:00
Gwendal Roué 9d391badc0 Documentation 2019-02-02 14:31:12 +01:00
Gwendal Roué f309a0c5f3 Documentation 2019-02-02 13:30:57 +01:00
Gwendal Roué d9530433f2 Move JoinCondition definition 2019-02-02 13:15:17 +01:00
Gwendal Roué 20d067c826 Documentation 2019-02-02 13:11:00 +01:00
Gwendal Roué 1e7840f0e4 More trimming 2019-02-02 11:38:27 +01:00
Gwendal Roué 77fd2b8411 Restore failing tests 2019-02-02 10:51:33 +01:00
Gwendal Roué b180fc37bb Trim associations 2019-02-02 10:38:47 +01:00
Gwendal Roué 4e4d591109 Typo fix 2019-01-30 08:46:18 +01:00
Gwendal Roué 7745e92a1f Merge pull request #470 from timwredwards/master
Update README.md
2019-01-14 14:06:22 +01:00
Tim Edwards b70de2033a Update README.md
Fixed "latest release" date
2019-01-14 13:02:50 +00:00
Gwendal Roué 134bc670ef CHANGELOG 2019-01-05 15:57:10 +01:00
Gwendal Roué d265e2d77b v3.6.2 2019-01-05 15:40:05 +01:00
Gwendal Roué ac40b63262 Merge pull request #464 from groue/feature/updatesChanges
Make updateChanges(_:with:) available to PersistableRecord structs
2019-01-05 14:47:35 +01:00
Gwendal Roué bac9d8e425 CHANGELOG.md 2019-01-05 14:46:38 +01:00
Gwendal Roué bf0c9b5c27 Move non-mutating updateChanges(_:with:) from PersistableRecord to PersistableRecord & AnyObject. 2019-01-05 12:35:28 +01:00
Gwendal Roué f70d04c76a Failing test for updateChanges(_:with:) for PersistableRecord struct
The problem is that the code does not compile :'(
2019-01-05 12:30:48 +01:00
Gwendal Roué 85aa899c7b Fix #462 2019-01-02 17:49:36 +01:00
Gwendal Roué 19fa05aecc Update TODO.md 2018-12-13 16:46:13 +01:00
Gwendal Roué 9c4a8fb0b2 Fix typo 2018-12-09 11:35:22 +01:00
Gwendal Roué e19f02b77e v3.6.1 2018-12-09 11:18:41 +01:00
Gwendal Roué b34030fc39 Merge pull request #458 from groue/feature/FixValueObserverOverRetain
Fix ValueObservation duration - code & doc
2018-12-09 10:37:51 +01:00
Gwendal Roué 40a5fb1195 Observer deallocation needs better tests 2018-12-09 06:17:36 +01:00
Gwendal Roué d9dd880d6d Fix flaky test 2018-12-09 05:45:14 +01:00
Gwendal Roué c51b0ba862 Fix documentation about ValueObservation.extent, and add a note in remove(transactionObserver:) documentation. 2018-12-08 17:32:18 +01:00
Gwendal Roué 197f922e7e Fix failing tests for over-retained ValueObserver 2018-12-08 17:11:53 +01:00
Gwendal Roué 25f6bd9673 Failing tests for over-retained ValueObserver 2018-12-08 17:11:30 +01:00
Gwendal Roué 909821f4e5 Add a link to Codable records 2018-12-08 14:57:20 +01:00
Gwendal Roué b211dc55c4 Put associations in the feature list
... and use the "relation" keyword: people familiar with other toolkits may search for this word https://forums.swift.org/t/new-release-grdb-3-6-0/18660/4
2018-12-08 14:36:45 +01:00
Gwendal Roué 863a762eca Wording 2018-12-08 12:23:41 +01:00
Gwendal Roué bb01da7635 Mention ValueObservation iin WhyAdoptGRDB 2018-12-08 11:32:26 +01:00
Gwendal Roué 558cdacb5b Fix typo 2018-12-08 07:50:41 +01:00
Gwendal Roué eff7dbd798 CHANGELOG 2018-12-08 07:18:22 +01:00
Gwendal Roué 1d3935baaf Merge pull request #457 from diatoming/patch-2
Typo in AssociationsBasics.md
2018-12-08 05:40:39 +01:00
diatoming b40e4e58e1 Typo in AssociationsBasics.md 2018-12-08 07:08:20 +08:00
Gwendal Roué 36d3607565 http://github.com/groue/GRDBDemo is no longer 2018-12-07 20:56:04 +01:00
Gwendal Roué d55807e2a2 Realm 3.12.0, Swift 4.2.1 2018-12-07 20:55:12 +01:00
Gwendal Roué 6447eeca17 v3.6.0 2018-12-07 18:58:30 +01:00
Gwendal Roué 1fea9c06e8 Merge branch 'development' 2018-12-07 18:30:07 +01:00
Gwendal Roué 11d3dd9538 CHANGELOG 2018-12-07 18:22:01 +01:00
Gwendal Roué f6f236512b Documentation 2018-12-07 18:08:53 +01:00
Gwendal Roué 343816ed7b Documentation 2018-12-07 18:04:16 +01:00
Gwendal Roué 59a65bf81e PULL_REQUEST_TEMPLATE 2018-12-07 17:57:50 +01:00
Gwendal Roué a5b06b5cb0 Merge branch 'master' into development 2018-12-07 17:55:00 +01:00
Gwendal Roué 802575c505 Merge pull request #456 from diatoming/patch-1
fix typo in AssociationsBasics.md
2018-12-07 13:13:04 +01:00
diatoming c433a130e5 Update AssociationsBasics.md
just fix typo
2018-12-07 19:56:28 +08:00
Gwendal Roué ca4a867803 Remove picture that breaks anchor linking 2018-12-07 08:43:59 +01:00
Gwendal Roué 37ac126d26 Documentation 2018-12-07 08:42:28 +01:00
Gwendal Roué 5badd62515 Documentation 2018-12-07 08:41:17 +01:00
Gwendal Roué 37983b8581 Documentation 2018-12-07 08:36:11 +01:00
Gwendal Roué 815a3697da Documentation 2018-12-07 08:20:18 +01:00
Gwendal Roué 32acfb2cf4 Merge pull request #455 from groue/feature/DatabaseRegionObserver
DatabaseRegionObservation
2018-12-07 08:07:28 +01:00
Gwendal Roué 9fd802b3ea Documentation 2018-12-06 18:54:09 +01:00
Gwendal Roué 21d243fc33 Documentation 2018-12-06 18:51:45 +01:00
Gwendal Roué 97936c3fad Documentation 2018-12-06 18:46:57 +01:00
Gwendal Roué 03934041c2 Fix DatabaseRegion doc layout 2018-12-06 18:41:43 +01:00
Gwendal Roué 862563fdaa Remove obsolete test 2018-12-06 16:42:20 +01:00
Gwendal Roué 73935dfa9d CHANGELOG 2018-12-06 14:02:10 +01:00
Gwendal Roué 9a3e6f0b97 CHANGELOG 2018-12-06 13:58:47 +01:00
Gwendal Roué bc5899543f Documentation 2018-12-06 13:55:08 +01:00
Gwendal Roué fd79a53a96 Documentation 2018-12-06 13:34:02 +01:00
Gwendal Roué 194624212e Move db observation documentations around 2018-12-06 13:33:17 +01:00
Gwendal Roué 1472385242 Documentation 2018-12-06 08:55:31 +01:00
Gwendal Roué 78bb086f69 Documentation 2018-12-06 08:43:44 +01:00
Gwendal Roué e3681fdde5 DatabaseRegionObservationTests 2018-12-06 08:28:43 +01:00
Gwendal Roué 6ec4556c2c DatabaseRegionObservation 2018-12-06 07:49:41 +01:00
Gwendal Roué 1e72731c07 Distinguish distinctUntilChanged from distinctUntilDatabaseChanged 2018-12-06 07:04:40 +01:00
Gwendal Roué 82329c899e Hide DatabaseWriter.remove(transactionObserver:) from Jazzy 2018-12-05 19:27:04 +01:00
Gwendal Roué 8ab6e67f07 Hide DatabaseWriter.add(observation:onError:onChange:) from Jazzy 2018-12-05 19:23:06 +01:00
Gwendal Roué 643bbc7076 Merge pull request #454 from groue/feature/distinctUntilChanged
ValueObservation.distinctUntilChanged
2018-12-05 12:06:42 +01:00
Gwendal Roué 61f2544afe Remove a breaking change introduced by #446 2018-12-05 08:47:55 +01:00
Gwendal Roué 546289bc88 CHANGELOG 2018-12-05 08:29:49 +01:00
Gwendal Roué d3d5b1d24c CHANGELOG 2018-12-05 08:28:08 +01:00
Gwendal Roué dd59186887 Documentation 2018-12-05 08:24:12 +01:00
Gwendal Roué 88d7c58522 TODO: remove some magic in GRDB 4 2018-12-05 08:02:18 +01:00
Gwendal Roué c711ca1e8f ValueObservation.distinctUntilChanged() 2018-12-05 07:58:03 +01:00
Gwendal Roué 56d49dd385 Cleanup 2018-12-02 10:12:21 +01:00
Gwendal Roué 7b97d75a80 Merge pull request #452 from groue/feature/MapReducer
ValueObservation.mapReducer
2018-12-02 07:56:50 +01:00
Gwendal Roué a8d9f2d82b CHANGELOG 2018-12-02 01:11:58 +01:00
Gwendal Roué c7d28de386 CHANGELOG 2018-12-02 01:10:13 +01:00
Gwendal Roué ce61d27a9e CHANGELOG 2018-12-02 01:02:14 +01:00
Gwendal Roué b8e3994858 ValueObservation.mapReducer
and expose more precise value reducers
2018-12-02 00:01:21 +01:00
Gwendal Roué 7c6c615969 Merge pull request #451 from groue/feature/CompactMap
ValueObservation.compactMap
2018-12-01 21:03:34 +01:00
Gwendal Roué 8c543f5078 Fix failing tests 2018-12-01 19:07:58 +01:00
Gwendal Roué 3884141fc2 map/compactMap fail preserving ValueObservation configuration 2018-12-01 19:06:16 +01:00
Gwendal Roué 2c3776d372 Fix typo 2018-12-01 18:59:01 +01:00
Gwendal Roué c1d8dcb105 Link to ValueObservation from GoodPracticesForDesigningRecordTypes 2018-12-01 17:17:54 +01:00
Gwendal Roué c89540683f README 2018-12-01 17:11:56 +01:00
Gwendal Roué 3687e11958 README 2018-12-01 17:10:17 +01:00
Gwendal Roué 90c588a9f5 README 2018-12-01 17:06:10 +01:00
Gwendal Roué 838d9204ab CHANGELOG 2018-12-01 17:02:30 +01:00
Gwendal Roué 2488007b9c README 2018-12-01 17:02:25 +01:00
Gwendal Roué 5b3412e9f7 ValueObservation.compactMap 2018-12-01 16:35:19 +01:00
Gwendal Roué f07eee3ca7 DispatchQueue creation cleanup 2018-12-01 16:22:05 +01:00
Gwendal Roué 769b247da9 Merge pull request #449 from groue/feature/fixEmptyContainersJSONEncoding
Fix JSON encoding of empty containers
2018-11-28 12:24:14 +01:00
Gwendal Roué ef54efcb75 Cleanup 2018-11-28 09:11:36 +01:00
Gwendal Roué f41112c071 Documentation 2018-11-28 08:46:48 +01:00
Gwendal Roué e8ad816de5 CHANGELOG 2018-11-28 08:41:30 +01:00
Gwendal Roué 32f1a7ae0f Fix JSON encoding of empty arrays and dictionaries 2018-11-28 08:34:32 +01:00
Gwendal Roué 3dcae6d409 Forgot that reducer factory closure throws 2018-11-25 18:35:05 +01:00
Gwendal Roué 550c016a98 Merge pull request #446 from groue/feature/ValueReducerFactory
ValueObservation: delayed reducer creation
2018-11-25 18:24:35 +01:00
Gwendal Roué e092e8b3ec CHANGELOG 2018-11-25 15:42:34 +01:00
Gwendal Roué 1b53bf9ea2 Documentation 2018-11-25 15:27:26 +01:00
Gwendal Roué 3f001ba04d ValueObservation now accept a reducer factory 2018-11-25 15:18:03 +01:00
Gwendal Roué 87c4775421 ValueObservation creates a reducer when its starts 2018-11-25 14:26:04 +01:00
Gwendal Roué 2e3f2f9d61 Tests for reducer queue labels 2018-11-25 09:35:17 +01:00
Gwendal Roué 798b727d7f Reducer queue honors qos and targetQueue configuration 2018-11-25 09:35:04 +01:00
Gwendal Roué 54361617fe Remove headers 2018-11-25 09:33:55 +01:00
Gwendal Roué 417b830b61 CHANGELOG menu 2018-11-25 07:51:08 +01:00
Gwendal Roué b757a44a77 CHANGELOG menu 2018-11-25 07:47:57 +01:00
Gwendal Roué 6b78be51e2 CHANGELOG 2018-11-24 23:22:12 +01:00
Gwendal Roué 466140e699 Merge pull request #445 from groue/feature/qos
Quality of service and target dispatch queue
2018-11-24 23:18:57 +01:00
Gwendal Roué 4e1eea5743 Run run qos and targetQueue tests on Xcode 9.3, iOS 9.0
We lack dispatchPrecondition(condition:)
2018-11-24 21:46:50 +01:00
Gwendal Roué 267b4f958d Remove useless availability check 2018-11-24 21:22:47 +01:00
Gwendal Roué 9c71061629 Tests for QoS 2018-11-24 21:14:35 +01:00
Gwendal Roué 40ba0a7e8f CHANGELOG 2018-11-24 20:57:43 +01:00
Gwendal Roué bf6a101338 dispatchPrecondition(condition:) iOS availability 2018-11-24 20:56:36 +01:00
Gwendal Roué 736db6a546 Confiiguration.qos and targetQueue 2018-11-24 20:48:17 +01:00
Gwendal Roué 6a10ad0e11 Merge pull request #444 from groue/feature/ValueObservationCombine
Combine Value Observations
2018-11-24 19:39:51 +01:00
Gwendal Roué a521c89962 Documentation 2018-11-24 19:39:15 +01:00
Gwendal Roué b155ab742a Documentation 2018-11-24 19:38:24 +01:00
Gwendal Roué 4376e7519f Documentation 2018-11-24 14:55:15 +01:00
Gwendal Roué 42f13a621a Documentation 2018-11-24 14:53:23 +01:00
Gwendal Roué 8a9ccccf93 Documentation 2018-11-24 14:47:34 +01:00
Gwendal Roué e3a8bfda6f Documentation 2018-11-24 14:37:36 +01:00
Gwendal Roué a5c291e7a8 CHANGELOG 2018-11-24 14:35:27 +01:00
Gwendal Roué 71b75ee265 Documentation 2018-11-24 14:27:41 +01:00
Gwendal Roué 3f1db5aa10 Cleanup 2018-11-24 14:22:04 +01:00
Gwendal Roué 5ff519afcb Documentation 2018-11-24 13:50:36 +01:00
Gwendal Roué 41d814b540 Tests for ValueObservation combine 2018-11-24 12:57:24 +01:00
Gwendal Roué 326ef19fe9 ValueObservation combination 2018-11-24 11:38:47 +01:00
Gwendal Roué 796644edda Fix test
Concurrency is hard
2018-11-23 07:41:31 +01:00
Gwendal Roué 03b51ee899 Second failed test :-( 2018-11-22 09:34:10 +01:00
Gwendal Roué a2af4fb99a Merge pull request #443 from groue/feature/updateChanges
In place record update
2018-11-22 08:16:09 +01:00
Gwendal Roué e95119130c Documentation tweaks 2018-11-22 08:14:00 +01:00
Gwendal Roué 9735d8b74e Record Comparison documentation 2018-11-21 23:08:53 +01:00
Gwendal Roué f4c0eaa912 updateChanges(_:with:) documentation 2018-11-21 23:03:30 +01:00
Gwendal Roué d6e7d74a12 Cleanup 2018-11-21 22:27:33 +01:00
Gwendal Roué 771c85581c Fix documentation typo 2018-11-21 22:13:07 +01:00
Gwendal Roué 1baca23500 CHANGELOG 2018-11-21 22:12:52 +01:00
Gwendal Roué cc2a2a3545 Non-mutating version of updateChanges 2018-11-21 22:09:41 +01:00
Gwendal Roué 72a2408fce CHANGELOG 2018-11-21 22:08:05 +01:00
Gwendal Roué 0cd1ca11ef TODO 2018-11-21 21:48:34 +01:00
Gwendal Roué c04e6ad86d Tests for updateChanges(_:with:) 2018-11-21 21:48:24 +01:00
Gwendal Roué 3e67a1a021 Why use fileprivate when private is enough? 2018-11-21 20:33:21 +01:00
Gwendal Roué a3e62d8734 Factor updateChanges 2018-11-21 20:28:22 +01:00
Gwendal Roué f5bfb9df95 MutablePersistableRecord.updateChanges(_:with:) 2018-11-21 08:37:51 +01:00
Gwendal Roué d45ed56b64 Fix documentation typo 2018-11-19 09:01:26 +01:00
Gwendal Roué 59175a6b4d DatabasePool: block reader until concurrent fetch has been executed 2018-11-18 17:18:29 +01:00
Gwendal Roué f4e77c7700 Fix Swift 4.1 "expression was too complex to be solved in reasonable time" error 2018-11-18 17:05:10 +01:00
Gwendal Roué cbc3467e2d Database.beginSnapshotIsolation() 2018-11-18 16:49:51 +01:00
Gwendal Roué 65cc0bb2b3 Cache frequently used statements 2018-11-18 16:49:14 +01:00
Gwendal Roué 7e548aee13 Cleanup SchemaInfo 2018-11-18 15:47:11 +01:00
Gwendal Roué 8d18b06e5d Merge pull request #442 from groue/feature/reindex
Reindex
2018-11-17 22:12:34 +01:00
Gwendal Roué 55c8d350b8 CHANGELOG 2018-11-17 19:17:25 +01:00
Gwendal Roué 064f1005e5 CHANGELOG 2018-11-17 19:12:20 +01:00
Gwendal Roué 53adad16e5 Tests for Database.reindex(collation:) 2018-11-17 18:56:38 +01:00
Gwendal Roué 466a1ad4d5 Database.reindex(collation:) 2018-11-17 18:56:29 +01:00
Gwendal Roué f80f59cc38 Tweaks to demo app 2018-11-17 18:41:46 +01:00
Gwendal Roué ead2b13362 Optimize value observation for views that feed from a single table
By removing views from the observed database region, we allow the "single-table observation optimization" to kick in.

Thank you @foxware00 for revealing this opportunity in #441 :-)
2018-11-17 16:29:31 +01:00
Gwendal Roué 0ea9a1ce0d Use SchemaInfo more 2018-11-17 15:59:09 +01:00
Gwendal Roué 3b7801efff Cache full database schema 2018-11-17 15:38:55 +01:00
Gwendal Roué 5efbbe9f0c Typo 2018-11-17 14:13:58 +01:00
Gwendal Roué d868b7e1ce Test ValueObservation with database queue and pool 2018-11-17 14:12:03 +01:00
Gwendal Roué 60358ba0c0 CHANGELOG 2018-11-17 13:43:03 +01:00
Gwendal Roué b6eb5ab399 ValueObservation: tests for region arrays 2018-11-17 13:26:14 +01:00
Gwendal Roué b9ab74cb1d ValueObservation: support region arrays (address #441) 2018-11-17 13:25:55 +01:00
Gwendal Roué d3fd838c6c DatabaseRegion cleanup and documentation
Goal: improve understanding of observation performance.
Context: https://github.com/groue/GRDB.swift/issues/441
2018-11-17 12:46:01 +01:00
Gwendal Roué 1108ba4bf2 DatabaseError gets a default message, derived from its resultCode 2018-11-16 09:07:52 +01:00
Gwendal Roué 49de0e0f49 Call sqlite3_close() even if opening failed
Thanks to https://github.com/feistydog/FeistyDB/commit/6859f622797480656f8897c2db5e620e6a98c858
2018-11-16 08:48:25 +01:00
Gwendal Roué d56b62a65f Flag ValueReducer as experimental 2018-11-10 12:31:35 +01:00
Gwendal Roué c28a4d4061 Remove public initializers of utility value reducers 2018-11-10 12:29:31 +01:00
Gwendal Roué 3971b43894 Cleanup 2018-11-05 09:08:14 +01:00
Gwendal Roué 9fc5c2680b Typo 2018-11-05 09:08:01 +01:00
Gwendal Roué 0f8156afed Cleanup demo app 2018-11-04 03:50:19 +01:00
Gwendal Roué da3f14c29a Typo 2018-11-03 16:39:36 +01:00
Gwendal Roué dbacf3acf0 Documentation 2018-11-02 18:04:48 +01:00
Gwendal Roué 961138b09b v3.5.0 2018-11-02 17:01:39 +01:00
Gwendal Roué 6c6e46b8d6 Merge branch 'development' 2018-11-02 16:55:53 +01:00
Gwendal Roué 0cbf259ed1 Merge pull request #435 from groue/feature/ValueObservation
Improved support for values observation
2018-11-02 16:47:22 +01:00
Gwendal Roué 07bf5882fe Adding more reactive engines is no longer hard 2018-11-02 16:28:06 +01:00
Gwendal Roué b3c7fec676 Documentation 2018-11-02 13:56:52 +01:00
Gwendal Roué 296a1d5b12 CHANGELOG 2018-11-02 13:18:27 +01:00
Gwendal Roué 8c5e3df546 Documentation 2018-11-02 13:04:22 +01:00
Gwendal Roué 50213c925f Documentation 2018-11-02 13:00:42 +01:00
Gwendal Roué a1a5165bd2 Documentation 2018-11-02 12:48:48 +01:00
Gwendal Roué 7d9e87088d Rename ValueObservation.isReadOnly to requiresWriteAccess 2018-11-02 12:31:26 +01:00
Gwendal Roué c300cf2a38 Documentation 2018-11-02 12:15:04 +01:00
Gwendal Roué c48d2e484a Documentation 2018-11-02 12:10:49 +01:00
Gwendal Roué 2bc8f33249 Cleanup 2018-11-02 11:49:03 +01:00
Gwendal Roué 257fc8b66a Cleanup 2018-11-02 08:35:16 +01:00
Gwendal Roué bc274a603c Documentation 2018-11-02 08:35:04 +01:00
Gwendal Roué ab7970d470 Documentation 2018-11-01 22:58:20 +01:00
Gwendal Roué 087a899f13 Rename ValueObservation.tracking(withUniquing:fetch) to ValueObservation.tracking(_:fetchDistinct) 2018-11-01 22:18:58 +01:00
Gwendal Roué 842eaf0816 ValueObservation: perform uniquing by default 2018-11-01 21:46:59 +01:00
Gwendal Roué f7b79e05f6 Attempt at addressing https://github.com/groue/GRDB.swift/issues/430 2018-11-01 16:59:39 +01:00
Gwendal Roué 1867ee91de Documentation 2018-11-01 13:38:54 +01:00
Gwendal Roué d53412d404 Documentation 2018-11-01 13:22:02 +01:00
Gwendal Roué 74ca85e52c More links to the demo app 2018-11-01 13:16:04 +01:00
Gwendal Roué 51942046b9 Avoid the "No output has been received in the last 10m0s" error on Travis 2018-11-01 13:10:52 +01:00
Gwendal Roué 38e1cc9a27 Use ValueObservation is demo application 2018-11-01 12:58:17 +01:00
Gwendal Roué 7e8ebed7a8 Documentation 2018-10-31 19:39:44 +01:00
Gwendal Roué eb95562b73 Documentation 2018-10-31 19:37:35 +01:00
Gwendal Roué 44af4e62a6 Documentation 2018-10-31 19:35:49 +01:00
Gwendal Roué 30363b4a5b Tests for ValueObservation.map 2018-10-31 19:02:47 +01:00
Gwendal Roué bb02d9d857 ValueObservation.map 2018-10-31 12:07:08 +01:00
Gwendal Roué 9babbcbcb3 README: foster ValueObservation 2018-10-31 08:59:50 +01:00
Gwendal Roué 04de6193c0 Documentation 2018-10-31 07:37:05 +01:00
Gwendal Roué 6fa72ebea1 Documentation 2018-10-30 13:44:05 +01:00
Gwendal Roué 0e51a0ff65 Documentation 2018-10-30 13:40:32 +01:00
Gwendal Roué a276a49a26 CHANGELOG 2018-10-30 13:37:58 +01:00
Gwendal Roué 741f0b2a43 CHANGELOG 2018-10-30 13:37:05 +01:00
Gwendal Roué 3d21773496 CHANGELOG 2018-10-30 13:33:24 +01:00
Gwendal Roué cca716e1ab Cleanup 2018-10-30 08:49:36 +01:00
Gwendal Roué 8e13cb4e6c Cleanup 2018-10-30 07:46:41 +01:00
Gwendal Roué c4d328783f Documentation 2018-10-30 07:24:27 +01:00
Gwendal Roué 22b5990669 Documentation 2018-10-29 23:04:00 +01:00
Gwendal Roué d3838d1d73 ValueObservation error handling 2018-10-29 21:13:14 +01:00
Gwendal Roué cdd7579104 Documentation 2018-10-29 19:40:37 +01:00
Gwendal Roué 4e3b7c14a9 Documentation 2018-10-29 19:39:44 +01:00
Gwendal Roué b4b824c360 dbQueue.start(observation) -> observation.start(in: dbQueue) 2018-10-29 19:31:04 +01:00
Gwendal Roué 6f86cbf0c4 Documentation 2018-10-29 18:48:16 +01:00
Gwendal Roué f68b1cd2c3 Documentation 2018-10-29 18:44:48 +01:00
Gwendal Roué 53f98a7bf6 Documentation 2018-10-29 18:42:04 +01:00
Gwendal Roué 77de519fcc More tests for read/write observations 2018-10-29 18:40:12 +01:00
Gwendal Roué 739c325079 Documentation 2018-10-29 18:34:11 +01:00
Gwendal Roué 10650704b5 Documentation (todo: document error handling) 2018-10-29 18:32:54 +01:00
Gwendal Roué 735394669d Documentation 2018-10-29 18:28:10 +01:00
Gwendal Roué 4e40d755f4 Documentation 2018-10-29 18:26:27 +01:00
Gwendal Roué e5f43e341b ValueScheduling.unsafe guarantees that initial value is notified on the dispatch queue which starts the observation 2018-10-29 18:23:38 +01:00
Gwendal Roué 72c5769e8b ValueScheduling.unsafe 2018-10-29 13:59:02 +01:00
Gwendal Roué 669b9c4e91 Test for the ValueReducer documented in README 2018-10-29 13:31:42 +01:00
Gwendal Roué a489959780 Typo 2018-10-29 13:10:04 +01:00
Gwendal Roué 1985b9129a Fix SPM build 2018-10-29 13:09:56 +01:00
Gwendal Roué f7712473aa Move Sequence.allSatisfy where it is used: tests 2018-10-29 12:27:39 +01:00
Gwendal Roué f582683f20 Move remove(transactionObserver:) to DatabaseReader 2018-10-29 12:26:12 +01:00
Gwendal Roué a4b35729df Documentation 2018-10-29 12:22:16 +01:00
Gwendal Roué 191607fc13 Documentation 2018-10-29 09:18:29 +01:00
Gwendal Roué 5a540e8850 Documentation 2018-10-29 09:16:42 +01:00
Gwendal Roué f59dba711c Try with "tracking" 2018-10-29 09:15:18 +01:00
Gwendal Roué 93326307fa Documentation 2018-10-29 09:00:15 +01:00
Gwendal Roué 8d6ec6297a Backport Sequence.allSatisfy in Swift 4.1 2018-10-29 08:52:59 +01:00
Gwendal Roué 1d47853abe Documentation 2018-10-29 08:47:51 +01:00
Gwendal Roué 38e4027599 Documentation 2018-10-29 08:41:22 +01:00
Gwendal Roué 29b54dd37d Documentation 2018-10-29 08:17:35 +01:00
Gwendal Roué 03d2bc43ac Documentation 2018-10-29 08:07:28 +01:00
Gwendal Roué 22ed0fb1a1 Documentation 2018-10-29 08:00:39 +01:00
Gwendal Roué 489454b0d4 add(observation:observation) -> start(observation) 2018-10-29 07:19:36 +01:00
Gwendal Roué 840f8358b5 Documentation 2018-10-29 06:51:56 +01:00
Gwendal Roué 470e1534dc Documentation 2018-10-28 22:29:15 +01:00
Gwendal Roué 158177364b Documentation 2018-10-28 22:04:39 +01:00
Gwendal Roué de2823b613 ValueObservation: StatementColumnConvertible tests 2018-10-28 19:28:19 +01:00
Gwendal Roué 0d5adfe5a9 ValueObservation: FetchableRecord & DatabaseValueConvertible tests 2018-10-28 19:16:55 +01:00
Gwendal Roué 0010be4e56 ValueObservation: row tests 2018-10-28 18:40:21 +01:00
Gwendal Roué 62f6cfe6b5 ValueObservation: count tests 2018-10-28 17:41:18 +01:00
Gwendal Roué 31e6ddeac3 ValueObservation: test scheduling 2018-10-28 17:32:31 +01:00
Gwendal Roué f2c3c213cc Read-only observation is enforced. When not read-only, savepoint is enforced. 2018-10-28 17:04:36 +01:00
Gwendal Roué f303664808 Cleanup 2018-10-28 16:20:57 +01:00
Gwendal Roué 471808fa3b More ValueObseervation tests: fetch, with and without uniquing 2018-10-28 16:13:58 +01:00
Gwendal Roué cbe505f4a4 Cleanup 2018-10-28 16:13:34 +01:00
Gwendal Roué 087989fc89 More ValueObseervation tests: extent 2018-10-28 15:57:27 +01:00
Gwendal Roué a519a4ab86 Documentation 2018-10-28 15:38:01 +01:00
Gwendal Roué 627e8ec969 Fix wrong documentation 2018-10-28 15:35:25 +01:00
Gwendal Roué 2b78479a5e More ValueReducer tests: error 2018-10-28 15:32:55 +01:00
Gwendal Roué e0a9cced4a First tests for ValueObservation: focus on reducers 2018-10-28 13:27:43 +01:00
Gwendal Roué 26ba5768b2 whitespace 2018-10-28 13:26:40 +01:00
Gwendal Roué 09581c6ae0 ValueObservation factory requires a DatabaseRegionConvertible. Introduce AnyDatabaseRegionConvertible. 2018-10-28 11:45:49 +01:00
Gwendal Roué fc3aca792f Replace InitialDispatch with ValueScheduling 2018-10-28 11:28:31 +01:00
Gwendal Roué a043c4c29e QoS are hard 2018-10-27 23:01:24 +02:00
Gwendal Roué ec5451ee70 Cleanup 2018-10-27 17:18:03 +02:00
Gwendal Roué 7c4462641e ValueObservation creation is always done with a factory initializer 2018-10-27 17:16:03 +02:00
Gwendal Roué 82efe7ca23 AnyValueReducer 2018-10-27 17:06:23 +02:00
Gwendal Roué 052d2e3008 Value (string, int, etc.) observation, with uniquing 2018-10-27 16:41:42 +02:00
Gwendal Roué de227bdce1 Bake uniquing right into ValueObservation: introduce ValueReducer 2018-10-27 16:12:42 +02:00
Gwendal Roué 697b2af61d Wrap long lines 2018-10-27 05:11:19 +02:00
Gwendal Roué ff4f6f3b12 Cleanup 2018-10-27 04:59:24 +02:00
Gwendal Roué 31b688d801 ValueObservationn has a QoS 2018-10-27 04:24:17 +02:00
Gwendal Roué f694437f5b Add missing public qualifiers 2018-10-27 04:23:45 +02:00
Gwendal Roué 69853d7901 Now that user implementations of DatabaseWriter are no longer supported...
...stop pretending we have to implement concurrentRead
on top of the deprecated readFromCurrentState.

And this fixes #419 :-)
2018-10-26 16:53:30 +02:00
Gwendal Roué abe6957c85 Typo 2018-10-26 16:42:27 +02:00
Gwendal Roué 08b103f5f5 DatabaseReader and DatabaseWriter are no longer available for user types
- stop testing compatibility with user types
- document that they are no longer available for user types (readme, changelog)
2018-10-26 16:42:14 +02:00
Gwendal Roué 9c71356e3d Honor ValueObservation.readonly 2018-10-26 09:10:26 +02:00
Gwendal Roué 2341523c41 API cleanup 2018-10-26 08:50:59 +02:00
Gwendal Roué 0df4815086 Move ValueObservation support to DatabaseReader 2018-10-25 20:39:04 +02:00
Gwendal Roué fe0f238f32 Cleanup 2018-10-25 08:49:57 +02:00
Gwendal Roué fda04a105d ValueObservation: extract callbacks 2018-10-25 08:39:52 +02:00
Gwendal Roué e5d97c15ad Looking for a good API 2018-10-25 08:05:55 +02:00
Gwendal Roué ce95ff7278 Move towards observation from reader 2018-10-24 19:17:11 +02:00
Gwendal Roué 33927e7f4d FetchResultsObserver 2018-10-23 13:24:46 +02:00
Gwendal Roué 6a4d9fb8fc Merge pull request #431 from KyleLeneau/codeable-json-sync-playground
Working on a Codable JSON sync example
2018-10-17 19:14:49 +02:00
Kyle LeNeau cf33d78f49 Working on a Codable JSON sync example 2018-10-14 12:49:37 -07:00
Gwendal Roué 0d89aa911b Documentation 2018-10-09 08:35:17 +02:00
Gwendal Roué d521a99d87 Typo fix 2018-10-09 08:10:56 +02:00
Gwendal Roué a848d864ce Documentation 2018-10-08 21:59:04 +02:00
Gwendal Roué 759c1088a1 v3.4.0 2018-10-08 21:37:58 +02:00
Gwendal Roué 2d004a1a26 Merge branch 'development' 2018-10-08 21:22:10 +02:00
Gwendal Roué 35e1de495e Merge pull request #428 from groue/feature/SQLite-3.25.2
Upgrade custom SQLite builds to version 3.25.2
2018-10-08 21:19:51 +02:00
Gwendal Roué 697709c82f thank you note 2018-10-08 19:19:45 +02:00
Gwendal Roué 9ad476235d CHANGELOG 2018-10-08 19:17:02 +02:00
Gwendal Roué dadc5c3c58 Fix a test for syntax error that fails with SQLite 3.25.2 2018-10-08 19:16:54 +02:00
Gwendal Roué 3be3a51cdc Fix a compiler warning 2018-10-08 19:13:12 +02:00
Gwendal Roué 7bdbfb77dd Upgrade SQLite version in documentation 2018-10-08 19:11:24 +02:00
Gwendal Roué 8e0c01ef70 SQLite 3.25.2 2018-10-08 19:03:41 +02:00
Gwendal Roué 1c5cecf568 Merge pull request #423 from groue/feature/annotation
Association Aggregates
2018-10-08 13:59:14 +02:00
Gwendal Roué 9330468f92 Documentation 2018-10-08 09:10:48 +02:00
Gwendal Roué fcbea047cc Documentation 2018-10-08 09:08:37 +02:00
Gwendal Roué 619b73ea76 Documentation 2018-10-08 09:04:14 +02:00
Gwendal Roué 597d745e37 Documentation 2018-10-08 09:02:53 +02:00
Gwendal Roué 52ffb4a02c Documentation 2018-10-08 08:59:56 +02:00
Gwendal Roué c007c04afb Documentation 2018-10-08 08:58:21 +02:00
Gwendal Roué 4b92968912 Documentation 2018-10-08 08:56:36 +02:00
Gwendal Roué 2938a95270 Inline documentation 2018-10-08 08:24:14 +02:00
Gwendal Roué 5b2e9cdaa5 Fix link 2018-10-07 20:01:39 +02:00
Gwendal Roué 5736cd2740 CHANGELOG 2018-10-07 19:59:35 +02:00
Gwendal Roué 6b05617d8d Documentation 2018-10-07 19:10:37 +02:00
Gwendal Roué 58470fa959 Documentation 2018-10-07 18:50:50 +02:00
Gwendal Roué 43c04268ee Documentation 2018-10-07 18:47:21 +02:00
Gwendal Roué 3ba8d7ae60 Documentation 2018-10-07 18:45:17 +02:00
Gwendal Roué 97c22cde40 Documentation 2018-10-07 18:26:10 +02:00
Gwendal Roué 8a983274af Documentation 2018-10-07 18:25:33 +02:00
Gwendal Roué 445ec18d6e Documentation 2018-10-07 18:20:22 +02:00
Gwendal Roué a441b1d24d Documentation 2018-10-07 18:18:51 +02:00
Gwendal Roué 23743680d2 Documentation 2018-10-07 18:11:52 +02:00
Gwendal Roué afaabfe872 Documentation 2018-10-07 18:09:53 +02:00
Gwendal Roué 53114ea491 Documentation 2018-10-07 18:05:41 +02:00
Gwendal Roué 12745b2882 Documentation 2018-10-07 18:03:38 +02:00
Gwendal Roué 19291e2501 Documentation 2018-10-07 17:55:49 +02:00
Gwendal Roué 3890d2659f Documentation 2018-10-07 17:51:51 +02:00
Gwendal Roué 68a8592bcd Documentation 2018-10-07 17:42:55 +02:00
Gwendal Roué 445187c276 Documentation 2018-10-07 17:37:55 +02:00
Gwendal Roué 55707e67d4 Documentation 2018-10-07 17:31:58 +02:00
Gwendal Roué 82435db722 Documentation 2018-10-07 17:29:59 +02:00
Gwendal Roué a47a0c9d2d Typo 2018-10-07 17:17:41 +02:00
Gwendal Roué 5a24726cf1 Documentation 2018-10-07 17:08:24 +02:00
Gwendal Roué 7ecacaaccc Documentation 2018-10-07 16:34:49 +02:00
Gwendal Roué 704da35576 aliased(CodingKey), annotated(with: aggregate, ...), count and isEmpty are now properties 2018-10-07 16:20:13 +02:00
Gwendal Roué 2774aaf292 aggregate alias cleanup 2018-10-07 15:40:38 +02:00
Gwendal Roué 8ffeb28b02 Tests for association aggregate operators 2018-10-07 15:20:24 +02:00
Gwendal Roué 5f92209c59 AssociationAggregates: logic, arithmetic, and comparison operators 2018-10-07 12:22:48 +02:00
Gwendal Roué 4f8e97a07c AssociationAggregate is now generic on its anchor type only 2018-10-07 12:08:25 +02:00
Gwendal Roué 39bc140dc8 Rename Annotation to AssociationAggregate 2018-10-07 11:39:46 +02:00
Gwendal Roué 0838d5903e Documentation 2018-10-06 15:46:47 +02:00
Gwendal Roué a0cd603c61 Nicer SQL generation for isEmpty annotation 2018-10-06 14:50:08 +02:00
Gwendal Roué 3ef8083043 testAnnotationWithJoiningMethodAndTableAliasAndSQLSnippet 2018-10-06 14:29:48 +02:00
Gwendal Roué 35ed13c940 Test for annotations in HAVING clauses 2018-10-06 14:15:35 +02:00
Gwendal Roué 1da41c7fe5 TODO 2018-10-05 18:50:34 +02:00
Gwendal Roué 01069ee998 fix typo 2018-10-05 18:50:34 +02:00
Gwendal Roué ebbf858da4 Documentation 2018-10-05 18:50:34 +02:00
Gwendal Roué 047a95f2c9 Improve sample code 2018-10-05 18:50:34 +02:00
Gwendal Roué 7508811e40 Fix typo 2018-10-05 18:50:34 +02:00
Gwendal Roué 2ae8e236c0 Aggregates are no longer a missing association feature :-) 2018-10-05 18:50:34 +02:00
Gwendal Roué a13903e7a1 Documentation 2018-10-05 18:50:34 +02:00
Gwendal Roué c25bc1d5fa Documentation 2018-10-05 18:50:34 +02:00
Gwendal Roué d004372b63 More cleanup 2018-10-05 18:50:34 +02:00
Gwendal Roué 789248e369 minor 2018-10-05 18:50:34 +02:00
Gwendal Roué 3404cc574b CHANGELOG 2018-10-05 18:50:34 +02:00
Gwendal Roué 2ca049c2e4 Cleanup 2018-10-05 18:50:34 +02:00
Gwendal Roué 89054c8165 typo 2018-10-05 18:50:34 +02:00
Gwendal Roué 24e8ee2d00 Stabilize annotation aliases, and allow aggregate any expression 2018-10-05 18:50:34 +02:00
Gwendal Roué f69c79bc1a typo 2018-10-05 18:50:34 +02:00
Gwendal Roué 82765aba1d typo 2018-10-05 18:50:34 +02:00
Gwendal Roué bcc177ff7d typo 2018-10-05 18:50:34 +02:00
Gwendal Roué 3bfef630f9 typo 2018-10-05 18:50:34 +02:00
Gwendal Roué 6a6d58da6c typo 2018-10-05 18:50:34 +02:00
Gwendal Roué 6e7065de36 Annotation documentation 2018-10-05 18:50:34 +02:00
Gwendal Roué f60152ed2e Add Inflections.swift to GRDBWatchOS 2018-10-05 18:50:34 +02:00
Gwendal Roué f6b0c0cc65 Rename test 2018-10-05 18:50:34 +02:00
Gwendal Roué c16b2bcb57 The count annotation has to be distinct 2018-10-05 18:50:34 +02:00
Gwendal Roué 5d70ef93c8 Test that filter(key:), orderByPrimaryKey(), and groupByPrimaryKey() capture the table name 2018-10-05 18:50:34 +02:00
Gwendal Roué 68d76eca01 Annotations: avg, min, max, sum 2018-10-05 18:50:33 +02:00
Gwendal Roué 83453e1b11 Make private a test helper class 2018-10-05 18:50:33 +02:00
Gwendal Roué 903694d095 First annotation: HasManyAssociaton.count 2018-10-05 18:50:33 +02:00
Gwendal Roué 168d2850ab Introduce groupByPrimaryKey() 2018-10-05 18:50:33 +02:00
Gwendal Roué fc692bdb8a Merge pull request #427 from groue/feature/cursor-reset
Have cursors reset SQLite statements in deinit
2018-10-05 12:23:08 +02:00
Gwendal Roué d963e688be CHANGELOG 2018-10-05 08:24:34 +02:00
Gwendal Roué 6157ab0583 Have cursors reset their statement when they are deinitialized
This is the real fix for #424. GRDB used to keep unfinished SQLite statements around. Now cursors properly reset their statement when they are done. We no longer have to clear the statement cache before a backup.
2018-10-05 08:13:23 +02:00
Gwendal Roué ad61c72988 Remove two invalid tests that use cursor outside of their protected dispatch queue 2018-10-05 08:04:37 +02:00
Gwendal Roué dd4b651938 Merge pull request #425 from groue/feature/robust-backup
Fix "destination database is in use " error during database backup
2018-10-04 15:59:43 +02:00
Gwendal Roué 7cd50872cf Merge branch 'master' into development 2018-10-04 13:40:43 +02:00
Gwendal Roué fc5e92954b SQLCipher, too, can't erase a database if there are cached prepared statements. 2018-10-04 13:34:35 +02:00
Gwendal Roué 6c7ac25fb8 Remove Carthage from suggested contributions (#408 and #262 have helped a lot) 2018-10-04 13:20:51 +02:00
Gwendal Roué 86cff20f99 New suggested contribution: "Records: Splitting Database Encoding from Ability to Write in the Database" 2018-10-04 13:14:29 +02:00
Gwendal Roué 7a628bf23f Add minimal failing test for #424 2018-10-04 08:35:02 +02:00
Gwendal Roué 9e8d08f579 CHANGELOG 2018-10-04 07:59:50 +02:00
Gwendal Roué 8c3606fe4b Fix failing test for #424 2018-10-04 07:58:36 +02:00
Gwendal Roué 01c9e9e1e1 Failing test for #424 2018-10-03 13:55:55 +02:00
Gwendal Roué ff28c02f21 Merge branch 'master' into development 2018-10-03 13:00:02 +02:00
Gwendal Roué 1426c7fd38 New suggested contribution: Custom FTS5 Auxiliary Functions 2018-10-03 12:57:21 +02:00
Gwendal Roué 366460bc62 Merge pull request #422 from groue/feature/AssociationMerge
Refining Association Requests
2018-09-30 16:39:33 +02:00
Gwendal Roué 16c62999fa More merging tests (and fix a bug with ordering) 2018-09-30 15:10:54 +02:00
Gwendal Roué 2cd3a7e0c9 High-level test for association request refining
Here we test the sample code in AssociationBasics.md
2018-09-30 14:51:52 +02:00
Gwendal Roué 9958e7b96c Documentation and cleanup 2018-09-30 13:57:31 +02:00
Gwendal Roué 8319c70315 CHANGELOG 2018-09-30 13:32:44 +02:00
Gwendal Roué 45ff5f2fa1 One less known issue with associations :-) 2018-09-30 13:23:35 +02:00
Gwendal Roué df51d2887a Documentation tweaks 2018-09-30 13:22:05 +02:00
Gwendal Roué 9c37237f7b New "Refining Association Requests" documentation chapter 2018-09-30 13:16:57 +02:00
Gwendal Roué 6ecb7a40d0 associations are not merged when they don't have the same key 2018-09-30 06:48:20 +02:00
Gwendal Roué 52ec6c6cd2 Merge associations: 2018-09-30 06:35:15 +02:00
Gwendal Roué ba11d7be66 Merge associations: SQL tests 2018-09-30 05:46:44 +02:00
Gwendal Roué 4c58fd5111 Merge associations: scope tests WIP 2018-09-29 20:28:28 +02:00
Gwendal Roué 4bde81db4f Merge associations: scope tests WIP 2018-09-29 15:18:53 +02:00
Gwendal Roué 37a9999b35 Merge associations: including wins over joining 2018-09-29 14:37:53 +02:00
Gwendal Roué 33b40637a8 Merge associations 2018-09-29 14:16:56 +02:00
Gwendal Roué e7fd075936 Early detection of association key conflict 2018-09-29 12:40:11 +02:00
Gwendal Roué cc4a9fa2e2 Demo screenshot fixes 2018-09-23 15:48:41 +02:00
Gwendal Roué 56f3bdc390 Demo screenshot fixes 2018-09-23 15:48:08 +02:00
Gwendal Roué ba5537692f Demo screenshot fixes 2018-09-23 15:47:18 +02:00
Gwendal Roué 5595046341 Fix documentation 2018-09-23 12:39:21 +02:00
Gwendal Roué ad844f6ba5 Merge branch 'development' 2018-09-23 10:41:13 +02:00
Gwendal Roué baf8dbc881 v3.3.1 2018-09-23 10:39:55 +02:00
Gwendal Roué ad672395de Fix screenshot 2018-09-23 10:18:28 +02:00
Gwendal Roué 923fab769f final tweaks 2018-09-23 09:59:29 +02:00
Gwendal Roué 4e3dc03422 inner links 2018-09-23 07:09:37 +02:00
Gwendal Roué d96212ca59 CHANGELOG 2018-09-22 20:46:13 +02:00
Gwendal Roué d16022a33a README 2018-09-22 20:38:27 +02:00
Gwendal Roué 5cb22125aa README 2018-09-22 20:35:14 +02:00
Gwendal Roué 6ee77df2dd Layout 2018-09-22 20:31:03 +02:00
Gwendal Roué ea54b06e28 Layout 2018-09-22 20:30:27 +02:00
Gwendal Roué 6b33c08b26 Demo app README 2018-09-22 15:01:22 +02:00
Gwendal Roué cb16bf549f Demo app README 2018-09-22 14:57:22 +02:00
Gwendal Roué 9a8b60a8a7 PlayerEditionViewController saves in the database 2018-09-22 14:55:32 +02:00
Gwendal Roué dec965d610 Demo app README 2018-09-22 14:06:00 +02:00
Gwendal Roué adf3e65971 Demo app README 2018-09-22 14:01:45 +02:00
Gwendal Roué c437e4a2ef Demo app README 2018-09-22 13:47:38 +02:00
Gwendal Roué 4dd9d2e1fe Demo app README.md 2018-09-22 13:46:37 +02:00
Gwendal Roué 185c3cbbf9 Update documentation inner links 2018-09-22 13:41:46 +02:00
Gwendal Roué ffbf4d2c87 Layout 2018-09-22 13:34:41 +02:00
Gwendal Roué 464cd0db7d Layout 2018-09-22 13:32:53 +02:00
Gwendal Roué e2e00f9b40 Layout 2018-09-22 13:30:16 +02:00
Gwendal Roué 2c2c75b0f4 Layout 2018-09-22 13:29:47 +02:00
Gwendal Roué 8ef7547c8e Promote demo app in main README.md 2018-09-22 13:21:11 +02:00
Gwendal Roué d82daaa398 CHANGELOG 2018-09-22 13:00:34 +02:00
Gwendal Roué a5a8b2ac40 Fix failing test for custom FTS5 tokenizer in DatabasePool
Tokenizer are now added to new reader connections.
2018-09-22 13:00:34 +02:00
Gwendal Roué bdcbee37f4 Failing test for custom FTS5 tokenizer in DatabasePool 2018-09-22 13:00:34 +02:00
Gwendal Roué 70508f5daa Split long line 2018-09-22 12:59:50 +02:00
Gwendal Roué 3c44180c47 PlayerEditionViewController UI tweaks 2018-09-22 12:54:25 +02:00
Gwendal Roué 3d179acc00 Demo app code cleanup
- Make Player columns private
- Simplify view controllers relationships
2018-09-22 12:32:55 +02:00
Gwendal Roué dd9ca2317c More SQL generation ideas 2018-09-20 08:22:34 +02:00
Gwendal Roué c71d4903a0 Merge branch 'release/v3.3.0' 2018-09-16 18:55:43 +02:00
Gwendal Roué d118a775ac Bump SQLCipher/src 2018-09-16 18:52:37 +02:00
Gwendal Roué e92c0c9aed Hide SQLSpecificExpressible from jazzy documentation 2018-09-16 13:39:11 +02:00
Gwendal Roué b826789349 Workaround https://github.com/realm/jazzy/issues/970 2018-09-16 13:35:56 +02:00
Gwendal Roué a09099bb02 v3.3.0 2018-09-16 12:58:36 +02:00
Gwendal Roué 914781cd7f Thank you @KyleLeneau 2018-09-16 12:16:52 +02:00
Gwendal Roué de84b084ec Merge pull request #408 from KyleLeneau/fix-carthage-tests
Getting carthage tests to pass
2018-09-16 12:11:39 +02:00
Gwendal Roué 2b6e69404e FetchedRecordsController in usage section 2018-09-16 12:09:47 +02:00
Kyle LeNeau aaca651a2e Getting Carthage tests to pass 2018-09-14 01:34:38 +09:00
Gwendal Roué 138289b646 Documentation improvement 2018-09-13 09:07:12 +02:00
Gwendal Roué d4157db4b1 CHANGELOG 2018-09-13 09:02:14 +02:00
Gwendal Roué 3bf32564a4 Merge pull request #409 from groue/feature/concurrentRead
DatabaseWriter.concurrentRead
2018-09-13 08:56:38 +02:00
Gwendal Roué 7186cd98c8 (more diff algorithms) 2018-09-13 07:31:35 +02:00
Gwendal Roué b9a878bb20 Cleanup 2018-09-11 08:56:29 +02:00
Gwendal Roué 8c479a863a Documentation 2018-09-09 20:00:03 +02:00
Gwendal Roué 58a48b73ae concurrentRead documentation 2018-09-09 19:55:07 +02:00
Gwendal Roué 2e6ed9d8f9 TODO 2018-09-09 16:03:00 +02:00
Gwendal Roué df406341c1 CHANGELOG.md 2018-09-09 16:00:53 +02:00
Gwendal Roué 41629ec9aa Future.wait() must be called only once 2018-09-09 16:00:01 +02:00
Gwendal Roué 47b42f38e3 CHANGELOG.md 2018-09-09 15:46:36 +02:00
Gwendal Roué 21209fb107 CHANGELOG.md 2018-09-09 13:46:13 +02:00
Gwendal Roué 106812c02c Fix SPM 2018-09-09 13:42:35 +02:00
Gwendal Roué da58e228c0 Document Future 2018-09-09 13:18:15 +02:00
Gwendal Roué 9bfe893908 DatabaseWriter.concurrentRead replaces readFromCurrentState 2018-09-09 13:12:35 +02:00
Gwendal Roué 03a781075e Cleanup 2018-09-06 08:50:56 +02:00
Gwendal Roué 60afc9ee06 Tweak existence checks for tables, views and triggers 2018-09-06 08:31:27 +02:00
Gwendal Roué 22165984c3 Cursor.isEmpty() 2018-09-06 08:29:57 +02:00
Gwendal Roué eebb013d06 Merge branch 'master' into development 2018-09-05 14:16:39 +02:00
Gwendal Roué 0e0ebdb2d6 Fix podspec 2018-09-05 14:09:01 +02:00
Gwendal Roué be15f89e28 Merge tag 'v3.3.0-beta1' into development
v3.3.0-beta1
2018-09-05 13:55:48 +02:00
Gwendal Roué 5d2f063c93 Merge branch 'release/v3.3.0-beta1' 2018-09-05 13:55:47 +02:00
Gwendal Roué e49c190288 Fix release date 2018-09-05 13:52:00 +02:00
Gwendal Roué d3ddf1c1bc Prepare merge on master 2018-09-05 13:36:31 +02:00
Gwendal Roué 04fc14d557 Compatibility: restore SWIFT_VERSION to 4.0 for embeddable projects 2018-09-05 13:09:27 +02:00
Gwendal Roué 603115c9a4 Tests/CocoaPods: use Swift 4.2 2018-09-05 13:04:47 +02:00
Gwendal Roué 6b60fbe50e Tests/CocoaPods/GRDBiOS: use Swift 4.2 2018-09-05 13:04:47 +02:00
Gwendal Roué 2a43869e45 Prepare v3.3.0-beta1 2018-09-05 13:04:47 +02:00
Gwendal Roué bd52dbcec0 Migrate projects to SWIFT_VERSION = 4.2 2018-09-05 13:04:47 +02:00
Gwendal Roué c9dace3089 Spot a flacky test 2018-09-05 13:04:47 +02:00
Gwendal Roué 9184cbe324 Welcome @SD10 in the thank you notice 2018-09-04 13:16:14 +02:00
Gwendal Roué 2216573acb Prefer pseudonyms 2018-09-04 13:15:20 +02:00
Gwendal Roué 2b331e3c03 Merge pull request #407 from SD10/development
Add Code of Conduct
2018-09-04 13:10:05 +02:00
Gwendal Roué 875e7779c3 More CloudKit 2018-09-04 08:54:20 +02:00
Gwendal Roué 743a56e0e4 More CloudKit 2018-09-04 08:47:20 +02:00
Gwendal Roué 6e1ef92a38 More CloudKit 2018-09-04 08:43:49 +02:00
Gwendal Roué e3ca4e42a3 CloudKit context 2018-09-04 08:24:39 +02:00
Steven Deutsch 6db4c38c74 Fix develop -> development branch name 2018-09-01 11:12:20 -05:00
Steven Deutsch 8a16f0ba42 Add CODE_OF_CONDUCT 2018-09-01 11:03:34 -05:00
Gwendal Roué 81cd30bb38 CONTRIBUTING.md 2018-09-01 16:38:35 +02:00
Gwendal Roué d26145e59e CONTRIBUTING.md 2018-09-01 16:37:37 +02:00
Gwendal Roué 2b664d5485 CONTRIBUTING.md 2018-09-01 16:06:50 +02:00
Gwendal Roué 27f8103e79 CONTRIBUTING.md 2018-09-01 15:55:44 +02:00
Gwendal Roué a5c2c618e4 CONTRIBUTING.md 2018-09-01 15:55:26 +02:00
Gwendal Roué 9d4a083193 CONTRIBUTING.md 2018-09-01 15:52:04 +02:00
Gwendal Roué 9d00f63358 CONTRIBUTING.md 2018-09-01 15:47:16 +02:00
Gwendal Roué 0ae85eed24 CONTRIBUTING.md 2018-09-01 15:43:25 +02:00
Gwendal Roué 41050094af CONTRIBUTING.md 2018-09-01 15:41:06 +02:00
Gwendal Roué 7d339edd6e CONTRIBUTING.md 2018-09-01 15:26:43 +02:00
Gwendal Roué 23d7d3f8ed CONTRIBUTING.md 2018-09-01 15:17:34 +02:00
Gwendal Roué 7bd9703540 CONTRIBUTING.md 2018-09-01 15:16:37 +02:00
Gwendal Roué 8a6e7b70ef CONTRIBUTING.md 2018-09-01 15:12:55 +02:00
Gwendal Roué 5a8c3cdafc CONTRIBUTING.md 2018-09-01 15:09:15 +02:00
Gwendal Roué 16a1cecc57 CONTRIBUTING.md 2018-09-01 15:02:05 +02:00
Gwendal Roué e367d55940 CONTRIBUTING.md 2018-09-01 14:46:07 +02:00
Gwendal Roué b45b6cd0cf CONTRIBUTING.md 2018-09-01 14:40:28 +02:00
Gwendal Roué c2535d19e9 CONTRIBUTING.md 2018-09-01 14:37:30 +02:00
Gwendal Roué fa4ca12903 CONTRIBUTING.md 2018-09-01 14:17:27 +02:00
Gwendal Roué c5444fa99d Merge pull request #396 from groue/swift4.2
Support for Xcode 10 and Swift 4.2
2018-08-31 08:24:53 +02:00
Gwendal Roué 468eaf8642 CHANGELOG 2018-08-31 08:17:50 +02:00
Gwendal Roué d9d0f62f71 Travis: please test Swift 4.0, 4.2, and Xcode 9.3, 9.4, and 10. 2018-08-30 16:34:30 +02:00
Gwendal Roué 8b4eb55568 Use Cocoapods pre-release (1.6.0 beta) 2018-08-30 16:34:30 +02:00
Gwendal Roué 132ba89427 Adapt SQLCipher to the new build system 2018-08-30 16:34:30 +02:00
Gwendal Roué 1c26b7748e SQLCipher: Define ARCHS to $ARCHS_STANDARD for all sdks
This prevents Xcode 10 beta from outputting errors when it meets the i386 architecture.
2018-08-30 16:34:30 +02:00
Gwendal Roué 3354b22cd0 Travis: run tests with Xcode 10 2018-08-30 16:34:30 +02:00
Gwendal Roué e5cd3a8994 SE-0206 2018-08-30 16:34:30 +02:00
Gwendal Roué 1c09a3d31f New MIN_SWIFT_VERSION and MAX_SWIFT_VERSION makefile variables
This allows us to test GRDB with Swift 4.2, but also with the Swift 4.2 compiler in 4.0 compatibility mode.
2018-08-30 16:34:30 +02:00
Gwendal Roué 83c257822b FTS5: Swift / OS version checks extravaganza
With a big thank you to @hartbit for providing a ready-made solution
2018-08-30 16:34:30 +02:00
Gwendal Roué e82c92a002 Allow experiments with OTHER_SWIFT_FLAGS 2018-08-30 16:34:30 +02:00
Gwendal Roué d58586a18e Enable FTS5 on iOS 12
Thanks to @jrose-apple for the nice tip that avoids code duplication
2018-08-30 16:34:30 +02:00
Gwendal Roué 066889e0d7 Upgrade swiftlyfalling/SQLiteLib 2018-08-30 16:34:30 +02:00
Gwendal Roué ff595eeaef Compile with both Swift 4.1 and Swift 4.2 2018-08-30 16:34:30 +02:00
Gwendal Roué 80956ee2c7 Makefile: support for Xcode 10.0 2018-08-30 16:34:30 +02:00
Gwendal Roué 95ef76e839 More DatabaseRegion documentation 2018-08-30 13:32:53 +02:00
Gwendal Roué bcdf9d8c58 Internal documentation link 2018-08-30 13:03:13 +02:00
Gwendal Roué c44a1518cc Improve DatabaseRegion documentation 2018-08-30 13:02:17 +02:00
Gwendal Roué 8056a0e3c9 Vocabulary 2018-08-30 10:37:51 +02:00
Gwendal Roué 47275d0bf0 Internal documentation link 2018-08-30 10:35:12 +02:00
Gwendal Roué af8e17c753 Document that observation works well with SQL triggers 2018-08-30 10:33:31 +02:00
Gwendal Roué 6b6f80b818 Internal documentation link 2018-08-30 10:27:26 +02:00
Gwendal Roué eaf25161a5 Fic typo 2018-08-30 10:22:15 +02:00
Gwendal Roué 870d6e6966 More DatabaseRegion documentation 2018-08-30 10:21:25 +02:00
Gwendal Roué cd2697e34b CHANGELOG 2018-08-30 10:16:04 +02:00
Gwendal Roué 2083c3b41c Fix typo 2018-08-30 10:14:19 +02:00
Gwendal Roué d65d547b23 DatabaseRegion documentation 2018-08-30 10:13:01 +02:00
Gwendal Roué 0593832d10 Document interaction between DatabaseRegion and transaction observers (2) 2018-08-30 09:00:21 +02:00
Gwendal Roué 056db7ff6f Document interaction between DatabaseRegion and transaction observers 2018-08-30 08:46:58 +02:00
Gwendal Roué 3c01f0f1c0 TODO 2018-08-27 17:30:44 +02:00
Gwendal Roué 05dc1a5bea Fix typo 2018-08-27 15:53:33 +02:00
Gwendal Roué 2174beb396 Review DatabaseValueConversionErrorTests 2018-08-26 15:14:43 +02:00
Gwendal Roué d9989fc442 FetchableRecord+Decodable: fix a few corner cases 2018-08-26 15:14:20 +02:00
Gwendal Roué 566f42e8d0 Remove useless conversion contexts 2018-08-26 14:07:36 +02:00
Gwendal Roué f159927724 SE-0075 2018-08-26 12:07:19 +02:00
Gwendal Roué 21b8690e07 TODO 2018-08-26 10:42:01 +02:00
Gwendal Roué bb91a7ca0b Fix typo 2018-08-26 10:41:36 +02:00
Gwendal Roué 5819419f3b Minor documentation update 2018-08-25 17:30:40 +02:00
Gwendal Roué 2c59f838aa Fix typo 2018-08-25 17:00:56 +02:00
Gwendal Roué cbbc12adc0 Enhance introduction to records 2018-08-25 17:00:10 +02:00
Gwendal Roué d4d0aed3ae Simplify jazzy documentation 2018-08-25 16:04:50 +02:00
Gwendal Roué 588d7ac4ca Enhance Transactions documentation 2018-08-25 15:43:22 +02:00
Gwendal Roué ab98081e7b Don't initialize PersistenceContainer inside RecordEncoder 2018-08-25 15:32:57 +02:00
Gwendal Roué a8a3ec8259 Enhance Swift Enums documentation 2018-08-25 15:31:59 +02:00
Gwendal Roué 4fcc1f81d5 Update "Differences between Database Queues and Pools" chapter 2018-08-25 14:17:46 +02:00
Gwendal Roué 4572e493e6 Update "Differences between Database Queues and Pools" chapter 2018-08-25 13:43:58 +02:00
Gwendal Roué 1928c84b80 Update "Differences between Database Queues and Pools" chapter 2018-08-25 13:17:01 +02:00
Gwendal Roué b4d99dc738 Update "Differences between Database Queues and Pools" chapter 2018-08-25 13:07:33 +02:00
Gwendal Roué 8abf815045 Enhance readFromCurrentState and snapshots documentation 2018-08-25 12:22:40 +02:00
Gwendal Roué 7610eebb3f Enhance Codable Record documentatoin 2018-08-25 12:19:16 +02:00
Gwendal Roué c43800f40d Enhance Date documentation 2018-08-25 12:16:16 +02:00
Gwendal Roué a511772562 Enhance Values documentation 2018-08-25 12:11:39 +02:00
Gwendal Roué e916f577f1 Enhance Row documentation 2018-08-25 12:10:07 +02:00
Gwendal Roué da14fd2f87 Enhance DatabaseValue documentation 2018-08-25 11:50:07 +02:00
Gwendal Roué 052e615de0 Enhance Row documentation 2018-08-25 11:48:08 +02:00
Gwendal Roué 5a2f713775 Enhance Cursor documentation 2018-08-25 11:46:41 +02:00
Gwendal Roué ae66563654 Documentation + test for mixed arguments 2018-08-23 14:52:59 +02:00
Gwendal Roué 26df5aa516 Documentation 2018-08-23 14:32:30 +02:00
Gwendal Roué d3a9667f10 Cleanup 2018-08-22 13:04:24 +02:00
Gwendal Roué adf5695c20 Move StatementCache to Database+Statements.swift 2018-08-22 12:56:12 +02:00
Gwendal Roué aa8cb60fad SQLCipher has learned SQLITE_PREPARE_PERSISTENT 2018-08-22 12:52:13 +02:00
Gwendal Roué 65d99879a8 SQLCipher has learned SQLITE_PREPARE_PERSISTENT 2018-08-22 12:50:07 +02:00
Gwendal Roué b14f1b9fdc SQLCipher has learned sqlite3_prepare_v3 2018-08-22 08:53:01 +02:00
Gwendal Roué 46511e507e Avoid code duplication in Database.setupTrace
Also, use sqlite3_trace_v2 with SQLCipher
2018-08-22 08:35:54 +02:00
Gwendal Roué 8f5eee0130 Avoid code duplication in Database.closeConnection 2018-08-22 08:01:26 +02:00
Gwendal Roué 7f8d59b7b1 Merge pull request #403 from groue/feature/decoding-strategies
Codable records: customize date and uuid format
2018-08-21 19:40:20 +02:00
Gwendal Roué 0932e92fb4 Documentation 2018-08-21 19:39:34 +02:00
Gwendal Roué 5a8381b282 Add missing attribution 2018-08-21 14:39:46 +02:00
Gwendal Roué 8493984949 Fix Typo 2018-08-21 14:32:43 +02:00
Gwendal Roué a386fb6580 Documentation 2018-08-21 08:17:57 +02:00
Gwendal Roué baee699591 CHANGELOG 2018-08-21 06:58:18 +02:00
Gwendal Roué ad11affd21 ISO8601: don't let user customize the formatter 2018-08-20 23:43:04 +02:00
Gwendal Roué 209b3d0d37 Fix SPM and -O builds 2018-08-20 23:32:38 +02:00
Gwendal Roué edca38470e Documentation 2018-08-20 22:24:26 +02:00
Gwendal Roué e9b76bb196 Tests for DatabaseUUIDEncodingStrategy 2018-08-20 22:16:29 +02:00
Gwendal Roué f70e9b3e39 Introduce DatabaseUUIDEncodingStrategy 2018-08-20 21:14:51 +02:00
Gwendal Roué 13f3e5ec0d Remove useless conversions from Int to Int32 2018-08-20 21:14:32 +02:00
Gwendal Roué fb209d8805 Decode UUID and NSUUID from both blobs and strings 2018-08-20 21:13:58 +02:00
Gwendal Roué c6b1872291 Documentation 2018-08-20 19:40:23 +02:00
Gwendal Roué 8fa405452d Documentation 2018-08-20 19:38:11 +02:00
Gwendal Roué 34c7b0b40c Documentation 2018-08-20 19:32:59 +02:00
Gwendal Roué f583ef0d2a Documentation 2018-08-20 19:30:59 +02:00
Gwendal Roué e438d580b4 Don't close doors 2018-08-20 09:02:15 +02:00
Gwendal Roué 2c9a4b6968 Enhance "Record Customization Options" chapter 2018-08-20 09:00:35 +02:00
Gwendal Roué ba984427a4 Sort "Record Customization Options" by expected popularity 2018-08-20 08:58:17 +02:00
Gwendal Roué 1e34128213 Sort "Record Customization Options" by expected popularity 2018-08-20 08:57:35 +02:00
Gwendal Roué 319ac27b15 Extend "Record Customization Options" chapter 2018-08-20 08:56:02 +02:00
Gwendal Roué 8ea13dc5fd Quiet 2018-08-20 08:52:51 +02:00
Gwendal Roué ad6f1f4a37 Fix inner link 2018-08-20 08:51:48 +02:00
Gwendal Roué 063fe70766 More fostering of Codable records 2018-08-20 08:50:13 +02:00
Gwendal Roué 1c9ce6781b Enhance "JSON Columns" chapter 2018-08-20 08:30:57 +02:00
Gwendal Roué 81e777a323 Enhance "Use CodingKeys as Columns" chapter 2018-08-20 08:14:51 +02:00
Gwendal Roué b7273e0a7e Documentation 2018-08-20 08:05:20 +02:00
Gwendal Roué bb90ea0259 Improve explanation why the sortedKeys JSON option is recommended 2018-08-19 22:40:51 +02:00
Gwendal Roué f925d7e3d4 Fix SPM 2018-08-19 22:21:03 +02:00
Gwendal Roué bbf7eb0b73 Make tests platform-independent 2018-08-19 22:15:19 +02:00
Gwendal Roué 140c590c49 DatabaseDateEncodingStrategy tests 2018-08-19 21:54:50 +02:00
Gwendal Roué ff306c21e2 DatabaseDateEncodingStrategy 2018-08-19 21:54:41 +02:00
Gwendal Roué d1892c649c Documentation 2018-08-19 21:41:47 +02:00
Gwendal Roué f5d0e4db12 Cleanup & documentation 2018-08-19 20:28:47 +02:00
Gwendal Roué fc914470f5 DatabaseDateDecodingStrategy tests 2018-08-19 19:51:09 +02:00
Gwendal Roué d03b76b7e7 DatabaseDateDecodingStrategy 2018-08-19 19:50:35 +02:00
Gwendal Roué d45afb921a Merge pull request #401 from groue/feature/selectAs
Query Interface: set the selection and the fetched type in a single method call
2018-08-19 15:54:42 +02:00
Gwendal Roué e1f80494a8 CHANGELOG.md 2018-08-19 13:52:42 +02:00
Gwendal Roué 982dee5b77 Documentation improvements 2018-08-19 13:31:48 +02:00
Gwendal Roué 9815b310b6 TODO.md 2018-08-19 13:03:00 +02:00
Gwendal Roué 7bb0718bae Documentation for select(..., as:) 2018-08-19 13:02:45 +02:00
Gwendal Roué da60a5004e Tests for select(..., as:) 2018-08-19 12:30:02 +02:00
Gwendal Roué 8af33c4fc9 Introduce select(..., as:)
Record.select(..., as: Value.self) is equivalent to Record.select(...).asRequest(of: Value.self).

It somewhat improves the readability of some requests:

Player.select(max(Column("score")), as: Int.self)
2018-08-19 12:25:27 +02:00
Gwendal Roué 1fba575c18 Merge pull request #399 from groue/feature/codableUserInfo
Codable support: customize the `userInfo` context dictionary, and the format of JSON columns
2018-08-19 07:31:44 +02:00
Gwendal Roué 1e25debefc Done 2018-08-19 07:31:09 +02:00
Gwendal Roué 97d77e871b internal documentation 2018-08-18 20:54:40 +02:00
Gwendal Roué 7cb58cfffc Major cleanup of FetchableRecord+Decodable 2018-08-18 20:27:07 +02:00
Gwendal Roué 950940dedf Major cleanup of MutablePersistableRecord+Encodable 2018-08-18 19:02:16 +02:00
Gwendal Roué c32af15fdd Fix sample code 2018-08-18 16:10:47 +02:00
Gwendal Roué 3d285dfc81 Fix sample code 2018-08-18 16:09:44 +02:00
Gwendal Roué 76d3ac42ff More taste of DAO 2018-08-18 16:07:52 +02:00
Gwendal Roué e9b7a67c73 Fix JSON column tests so that they don't run when .sortedKeys option is not available 2018-08-18 15:54:01 +02:00
Gwendal Roué ba7cd4f61d Cleanup 2018-08-18 15:54:01 +02:00
Gwendal Roué 7a3321a5ed Add missing Foundation import 2018-08-18 15:54:01 +02:00
Gwendal Roué 5cb9d19b1e Cleanup README 2018-08-18 15:54:01 +02:00
Gwendal Roué 9e3da1a1a9 CHANGELOG 2018-08-18 15:54:01 +02:00
Gwendal Roué 35e202eb13 Documentation 2018-08-18 15:54:01 +02:00
Gwendal Roué 812975ee7d Cleanup 2018-08-18 15:54:01 +02:00
Gwendal Roué 934ee8e5f4 Remove a few obsolete debugging print statements 2018-08-18 15:54:01 +02:00
Gwendal Roué 47c424cb69 PersistableRecord: customize JSON encoding per column 2018-08-18 15:54:01 +02:00
Gwendal Roué b35fb6e315 FetchableRecord: customize JSON decoding per column 2018-08-18 15:54:01 +02:00
Gwendal Roué fdc191bbb4 Inline documentation 2018-08-18 15:54:01 +02:00
Gwendal Roué a8ec0530b1 Fix tests for iOS 2018-08-18 15:54:01 +02:00
Gwendal Roué b7b8594176 Pass tests for MutablePersistableRecord userInfo customization 2018-08-18 15:54:01 +02:00
Gwendal Roué eee433fefe Failing tests for MutablePersistableRecord userInfo customization 2018-08-18 15:54:01 +02:00
Gwendal Roué 513a5a3fb7 More FetchableRecord userInfo customization tests 2018-08-18 15:54:01 +02:00
Gwendal Roué 1a3638c0ef FetchableRecord can customize Decoder userInfo 2018-08-18 15:54:01 +02:00
Gwendal Roué ef123824c3 Failing tetsts for Decodable user infos 2018-08-18 15:54:01 +02:00
Gwendal Roué 2bc56255b2 TODO 2018-08-17 09:50:20 +02:00
Gwendal Roué a94711ad77 Fix a compiler warning introduced by 7be63866 2018-08-16 14:34:30 +02:00
Gwendal Roué 0ab84aff52 Enhance Codable Records documentation chapter 2018-08-16 14:24:07 +02:00
Gwendal Roué e415db248a Minor documentation tweak 2018-08-16 13:45:05 +02:00
Gwendal Roué c3a15bc2fc The benefits of having CodingKeys adopt ColumnExpression 2018-08-16 13:23:47 +02:00
Gwendal Roué 7a18b7c948 Test for CodingKey as ColumnExpression 2018-08-16 12:31:26 +02:00
Gwendal Roué df1f9b92a1 TODO.md 2018-08-16 11:00:35 +02:00
Gwendal Roué 4110f890da Minor documentation tweak 2018-08-16 09:02:05 +02:00
Gwendal Roué 44061f0d31 Improve Codable support visibility 2018-08-16 08:59:18 +02:00
Gwendal Roué 7be6386689 Fix DatabaseQueue.write and unsafeReentrantRead throws/rethrows qualifier. 2018-08-16 08:27:05 +02:00
Gwendal Roué 4d7d5e8429 Minor documentation tweak 2018-08-16 08:14:32 +02:00
Gwendal Roué b933917f34 Minor documentation tweak 2018-08-16 08:12:41 +02:00
Gwendal Roué d7f7a57129 Hide implementation details 2018-08-16 06:42:31 +02:00
Gwendal Roué d5008283d4 Minor documentation tweak 2018-08-15 23:18:36 +02:00
Gwendal Roué e51f27403d Minor documentation tweak 2018-08-15 23:05:09 +02:00
Gwendal Roué e5b2710151 Minor documentation tweaks 2018-08-15 22:58:49 +02:00
Gwendal Roué bdca768900 Improve Cursor documentation 2018-08-15 22:31:43 +02:00
Gwendal Roué b9b7ab2902 Rewrite Database queue and pool introducttions 2018-08-15 21:57:46 +02:00
Gwendal Roué 30bc15afb6 Merge pull request #397 from rotacloud/rotacloud
JSON encoding and decoding of codable record properties
2018-08-15 21:07:44 +02:00
Gwendal Roué 7ea15dcce2 Welcome @valexa and @gusrota to the thank you notice 2018-08-15 19:44:47 +02:00
Gwendal Roué 44b998c08f CHANGELOG.md 2018-08-15 19:38:03 +02:00
Gwendal Roué 2b8c8389fe Fix typo 2018-08-15 19:01:11 +02:00
Gwendal Roué dfb9421bd7 Documentation for JSON support 2018-08-15 18:53:10 +02:00
Gwendal Roué 02db2a8dc6 Tests for JSON data strategy 2018-08-15 18:40:24 +02:00
Gwendal Roué 9bb4ff86f1 Tests for JSON date strategy 2018-08-15 18:35:06 +02:00
Gwendal Roué 2eb0955420 JSON encoding: choose strategies
Data: .base64
Date: .millisecondsSince1970
NonConformingFloat: .throw
2018-08-15 18:34:47 +02:00
Gwendal Roué 659db4fdd9 Safer default implementation for RowImpl.copiedRow(_:) 2018-08-15 17:33:05 +02:00
Gwendal Roué d00421abe0 Restore SPM: add missing Foundation import 2018-08-15 17:17:08 +02:00
Gwendal Roué 4d343e893e More tests for Data -> String conversion: play with JPEG :-) 2018-08-15 17:09:15 +02:00
Gwendal Roué eba21d3371 Oh men of little faith! 2018-08-15 16:55:12 +02:00
Gwendal Roué b47f5864ac Even better feedback for conversion errors from StatementColumnConvertible 2018-08-15 16:49:07 +02:00
Gwendal Roué e8dacb31cc Tests for failed value conversions 2018-08-15 16:22:27 +02:00
Gwendal Roué 0b77d0d745 Better feedback for conversion errors from StatementColumnConvertible 2018-08-15 16:10:51 +02:00
Gwendal Roué de4f57c2aa Test decoding of non-UTF8 data 2018-08-15 16:09:45 +02:00
Gwendal Roué 2d6140a805 Refactor value conversion tests 2018-08-15 15:17:54 +02:00
Vlad Alexa b2234b46a2 5f41c57c addition 2018-08-15 14:04:14 +01:00
Gwendal Roué 358225b462 Cleanup, documentation, and preserve coding paths 2018-08-15 13:41:53 +02:00
Gwendal Roué 820673b78b PersistableRecord+Encodable: make it as robust as FetchableRecord+Decodable 2018-08-15 13:23:58 +02:00
Gwendal Roué 1c66ad4aad Restore GRDB/Core/Support/Foundation/Data.swift
because Data belongs to Foundation, not to the Standard Library.

Remove `import Foundation` from StandardLibrary.swift
2018-08-15 12:05:16 +02:00
Vlad Alexa 5f41c57c45 amended the documentation and tests to include Dictionary support to Codable types 2018-08-15 10:21:55 +01:00
Gwendal Roué 0cdc7d81d4 Just some cleanup, nothing new 2018-08-15 11:10:11 +02:00
Gwendal Roué 942b32e5d5 RowSingleValueDecodingContainer performance improvements
We switch from column indexing to integer indexing, which is far more efficient. And we can use the improved value decoding methods from #384.
2018-08-15 10:40:14 +02:00
Gwendal Roué aa8bc0fae3 Don't let JSONDecodingRequiredError go
JSON decoding: when row doesn't contain any Data, we don't want to expose a JSONDecodingRequiredError error to the user. We switch to a detailed conversion error instead (see #384).
2018-08-15 10:24:28 +02:00
Gwendal Roué 275098084d Introduce JSONDecodingRequiredError
We used to check for a standard DecodingError.typeMismatch error with specific message before switching to JSON decoding.

There was a small risk that such an error would not be generated by GRDB. In this case, we'd erroneously switch to JSON decoding instead of throwing the error.

So let's recognize the specific need for JSON decoding with a specific error instead: JSONDecodingRequiredError.
2018-08-15 10:12:28 +02:00
Gwendal Roué 05fda18a56 Introduce RowSingleValueDecoder
This allows complex decodable types to fail decoding from a row column, so that we switch to JSON decoding.
2018-08-15 09:55:45 +02:00
Gwendal Roué 4b7f17dbfa Merge remote-tracking branch 'origin/development' into rotacloud 2018-08-15 05:12:28 +02:00
Angus Muller c52b59f1bc Switching to JSON encoding for nested containers. 2018-08-14 16:01:05 +01:00
Vlad Alexa 76f5adf944 moved the extension to Swift.Data to follow the extension to Swift.String in the StandardLibrary.swift,
added case .blob(let data): return String(data: data, encoding: .utf8) to String.fromDatabaseValue
fixed tests
2018-08-14 15:04:07 +01:00
Vlad Alexa d81475adc4 6262d10 continued 2018-08-14 13:06:26 +01:00
Angus Muller a08974ffa4 Added tests for arrays 2018-08-14 11:20:02 +01:00
Angus Muller 8c06e7bff5 Detached rows string to data and tests 2018-08-14 11:16:47 +01:00
Vlad Alexa 7f16e357d0 extended Codable documentation and added test for the example used in the documentation 2018-08-14 10:39:31 +01:00
Vlad Alexa 6262d10794 added catch 2018-08-14 09:25:44 +01:00
Gwendal Roué d9dd293d7f A really difficult cleanup process 2018-08-14 08:33:06 +02:00
Gwendal Roué e49e2db571 Optimize decoding of StatementColumnConvertible values in Decodable records
This is the real final touch for #384, after all
2018-08-13 21:17:52 +02:00
Gwendal Roué 7da5ff95a0 Makefile: fix rule for Realm 2018-08-13 07:51:13 +02:00
Gwendal Roué 8eee52dad5 Merge pull request #384 from groue/conversionDebugInfo
Improve database value decoding diagnostics
2018-08-13 07:45:32 +02:00
Gwendal Roué 9bc68cd10e The final touch 2018-08-12 15:12:46 +02:00
Gwendal Roué e415a93d7e Performance tests for Codable records 2018-08-12 14:10:38 +02:00
Gwendal Roué 46bba98f0f Fix versions in performance report 2018-08-12 13:43:39 +02:00
Gwendal Roué 6a21e97a12 Profile struct decoding 2018-08-12 13:43:16 +02:00
Gwendal Roué 1ae8e39dab Perform performance tests against SQLite.swift 0.11.5 2018-08-12 12:46:51 +02:00
Gwendal Roué b99b14eb4d Perform performance tests against FMDB 2.7 2018-08-12 12:45:02 +02:00
Gwendal Roué 5579dd651a Perform performance tests against Realm 3.7.6 2018-08-12 12:42:58 +02:00
Gwendal Roué 66541922a4 More cleanup 2018-08-12 12:27:47 +02:00
Gwendal Roué 80fe7f87b1 More cleanup 2018-08-12 11:39:48 +02:00
Gwendal Roué bf5420de26 More cleanup 2018-08-12 10:20:10 +02:00
Gwendal Roué ef10e2e8ed General cleanup:
- rename ValueConversionDebuggingInfo to ValueConversionContext
- allow missing value conversion context (when decoding a raw DatabaseValue)
- rename ColumnCursor to FastDatabaseValueCursor
- rename NullableColumnCursor to FastNullableDatabaseValueCursor
2018-08-11 19:45:58 +02:00
Gwendal Roué 1dcb42c540 wip: debug info for no such column errors 2018-08-11 13:03:11 +02:00
Gwendal Roué 897fd32725 Cleanup 2018-08-11 12:58:04 +02:00
Gwendal Roué e46902c845 wip: debug info for no such column errors 2018-08-11 07:16:55 +02:00
Gwendal Roué d836fffd08 wpi: debug info for no such column errors 2018-08-10 08:52:32 +02:00
Gwendal Roué c480e07f08 Increase single-value containers testing 2018-08-10 05:21:33 +02:00
Gwendal Roué 9f2058f6d9 Fix DatabaseValueConvertible implementation for Decodable types that need a single-value container 2018-08-10 05:01:30 +02:00
Gwendal Roué 7d4ebce70a TODO conversion error message for adapted rows 2018-08-10 04:52:59 +02:00
Gwendal Roué cbda1f9211 Fix DatabaseValueConvertible implementation for Decodable types that need a single-value container
They used to crash on decoding errors
2018-08-10 04:52:23 +02:00
Gwendal Roué cef5d25228 Test conversion error messages 2018-08-09 19:19:22 +02:00
Gwendal Roué 220ce379e1 Test conversion error messages 2018-08-09 14:00:33 +02:00
Vlad Alexa 2826472c19 sorted encoder outputFormatting for ios11+ etcl 2018-08-09 09:46:45 +01:00
Gwendal Roué bcc45dc076 no more throwing conversion methods, and refactor ValueConversionDebuggingInfo 2018-08-09 08:51:50 +02:00
Vlad Alexa 7def60c3c0 fixed checking for nested codable 2018-08-08 14:35:05 +01:00
Vlad Alexa 74aae3dd59 implemented requested changes 2018-08-08 11:41:26 +01:00
Gwendal Roué 89d5bd7945 Restore SQLCipher/src to v3.4.2 2018-08-07 19:44:38 +02:00
Vlad Alexa feeedcb92d Added nested Codable support by flattening into/from JSON 2018-08-07 15:29:16 +01:00
Gwendal Roué 78a6f7251b Spot a few Demeter law violations 2018-08-06 13:40:37 +02:00
Gwendal Roué b307e907cb CHANGELOG 2018-08-06 13:40:37 +02:00
Gwendal Roué 9f2ba7245b fix SPM build 2018-08-06 13:40:05 +02:00
Gwendal Roué e9e1fa85c6 Cleanup 2018-08-06 13:40:05 +02:00
Gwendal Roué f8de01779c Cleanup 2018-08-06 13:40:05 +02:00
Gwendal Roué 84c53ef6b9 improve value conversion diagnostics more 2018-08-06 13:40:05 +02:00
Gwendal Roué a8f6ed6d61 improve value conversion diagnostics more 2018-08-06 13:40:05 +02:00
Gwendal Roué 1c811a61ca improve value conversion diagnostics 2018-08-06 13:40:05 +02:00
Gwendal Roué 566dae0574 Merge pull request #393 from groue/SQLCipher-3.4.2
Upgrade SQLCipher to 3.4.2, enable FTS5 on GRDBCipher and new pod GRDBPlus
2018-08-06 13:32:57 +02:00
Gwendal Roué f0ec9925d2 Add @Marus to the thank you notice 2018-08-06 08:40:37 +02:00
Gwendal Roué 481dc79c85 CHANGELOG: documentation diff 2018-08-06 08:32:16 +02:00
Gwendal Roué 0b1a24184b Upgrade release process for GRDBPlus pod 2018-08-06 08:19:58 +02:00
Gwendal Roué b473d07b3c Fix typo 2018-08-06 08:19:37 +02:00
Gwendal Roué 5538977911 Improve doc about FTS5 support 2018-08-06 08:07:31 +02:00
Gwendal Roué 9815b0b480 CHANGELOG 2018-08-05 14:47:26 +02:00
Gwendal Roué 9ed01719b7 Update SQLCipher version in README.md 2018-08-05 14:41:52 +02:00
Gwendal Roué 0e40b6bda2 Document how to activate FTS5
and address #373
2018-08-05 14:37:02 +02:00
Gwendal Roué dd18323a36 New pod: GRDBPlus
This is a workaround for https://github.com/CocoaPods/CocoaPods/issues/7333
2018-08-05 14:25:58 +02:00
Gwendal Roué 06e5dc5dfd Further split CocoaPods lint tasks
(still hoping that this fixes Travis timeout)
2018-08-04 13:24:03 +02:00
Gwendal Roué b916bca1f6 Split test_CocoaPodsLint Makefile target
... in order to avoid Travis CI timeouts
2018-08-04 07:19:06 +02:00
Gwendal Roué 4186d2e5c4 Fix test_install_GRDBFTS5_CocoaPods 2018-08-03 13:28:10 +02:00
Gwendal Roué 33a5decfdc Fix GRDB.swift podspec 2018-08-03 13:27:15 +02:00
Gwendal Roué 2c35ca5ac7 Rename GRDB/FTS5 podspec to GRDB/3.19.3, and comment out target requirements that CocoaPods does not support; 2018-08-03 08:24:25 +02:00
Gwendal Roué 4d2e230633 Makefile: test FTS5 support on iOS 11.4+ and macOS 10.13+ 2018-08-03 08:24:25 +02:00
Gwendal Roué 66d7f37643 https://github.com/CocoaPods/CocoaPods/issues/7333 😭 2018-08-03 08:24:25 +02:00
Gwendal Roué fd00cd613e New Makefile target test_install_GRDBFTS5_CocoaPods that tests GRDB/FTS5 subspec 2018-08-03 08:24:25 +02:00
Gwendal Roué c5c4508bfe New GRDB.swift/FTS5 subspec 2018-08-03 08:24:25 +02:00
Gwendal Roué d21a9b90b2 Enable FTS5 for SQLite < 3.20.0 (sqlite3_prepare_v3 and sqlite3_bind_pointer) 2018-08-03 08:24:25 +02:00
Gwendal Roué 0eeb72a89b Ignore CocoaPods tests workspaces 2018-08-03 08:24:25 +02:00
Gwendal Roué 1cd211bd89 New Makefile target test_install_GRDBCipher_CocoaPods 2018-08-03 08:24:25 +02:00
Gwendal Roué 1d04376493 New Tests/CocoaPods/GRDBCipherMacOS app that checks GRDBCipher integration + FTS5 2018-08-03 08:24:25 +02:00
Gwendal Roué fa396a2d86 New Makefile target test_install_GRDB_CocoaPods 2018-08-03 08:24:25 +02:00
Gwendal Roué 06150b5e58 Make Tests/CocoaPods/GRDBiOS buildable again 2018-08-03 08:24:25 +02:00
Marcel Ball 4f0b5eb7b9 Enable FTS5 extension for GRDBCipher builds
- Enable
- Add -DSQLITE_ENABLE_FTS5 to the CFLAGS for SQLCipher (SQLCipher/src/sqlcipher.xcconfig) (via submodule update)
- Add -D SQLITE_ENABLE_FTS5 to swift flags for GRDBCipher (SQLCipher/GRDBCipher.xcconfig)
- Add -D SQLITE_ENABLE_FTS5 to the GRDBCipher Testing Projects
- Updated message in EncryptionTests - SQLCipher changed the message “file is encrypted or is not a database” back to just “file is not a database” in 3.4.2 - seems like an odd choice on their part but is behaving as expected.
2018-08-03 08:24:25 +02:00
Gwendal Roué 79fd17faec Upgrade SQLCipher to 3.4.2 + FTS5 2018-08-03 08:24:25 +02:00
Gwendal Roué 59da551b66 Merge branch 'master' into development 2018-08-02 16:46:10 +02:00
Gwendal Roué 89d95f6a7c Merge pull request #390 from kluufger/patch-2
fix small typo in readme
2018-07-19 14:30:42 +02:00
kluufger 1db18b818a player -> country 2018-07-19 11:39:01 +00:00
kluufger 37be51ec37 player -> country x2 2018-07-19 11:22:33 +00:00
kluufger 6fb5bb8ffd player -> country 2018-07-19 10:57:14 +00:00
Gwendal Roué d82b539942 Merge pull request #387 from kluufger/patch-1
Fix some typos in AssociationsBasics guide
2018-07-19 12:56:41 +02:00
kluufger dc8406d732 fix small type in readme 2018-07-19 10:08:59 +00:00
kluufger 328d1fcd30 Fix some typos in AssociationsBasics guide
Not sure about some of them, though.
2018-07-19 08:09:10 +00:00
Gwendal Roué d4590ff91f Fix DatabaseWriter.readFromCurrentState documentation 2018-07-13 09:45:59 +02:00
Gwendal Roué 5bcc95ce87 Update TODO.md 2018-07-11 18:11:42 +02:00
Gwendal Roué 0dabd36123 v3.2.0 2018-07-08 13:23:40 +02:00
Gwendal Roué 8a83ee4599 Travis: use Xcode 9.4 2018-07-08 12:22:53 +02:00
Gwendal Roué 29e720c474 DONE: #378 2018-07-08 12:17:38 +02:00
Gwendal Roué 444f5b003f Merge branch 'master' of github.com:groue/GRDB.swift into development 2018-07-08 12:17:06 +02:00
Gwendal Roué 3e60b00bab Merge pull request #381 from groue/feature/378-nuking-db-during-development
Nuking db during development
2018-07-08 06:31:30 +02:00
Gwendal Roué fc2c2658b7 DatabaseWriterTests.testEraseAndVacuum: use auto increment so we can test database erasure with internal SQLite objects 2018-07-07 17:53:36 +02:00
Gwendal Roué fdef88d150 DatabaseWriterTests.testEraseAndVacuum: add a virtual table 2018-07-07 17:51:55 +02:00
Gwendal Roué 1a84a84bd1 Typo fix 2018-07-07 17:45:15 +02:00
Gwendal Roué 22006e2251 CHANGELOG 2018-07-07 17:43:42 +02:00
Gwendal Roué 3405585d60 Typo fix 2018-07-07 17:43:37 +02:00
Gwendal Roué 91d0a453da DatabaseWriter.erase(): more robust error handling 2018-07-07 17:43:26 +02:00
Gwendal Roué d814249c5a eraseDatabaseOnSchemaChange documentation 2018-07-07 17:34:44 +02:00
Gwendal Roué fc2d5419b3 CHANGELOG 2018-07-07 17:17:23 +02:00
Gwendal Roué 3593806685 Cleanup 2018-07-07 14:49:43 +02:00
Gwendal Roué e84b539de2 DatabaseWriter.erase(): don't mess with internal SQLite objects 2018-07-07 14:42:18 +02:00
Gwendal Roué fee4486d1b DatabaseMigrator.eraseDatabaseOnSchemaChange 2018-07-07 14:23:50 +02:00
Gwendal Roué a73be9c010 Fix databaseWriter.erase() with SQLCipher 2018-07-07 12:32:40 +02:00
Gwendal Roué 0bc25f8773 Tests for DatabaseQueue and DatabasePool erase and vacuum 2018-07-06 14:03:44 +02:00
Gwendal Roué a465f16ff7 databaseWriter.erase(), databaseWriter.vacuum() 2018-07-06 13:58:55 +02:00
Gwendal Roué 86d93b11dd Easier database backup invocation 2018-07-06 13:57:55 +02:00
Gwendal Roué f8aa5b7e21 Fix typo 2018-07-05 08:38:56 +02:00
Gwendal Roué 16184ae89b More documentation about invalid value conversions 2018-07-05 08:37:57 +02:00
Gwendal Roué af2a3ea827 More documentation about invalid value conversions 2018-07-05 08:31:58 +02:00
Gwendal Roué ca7df229fa Cleanup 2018-07-03 18:44:42 +02:00
Gwendal Roué f121c6b139 TODO.md: look at #378 2018-07-02 08:15:40 +02:00
Gwendal Roué 2a6f7b7588 Fix typo 2018-06-30 11:41:11 +02:00
Gwendal Roué a87d06d609 Add @bellebethcooper to the thank you notice 2018-06-30 11:40:16 +02:00
Gwendal Roué 7c85a973dc TODO (inspired by #377) 2018-06-30 11:22:50 +02:00
Gwendal Roué 97961f4374 Merge pull request #376 from bellebethcooper/patch-1
Typo fix
2018-06-30 07:11:24 +02:00
bellebethcooper 4436badbc8 Typo fix 2018-06-30 10:31:10 +10:00
Gwendal Roué 9060048044 PULL_REQUEST_TEMPLATE.md 2018-06-28 14:03:25 +02:00
Gwendal Roué 99566225f0 TODO.md 2018-06-28 13:38:09 +02:00
Gwendal Roué b4bd25decc Fix typo in GoodPracticesForDesigningRecordTypes.md 2018-06-25 13:35:52 +02:00
Gwendal Roué 0e94c7b44e Improve GoodPracticesForDesigningRecordTypes.md 2018-06-25 13:34:38 +02:00
Gwendal Roué c750fd7b1d v3.1.0 2018-06-17 15:23:53 +02:00
Gwendal Roué 0ed4491b46 Prepare for SE-0206 "Hashable Enhancements" 2018-06-17 15:23:23 +02:00
Gwendal Roué b4a3adafb1 Merge pull request #372 from groue/sqlite3.24.0
Upgrade custom SQLite builds to 3.24.0
2018-06-17 14:34:45 +02:00
Gwendal Roué 2e953221fa CHANGELOG 2018-06-15 08:26:13 +02:00
Gwendal Roué 1886ac5cfb Upgrade custom SQLite builds to 3.24.0 2018-06-15 08:21:52 +02:00
Gwendal Roué 7ed7196c48 Merge pull request #371 from groue/queueLabels
Database can have a label
2018-06-15 05:03:10 +02:00
Gwendal Roué 38b1e41aab Final tweaks to dispatch queue labels 2018-06-14 21:10:56 +02:00
Gwendal Roué 467819bdd5 Confiiguration.label documentation 2018-06-14 20:50:06 +02:00
Gwendal Roué e81e818305 Confiiguration.label documentation 2018-06-14 20:47:43 +02:00
Gwendal Roué 342dcc5094 Confiiguration.label is used to name dispatch queues 2018-06-14 20:26:34 +02:00
Gwendal Roué 8f89a2063e CHANGELOG 2018-06-14 13:45:44 +02:00
Gwendal Roué 2e80db8aed Database dispatch queues now have labels 2018-06-14 13:36:42 +02:00
Gwendal Roué 4e7fc83ad5 Add test for FTS4 compression/decompression (addresses #369) 2018-06-14 13:32:28 +02:00
Gwendal Roué 200f12a558 TODO 2018-06-13 07:48:56 +02:00
Gwendal Roué 5c1eea4c6f TODO 2018-06-13 07:48:56 +02:00
Gwendal Roué b73771fd6c Look for open issues first 2018-06-12 10:42:10 +02:00
Gwendal Roué a47f10cf07 Link to forums 2018-06-12 10:40:43 +02:00
Gwendal Roué 75d0643642 Improve AssociationsBasics.md 2018-06-11 08:20:05 +02:00
Gwendal Roué 732e0bd34b Improve AssociationsBasics.md 2018-06-11 08:15:09 +02:00
Gwendal Roué ac2cd485c8 Mini typo in GoodPracticesForDesigningRecordTypes.md 2018-06-08 05:54:27 +02:00
Gwendal Roué b967018390 Improve GoodPracticesForDesigningRecordTypes.md 2018-06-07 20:15:45 +02:00
Gwendal Roué df16c4856f Improve GoodPracticesForDesigningRecordTypes.md 2018-06-07 20:11:01 +02:00
Gwendal Roué 4e97b80274 Improve GoodPracticesForDesigningRecordTypes.md 2018-06-07 19:58:22 +02:00
Gwendal Roué 65b3e21e65 Another typo in GoodPracticesForDesigningRecordTypes.md 2018-06-07 19:54:59 +02:00
Gwendal Roué 5b97dea3c6 Mini typo in GoodPracticesForDesigningRecordTypes.md 2018-06-07 19:50:48 +02:00
Gwendal Roué 20322640c3 New Associations demo playground, and fix a few typos in GoodPracticesForDesigningRecordTypes.md 2018-06-07 19:37:31 +02:00
Gwendal Roué 89ce13c43c Documentation tweaks 2018-06-07 18:59:47 +02:00
Gwendal Roué 27e94c211d Upgrade SPM test app to v3.0.0 2018-06-07 13:53:16 +02:00
Gwendal Roué bca4af679e No more reference to the GRDB3 branch 2018-06-07 13:28:30 +02:00
Gwendal Roué cb7f827118 GRDB2MigrationGuide.md no longer refers to GRDB3 branch 2018-06-07 13:26:48 +02:00
Gwendal Roué 1bc4299bfc Fix bug in GRDBDemoiOS 2018-06-07 12:53:24 +02:00
Gwendal Roué 79c788e571 v3.0.0 2018-06-07 12:46:38 +02:00
Gwendal Roué 0125107855 Improve "Good Practices for Designing Record Types" 2018-06-07 11:42:45 +02:00
Gwendal Roué 24694b8b23 Merge branch 'GRDB3' into development 2018-06-07 08:49:36 +02:00
Gwendal Roué 0c79224209 Family gets bigger :-) 2018-06-07 08:39:55 +02:00
Gwendal Roué a88b5dc3df Append #334 to CHANGELOG 2018-06-07 08:36:29 +02:00
Gwendal Roué f259cac51f SQLiteDateParser: tighten vsscanf format 2018-06-07 08:36:29 +02:00
Gwendal Roué fe1146134b SQLiteDateParser: fix nanosecond parsing 2018-06-07 08:36:29 +02:00
Gwendal Roué 6dd4f1c666 More DatabaseDateComponents parsing tests 2018-06-07 08:36:29 +02:00
Gwendal Roué 4415681c92 SQLiteDateParser: don't parse garbage into nanoseconds 2018-06-07 08:36:29 +02:00
Gwendal Roué 5a0425a23c SQLiteDateParser: optimize nanoseconds parsing 2018-06-07 08:36:29 +02:00
Gwendal Roué 8729085528 Add a sanity check 2018-06-07 08:36:29 +02:00
Gwendal Roué 88cbbf5c5e Add missing imports (should fix travis issues) 2018-06-07 08:36:29 +02:00
Gwendal Roué 6816bceed0 No need for useScanfStrategy any longer 2018-06-07 08:36:29 +02:00
Gwendal Roué 76dc5e6b89 Cleanup 2018-06-07 08:36:29 +02:00
Gwendal Roué ee39a52069 New DateParsingTests in GRDBOSXPerformanceTests 2018-06-07 08:36:29 +02:00
Gwendal Roué 82482bdbf7 Date adopts StatementColumnConvertible 2018-06-07 08:36:29 +02:00
Gwendal Roué 062f916607 Documentation 2018-06-07 08:36:29 +02:00
Gwendal Roué 2b73c4f348 Check useScanfStrategy in DatabaseDateComponents.init(sqliteStatement:index:)
...so that we can eventually compare gains
2018-06-07 08:36:29 +02:00
Gwendal Roué 54b2135b74 DatabaseDateComponents adopts StatementColumnConvertible
We'll need benchmarks to evaluate the gain, here
2018-06-07 08:36:29 +02:00
Gwendal Roué bf3b4e7e02 SQLiteDateParser: parse C strings
Since the goal of this PR is efficiency, we'll soon parse Date and
DatabaseDateComponents right from raw SQLite buffers.
2018-06-07 08:36:29 +02:00
Gwendal Roué ad8b80bafd (whitespace) 2018-06-07 08:36:29 +02:00
Gwendal Roué 06476bc6fe SQLiteDateParser.components(from:) is not public 2018-06-07 08:36:29 +02:00
Gwendal Roué 0616209e58 SQLiteDateParser: no more static methods 2018-06-07 08:36:29 +02:00
Gwendal Roué 415f2971e5 SQLiteDateParser: use withUnsafeMutablePointer instead of allocations
OK, not really: the nanosecond components remains in the heap.
But we may find a way to put 11 chars on the stack.
2018-06-07 08:36:29 +02:00
Gwendal Roué 3a7b2cc4a2 SQLiteDateParser: get rid of the mutex 2018-06-07 08:36:29 +02:00
Gwendal Roué 726e40984a Add SQLiteDateParser.swift to GRDBCustom and GRDBCipher
... so that all GRDB flavors can use the new technique.
GRDB has three distinct projects since #282.
2018-06-07 08:36:29 +02:00
Matt Greenfield 63a68978f0 truncate nanosecond precision to 3 sig figs 2018-06-07 08:36:29 +02:00
Matt Greenfield 13d973dde4 Revert "fix the tests to expect less nanosecond precision loss"
This reverts commit eba5df1fcc.
2018-06-07 08:36:29 +02:00
Matt Greenfield 8f5ef76e7e Revert "permit precision loss down to 3 sig figs"
This reverts commit 3bcc5b8064.
2018-06-07 08:36:29 +02:00
Matt Greenfield 36ac5fa53e truncate date/time strings that include seconds precision beyond the nanosecond scale 2018-06-07 08:36:29 +02:00
Matt Greenfield cda891ca02 permit precision loss down to 3 sig figs 2018-06-07 08:36:29 +02:00
Matt Greenfield ff4447713a fix the tests to expect less nanosecond precision loss 2018-06-07 08:36:29 +02:00
Matt Greenfield 70190e2a23 not all nanosecond fractions have 3 sig figs, so can't hard code the acceptable string lengths 2018-06-07 08:36:29 +02:00
Matt Greenfield 2682dae34b 0.123 is not the same thing as 0.000123 2018-06-07 08:36:29 +02:00
Matt Greenfield 3a1e695a39 fractions of seconds are not the same thing as integer counts of nanoseconds 2018-06-07 08:36:29 +02:00
Matt Greenfield 604f80f6fa differentiate between SS and SS.SSS formats 2018-06-07 08:36:29 +02:00
Matt Greenfield 5c0b88eb82 return correct Format for partial date/time combinations 2018-06-07 08:36:29 +02:00
Matt Greenfield 7e39fbaba0 add SQLiteDateParser to project file 2018-06-07 08:36:29 +02:00
Matt Greenfield 815424770b initial scanf() based date string parser 2018-06-07 08:36:29 +02:00
Gwendal Roué 30fcd95f1d Change podspec description 2018-06-07 08:31:57 +02:00
Gwendal Roué 4637930027 Improve "Good Practices for Designing Record Types" 2018-06-06 17:09:03 +02:00
Gwendal Roué 729ec6714c Improve "Good Practices for Designing Record Types" 2018-06-06 17:08:42 +02:00
Gwendal Roué b2683eb864 Improve "Good Practices for Designing Record Types" 2018-06-06 17:04:42 +02:00
Gwendal Roué e7bcf7c7db Funny how time you have for tweaking stuff when you're waiting for a watch app to launch... 2018-06-06 16:15:44 +02:00
Gwendal Roué d1c47c3364 Improve "Good Practices for Designing Record Types" 2018-06-06 16:12:21 +02:00
Gwendal Roué 44140cb1db README.md 2018-06-06 15:01:59 +02:00
Gwendal Roué 4bc6a77588 README.md 2018-06-06 14:02:48 +02:00
Gwendal Roué edd294550f Revert "README.md"
This reverts commit 69c2077037.
2018-06-06 13:59:52 +02:00
Gwendal Roué 69c2077037 README.md 2018-06-06 13:59:07 +02:00
Gwendal Roué b3f1997049 README.md 2018-06-06 13:57:44 +02:00
Gwendal Roué c2e624c78d README.md 2018-06-06 13:52:55 +02:00
Gwendal Roué ff69d3fbc3 Merge pull request #365 from groue/GRDB3-DelayedOrdering
Delayed Request Ordering
2018-06-06 07:44:23 +02:00
Gwendal Roué 018fac8c57 CHANGELOG.md 2018-06-05 23:07:00 +02:00
Gwendal Roué 0b1bc80c41 Document orderByPrimaryKey 2018-06-05 22:53:05 +02:00
Gwendal Roué 7e6de4fbd0 Test TableRequest.orderByPrimaryKey() 2018-06-05 22:46:24 +02:00
Gwendal Roué fa31c484da OrderedRequest now waits for the database connection before ordering is computed 2018-06-05 22:46:02 +02:00
Gwendal Roué 2556fd041f Update Makefile for Xcode 9.4 2018-06-05 22:23:43 +02:00
Gwendal Roué e915d28cb2 Fix failing tests for Database.indexes(on:) and Database.foreignKeys(on:) 2018-06-05 14:38:59 +02:00
Gwendal Roué 60eb868fa5 Failing tests for Database.indexes(on:) and Database.foreignKeys(on:) 2018-06-05 14:38:47 +02:00
Gwendal Roué 6130c6f985 Who guessed String ordering would depend on Swift version? Fix a test so that it runs in both Swift 4.1 and Swift 4.2 2018-06-05 08:03:50 +02:00
Gwendal Roué b7f44785ec The SQL statement generated by record.update(db) lists columns in the same order as in the table definition (this fixes tests made flaky by SE-0206) 2018-06-05 08:02:54 +02:00
Gwendal Roué 8b44b0af7b Fix SerializedDatabase.reentrantSync check for unsafe transactions 2018-06-04 11:59:43 +02:00
Gwendal Roué caea11fbbb Database: a couple more asserts 2018-06-04 11:58:40 +02:00
Gwendal Roué c7f018c635 GoodPracticesForDesigningRecordTypes.md 2018-06-04 07:40:12 +02:00
Gwendal Roué b8328bd3bb GoodPracticesForDesigningRecordTypes.md 2018-06-03 18:37:00 +02:00
Gwendal Roué 0dd8fce854 GoodPracticesForDesigningRecordTypes.md 2018-06-03 18:34:27 +02:00
Gwendal Roué f8b7156b48 Simplify demo application 2018-06-03 13:23:31 +02:00
Gwendal Roué cfba53e586 Associations documentatiion 2018-05-31 22:54:13 +02:00
Gwendal Roué 003020dd29 Associations documentatiion 2018-05-31 22:52:32 +02:00
Gwendal Roué f2b46963bd minor 2018-05-31 22:35:58 +02:00
Gwendal Roué 62a434f898 Associations documentatiion 2018-05-31 22:21:00 +02:00
Gwendal Roué 16af4513d6 Associations documentatiion 2018-05-31 22:11:18 +02:00
Gwendal Roué ead89420c4 Avoid undefined behavior (UnsafePointer documentation is scary) 2018-05-31 17:37:46 +02:00
Gwendal Roué 88fac9e21d Merge pull request #362 from hartbit/scanf-buffer-overflow
Fix buffer overflow in vsscanf date parsing
2018-05-31 17:11:35 +02:00
David Hart d601e06f25 Fix buffer overflow in vsscanf date parsing 2018-05-31 17:07:23 +02:00
Gwendal Roué 6cdcd97912 Associations documentation 2018-05-31 08:21:07 +02:00
Gwendal Roué 8a4fbcc725 Associations documentation: avoid explicit databaseTableName when possible 2018-05-31 08:19:49 +02:00
Gwendal Roué e9cbbe2903 Documentation 2018-05-28 14:25:08 +02:00
Gwendal Roué 366e049ddf Bring GRDBDemo to GRDB 3 2018-05-25 07:26:15 +02:00
Gwendal Roué 4e73c31662 Fix documentation typo 2018-05-24 23:05:59 +02:00
Gwendal Roué 0d2079df42 keypath-based expressions? 2018-05-24 05:56:29 +02:00
Gwendal Roué 318e7455e7 Update Package.swift for Swift 4.1 2018-05-24 05:56:03 +02:00
Gwendal Roué eb7c98c510 Fix GRDB3 SPM doc 2018-05-23 12:11:43 +02:00
Gwendal Roué ac955873f2 Improve documentation for persistable protocol choice 2018-05-23 08:36:29 +02:00
Gwendal Roué 051f0416a4 Extend the "thank you" notice 2018-05-23 08:19:40 +02:00
Gwendal Roué c96ed597ed Merge pull request #356 from pocketpixels/patch-1
Fixing type used in 'Demographics BelongsTo Country' example
2018-05-23 08:16:57 +02:00
Gwendal Roué 5ccf87802e Merge pull request #355 from groue/GRDB3-AutomaticTableName
Automatic table name generation
2018-05-23 06:27:38 +02:00
pocketpixels c93f3cda06 Fixed type used in 'Demographics BelongsTo Country' example
I am reading this for the first time, so I might be wrong, but I strongly suspect the type in the belongsTo() call should be Country?
2018-05-22 23:18:18 -04:00
Gwendal Roué 2e477feb33 TableRecord documentation 2018-05-22 23:51:19 +02:00
Gwendal Roué dcb626b32b TableRecord documentation 2018-05-22 23:48:01 +02:00
Gwendal Roué ce03deeccc Change log for default implementation for TableRecord.databaseTableName 2018-05-22 23:31:37 +02:00
Gwendal Roué 1213fa0a43 Document default implementation for TableRecord.databaseTableName 2018-05-22 23:18:33 +02:00
Gwendal Roué 76299d9302 Document default implementation for TableRecord.databaseTableName in GRDB2 Migration Guide 2018-05-22 22:58:15 +02:00
Gwendal Roué 7b59c097c6 Test for default implementation for TableRecord.databaseTableName 2018-05-22 22:43:01 +02:00
Gwendal Roué af8971bcd8 Default implementation for TableRecord.databaseTableName 2018-05-22 22:14:18 +02:00
Gwendal Roué 5de7a5274e Remove useless #if swift(>=3.1) 2018-05-22 20:32:24 +02:00
Gwendal Roué e0a1ee4c10 Merge pull request #354 from fpillet/linux-support
Main framework compiles on Linux
2018-05-21 09:35:54 +02:00
Gwendal Roué cdf5462005 Harmonize fetching methods with CustomizedDecodingOfDatabaseRows playground 2018-05-21 08:39:48 +02:00
Gwendal Roué 86f084cb3e Fix DatabaseRegion inline documentation 2018-05-21 08:27:47 +02:00
Gwendal Roué 5d7245af2a Fix DatabaseRegion documentation formatting 2018-05-21 08:26:06 +02:00
Gwendal Roué cacc3e8456 Fix DatabasePool.makeSnapshot() documentation 2018-05-21 08:21:36 +02:00
Gwendal Roué 0620b1b513 Associations: inline documentation 2018-05-21 07:53:06 +02:00
Gwendal Roué 4eac0797fa Less TODO 2018-05-21 07:39:30 +02:00
Gwendal Roué 07176e941b Associations: inline documentation 2018-05-21 07:35:25 +02:00
Gwendal Roué dadece1b04 Associations: inline documentation 2018-05-20 19:35:18 +02:00
Gwendal Roué b98992eb18 Associations: inline documentation 2018-05-20 19:05:45 +02:00
Gwendal Roué 0191d64f56 Associations: inline documentation 2018-05-20 18:55:14 +02:00
Gwendal Roué 02d5b9c014 Associations: inline documentation 2018-05-20 18:13:34 +02:00
Gwendal Roué aa81b992c4 Associations: inline documentation 2018-05-20 17:48:22 +02:00
Gwendal Roué 9be001533c Fix inner link 2018-05-20 16:16:02 +02:00
Gwendal Roué 7be345521b Associations: new "DerivableRequest Protocol" documentation chapter 2018-05-20 16:14:23 +02:00
Gwendal Roué 67e48f8ad7 CustomizedDecodingOfDatabaseRows 2018-05-20 15:45:59 +02:00
Florent Pillet c0bd8ce917 Rolled back to previous NSUUID extension as compiler freaks out on a more modern implementation 2018-05-20 14:37:59 +02:00
Florent Pillet da65deec69 Removed LinuxMain.swift 2018-05-20 14:21:41 +02:00
Florent Pillet 34db8efea0 Added missing LinuxMain.swift 2018-05-20 00:44:59 +02:00
Florent Pillet df8887be05 Fix NSUUID compilation issue (now using more Swift code) 2018-05-20 00:27:02 +02:00
Florent Pillet 55472c2d7f Main framework compiles on Linux 2018-05-19 18:52:35 +02:00
Gwendal Roué 2a1c87f24a Link to "Customized Decoding of Database Rows" from the "Custom Requests" chapter 2018-05-19 18:45:13 +02:00
Gwendal Roué 88c4f02f5d Fix typo 2018-05-19 18:04:55 +02:00
Gwendal Roué 3017668ba2 Fix typo 2018-05-19 13:58:57 +02:00
Gwendal Roué 4f5fdf45e8 More reasons not to fear leaving FetchableRecord 2018-05-19 13:27:24 +02:00
Gwendal Roué 6037c418cb New "Customized Decoding of Database Rows" documentation chapter 2018-05-19 12:52:51 +02:00
Gwendal Roué 785853dd2b Move the Custom Value Types chapter 2018-05-19 12:28:52 +02:00
Gwendal Roué 2ce2b4885d Rename playground 2018-05-19 12:26:38 +02:00
Gwendal Roué 5637514dd6 AlternateRowDecoder playground 2018-05-19 12:25:35 +02:00
Gwendal Roué 0a3a8d738a AlternateRowDecoder playground 2018-05-18 19:20:03 +02:00
Gwendal Roué 1d1c7fc467 Merge branch 'GRDB3' of github.com:groue/GRDB.swift into GRDB3 2018-05-18 18:47:42 +02:00
Gwendal Roué 1f274f5c04 More AlternateRowDecoder playground 2018-05-18 18:47:12 +02:00
Gwendal Roué eddc078c2d Prepare AlternateRowDecoder playground 2018-05-18 14:29:03 +02:00
Gwendal Roué 5136142d83 Playgrounds documentation 2018-05-18 08:49:47 +02:00
Gwendal Roué 857798b939 Extend the "thank you" notice 2018-05-15 13:35:36 +02:00
Gwendal Roué 82d8fd65d0 Merge pull request #350 from fpillet/patch-1
Use `String(format: ...)`
2018-05-13 15:15:05 +02:00
Florent Pillet 2de040a6f1 Use String(format: ...)
... instead of `NSString(format: ...) as String`
2018-05-12 15:39:59 +02:00
Gwendal Roué aead6eec4a Sometimes you don't understand what you read because information is not given at the right time 2018-05-07 19:39:13 +02:00
Gwendal Roué 756863152c Fix documentation typos 2018-05-07 19:33:07 +02:00
Gwendal Roué c1c3233ba2 Remove two useless .init (thank you Xcode autocomplete) 2018-05-07 19:23:33 +02:00
Gwendal Roué 91ad986d0b Cleanup and add internal documentation for the non-trivial TableAlias 2018-05-07 19:17:19 +02:00
Gwendal Roué a35f012286 Cleanup 2018-05-07 17:50:27 +02:00
Gwendal Roué 56a0dab443 Typo 2018-05-07 09:10:50 +02:00
Gwendal Roué 69cf95e828 Typo 2018-05-06 20:03:28 +02:00
Gwendal Roué 56ae745851 Prepare v3.0.0-beta.1 release 2018-05-06 14:55:39 +02:00
Gwendal Roué 62f985469c Update WhyAdoptGRDB.md for GRDB3 2018-05-06 14:53:49 +02:00
Gwendal Roué a12bc2e90e Tweaks in GRDB2MigrationGuide.md 2018-05-06 14:44:32 +02:00
Gwendal Roué 402f9d3ba9 Tweaks in AssociationBasics.md 2018-05-06 14:43:44 +02:00
Gwendal Roué a360976e23 ForeignKey initializer accepts ColumnExpression 2018-05-06 14:15:12 +02:00
Gwendal Roué de6667a236 WIP: GRDB2MigrationGuide.md 2018-05-06 12:44:06 +02:00
Gwendal Roué 6db0831bfd fix links 2018-05-06 12:12:11 +02:00
Gwendal Roué 26607ba193 WIP: GRDB2MigrationGuide.md 2018-05-06 11:56:02 +02:00
Gwendal Roué 15299eaac0 WIP: GRDB2MigrationGuide.md 2018-05-06 11:53:19 +02:00
Gwendal Roué 9c9217727c WIP: GRDB2MigrationGuide.md 2018-05-06 11:10:42 +02:00
Gwendal Roué 6434f0cdb1 WIP: GRDB2MigrationGuide.md 2018-05-06 11:09:44 +02:00
Gwendal Roué 7a520f3269 WIP: GRDB2MigrationGuide.md 2018-05-06 10:55:39 +02:00
Gwendal Roué cc7cf597f3 WIP: GRDB2MigrationGuide.md 2018-05-06 10:50:14 +02:00
Gwendal Roué 0a6b34bb85 Merge pull request #348 from groue/GRDB3-RxGRDB
GRDB3 Support for RxGRDB
2018-05-06 10:08:44 +02:00
Gwendal Roué 175c96cd38 Update documentation of FetchRequest protocol 2018-05-06 10:03:07 +02:00
Gwendal Roué cce0e332e0 Update documentation of FetchRequest protocol 2018-05-06 10:01:10 +02:00
Gwendal Roué 214748fe5a DatabaseRegion.fullDatabase is public 2018-05-06 09:11:00 +02:00
Gwendal Roué dc7bdfed50 More fixits for DatabaseRegion 2018-05-05 12:02:50 +02:00
Gwendal Roué 2d008b8c54 Yet another request protocols update, in order to empower RxGRDB 2018-05-05 11:57:17 +02:00
Gwendal Roué 310c2637cb Merge pull request #347 from groue/GRDB3-DerivableRequest
Common API for requests and associations derivation
2018-05-05 11:56:59 +02:00
Gwendal Roué 264bceee2a Cleanup 2018-05-04 14:28:29 +02:00
Gwendal Roué cdad6fa313 Introduce DerivableRequest 2018-05-04 14:19:27 +02:00
Gwendal Roué babaefca8f WIP: GRDB2MigrationGuide.md 2018-05-04 10:48:56 +02:00
Gwendal Roué 6a4382c323 TODO 2018-05-04 08:32:51 +02:00
Gwendal Roué 231906e5ea WIP: GRDB2MigrationGuide.md 2018-05-03 10:17:38 +02:00
Gwendal Roué 1c9db9ec10 WIP: GRDB2MigrationGuide.md 2018-05-03 08:55:52 +02:00
Gwendal Roué 31e927f9da WIP: GRDB2MigrationGuide.md 2018-05-03 08:54:50 +02:00
Gwendal Roué 26b9030eaa WIP: GRDB2MigrationGuide.md 2018-05-03 08:53:19 +02:00
Gwendal Roué da38df6bd6 WIP: GRDB2MigrationGuide.md 2018-05-03 08:51:31 +02:00
Gwendal Roué ebb1eba96f WIP: GRDB2MigrationGuide.md 2018-05-03 08:34:02 +02:00
Gwendal Roué c7a1daa8e5 WIP: GRDB2MigrationGuide.md 2018-05-02 21:55:53 +02:00
Gwendal Roué 0aa75f418f WIP: GRDB2MigrationGuide.md 2018-05-02 21:27:03 +02:00
Gwendal Roué a5d56d38d6 WIP: GRDB2MigrationGuide.md 2018-05-02 20:03:56 +02:00
Gwendal Roué fa04627ece WIP: GRDB2MigrationGuide.md 2018-05-02 19:57:36 +02:00
Gwendal Roué 33ec30438d WIP: GRDB2MigrationGuide.md 2018-05-02 19:52:26 +02:00
Gwendal Roué e3ab3a991e WIP: GRDB2MigrationGuide.md 2018-05-02 18:47:34 +02:00
Gwendal Roué 287422f2f8 WIP: GRDB2MigrationGuide.md 2018-05-02 13:59:15 +02:00
Gwendal Roué e184963b8f WIP: GRDB2MigrationGuide.md 2018-05-02 13:40:33 +02:00
Gwendal Roué 06f9a4601c TODO 2018-05-02 07:43:16 +02:00
Gwendal Roué 7a30eb2613 Merge pull request #319 from groue/GRDB3-Associations
Associations & Joins
2018-05-01 21:48:06 +02:00
Gwendal Roué 5160b69c34 Merge branch 'GRDB3' into GRDB3-Associations 2018-05-01 21:47:44 +02:00
Gwendal Roué fa00b8ad99 Associations and Joins documentation 2018-05-01 21:44:43 +02:00
Gwendal Roué 1bf7f67008 Update inline documentation with singular table names 2018-05-01 20:32:18 +02:00
Gwendal Roué 872d6d21ac Update README.md with singular table names 2018-05-01 19:01:45 +02:00
Gwendal Roué ab36df6e0f Use "finalized" to describe queries that are ready for SQL generation 2018-05-01 17:42:39 +02:00
Gwendal Roué ffaabdfd62 Toward improved DatabaseRegion for joined requests 2018-05-01 17:20:37 +02:00
Gwendal Roué 8e2cdeebc3 Cleanup 2018-05-01 15:03:36 +02:00
Gwendal Roué a3189f79b6 StatementArguments: no more need for internal setters 2018-05-01 14:52:03 +02:00
Gwendal Roué 66a425f718 Thread-safe table name disambiguation, via SQLGenerationContext. Merge SQLTableQualifier into TableAlias. 2018-05-01 14:44:51 +02:00
Gwendal Roué 344eba821f Spot more qualifier/alias problems 2018-04-30 19:31:56 +02:00
Gwendal Roué 8d5e57873e Documentation 2018-04-30 15:33:16 +02:00
Gwendal Roué 9f78a758bd RowAdapter.addingScopes returns self if the scopes dictionary is empty 2018-04-30 14:04:07 +02:00
Gwendal Roué e6f084d397 Law of Demeter 2018-04-30 13:59:20 +02:00
Gwendal Roué 09458c1d37 Documentation, move asRequest(of:) to QueryInterfaceRequest in order to avoid AnyFetchRequest contamination 2018-04-30 13:41:20 +02:00
Gwendal Roué 9a379fc1bc Use DatabasePromise where relevant 2018-04-30 12:57:12 +02:00
Gwendal Roué a45d019472 Simplification
Rename AssociationMapping to JoinCondition
Replace AssociationMappingRequest enum with ForeignKeyJoinConditionRequest struct
Rename AssociationChainOperator to AssociationJoinOperator, and "chain" to "join"
2018-04-30 12:50:38 +02:00
Gwendal Roué 50dd846a36 Remove useless constraint on Association.LeftAssociated and Association.RightAssociated 2018-04-30 12:25:07 +02:00
Gwendal Roué dddeff458a none() is no longer a requirement of FilteredRequest 2018-04-30 09:02:05 +02:00
Gwendal Roué ae162a88c6 Upgrade .swift-version and Swift badge to 4.1 2018-04-30 08:57:10 +02:00
Gwendal Roué ccc259c25c Documentation 2018-04-30 08:55:16 +02:00
Gwendal Roué 5e7235307a Cleanup 2018-04-30 08:36:29 +02:00
Gwendal Roué 5747d1cff0 No more #if swift(>=4.1) 2018-04-30 08:26:23 +02:00
Gwendal Roué e05a64f1cb Cleanup 2018-04-30 08:11:16 +02:00
Gwendal Roué 83104769ef Conditional Conformance requires Swift 4.1 and Xcode 9.3+ 2018-04-29 19:21:10 +02:00
Gwendal Roué 39c5313738 Associations Documentation 2018-04-29 18:45:51 +02:00
Gwendal Roué d6f088609e Prevent chaining required association behind an optional one 2018-04-29 18:34:49 +02:00
Gwendal Roué 4586eb9a82 Associations Documentation 2018-04-29 18:27:59 +02:00
Gwendal Roué a16bd6b54e Associations Documentation 2018-04-29 18:18:33 +02:00
Gwendal Roué 3e46942f30 Associations 2018-04-29 18:16:39 +02:00
Gwendal Roué df79bb8ed8 whitespace 2018-04-28 10:36:58 +02:00
Gwendal Roué d6183a4745 Typo 2018-04-28 10:29:56 +02:00
Gwendal Roué bf470b5870 Documentation 2018-04-27 18:01:11 +02:00
Gwendal Roué 175656aa26 Documentation 2018-04-27 09:01:13 +02:00
Gwendal Roué 497295a0c6 Merge pull request #342 from groue/GRDB3-reversedCleanup
Reversing unordered requests
2018-04-26 19:45:27 +02:00
Gwendal Roué 0f21f886b4 Document that request.reversed() has no effect when request is not already ordered 2018-04-26 12:54:28 +02:00
Gwendal Roué f4382e6bcb Test that request.reversed() has no effect when request is not already ordered 2018-04-26 12:52:01 +02:00
Gwendal Roué 26108badd4 request.reversed() has no effect when request is not already ordered 2018-04-26 12:51:29 +02:00
Gwendal Roué 2ae93a2a0b Honor #337 2018-04-26 09:01:33 +02:00
Gwendal Roué d8860d2527 Typo 2018-04-26 08:27:37 +02:00
Gwendal Roué 40cfbd8c9c Update Documentation for the implicit transactions opened by the write method 2018-04-26 08:26:39 +02:00
Gwendal Roué 6dea09ec24 Typo 2018-04-26 08:05:57 +02:00
Gwendal Roué 8d84050f77 Typo 2018-04-26 07:58:06 +02:00
Gwendal Roué af8801c28a TODO 2018-04-26 07:45:16 +02:00
Gwendal Roué 58edfcbc99 Typo 2018-04-26 07:18:02 +02:00
Gwendal Roué 25748566ea No more obsolete string.characters in documentation 2018-04-26 07:14:57 +02:00
Gwendal Roué 66bd7cff77 Typo 2018-04-26 06:40:26 +02:00
Gwendal Roué d09afc8929 explicitely -> explicitly 2018-04-25 19:35:03 +02:00
Gwendal Roué 92f037eb74 Merge remote-tracking branch 'origin/master' into GRDB3 2018-04-25 19:32:44 +02:00
Gwendal Roué 7032bb6416 Typo 2018-04-25 11:28:43 +02:00
Gwendal Roué 433f4e828f TODO 2018-04-25 11:06:19 +02:00
Gwendal Roué 319baad70c Typo 2018-04-25 11:00:26 +02:00
Gwendal Roué 56d06d0889 Honor #337 2018-04-25 10:59:07 +02:00
Gwendal Roué 727491ca1a New usage section: database observation 2018-04-25 10:57:42 +02:00
Gwendal Roué bc57d67a91 Rewrite usage section with details HTML tags 2018-04-25 10:49:35 +02:00
Gwendal Roué 4754a9dbe0 Minor 2018-04-25 09:12:43 +02:00
Gwendal Roué c4bb84a88f Fix outdated documentation 2018-04-25 09:10:03 +02:00
Gwendal Roué 543c361f87 Enhance documentation 2018-04-25 09:06:29 +02:00
Gwendal Roué e5c4409ad4 Enhance documentation 2018-04-25 08:57:44 +02:00
Gwendal Roué 5fe609ae5c TODO 2018-04-24 09:32:07 +02:00
Gwendal Roué f1baa0503f #339 follow-up: extend the thank you notice :-) 2018-04-23 14:46:12 +02:00
Gwendal Roué 9d8015925d Merge pull request #339 from kluufger/patch-1
fix small typo in readme
2018-04-23 14:44:04 +02:00
Gwendal Roué 32ec7504e5 Merge pull request #340 from groue/GRDB3-SQLColumnExpression
ColumnExpression Protocol
2018-04-23 14:10:56 +02:00
kluufger 16513dc387 as -> at 2018-04-23 11:51:16 +00:00
kluufger 4804f78042 datase -> database 2018-04-23 11:20:47 +00:00
kluufger eae2c38e23 sharedApplication() -> shared 2018-04-23 11:06:17 +00:00
kluufger 7ffc2faa9a uppercase -> uppercased since later it's called as uppercased 2018-04-23 11:00:23 +00:00
kluufger 6f03d51390 fix link 2018-04-23 07:18:32 +00:00
Gwendal Roué 4409b07ef5 ColumnExpression documentation 2018-04-23 08:39:19 +02:00
Gwendal Roué 5ee390f0da No more support for CodingKey & ColumnExpression 2018-04-23 08:19:15 +02:00
kluufger 3aa5719600 identity -> identify 2018-04-22 21:01:12 +00:00
kluufger 70e6454c38 fix typo 2018-04-22 19:49:06 +00:00
Gwendal Roué d6f93afffe Update documentation in order to foster column enums 2018-04-22 19:10:10 +02:00
Gwendal Roué f2ae44384f Rename SQLColumnExpression to ColumnExpression 2018-04-22 18:13:47 +02:00
kluufger 3c290ed6e2 case-unsensitive -> case-insensitive 2018-04-22 15:59:17 +00:00
kluufger 85849a889f parent -> parents
not sure about this one, where do `(c, d)` come from?
2018-04-22 15:42:04 +00:00
kluufger 4993198266 no need for the ellipses 2018-04-22 15:38:05 +00:00
kluufger ee7b8f74d7 update db.create(table: "example") 2018-04-22 15:35:50 +00:00
kluufger 8fd321f823 add .unique() to email column 2018-04-22 15:12:46 +00:00
kluufger 0526994603 one more 2018-04-22 14:55:51 +00:00
kluufger 0688305f86 fix small typo in readme 2018-04-22 14:44:32 +00:00
Gwendal Roué e54ccdfc54 Tests for SQLColumnExpression 2018-04-22 14:56:51 +02:00
Gwendal Roué 29b364d5cb Introduce SQLColumnExpression 2018-04-22 14:56:40 +02:00
Gwendal Roué 71d602850e Typo 2018-04-22 13:49:13 +02:00
Gwendal Roué b590ee5444 Typo 2018-04-22 13:39:28 +02:00
Gwendal Roué db31a94461 Typo 2018-04-22 13:35:36 +02:00
Gwendal Roué 405b537ef2 Typo 2018-04-22 13:32:26 +02:00
Gwendal Roué 6722ea8676 Typo 2018-04-22 13:29:52 +02:00
Gwendal Roué d3879567c4 New "Examples of Record Definitions" chapter (addresses #338) 2018-04-22 13:26:40 +02:00
Gwendal Roué 4c6147fc37 Documentation 2018-04-22 12:05:11 +02:00
Gwendal Roué b2d2d17dda #330 follow-up: extract QualifiedAllColumns from AllColumns 2018-04-22 07:26:08 +02:00
Gwendal Roué 2dae6d945f #330 follow-up: extract QualifiedColumn from Column 2018-04-22 07:17:26 +02:00
Gwendal Roué ddc551626c Merge pull request #337 from groue/GRDB3-autoIncrementedPrimaryKey
Foster auto-incremented primary keys
2018-04-22 06:39:42 +02:00
Gwendal Roué 7aacaef2cd Foster autoIncrementedPrimaryKey in documentation 2018-04-21 20:11:34 +02:00
Gwendal Roué e80dab2ea9 Documentation for TableDefinition.autoIncrementedPrimaryKey 2018-04-21 19:42:27 +02:00
Gwendal Roué 822ff97050 Tests for TableDefinition.autoIncrementedPrimaryKey 2018-04-21 19:41:45 +02:00
Gwendal Roué 73e89f76aa Introduce TableDefinition.autoIncrementedPrimaryKey 2018-04-21 19:41:21 +02:00
Gwendal Roué c21a330dce Cleanup 2018-04-21 19:40:30 +02:00
Gwendal Roué b8fc762e11 Cleanup 2018-04-21 19:28:58 +02:00
Gwendal Roué e44249be1c Merge pull request #336 from groue/GRDB3-LogicalOperatorRefactoring
Enhancements to logical operators
2018-04-21 19:06:36 +02:00
Gwendal Roué f4ab65e399 Fix typo 2018-04-21 17:21:16 +02:00
Gwendal Roué d63565f191 Documentation for joined(operator:) 2018-04-21 17:17:46 +02:00
Gwendal Roué 729f6bdc6c Tests for joined(operator:) 2018-04-21 17:05:03 +02:00
Gwendal Roué c691625b15 Dedicated implementations for AND and OR sql operators. Introduce joined(operator:) 2018-04-21 16:53:44 +02:00
Gwendal Roué 4e57bf5a0e Fix a youth error: DatabaseDateComponents initializer from DateComponents is no longer failable 2018-04-21 15:27:21 +02:00
Gwendal Roué 223d0a3fd3 Merge remote-tracking branch 'origin/development' into GRDB3 2018-04-21 15:20:36 +02:00
Gwendal Roué 00fa47b6b7 Family gets bigger :-) 2018-04-21 15:04:54 +02:00
Gwendal Roué f52536f4ae Append #334 to CHANGELOG 2018-04-21 15:04:37 +02:00
Gwendal Roué 76e1d4381d Merge pull request #334 from sobri909/development
Improve date parsing performance and memory footprint
2018-04-21 14:49:13 +02:00
Gwendal Roué 6c5d6ba631 SQLiteDateParser: tighten vsscanf format 2018-04-21 10:37:03 +02:00
Gwendal Roué 1311f6c87c SQLiteDateParser: fix nanosecond parsing 2018-04-21 10:17:07 +02:00
Gwendal Roué 219f96a11a More DatabaseDateComponents parsing tests 2018-04-21 10:16:49 +02:00
Gwendal Roué 8b175280fa TODO 2018-04-21 07:40:11 +02:00
Gwendal Roué 632bce5521 SQLiteDateParser: don't parse garbage into nanoseconds 2018-04-20 19:41:34 +02:00
Gwendal Roué 316d28746b SQLiteDateParser: optimize nanoseconds parsing 2018-04-20 19:26:42 +02:00
Gwendal Roué 9efe4a6efa Add a sanity check 2018-04-20 19:18:46 +02:00
Gwendal Roué 85fbf64068 Add missing imports (should fix travis issues) 2018-04-20 19:17:24 +02:00
Gwendal Roué 282255b841 No need for useScanfStrategy any longer 2018-04-20 19:14:58 +02:00
Gwendal Roué 9e380e5fea Cleanup 2018-04-20 19:14:32 +02:00
Gwendal Roué f12495b24a New DateParsingTests in GRDBOSXPerformanceTests 2018-04-20 19:06:02 +02:00
Gwendal Roué 266040747e Date adopts StatementColumnConvertible 2018-04-20 18:42:12 +02:00
Gwendal Roué 11a4a6acbd Documentation 2018-04-20 18:41:58 +02:00
Gwendal Roué c70689fe54 Check useScanfStrategy in DatabaseDateComponents.init(sqliteStatement:index:)
...so that we can eventually compare gains
2018-04-20 18:34:19 +02:00
Gwendal Roué 936b31f1f0 DatabaseDateComponents adopts StatementColumnConvertible
We'll need benchmarks to evaluate the gain, here
2018-04-20 14:04:12 +02:00
Gwendal Roué 8915672ce5 SQLiteDateParser: parse C strings
Since the goal of this PR is efficiency, we'll soon parse Date and
DatabaseDateComponents right from raw SQLite buffers.
2018-04-20 13:51:20 +02:00
Gwendal Roué 0640f90fc1 (whitespace) 2018-04-20 13:32:50 +02:00
Gwendal Roué d1a0e8d906 SQLiteDateParser.components(from:) is not public 2018-04-20 13:31:57 +02:00
Gwendal Roué e9a668ca56 SQLiteDateParser: no more static methods 2018-04-20 13:31:35 +02:00
Gwendal Roué 27194c802d SQLiteDateParser: use withUnsafeMutablePointer instead of allocations
OK, not really: the nanosecond components remains in the heap.
But we may find a way to put 11 chars on the stack.
2018-04-20 13:30:26 +02:00
Gwendal Roué 7aabfeaeac SQLiteDateParser: get rid of the mutex 2018-04-20 13:09:22 +02:00
Gwendal Roué 6d9bce3a25 Add SQLiteDateParser.swift to GRDBCustom and GRDBCipher
... so that all GRDB flavors can use the new technique.
GRDB has three distinct projects since #282.
2018-04-20 13:08:17 +02:00
Gwendal Roué efa0e3850f GRDB3 TODO 2018-04-20 06:16:10 +02:00
Gwendal Roué 1e7e011a61 Merge pull request #335 from groue/GRDB3-RowLookup
Row scopes collection, breadth-first scope search
2018-04-20 06:00:52 +02:00
Gwendal Roué e45642b6c1 Cleanup 2018-04-19 21:48:12 +02:00
Gwendal Roué b550e2bfd5 Cleanup 2018-04-19 21:45:40 +02:00
Gwendal Roué 4b3854d05d Finally, the meat: perform breadth-first search in let record = row[key], and in FetchableRecord & Decodable 2018-04-19 20:46:58 +02:00
Gwendal Roué 0362ae76ea Rename Row.Scopes to Row.ScopesView. Move breadth-first lookup to a new view, row.scopesTree, of type Row.ScopesTreeView 2018-04-19 20:29:11 +02:00
Gwendal Roué 098c11baf2 Row.Scopes.lookup(_:) performs a breadth-first lookup of a scope name 2018-04-19 19:50:43 +02:00
Gwendal Roué 4e659c550e Rename RowScopes to Row.Scopes. Harmonize row derivation. 2018-04-19 19:18:02 +02:00
Gwendal Roué 9cb1bac2fc Update documentation for scoped rows 2018-04-19 14:46:23 +02:00
Gwendal Roué 33d65e85d8 Update documentation for scoped rows 2018-04-19 14:44:05 +02:00
Gwendal Roué 7e260cf537 Update tests for new Row.scopes view 2018-04-19 14:41:49 +02:00
Gwendal Roué 57932235ba Introduce RowScopes collection, a view of a row's scopes 2018-04-19 09:07:16 +02:00
Gwendal Roué 2daba261a2 GRDB3 TODO 2018-04-19 08:09:46 +02:00
Gwendal Roué 9a6daedd6d Cleanup 2018-04-18 07:31:11 +02:00
Matt Greenfield 3b546dedd8 truncate nanosecond precision to 3 sig figs 2018-04-17 15:17:09 +07:00
Matt Greenfield 7320f88066 Revert "fix the tests to expect less nanosecond precision loss"
This reverts commit eba5df1fcc.
2018-04-17 15:14:18 +07:00
Matt Greenfield bde72e562e Revert "permit precision loss down to 3 sig figs"
This reverts commit 3bcc5b8064.
2018-04-17 15:14:09 +07:00
Matt Greenfield 33066133fc truncate date/time strings that include seconds precision beyond the nanosecond scale 2018-04-17 14:32:33 +07:00
Matt Greenfield 3bcc5b8064 permit precision loss down to 3 sig figs 2018-04-17 13:20:11 +07:00
Matt Greenfield eba5df1fcc fix the tests to expect less nanosecond precision loss 2018-04-17 12:57:59 +07:00
Matt Greenfield dad163771f not all nanosecond fractions have 3 sig figs, so can't hard code the acceptable string lengths 2018-04-17 12:38:23 +07:00
Matt Greenfield bb59f5e6f7 0.123 is not the same thing as 0.000123 2018-04-17 11:05:47 +07:00
Matt Greenfield 7a1aa88edb fractions of seconds are not the same thing as integer counts of nanoseconds 2018-04-16 19:18:49 +07:00
Gwendal Roué a2c06c1bdb Cleanup 2018-04-16 14:05:36 +02:00
Gwendal Roué 2a2c5a772f Cleanup 2018-04-16 14:05:04 +02:00
Gwendal Roué 969fac5c4b Cleanup 2018-04-16 14:01:54 +02:00
Matt Greenfield b444d376f4 differentiate between SS and SS.SSS formats 2018-04-16 17:39:41 +07:00
Matt Greenfield 59d7909f50 return correct Format for partial date/time combinations 2018-04-16 17:21:00 +07:00
Matt Greenfield f5f8ab5971 add SQLiteDateParser to project file 2018-04-16 16:32:32 +07:00
Matt Greenfield 362c4baeca initial scanf() based date string parser 2018-04-16 14:02:15 +07:00
Gwendal Roué d39f02113c Restore T.fetchXXX(db, request) APIs which were removed in PR #311 2018-04-16 08:50:55 +02:00
Gwendal Roué c9dc1223dd Harmonize dbQueue.writer with dbPool.writer 2018-04-15 20:14:25 +02:00
Gwendal Roué ba848d2d53 Less TODO 2018-04-15 19:57:36 +02:00
Gwendal Roué 1c9c3d4399 Merge pull request #332 from groue/GRDB3-DatabaseWriterRobustness
Implicit transaction in DatabasePool.write and DatabaseQueue.write
2018-04-15 19:51:52 +02:00
Gwendal Roué 090f872e80 Update documentation: don't mention dbQueue.inDatabase unless necessary 2018-04-15 18:09:34 +02:00
Gwendal Roué 3d9c1a2739 Cleanup 2018-04-15 17:26:37 +02:00
Gwendal Roué c97c260613 Update documentation about transactions 2018-04-15 17:15:13 +02:00
Gwendal Roué a46505e907 Cleanup 2018-04-15 14:30:12 +02:00
Gwendal Roué ea3f22c8a4 Fix tests that were failing now that DatabaseQueue.inDatabase runs inside a transaction 2018-04-13 18:07:24 +02:00
Gwendal Roué d78479e4af [WIP] DatabaseQueue.inDatabase runs inside a transaction 2018-04-13 08:56:03 +02:00
Gwendal Roué 267371ba90 Tests that DatabasePool.write opens a transaction 2018-04-13 08:20:17 +02:00
Gwendal Roué cc136922e5 Typo 2018-04-12 14:07:38 +02:00
Gwendal Roué 02927106ca It looks like documentation wants that DatabaseQueue automatically opens transactions as well... 2018-04-12 14:06:13 +02:00
Gwendal Roué 1275ebc2b1 Layout 2018-04-12 14:02:31 +02:00
Gwendal Roué 2ac2a148c6 Typo 2018-04-12 14:00:19 +02:00
Gwendal Roué 1a5f432ee1 Update documentation for DatabasePool.writeWithoutTransaction 2018-04-12 13:59:10 +02:00
Gwendal Roué 5df4e713b6 GRDB3 TODO 2018-04-12 12:39:29 +02:00
Gwendal Roué 20d2c74f87 Update documentation for DatabasePool.writeWithoutTransaction 2018-04-12 12:02:25 +02:00
Gwendal Roué bc244802c0 Update tests for DatabasePool/Writer.writeWithoutTransaction 2018-04-12 07:58:23 +02:00
Gwendal Roué bd2f17ee10 Fixes needed by DatabasePool/Writer.writeWithoutTransaction 2018-04-12 07:58:01 +02:00
Gwendal Roué 563a4d5c71 Introduce DatabaseWriter.writeWithoutTransaction 2018-04-11 20:03:18 +02:00
Gwendal Roué 78e6241d16 DatabaseWriter.write now guarantees that eventual concurrent readers don't see any changes until all changes are executed. DatabasePool.write thus wraps changes in a transaction. 2018-04-11 20:03:18 +02:00
Gwendal Roué d08f630a2c Merge pull request #331 from groue/GRDB3-RowDescription
Improve Row descriptions
2018-04-11 20:02:31 +02:00
Gwendal Roué 26912e746b Update documentation for new Row description format 2018-04-11 15:49:16 +02:00
Gwendal Roué fa68b62be1 Improve Row.description & Row.debugDescription 2018-04-11 13:39:44 +02:00
Gwendal Roué 07a1d4d1b8 Database.rollback: add missing dispatch queue check 2018-04-11 13:21:56 +02:00
Gwendal Roué 9c6b48980c Database.isInsideTransaction: add missing dispatch queue check 2018-04-11 13:18:34 +02:00
Gwendal Roué 79c7dd03a5 [Whitespace] 2018-04-11 13:10:15 +02:00
Gwendal Roué b252c689df Merge pull request #330 from groue/GRDB3-RemovePATs
Expressions are no longer PATs
2018-04-11 13:08:46 +02:00
Gwendal Roué c34380cf5c SQLExpression and SQLSelectable are no longer PATs 2018-04-11 08:19:15 +02:00
Gwendal Roué 75ab9d615c Merge pull request #329 from groue/GRDB3-RequestDerivation
Introduce request derivation protocols
2018-04-11 08:04:30 +02:00
Gwendal Roué b9333fab34 Update a few tests that have been broken by 64899e5a39.
(Some expressions which were not safely wrapped inside parenthesis now are wrapped inside parenthesis)
2018-04-10 13:45:31 +02:00
Gwendal Roué 64899e5a39 Introduce SelectionRequest, FilteredRequest, AggregatingRequest, and OrderedRequest.
Those request protocols allow types that are not QueryInterfaceRequest to expose the same derivation API. This is a necessary step towards associations.
2018-04-10 13:44:23 +02:00
Gwendal Roué 80889dc9d2 Merge pull request #328 from groue/GRDB3-DatabaseRequest
Allow observation of complex fetching strategies
2018-04-10 12:50:37 +02:00
Gwendal Roué b7239c4b6f Document request protocols 2018-04-08 13:18:02 +02:00
Gwendal Roué 67ae1d4cf0 Document request protocols 2018-04-08 13:09:24 +02:00
Gwendal Roué 03f5a83cbf Introduce and DatabaseRequest and SelectStatementRequest on top of FetchRequest 2018-04-08 12:08:51 +02:00
Gwendal Roué 77bb2ecc82 Merge branch 'SQLite-3.22.0' of github.com:groue/GRDB.swift into GRDB3 2018-04-08 11:51:56 +02:00
Gwendal Roué 3160b65172 Upgrade SQLiteCustom to 3.22.0 2018-04-04 13:23:46 +02:00
Gwendal Roué 65b3ba1d12 TODO 2018-04-04 09:49:38 +02:00
Gwendal Roué ce919f0411 GRDB3 TODO 2018-03-31 16:00:34 +02:00
Gwendal Roué 2dfbe8e5f2 Prevent snapshot creation from within a transaction 2018-03-31 15:56:42 +02:00
Gwendal Roué e9d45b5435 GRDB3 TODO 2018-03-31 15:07:19 +02:00
Gwendal Roué c3f9c75b3c Rename databaseEqual to databaseEquals 2018-03-31 14:53:22 +02:00
Gwendal Roué d24f79ee4d Merge branch 'master' into GRDB3 2018-03-31 14:36:43 +02:00
Gwendal Roué 2992bd544e GRDB3 TODO 2018-03-30 10:49:43 +02:00
Gwendal Roué 31ed3ce277 GRDB3 TODO 2018-03-30 09:12:35 +02:00
Gwendal Roué 91b574e153 v2.10.0 2018-03-30 08:32:18 +02:00
Gwendal Roué 7966b43daf Merge pull request #295 from groue/Swift4.1
Xcode 9.3 & Swift 4.1
2018-03-30 08:31:30 +02:00
Gwendal Roué 17dfb0db9d CHANGELOG 2018-03-30 08:19:46 +02:00
Gwendal Roué 2c3a62abbc Update performance tests for Swift 4.1 2018-03-30 08:12:24 +02:00
Gwendal Roué f9a806d9aa Xcode 9.3 artifact: IDEWorkspaceChecks.plist 2018-03-30 07:51:34 +02:00
Gwendal Roué afd2d25e5e Makefile: add support for Xcode 9.3 2018-03-30 07:21:49 +02:00
Gwendal Roué 4ee9580d31 Remove redundant conformance of DatabaseValue to SQLExpressible 2018-03-29 15:31:22 +02:00
Gwendal Roué b35cf4afdc Record.save(_:) documents that is can't be overridden 2018-03-15 20:46:03 +01:00
Gwendal Roué 930246592a Cleanup TODO 2018-03-15 20:32:04 +01:00
Gwendal Roué 727be0a8ab Merge pull request #321 from groue/GRDB3-Testability
Improve testability
2018-03-15 20:25:18 +01:00
Gwendal Roué ebe1d93c3a Polish 2018-03-15 20:22:39 +01:00
Gwendal Roué c7ad3ef4a9 DatabaseMigrator.appliedMigrations(in:) doc & changelog 2018-03-15 20:15:23 +01:00
Gwendal Roué fa8ed89eae DatabaseMigrator.appliedMigrations(_:) 2018-03-15 20:10:59 +01:00
Gwendal Roué 0d7f392bcd Database.isGRDBInternalTable(_:) 2018-03-15 20:04:50 +01:00
Gwendal Roué d61551cedb Database.isSQLiteInternalTable(_:) doc 2018-03-15 19:57:03 +01:00
Gwendal Roué 07b944039c Database.isSQLiteInternalTable(_:) 2018-03-15 19:52:44 +01:00
Gwendal Roué 95933e93dd Fix SQLRequest inline documentation 2018-03-12 23:03:46 +01:00
Gwendal Roué 1cbe60a13f Better checks for Swift < 4.1 (thanks @hartbit!) 2018-03-12 18:33:06 +01:00
Gwendal Roué 9505ba1606 Replace flatMap with compactMap in README.md 2018-03-12 18:20:10 +01:00
Gwendal Roué bca1fe0d9b SE-0184: backport UnsafeMutablePointer.deallocate() 2018-03-12 18:20:10 +01:00
Gwendal Roué 1d28ca1fca TODO Swift 4.1 2018-03-12 18:20:10 +01:00
Gwendal Roué a75e519294 SE-0185: let Swift 4.1 generate as much Equatable and Hashable conformance as possible 2018-03-12 18:20:10 +01:00
Gwendal Roué 75d5c2a39f SE-0187: deprecate Cursor.flatMap in favor of Cursor.compactMap 2018-03-12 18:20:10 +01:00
Gwendal Roué 85d3c584ef Swift 4.1 compatibility (SE-0184 , SE-0187) 2018-03-12 18:20:10 +01:00
Gwendal Roué ad0f6de809 Fix Xcode9.3 warnings 2018-03-12 18:20:10 +01:00
Gwendal Roué 5defb058d3 TODO 2018-03-05 14:22:58 +01:00
Gwendal Roué f202ad5e3f TODO 2018-03-05 10:18:44 +01:00
Gwendal Roué 1cd8467b8f TODO 2018-03-05 09:59:01 +01:00
Gwendal Roué f2462d4270 Improve Record overview 2018-03-02 18:56:43 +01:00
Gwendal Roué 4a4f4e37ba Improve Record overview 2018-03-02 15:13:12 +01:00
Gwendal Roué 3a625157ff README typos 2018-02-28 09:02:48 +01:00
Gwendal Roué 3bbc17fe4a Rename "record changes tracking" to "record comparison" in order to avoid confusion with database changes tracking performed by database observation 2018-02-28 08:58:27 +01:00
Gwendal Roué 8cff147029 TODO.md 2018-02-28 08:41:46 +01:00
Gwendal Roué ce984783ec Intra-doc links 2018-02-28 08:36:58 +01:00
Gwendal Roué dbde432948 Remove deprecated APIs 2018-02-28 08:35:07 +01:00
Gwendal Roué 85f945dcba Merge pull request #314 from groue/GRDB3-RenameRecordProtocols
Rename record protocols
2018-02-27 20:42:10 +01:00
Gwendal Roué 487f4e220f Record protocols fixit 2018-02-27 20:10:13 +01:00
Gwendal Roué 6a8dec11ea Record protocols changelog 2018-02-27 20:10:06 +01:00
Gwendal Roué 1a91020a84 After all, FetchableRecord and PersistableRecord 2018-02-27 19:25:49 +01:00
Gwendal Roué 08a08cd74f Rename MutablePersistable to EncodableRecord 2018-02-27 18:46:32 +01:00
Gwendal Roué 639de6ca11 Rename TableMapping to TableRecord 2018-02-27 13:28:29 +01:00
Gwendal Roué ba6a026cdc Rename RowConvertible to DecodableRecord 2018-02-27 13:17:51 +01:00
Gwendal Roué 07634229f9 GRDB3 TODO 2018-02-27 12:44:34 +01:00
Gwendal Roué 619aeb4355 Merge pull request #312 from groue/GRDB3-DropIteratorCursor
Drop IteratorCursor, use AnyCursor instead
2018-02-27 12:39:37 +01:00
Gwendal Roué e8d0af93fc Cursor changelog 2018-02-27 08:17:55 +01:00
Gwendal Roué 4faa9964bd Make AnyCursor final 2018-02-27 08:15:49 +01:00
Gwendal Roué 15a0ea79b0 Drop IteratorCursor, use AnyCursor instead 2018-02-27 08:11:48 +01:00
Gwendal Roué d0a281e14f Merge pull request #311 from groue/GRDB3-FetchRequest
Rename TypedRequest to FetchRequest, drop Request
2018-02-27 07:53:23 +01:00
Gwendal Roué 49e624e532 Update WhyAdoptGRDB.md for FetchRequest 2018-02-27 07:47:05 +01:00
Gwendal Roué 3bbcb8151d Update JoinSupportTests for FetchRequest 2018-02-26 22:34:46 +01:00
Gwendal Roué c7b9358bc7 Documentation polish 2018-02-26 22:29:58 +01:00
Gwendal Roué a552e7d25c Update README.md for FetchRequest 2018-02-26 22:18:35 +01:00
Gwendal Roué c108094aa5 FetchRequest changelog 2018-02-26 19:34:29 +01:00
Gwendal Roué 769c67e7d3 FetchRequest.adapted(_:) in not experimental 2018-02-26 19:34:16 +01:00
Gwendal Roué f605e049fd Rename TypedRequest to FetchRequest, drop Request 2018-02-26 13:12:33 +01:00
Gwendal Roué e44201e0e3 Apply advice from @sobri909 2018-02-25 09:43:00 +01:00
Gwendal Roué 028093199b Replace flatMap with compactMap in README.md 2018-02-25 09:26:18 +01:00
Gwendal Roué 6043b4288e SE-0184: backport UnsafeMutablePointer.deallocate() 2018-02-25 09:24:23 +01:00
Gwendal Roué 11ec16494d TODO Swift 4.1 2018-02-25 09:24:23 +01:00
Gwendal Roué b4922f60a2 SE-0185: let Swift 4.1 generate as much Equatable and Hashable conformance as possible 2018-02-25 09:24:23 +01:00
Gwendal Roué b0e126f29d SE-0187: deprecate Cursor.flatMap in favor of Cursor.compactMap 2018-02-25 09:24:23 +01:00
Gwendal Roué d8c411ad52 Swift 4.1 compatibility (SE-0184 , SE-0187) 2018-02-25 09:24:23 +01:00
Gwendal Roué 4f8f0e0bf3 Fix Xcode9.3 warnings 2018-02-25 09:23:05 +01:00
Gwendal Roué dee6bf79d1 TODO 2018-02-25 08:41:34 +01:00
Gwendal Roué baeba0dea3 v2.9.0 2018-02-25 07:40:14 +01:00
Gwendal Roué 3dc31ad638 Typo 2018-02-25 00:00:25 +01:00
Gwendal Roué 4201e2a611 README 2018-02-24 21:24:18 +01:00
Gwendal Roué d9f6fa7de6 CHANGELOG 2018-02-24 21:12:53 +01:00
Gwendal Roué d0146762bc Differences between Database Queues and Pools 2018-02-24 21:06:07 +01:00
Gwendal Roué 7e8f2e2fbc Differences between Database Queues and Pools 2018-02-24 21:05:23 +01:00
Gwendal Roué 497f4b65ef Differences between Database Queues and Pools 2018-02-24 21:03:08 +01:00
Gwendal Roué 03c44778ba Differences between Database Queues and Pools 2018-02-24 20:57:27 +01:00
Gwendal Roué 0cc744ae16 Differences between Database Queues and Pools 2018-02-24 20:54:12 +01:00
Gwendal Roué fae3862547 Typo 2018-02-24 20:08:07 +01:00
Gwendal Roué 70a222f3c9 Typo 2018-02-24 20:07:21 +01:00
Gwendal Roué 5676adca99 TODO: Decode NSDecimalNumber from text database values
(Idea from @robertmryan at https://github.com/ccgus/fmdb/pull/647#issuecomment-368083101)
2018-02-24 18:18:41 +01:00
Gwendal Roué 3a77ca68c4 TODO 2018-02-24 17:58:02 +01:00
Gwendal Roué 248437d1d6 DatabaseSnapshot documentation 2018-02-24 17:55:34 +01:00
Gwendal Roué afcde4609e CHANGELOG 2018-02-24 17:49:39 +01:00
Gwendal Roué 2e98974373 Cursor doc 2018-02-24 17:46:01 +01:00
Gwendal Roué 086a33fd62 Cursor doc 2018-02-24 17:44:33 +01:00
Gwendal Roué 33359dd435 Markdown typo 2018-02-24 17:42:52 +01:00
Gwendal Roué 574d71b50c Cursor level 2018-02-24 17:41:29 +01:00
Gwendal Roué c806b706d4 Focus on Cursor specificities 2018-02-24 17:40:16 +01:00
Gwendal Roué c3b8c0f7e9 Explain why cursors are not sequences (addresses #303) 2018-02-24 17:37:00 +01:00
Gwendal Roué a1cd622892 Focus on Cursor specificities 2018-02-24 17:30:31 +01:00
Gwendal Roué dea3ee0b84 Focus on Cursor specificities 2018-02-24 17:29:29 +01:00
Gwendal Roué 5c64348ea8 Focus on Cursor specificities 2018-02-24 17:25:13 +01:00
Gwendal Roué 262ac2c476 Intra-doc links 2018-02-24 17:17:34 +01:00
Gwendal Roué dbfbe30749 DatabaseSnapshot RAII 2018-02-24 17:15:53 +01:00
Gwendal Roué 70437bd4cb Documentation typos 2018-02-24 17:14:30 +01:00
Gwendal Roué 2d30b5ea1c Documentation typos 2018-02-24 17:13:27 +01:00
Gwendal Roué 5414111bed Update changes tracking documentation, and changelog 2018-02-24 17:06:35 +01:00
Gwendal Roué 9168bac16e Deprecate RecordBox. Introduce changes API on MutablePersistable. Rename Record changes tracking methods. 2018-02-24 16:19:21 +01:00
Gwendal Roué 8760d36f6c Snapshot documentation 2018-02-24 07:59:44 +01:00
Gwendal Roué 141b870bc0 Typo 2018-02-24 07:55:15 +01:00
Gwendal Roué 5e4406e78c Improves documentation (addresses #306) 2018-02-24 07:54:42 +01:00
Gwendal Roué c5426bfcf7 CHANGELOG 2018-02-24 07:44:35 +01:00
Gwendal Roué 76561a567f Introduce DatabaseSnapshot 2018-02-24 07:37:26 +01:00
Gwendal Roué 8288f0c751 Add a real-life test for allowsUnsafeTransactions 2018-02-23 19:11:38 +01:00
Gwendal Roué 7dc008db8b Expose Database.beginTransaction(), commit(), rollback(). New Configuration.allowsUnsafeTransactions flag. New fatal error when a database access block ends with a transaction left opened. 2018-02-23 14:14:05 +01:00
Gwendal Roué 86bb4a27a4 CHANGELOG 2018-02-23 13:23:44 +01:00
Gwendal Roué f2d9f50930 CHANGELOG 2018-02-23 13:10:40 +01:00
Gwendal Roué b9af7e6a25 Update ColumnInfo.primaryKeyIndex documentation 2018-02-23 12:55:27 +01:00
Gwendal Roué 00825748ff Fix ColumnInfo test (it is different with SQLite < 3.7.16) 2018-02-23 12:53:41 +01:00
Gwendal Roué fe0edde4a9 TODO 2018-02-23 12:41:19 +01:00
Gwendal Roué edfea91920 TODO 2018-02-23 09:03:58 +01:00
Gwendal Roué 319e6bcdc8 Typo 2018-02-23 08:55:40 +01:00
Gwendal Roué 274f73e040 Cleanup 2018-02-23 08:55:03 +01:00
Gwendal Roué fab37838b2 Cleanup 2018-02-23 08:49:50 +01:00
Gwendal Roué a5a3610bf6 Cleanup 2018-02-23 08:49:27 +01:00
Gwendal Roué 07e600163c Splitting rows: documentation WIP 2018-02-23 08:35:32 +01:00
Gwendal Roué 14a5dc5489 Cleanup 2018-02-23 08:34:34 +01:00
Gwendal Roué 46c2b94425 Cleanup 2018-02-23 08:32:50 +01:00
Gwendal Roué 9a1dc7f292 Cleanup 2018-02-23 08:32:17 +01:00
Gwendal Roué c68fc37959 Cleanup 2018-02-23 08:17:15 +01:00
Gwendal Roué aa1f555e05 Drop init(leftJoinedRow:), and expose Row subscripts that return records 2018-02-23 08:08:00 +01:00
Gwendal Roué 699e64c610 Splitting rows: documentation WIP 2018-02-22 23:31:58 +01:00
Gwendal Roué e8c1392314 TODO 2018-02-22 23:30:48 +01:00
Gwendal Roué c1ae47d188 Splitting rows: documentation WIP 2018-02-22 23:26:37 +01:00
Gwendal Roué 13a9f1113a Splitting rows: documentation WIP 2018-02-22 23:07:19 +01:00
Gwendal Roué c4ad86863f Splitting rows: documentation WIP 2018-02-22 23:03:39 +01:00
Gwendal Roué 8300a618f8 Splitting rows: documentation WIP 2018-02-22 22:58:56 +01:00
Gwendal Roué 52f0038262 Splitting rows: documentation WIP 2018-02-22 22:58:05 +01:00
Gwendal Roué 31710ce91c Splitting rows: documentation WIP 2018-02-22 22:55:24 +01:00
Gwendal Roué a9c75652e1 Splitting rows: documentation WIP 2018-02-22 22:54:21 +01:00
Gwendal Roué 3e13e5be57 Splitting rows: documentation WIP 2018-02-22 22:48:52 +01:00
Gwendal Roué c27979a210 Splitting rows: documentation WIP 2018-02-22 22:37:42 +01:00
Gwendal Roué 37d7c84bc3 Splitting rows: documentation WIP 2018-02-22 22:30:13 +01:00
Gwendal Roué 62f5c8fc2f Splitting rows: documentation WIP 2018-02-22 22:18:12 +01:00
Gwendal Roué 289c449dff Splitting rows: documentation WIP 2018-02-22 22:13:29 +01:00
Gwendal Roué e7b7b603d2 Splitting rows: documentation WIP 2018-02-22 22:08:23 +01:00
Gwendal Roué e7e342600b Splitting rows: documentation WIP 2018-02-22 21:03:17 +01:00
Gwendal Roué db6e3b8371 Splitting rows: documentation WIP 2018-02-22 20:33:46 +01:00
Gwendal Roué 79ed15c38c Deprecate Database.columnCount(in:) in favor of Database.columns(in:). Update doc and changelog 2018-02-22 14:00:19 +01:00
Gwendal Roué 6f175dcafb Add ColumnInfoTests to GRDBCustom/GRDBCipher tests 2018-02-22 13:52:52 +01:00
Gwendal Roué ca70a10bd4 TODO 2018-02-22 13:37:49 +01:00
Gwendal Roué ae3319e9f9 Make ColumnInfo public (asked by @freak4pc) 2018-02-22 13:20:41 +01:00
Gwendal Roué 5112cb24f5 Expose EmptyRowAdapter, and ScopeAdapter(base:scopes:) 2018-02-22 12:38:03 +01:00
Gwendal Roué c6bbccc02e Have AdaptedRow go straight to SQLite when possible (avoid DatabaseValue initializer) 2018-02-22 12:23:19 +01:00
Gwendal Roué 93ec4d2515 Remove Row.hasNull(named:String) and Row.hasNull(Column) 2018-02-22 12:00:06 +01:00
Gwendal Roué 955dc6094b TODO 2018-02-22 09:24:30 +01:00
Gwendal Roué bd694cbc53 Cleanup 2018-02-22 08:50:35 +01:00
Gwendal Roué c115a035ec Row.hasNull(atIndex:) goes straight to sqlite3_column_type() when possible 2018-02-22 08:39:14 +01:00
Gwendal Roué 288144f347 splittingRowAdapters(columnCounts:), ScopeAdapter(nestedScopes:), RowConvertible?(leftJoinedRow:), TableMapping.numberOfSelectedColumns(_:), support for nested codable records 2018-02-21 23:15:13 +01:00
Gwendal Roué 3bdfdaa40a TableMapping.selectionSQL(_:) 2018-02-21 13:51:37 +01:00
Gwendal Roué 22949813af Row.hasNull(atIndex:), Row.hasNull(named:), Row.hasNull(_:), Row.hasNonNullValue 2018-02-20 14:43:06 +01:00
Gwendal Roué 5c98b01484 Update Record.updateChanges(_:) documentation 2018-02-20 13:20:50 +01:00
Gwendal Roué ea5e1cd0db CHANGELOG 2018-02-20 13:18:38 +01:00
Gwendal Roué b5d9955442 Tests: setup Database.logError only once (and avoid SQLite misuse) 2018-02-20 13:16:11 +01:00
Gwendal Roué feb5cb35b4 Record.updateChanges now returns whether the record had changes 2018-02-20 13:06:58 +01:00
Gwendal Roué 654c7083eb TODO 2018-02-17 17:44:03 +01:00
Gwendal Roué a0457928b3 TODO 2018-02-17 17:40:25 +01:00
Gwendal Roué 4df535a3a9 TODO 2018-02-17 17:32:15 +01:00
Gwendal Roué 0b251ec4e0 TODO 2018-01-31 19:54:37 +01:00
Gwendal Roué 7704a9ac41 v2.8.0 2018-01-29 08:12:29 +01:00
Gwendal Roué 59031893ff Merge pull request #297 from groue/MoreCursor
More sequence-like cursor methods
2018-01-29 07:19:58 +01:00
Gwendal Roué fcfa044320 Parts of Cursor implementation are derived from Swift.org 2018-01-28 18:56:40 +01:00
Gwendal Roué f95658e7ce Remove convenience cursor types from reference documentation
Those types bloat the documentation for no real value: DropFirstCursor, DropWhileCursor, EnumeratedCursor, FilterCursor, FlattenCursor, MapCursor, PrefixCursor, PrefixWhileCursor
2018-01-28 17:13:53 +01:00
Gwendal Roué 2c16fcaa99 Cursor cleanup 2018-01-28 17:13:52 +01:00
Gwendal Roué 4e638016e1 Cursor changelog 2018-01-28 17:13:52 +01:00
Gwendal Roué 5d811c0e68 Documentation for Cursor convenience methods 2018-01-28 17:13:52 +01:00
Gwendal Roué 9f1f51637a Tests for Cursor.joined(separator:String) 2018-01-28 17:13:52 +01:00
Gwendal Roué 7c16ffcdf8 Cursor.joined(separator:String) 2018-01-28 17:13:51 +01:00
Gwendal Roué 7ca582719b Tests for Cursor.reduce(into:_:) 2018-01-28 17:13:51 +01:00
Gwendal Roué e4b83baa53 Cursor.reduce(into:_:) 2018-01-28 17:13:51 +01:00
Gwendal Roué ac6b2933a8 Tests for Cursor.max(by:), max(), min(by:), min() 2018-01-28 17:13:50 +01:00
Gwendal Roué 92758fa51d Cursor.max(by:), max(), min(by:), min() 2018-01-28 17:13:50 +01:00
Gwendal Roué acd06a4f5a Tests for Cursor.dropLast() 2018-01-28 17:13:50 +01:00
Gwendal Roué eec6b17398 Cursor.dropLast() 2018-01-28 17:13:50 +01:00
Gwendal Roué 15fbf02647 Tests for Cursor.dropFirst() 2018-01-28 17:13:49 +01:00
Gwendal Roué c296be5057 Cursor.dropFirst() 2018-01-28 17:13:49 +01:00
Gwendal Roué 129e178ee0 Tests for Cursor.dropFirst(_:) 2018-01-28 17:13:49 +01:00
Gwendal Roué 1e5caa62a8 Tests for Cursor.prefix(while:) 2018-01-28 17:13:49 +01:00
Gwendal Roué 420ed0764b Tests for Cursor.drop(while:) 2018-01-28 17:13:49 +01:00
Gwendal Roué ce6bbb2885 Tests for Cursor.prefix(_:) 2018-01-28 17:13:48 +01:00
Gwendal Roué 87d6c5dd29 Cursor.prefix(_:) 2018-01-28 17:13:48 +01:00
Gwendal Roué dccd456497 Tests for Cursor.dropLast(_:) 2018-01-28 17:13:48 +01:00
Gwendal Roué 520bdd64e6 Tests for Cursor.dropFirst(_:) 2018-01-28 17:13:47 +01:00
Gwendal Roué 72608fd016 Cursor.dropLast(_:) 2018-01-28 17:13:47 +01:00
Gwendal Roué 69b51ffbd5 Tests for Cursor.dropFirst(_:) 2018-01-28 17:13:47 +01:00
Gwendal Roué c9044ea07b Cursor.dropFirst(_:) 2018-01-28 17:13:47 +01:00
Gwendal Roué 362c40326f Tests for Cursor.suffix(_:) 2018-01-28 17:13:47 +01:00
Gwendal Roué 28d0793688 Cursor.suffix(_:) 2018-01-28 17:13:46 +01:00
Gwendal Roué abdc2000c4 Tests for Cursor.prefix(while:) 2018-01-28 17:13:46 +01:00
Gwendal Roué 3d845b1e9f Cursor.prefix(while:) 2018-01-28 17:13:46 +01:00
Gwendal Roué bae8c97df4 Tests for Cursor.drop(while:) 2018-01-28 17:13:46 +01:00
Gwendal Roué 452c1d4b92 Cursor.drop(while:) 2018-01-28 17:13:46 +01:00
Gwendal Roué 9990e6e2a6 Less TODO 2018-01-28 17:13:16 +01:00
Gwendal Roué 8d0dc3eb78 Merge pull request #293 from groue/SQLite3.22.0
Upgrade SQLite version to 3.22.0
2018-01-27 09:33:54 +01:00
Gwendal Roué 0a2a3c75c1 Fix typo 2018-01-26 08:47:27 +01:00
Gwendal Roué 830e6acb4f Documentation and changelog 2018-01-26 08:44:18 +01:00
Gwendal Roué 1da85dff58 FTS5Pattern(matchingPrefixPhrase:) 2018-01-26 08:38:11 +01:00
Gwendal Roué dd40e3be5b Upgrade custom SQLite version in documentation 2018-01-26 08:00:50 +01:00
Gwendal Roué 224d6488a9 Upgrade swiftlyfalling/SQLiteLib to v3.22.0 2018-01-26 07:54:08 +01:00
Gwendal Roué cac31d3294 TODO: apply @hartbit's suggestion 2018-01-24 18:56:53 +01:00
Gwendal Roué 951d5fa58d TODO SQLite 3.22.0 2018-01-23 08:10:26 +01:00
Gwendal Roué 7a4f0778df Remove references to discarded GRDB Extension Guide 2018-01-21 17:31:45 +01:00
Gwendal Roué 5aff4d29fc CHANGELOG 2018-01-21 17:29:27 +01:00
Gwendal Roué 402b7001ee v2.7.0 2018-01-21 17:07:39 +01:00
Gwendal Roué f7d0979fb1 Remove ExtendingGRDB guide 2018-01-21 17:05:38 +01:00
Gwendal Roué 2289ed9d95 Cleanup Jazzy documentation from most redundant definitions and experimental APIs 2018-01-21 16:57:43 +01:00
Gwendal Roué dfcb44016f Enhance CHANGELOG 2018-01-21 15:19:55 +01:00
Gwendal Roué 37a434a615 Merge pull request #289 from groue/RecordBox
Bring changes tracking to any record type
2018-01-21 13:16:35 +01:00
Gwendal Roué 0ddcf1e401 RecordBox documentation 2018-01-21 13:14:14 +01:00
Gwendal Roué 0aa673f24e RecordBox consequence: more TODO 2018-01-21 12:05:41 +01:00
Gwendal Roué b3a24daa2f Documentation tweaks 2018-01-21 07:49:13 +01:00
Gwendal Roué 8c6954cd75 RecordBox documentation 2018-01-21 07:35:52 +01:00
Gwendal Roué 283f08de07 RecordBox changelog 2018-01-20 20:26:37 +01:00
Gwendal Roué d96543ddeb RecordBox documentation 2018-01-20 20:26:37 +01:00
Gwendal Roué 4b320f3cb5 RecordBox documentation 2018-01-20 20:26:37 +01:00
Gwendal Roué 69a6d3e3f3 RecordBox documentation 2018-01-20 20:26:36 +01:00
Gwendal Roué 93d4587732 RecordBox 2018-01-20 20:26:36 +01:00
Gwendal Roué 7481b9788a Run truncate optimization tests with and without transaction observer
This topic is sooo touchy...
2018-01-20 20:26:10 +01:00
Gwendal Roué acf3e0b397 TODO 2018-01-20 19:54:19 +01:00
Gwendal Roué 88ae0fa059 TODO 2018-01-20 17:59:54 +01:00
Gwendal Roué a1e63d9028 Fix management of current transaction observation broker (and discover a new SQLite oddity) 2018-01-20 16:11:05 +01:00
Gwendal Roué 2a1ad8d31c TODO 2018-01-20 09:09:32 +01:00
Gwendal Roué ba7cd2160f TODO 2018-01-20 06:09:44 +01:00
Gwendal Roué 8e50383371 v2.6.1 2018-01-19 16:24:09 +01:00
Gwendal Roué ffc5352840 Fix transaction observer crash 2018-01-19 16:17:38 +01:00
Gwendal Roué 53e849cbec v2.6.0 2018-01-18 13:05:07 +01:00
Gwendal Roué b71d57d7ec Merge pull request #288 from groue/TransactionObserverInvalidation
Enhance Database Observation
2018-01-18 13:04:41 +01:00
Gwendal Roué 4fe2b2542f Cleanup 2018-01-18 12:54:02 +01:00
Gwendal Roué 8c7895d8ab Have Makefile accept both Xcode9.0 and Xcode9.0.1 2018-01-18 12:47:29 +01:00
Gwendal Roué ad15f4dc59 Fix .travis.yml for Xcode9 2018-01-17 13:51:19 +01:00
Gwendal Roué c4ef161a83 Rename Statement.region and Request.region to fetchedRegion 2018-01-17 06:54:10 +01:00
Gwendal Roué bb48025947 Derived requests ought to preserve database region: fix failing tests 2018-01-16 20:39:19 +01:00
Gwendal Roué 389a7f28c4 Derived requests ought to preserve database region: failing tests 2018-01-16 20:39:13 +01:00
Gwendal Roué 714cc1c734 DatabaseRegion() is public 2018-01-16 19:57:30 +01:00
Gwendal Roué 8d0da7f870 DatabaseRegion documentation 2018-01-16 18:47:59 +01:00
Gwendal Roué e42e74103d DatabaseRegion documentation 2018-01-16 18:46:55 +01:00
Gwendal Roué 4bcdb91895 AnyRequest and all derived requests preserve database region, and counting method 2018-01-16 14:11:05 +01:00
Gwendal Roué 938977bbca Cleanup DatabaseRegion: no more public intersection, no more public way to specify rowids 2018-01-16 13:58:55 +01:00
Gwendal Roué 581c1c46e2 More TODO 2018-01-16 11:28:48 +01:00
Gwendal Roué 768b2ab620 More TODO 2018-01-16 09:30:12 +01:00
Gwendal Roué 4eff5ab357 More TODO 2018-01-16 09:06:53 +01:00
Gwendal Roué 888892b92f Cleanup 2018-01-16 09:04:06 +01:00
Gwendal Roué ba4f146c9c Cleanup 2018-01-16 08:55:48 +01:00
Gwendal Roué 8359dd2ae2 Cleanup 2018-01-16 08:54:12 +01:00
Gwendal Roué 0be80db8f9 Cleanup 2018-01-16 08:51:42 +01:00
Gwendal Roué 72de142519 Cleanup 2018-01-16 08:50:49 +01:00
Gwendal Roué 0a7468f56d Cleanup 2018-01-16 08:34:54 +01:00
Gwendal Roué 33b5c6c616 Rename DatabaseSelectionInfo to DatabaseRegion 2018-01-16 08:23:08 +01:00
Gwendal Roué 4003d7600d DatabaseSelectionInfo documentation WIP 2018-01-15 23:41:49 +01:00
Gwendal Roué a7122ba8bb Unit tests for DatabaseSelectionInfo.isModified methods 2018-01-15 23:09:52 +01:00
Gwendal Roué dc8c85d3db Odd failing tests for DatabaseSelectionInfo and the rowid column. Consequences not cleared out yet. 2018-01-15 22:44:09 +01:00
Gwendal Roué fc1b4a6f35 Complete refactoring of SelectStatement.SelectionInfo into DatabaseSelectionInfo 2018-01-15 22:28:43 +01:00
Gwendal Roué af42623654 Fix SPM tests 2018-01-15 07:22:01 +01:00
Gwendal Roué ab1a672336 Disable test that fails on iOS 8.1 (SQLite 3.7.13) 2018-01-14 23:31:19 +01:00
Gwendal Roué 4501d7dcde TransactionObserver: provide default implementation for rarely used and stabilized databaseWillChange() and databaseWillCommit() methods 2018-01-14 22:58:12 +01:00
Gwendal Roué 5d463d6bff Goal achieved! FetchedRecordsController uses ignoreDatabaseChangesUntilNextTransaction, and checks changed rowIds in order to avoid useless fetch requests 2018-01-14 22:41:27 +01:00
Gwendal Roué 9c8a9fbe32 SelectionInfo.rowIds contains the rowIds fetched by a request 2018-01-14 22:05:18 +01:00
Gwendal Roué 1a89b2eae5 Test that sqlite authorizer uses "ROWID" as the name of the rowid column 2018-01-14 20:15:55 +01:00
Gwendal Roué fd65e72bbb CHANGELOG 2018-01-14 19:41:05 +01:00
Gwendal Roué 33e8d0875d Remove update hook when no observer is active. Allow truncate optimization when deletions are not observed. 2018-01-14 19:34:11 +01:00
Gwendal Roué 19e75576a8 Documentation for TransactionObserver.ignoreDatabaseChangesUntilNextTransaction() 2018-01-14 17:36:51 +01:00
Gwendal Roué 980860b2e9 Documentation for TransactionObserver.ignoreDatabaseChangesUntilNextTransaction() 2018-01-14 17:35:17 +01:00
Gwendal Roué eee3e36238 Test TransactionObserver.ignoreDatabaseChangesUntilNextTransaction() 2018-01-14 17:08:53 +01:00
Gwendal Roué eaadd37e87 TransactionObserver.ignoreDatabaseChangesUntilNextTransaction() is public 2018-01-14 17:08:42 +01:00
Gwendal Roué a1e508b1df TransactionObserver.ignoreDatabaseChangesUntilNextTransaction() 2018-01-14 16:45:36 +01:00
Gwendal Roué 2c8f9dffdd TODO GRDB3 2018-01-12 10:06:26 +01:00
Gwendal Roué 92fd3bf8ae TODO: TransactionObserver.stopObservingUntilNextTransaction() 2018-01-12 09:48:57 +01:00
Gwendal Roué c940675bf3 Fix typo 2018-01-12 09:12:35 +01:00
Gwendal Roué 2a147d5029 Travis: test Xcode 9.2 and Xcode 9.0 2018-01-12 08:19:02 +01:00
Gwendal Roué 0d236ae32c Row adopts RandomAccessCollection 2018-01-12 08:18:50 +01:00
Gwendal Roué cf4654108e More doc for filter(key:) and filter(keys:) 2018-01-12 07:19:26 +01:00
Gwendal Roué 7e9eed9374 v2.5.0 2018-01-11 21:16:54 +01:00
Gwendal Roué 383581938a Cleanup 2018-01-11 20:14:01 +01:00
Gwendal Roué df50da9024 Cleanup 2018-01-11 20:12:02 +01:00
Gwendal Roué d3a65303a1 Cleanup 2018-01-11 20:06:59 +01:00
Gwendal Roué 9a2bf923d2 Update CHANGELOG and README for new key-filtering requests 2018-01-11 20:04:49 +01:00
Gwendal Roué 9b27c0c651 WIP TableMapping.filter(key: [:]) and TableMapping.filter(keys: [[:], ]) 2018-01-11 19:34:28 +01:00
Gwendal Roué 2af85e7347 WIP TableMapping.filter(key:1) and TableMapping.filter(keys: [1, 2, 3]) 2018-01-11 18:09:01 +01:00
Gwendal Roué 071f0f4443 Cleanup 2018-01-10 08:50:45 +01:00
Gwendal Roué 903e8c96aa '^foo' is no longer an invalid FTS5 pattern in upcoming SQLite 3.22.0 2018-01-10 07:40:02 +01:00
Gwendal Roué 79a5fb9c15 Cleanup 2018-01-08 08:44:42 +01:00
Gwendal Roué 46ef4b27bb Fix failing test 2018-01-07 15:29:24 +01:00
Gwendal Roué 1838797d38 CHANGELOG 2018-01-07 14:25:36 +01:00
Gwendal Roué c7d500b8ba Optimize database event notifications for simple statements without side effect 2018-01-07 14:25:29 +01:00
Gwendal Roué 95a09cb644 Only notify observed events to transaction observers 2018-01-07 13:33:35 +01:00
Gwendal Roué c6ab92e60a v2.4.2 2018-01-06 14:35:05 +01:00
Gwendal Roué c0d5f3019b generatePerformanceReport reads versions of tested libraries from info.plist files 2018-01-06 13:37:30 +01:00
Gwendal Roué b09d5c3833 Fix FMDB performance tests 2018-01-06 12:47:01 +01:00
Gwendal Roué 3eff1b48b1 Update copyright year 2018-01-06 12:33:32 +01:00
Gwendal Roué a12fffc4e7 Update documentation about readFromCurrentState 2018-01-06 10:04:41 +01:00
Gwendal Roué 94715130fc DatabaseWriter.readFromCurrentState(_:) now fails with a fatal error if a transaction is currently opened 2018-01-06 09:19:26 +01:00
Gwendal Roué 313188ca0e More TODO 2018-01-05 19:40:55 +01:00
Gwendal Roué 5a68b008c6 CHANGELOG 2018-01-02 13:34:23 +01:00
Gwendal Roué 6fe9098c76 Statement compilation cleanup 2018-01-02 13:10:11 +01:00
Gwendal Roué 631a914acd Fix failing test for schema cache shared between DatabasePool reader and writer (stop sharing cache) 2018-01-02 13:08:41 +01:00
Gwendal Roué d1f24c9722 More TODO 2017-12-28 17:48:15 +01:00
Gwendal Roué 7b76c9319a Failing test for schema cache shared between DatabasePool reader and writer 2017-12-28 14:16:36 +01:00
Gwendal Roué 63083c5d1e Less TODO 2017-12-28 13:56:54 +01:00
Gwendal Roué c51a3cd624 Statement compilation cleanup 2017-12-17 13:57:35 +01:00
Gwendal Roué 1fadb7485a Less TODO 2017-12-17 13:14:15 +01:00
Gwendal Roué 58e05d13d1 v2.4.1 2017-12-16 15:09:59 +01:00
Gwendal Roué d8c9692d4d Fix typo 2017-12-16 14:40:58 +01:00
Gwendal Roué f83ffd3a25 Remove unused file 2017-12-16 14:35:09 +01:00
Gwendal Roué d12ff2a92b Scripts that generate performance comparison report 2017-12-16 14:35:02 +01:00
Gwendal Roué 8709d6f9a9 FMDB 2.7.4 2017-12-16 14:25:24 +01:00
Gwendal Roué e2806c55ff Upgrade Makefile test_performance target for Xcode 9.2 and Swift 4.0.3 2017-12-16 13:44:19 +01:00
Gwendal Roué 08d6c843d6 Upgrade performance comparison tests for Xcode 9.2 and Swift 4.0.3 2017-12-16 13:42:53 +01:00
Gwendal Roué 0da3726a89 Realm 3.0.2 2017-12-16 13:36:13 +01:00
Gwendal Roué 36676bcad3 SQLite.swift 0.11.4 2017-12-16 13:33:36 +01:00
Gwendal Roué 1509e1e9a8 Clean up projects & workspace 2017-12-16 13:29:05 +01:00
Gwendal Roué 4c71dd9ebe Remove compiler warning 2017-12-16 13:14:07 +01:00
Gwendal Roué ef8d0d6334 TODO.md 2017-12-15 18:49:36 +01:00
Gwendal Roué 7477b7a173 CHANGELOG.md 2017-12-13 08:24:14 +01:00
Gwendal Roué 246f36821b Merge pull request #284 from groue/Issue283
Don't call sqlite3_config() unless explicitly required to do so
2017-12-13 08:10:57 +01:00
Gwendal Roué d567ee60bf Remove compiler warning 2017-12-08 10:51:31 +01:00
Gwendal Roué 3a157d2808 Test for global SQLite error log requires global variables 2017-12-08 10:51:20 +01:00
Gwendal Roué 7d0c2f9ef8 Fix tests for Database.logError 2017-12-08 10:03:27 +01:00
Gwendal Roué f356f8734a Update Database.logError documentation, and make it clear that it has to be called very very early. 2017-12-07 13:35:19 +01:00
Gwendal Roué 5b7f4a7ff5 Call sqlite3_config(SQLITE_CONFIG_LOG, ...) if and only if Database.logError is set. 2017-12-07 13:14:49 +01:00
Gwendal Roué e10efca17a Fix typo 2017-12-03 16:27:59 +01:00
Gwendal Roué 578b9a5275 v2.4.0 2017-12-03 16:04:07 +01:00
Gwendal Roué 63304b3d12 Merge pull request #281 from groue/DropSynchronizationTriggers
Drop full-text synchronization triggers
2017-12-03 15:57:08 +01:00
Gwendal Roué 39f6ca0035 Merge branch 'master' into DropSynchronizationTriggers 2017-12-03 15:56:23 +01:00
Gwendal Roué 5e3c62c963 Merge pull request #282 from groue/preventXcodeWarningsForMissingFiles
Prevent Xcode warnings for missing files
2017-12-03 15:55:14 +01:00
Gwendal Roué 6966600223 Fix scheme references to projects 2017-12-03 14:41:16 +01:00
Gwendal Roué e028cbb6d5 Declare new GRDBCipher.xcodeproj and GRDBCustom.xcodeproj in CHANGELOG.md 2017-12-03 14:37:21 +01:00
Gwendal Roué 8b3c3f48a8 Update documention for embedding GRDBCipher & GRDBCustom 2017-12-03 14:23:49 +01:00
Gwendal Roué 2d84e72097 Restore GRDBOSXPerformanceComparisonTests 2017-12-03 14:20:08 +01:00
Gwendal Roué d91fe7b633 Extract GRDBCipher.xcodeproj and GRDBCustom.xcodeproj from GRDB.xcodeproj 2017-12-03 14:07:05 +01:00
Gwendal Roué 090df10831 Revert attempt at preventing Xcode warnings with Run Script phases 2017-12-03 12:52:37 +01:00
Gwendal Roué f21037bb69 Run make preventXcodeWarningsForMissingFiles as a Run Script Phase in all targets except custom SQLite 2017-12-01 13:47:06 +01:00
Gwendal Roué f3041bcc9a Run make preventXcodeWarningsForMissingFiles as a Run Script Phase in the GRDBiOS target 2017-12-01 13:41:47 +01:00
Gwendal Roué 67b1225dfa make preventXcodeWarningsForMissingFiles 2017-12-01 13:37:02 +01:00
Gwendal Roué 23f2e0371e Fix documentation typo 2017-12-01 13:24:04 +01:00
Gwendal Roué a3d8df222f Fix documentation typo 2017-12-01 13:20:17 +01:00
Gwendal Roué 632ef3707c CHANGELOG.md 2017-12-01 13:17:58 +01:00
Gwendal Roué 79dc099e6d Documentation for Database.dropFTS4SynchronizationTriggers & Database.dropFTS5SynchronizationTriggers 2017-12-01 13:17:54 +01:00
Gwendal Roué 75035fb40c Documentation for Database.dropFTS4SynchronizationTriggers & Database.dropFTS5SynchronizationTriggers 2017-12-01 13:14:30 +01:00
Gwendal Roué b4887b661c Tests for Database.dropFTS4SynchronizationTriggers & Database.dropFTS5SynchronizationTriggers 2017-12-01 13:14:24 +01:00
Gwendal Roué e8835af363 Database.dropFTS4SynchronizationTriggers & Database.dropFTS5SynchronizationTriggers 2017-12-01 13:14:13 +01:00
Gwendal Roué 1fabe08332 Trust SQLite: don't assert anything about the remaining characters after a statement 2017-11-30 08:53:10 +01:00
Gwendal Roué c2e3638e8d More failing tests for Database.execute() 2017-11-30 08:50:42 +01:00
Gwendal Roué 71abced420 CHANGELOG.md 2017-11-30 08:09:15 +01:00
Gwendal Roué ac00046b07 CHANGELOG.md 2017-11-29 20:29:33 +01:00
Gwendal Roué 38b5204713 Merge pull request #280 from groue/AddUntypedColumn
Table alteration: add untyped column
2017-11-29 20:21:13 +01:00
Gwendal Roué 4b173dece5 Test for t.add(column:) without any explicit column type 2017-11-29 20:17:26 +01:00
Gwendal Roué 8ce2c09b52 TableAlteration.add(column:type:) accepts nil type 2017-11-29 20:11:28 +01:00
Gwendal Roué 8125574f8f Fix typo in ISSUE_TEMPLATE.md 2017-11-22 08:56:48 +01:00
Gwendal Roué 8974360cac ISSUE_TEMPLATE.md 2017-11-22 08:24:21 +01:00
Gwendal Roué 6e48cc1524 Reminder: enable sanitizers when running tests 2017-11-11 06:43:59 +01:00
Gwendal Roué a1ea75ca34 TODO.md 2017-11-10 12:58:04 +01:00
Gwendal Roué 81d2f21093 Cleanup 2017-11-10 08:45:05 +01:00
Gwendal Roué fd73a31abc Fix failing tests and faulty assert 2017-11-09 14:29:59 +01:00
Gwendal Roué 1583ac0c08 Add failing test for Database.execute() 2017-11-09 14:29:35 +01:00
Gwendal Roué cafbecd8af v2.3.1 2017-11-08 07:50:58 +01:00
Gwendal Roué 78c36612b7 Enhance documentation of Codable Records 2017-11-07 19:29:51 +01:00
Gwendal Roué a95385c740 Simplify TransactionObserverTests with Codable 2017-11-07 19:22:54 +01:00
Gwendal Roué a58ebf7c48 CHANGELOG.md 2017-11-07 17:47:24 +01:00
Gwendal Roué 13623575ff Fix encryption tests broken by 681460a415 2017-11-07 17:21:32 +01:00
Gwendal Roué 87c5f913b8 CHANGELOG.md 2017-11-07 14:56:51 +01:00
Gwendal Roué 41172d7967 Documentation: no more exception for empty deferred transactions 2017-11-07 14:42:58 +01:00
Gwendal Roué 820bc87cfe No more exception for empty deferred transactions 2017-11-07 14:42:02 +01:00
Gwendal Roué 2901acfb41 Refactor tests of observation of transaction completion. Make them fail for empty deferred transactions. 2017-11-07 13:55:17 +01:00
Gwendal Roué 681460a415 Tests: generate a unique database by default 2017-11-07 13:54:19 +01:00
Gwendal Roué 19b067405f v2.3.0 2017-11-05 13:56:10 +01:00
Gwendal Roué 3b494b5737 Update SQLite to 3.21.0 2017-11-05 11:21:46 +01:00
Gwendal Roué 5f11a19296 Travis: use Xcode 9.1 2017-11-01 13:19:12 +01:00
Gwendal Roué 3ff7675eb7 Makefile: add support for Xcode 9.1 and Xcode 9.2 beta 1 2017-11-01 13:13:05 +01:00
Gwendal Roué 3d06841eba Remove Xcode9.1 warnings about deprecated string.characters 2017-11-01 07:33:03 +01:00
Gwendal Roué 188c026c6b v2.2.0 2017-10-31 14:07:23 +01:00
Gwendal Roué caf051f19d Improve jazzy documentation layout 2017-10-31 13:37:48 +01:00
Gwendal Roué c4a3d934a9 Documentation 2017-10-31 13:06:37 +01:00
Gwendal Roué b19424aa23 CHANGELOG.md 2017-10-31 12:51:45 +01:00
Gwendal Roué bc229fa6fd Documentation 2017-10-31 08:48:05 +01:00
Gwendal Roué 9beb5b553b Document that empty deferred transactions are not notified 2017-10-31 08:46:33 +01:00
Gwendal Roué 667e6a8e06 Document that empty deferred transactions are not notified 2017-10-31 08:45:52 +01:00
Gwendal Roué 8f9b667c29 Document that empty deferred transactions are not notified 2017-10-31 08:45:06 +01:00
Gwendal Roué a8e0c76a30 CHANGELOG.md 2017-10-31 08:33:38 +01:00
Gwendal Roué 49609ff08e Fix failing tests for observation of empty deferred transactions 2017-10-31 08:17:48 +01:00
Gwendal Roué efe201e032 More tests for observation of empty deferred transactions 2017-10-31 08:17:30 +01:00
Gwendal Roué 28c903f7ea Failing tests for observation of empty deferred transactions 2017-10-31 08:11:12 +01:00
Gwendal Roué a5b45031d2 Failing tests for observation of empty deferred transactions 2017-10-31 07:31:15 +01:00
Gwendal Roué 42e178b41d Improve tests robustness 2017-10-30 18:21:02 +01:00
Gwendal Roué c3fe2c13f4 More tests for "DROP INDEX" and "DROP TRIGGER" (#267) 2017-10-30 18:15:54 +01:00
Gwendal Roué af8a6872d9 StatementCompilationAuthorizer never returns SQLITE_IGNORE for a "DROP XXX" statement (#267) 2017-10-30 18:12:57 +01:00
Gwendal Roué f40a5e68ea Database.triggerExists(_:) 2017-10-30 18:10:22 +01:00
Gwendal Roué c4ad98426c Pass failing tests for "DROP VIEW" statements (#267) 2017-10-30 17:57:57 +01:00
Gwendal Roué a0e3d4ad69 Failing tests for "DROP VIEW" statements (#267) 2017-10-30 17:39:35 +01:00
Gwendal Roué d64bfe1cec Database.viewExists(_:) 2017-10-30 17:38:52 +01:00
Gwendal Roué 8a213af2ab Cleanup & whitespace 2017-10-30 12:25:12 +01:00
Gwendal Roué f02659e5d7 Remove outdated documentation 2017-10-29 17:05:14 +01:00
Gwendal Roué bdf943c3d9 Fix SPM compilation error 2017-10-29 15:45:35 +01:00
Gwendal Roué 9f1d5bc631 Fix SPM compilation error 2017-10-29 15:28:45 +01:00
Gwendal Roué f2b46679a6 Fix SPM compilation error 2017-10-29 14:35:10 +01:00
Gwendal Roué c5f38af247 Simplify select statement validation 2017-10-29 14:34:53 +01:00
Gwendal Roué 2bfef4f02d Rename DatabaseObservation.swift to TransactionObserver.swift 2017-10-29 14:24:41 +01:00
Gwendal Roué 07ae50cbb0 Detailed documentation of DatabaseObservationBroker 2017-10-29 14:22:22 +01:00
Gwendal Roué 7f10bf4005 Cleanup 2017-10-29 13:27:38 +01:00
Gwendal Roué 9130fe7b38 Cleanup 2017-10-29 12:58:24 +01:00
Gwendal Roué 340dcd1748 Extract transaction observation in the new DatabaseObservationBroker class 2017-10-29 12:22:54 +01:00
Gwendal Roué 8919bb5810 Move transaction and savepoint methods 2017-10-29 11:24:30 +01:00
Gwendal Roué bea98db813 Common code for select & update statements compilation 2017-10-29 11:13:30 +01:00
Gwendal Roué 05a0130c1e More straightforward cached statements API 2017-10-29 10:56:49 +01:00
Gwendal Roué e486437865 Split Database.swift 2017-10-29 10:43:22 +01:00
Gwendal Roué 1043516fb7 Fix sample code in CHANGELOG.md 2017-10-24 19:22:12 +02:00
Gwendal Roué c9b8b81ffb fix version number 2017-10-24 14:06:28 +02:00
Gwendal Roué 99b143a55c v2.1.0 2017-10-24 08:34:10 +02:00
Gwendal Roué 8401f42f3e Documentation 2017-10-24 08:20:33 +02:00
Gwendal Roué f69949edea Explain why Carthage test is commented out in .travis.yml 2017-10-24 08:18:06 +02:00
Gwendal Roué 62e33f294e ReleaseProcess.md 2017-10-24 08:11:13 +02:00
Gwendal Roué 2a8e48ba63 Minor 2017-10-24 08:11:05 +02:00
Gwendal Roué 6372bf663f Update Carthage information 2017-10-23 20:27:46 +02:00
Gwendal Roué ac7cc09bfe CHANGELOG.md 2017-10-23 19:54:38 +02:00
Gwendal Roué c9f0d473cf New FAQ: How do I print a request as SQL? 2017-10-23 19:54:30 +02:00
Gwendal Roué 8a7ffdbb67 CHANGELOG.md 2017-10-23 19:21:38 +02:00
Gwendal Roué d30baaf16c Fix default cached argument value for Request.asSQLRequest(_:cached:) 2017-10-23 19:21:30 +02:00
Gwendal Roué 1981adeb22 Request.asSQLRequest(_:cached:) 2017-10-23 19:20:38 +02:00
Gwendal Roué 8427b8b668 Remove test_CarthageBuild from the test make target 2017-10-23 19:02:09 +02:00
Gwendal Roué 6db590a31b Remove Carthage test from .travis.yml 2017-10-23 19:01:07 +02:00
Gwendal Roué 22faa03a48 Update sample code that create databases
The Application Support directory should generally be preferred.
2017-10-23 18:58:32 +02:00
Gwendal Roué d3cd0ae85a TODO.md 2017-10-23 09:42:40 +02:00
Gwendal Roué b624955bf3 Merge branch 'master' of github.com:groue/GRDB.swift into development 2017-10-15 12:19:35 +02:00
Gwendal Roué 1b20cd14d1 Fix link to SQLite documentation for the "pre-update hook" 2017-10-14 17:54:38 +02:00
Gwendal Roué baf2f780c9 Document that FetchedRecordsController is not suited for large data sets (#263) 2017-10-13 13:16:46 +02:00
Gwendal Roué 9d1997b6cd Typo 2017-10-12 21:54:46 +02:00
Gwendal Roué 313baa0064 Typo 2017-10-12 21:52:51 +02:00
Gwendal Roué 006eee9f51 Document that Record subclasses have to override database methods 2017-10-12 21:51:15 +02:00
Gwendal Roué 2720caf945 Documentation 2017-10-12 20:51:14 +02:00
Gwendal Roué 62faa57bf0 Documentation 2017-10-12 20:50:36 +02:00
Gwendal Roué abbdb995e6 Documentation 2017-10-12 20:46:01 +02:00
Gwendal Roué fd2ae60a65 Fix sample code of conversion from Row to Dictionary 2017-10-12 20:41:48 +02:00
Gwendal Roué 2c4cf2d06b Improve documentation of Codable support, and decrease focus on the Record class. 2017-10-12 20:40:33 +02:00
Gwendal Roué 0f5ec15d47 Test for Carthage integration in an iOS app 2017-10-12 08:26:36 +02:00
Gwendal Roué 1c3dfb346f Travis: move make test_CarthageBuild to the "Test Installation" stage 2017-10-11 22:02:02 +02:00
Darren Clark b76013d60b Travis - re-enable Carthage 2017-10-11 21:45:53 +02:00
Gwendal Roué e3ed95571c Upgrade custom SQLite builds to v3.20.1 2017-10-11 21:43:41 +02:00
Gwendal Roué c749893858 Update sqlcipher from https://github.com/groue/sqlcipher/pull/1 2017-10-11 21:26:37 +02:00
Gwendal Roué 9135be3da6 CHANGELOG 2017-10-11 08:20:34 +02:00
Gwendal Roué 9930fd3938 Fix failing test for drop temporary table 2017-10-11 08:17:57 +02:00
Gwendal Roué c62c3df00d Failing test for drop temporary table 2017-10-11 08:10:22 +02:00
Gwendal Roué 0419d67533 More fiddling with the deadly truncate optimization 2017-10-10 09:01:50 +02:00
Gwendal Roué 32d69c5be0 TODO.md 2017-10-10 08:20:27 +02:00
Gwendal Roué c2fb23c69c Stop using String.characters view 2017-10-10 08:15:28 +02:00
Gwendal Roué 47611e14f7 v2.0.3 2017-10-09 08:11:06 +02:00
Gwendal Roué b90f876b5b Records that adopt Encodable encode null columns 2017-10-09 08:06:46 +02:00
Gwendal Roué 9037d51bc7 Failing test for Encodable+Persistable (null values are not encoded) 2017-10-09 08:03:43 +02:00
Gwendal Roué fb8c68f5e0 Fix compiler error 2017-10-07 07:41:17 +02:00
Gwendal Roué 4995b5bb8c Group truncate optimization tests together 2017-10-07 06:51:13 +02:00
Gwendal Roué c87ebfd4eb CHANGELOG.md 2017-10-07 05:49:46 +02:00
Gwendal Roué b9d0dae5ac v2.0.2 2017-10-05 19:55:13 +02:00
Gwendal Roué ab2a74285d Issue156.playground 2017-10-05 19:09:22 +02:00
Gwendal Roué e37ab72182 Fix compiler error 2017-10-05 15:55:20 +02:00
Gwendal Roué 891dec64a0 Cleanup fix for failing test for "DROP TABLE t" executed from a prepared statement. 2017-10-05 15:34:36 +02:00
Gwendal Roué 90086789c6 Fix failing test for "DROP TABLE t" executed from a prepared statement.
Refactor authorization and truncate optimization prevention around the StatementAuthorizer protocol.
2017-10-05 15:15:13 +02:00
Gwendal Roué 2cdcdb9cd6 Refactor Statement initializers 2017-10-05 14:01:12 +02:00
Gwendal Roué 9c6879bd97 Xcode 9 sometimes performs gratuitous changes to shared schemes 2017-10-05 13:56:38 +02:00
Gwendal Roué fc88acc782 Add failing test for "DROP TABLE t" executed from a prepared statement. 2017-10-05 13:55:51 +02:00
Gwendal Roué 1578dfe26b Cleanup 2017-10-05 13:50:31 +02:00
Gwendal Roué eb5e5a7069 WhyAdoptGRDB.md 2017-10-04 08:02:19 +02:00
Gwendal Roué b58cfefa13 Refactor database setup sample code so that database migrator can be tested 2017-10-03 08:40:44 +02:00
Gwendal Roué de4d395aea WhyAdoptGRDB.md 2017-10-01 06:10:19 +02:00
Gwendal Roué 7072bd9f36 WhyAdoptGRDB.md 2017-10-01 06:08:54 +02:00
Gwendal Roué 8e36bc64fd WhyAdoptGRDB.md 2017-10-01 05:55:35 +02:00
Gwendal Roué 4326a705f3 Typo 2017-09-30 22:05:17 +02:00
Gwendal Roué eb99e294ed Typo 2017-09-30 20:53:44 +02:00
Gwendal Roué 27acb2b967 WhyAdoptGRDB.md 2017-09-30 20:24:33 +02:00
Gwendal Roué 9cf5124a52 Documentation 2017-09-30 00:22:00 +02:00
Gwendal Roué d00282f077 Documentation 2017-09-28 06:47:19 +02:00
Gwendal Roué 2556bedcda Enhance versions table 2017-09-28 06:01:29 +02:00
Gwendal Roué a569acd12a Documentation 2017-09-26 19:25:47 +02:00
Gwendal Roué 5e6c462708 Documentation 2017-09-26 19:23:55 +02:00
Gwendal Roué 4e0900dffa Documentation 2017-09-26 19:21:52 +02:00
Gwendal Roué 5c61211522 Swift flags for enhancing compilation time (from @jessesquires' https://www.jessesquires.com/blog/measuring-compile-times-xcode9/) 2017-09-21 17:24:00 +02:00
Gwendal Roué 0747dc5cf6 Diff links 2017-09-17 12:04:32 +02:00
Gwendal Roué 85099c8ad6 v2.0.1 2017-09-17 11:44:31 +02:00
Gwendal Roué 72da91a8c7 Remove obsolete FAQ 2017-09-17 08:10:16 +02:00
Gwendal Roué 4aced858a8 Fix documentation typo 2017-09-17 08:04:13 +02:00
Gwendal Roué 786ab176c9 v2.0 2017-09-16 18:37:27 +02:00
Gwendal Roué 973af107da More performance tests, upgrade SQLite.swift submodule 2017-09-16 18:25:24 +02:00
Gwendal Roué 1911ef0172 Merge branch 'master' of github.com:groue/GRDB.swift into Swift4
Conflicts:
	README.md
2017-09-16 14:49:39 +02:00
Gwendal Roué d2e9b340c9 Adapt FT5 support for the non optional Database.primaryKey(_:) 2017-09-15 19:05:39 +02:00
Gwendal Roué 5b487d1722 Fix compiler warning 2017-09-15 19:01:49 +02:00
Gwendal Roué a91da59448 Database.primaryKey(_:) no longer returns an Optional. PrimaryKeyInfo.isRowID tells whether the primary key is the rowed. 2017-09-15 09:00:56 +02:00
Gwendal Roué 2846254304 Improve make distclean, with submodules 2017-09-14 21:51:11 +02:00
Gwendal Roué 5fe765dd29 Improve make distclean 2017-09-14 21:49:06 +02:00
Gwendal Roué 9815f44134 Remove sqlite3.h from the distribution 2017-09-14 20:34:22 +02:00
Gwendal Roué 3f8969b88f PerformanceComparisonTests: update Realm to 2.10.0, SQLite.swift to latest swift-4 branch 2017-09-13 08:11:31 +02:00
Gwendal Roué 4fc7a44a9d Tweak JSONSynchronization playground 2017-09-12 08:30:05 +02:00
Gwendal Roué e132688e00 Simplify JSONSynchronization playground 2017-09-12 08:25:09 +02:00
Gwendal Roué 588df57840 Fix typo 2017-09-12 08:13:23 +02:00
Gwendal Roué 4a8ca6fdc1 TODO 2017-09-11 09:04:05 +02:00
Gwendal Roué 2bb2493731 Turn MutablePersistable.databaseDictionary into a property 2017-09-11 08:53:56 +02:00
Gwendal Roué c61949ceaf DatabaseError.description contains primary result code, not extended result code. 2017-09-11 08:12:43 +02:00
Gwendal Roué 3fce1e00c9 Introduce AnyDatabaseReader and AnyDatabaseWriter 2017-09-10 13:37:48 +02:00
Gwendal Roué 2f2add1c49 Update podspec 2017-09-09 13:29:24 +02:00
Gwendal Roué 697acb103f Cleanup 2017-09-08 21:45:35 +02:00
Gwendal Roué c830e43e8f Update JSONSynchronization playground with Record.updateChanges(_:) 2017-09-08 21:41:39 +02:00
Gwendal Roué 834ef45ca6 Document how to convert a Row to Dictionary 2017-09-08 20:38:03 +02:00
Gwendal Roué 279faa13e9 Less TODO 2017-09-08 13:23:20 +02:00
Gwendal Roué 0309abca6f Tests for Statement.SelectionInfo.description 2017-09-08 13:18:45 +02:00
Gwendal Roué fedee67bda Enhance documentation of fatal errors that happen during value conversion 2017-09-08 08:19:09 +02:00
Gwendal Roué a6c3566aa5 Record.updateChanges(_:) documentation 2017-09-08 08:08:07 +02:00
Gwendal Roué 52fa24e1c4 QueryInterfaceRequest.deleteAll() now honors the order and limit clauses when SQLite is compiled with the SQLITE_ENABLE_UPDATE_DELETE_LIMIT option 2017-09-08 07:07:43 +02:00
Gwendal Roué a7ecf41e3b QueryInterfaceRequest.deleteAll() now honors the order and limit clauses. New Set(cursor) initialiser. 2017-09-07 19:22:21 +02:00
Gwendal Roué e68e5f6265 Tests for Record.updateChangedColumns(_:) 2017-09-06 09:12:38 +02:00
Gwendal Roué aad5a9b060 Less TODO 2017-09-06 08:59:02 +02:00
Gwendal Roué aa064029ec More typed cursor tests 2017-09-06 08:58:27 +02:00
Gwendal Roué e84060e01c More value tests 2017-09-06 08:50:30 +02:00
Gwendal Roué f4f72ebb43 Record.updateChanges(_:) 2017-09-06 08:36:13 +02:00
Gwendal Roué da51e81e38 Fix typo 2017-09-05 09:01:57 +02:00
Gwendal Roué 247cbdd0d0 Date and NSDate interpret database numbers as unix timestamps. 2017-09-05 08:58:17 +02:00
Gwendal Roué c528740154 Documentation 2017-09-05 07:57:00 +02:00
Gwendal Roué 37b357b050 TODO 2017-09-05 05:50:11 +02:00
Gwendal Roué 18c376979d Reformat links to other Swift versions 2017-09-03 11:39:25 +02:00
Gwendal Roué 9cc4357a70 Merge branch 'master' of github.com:groue/GRDB.swift into Swift4 2017-09-03 11:03:36 +02:00
Gwendal Roué f2d35a052f Cleanup 2017-09-03 10:54:13 +02:00
Gwendal Roué 221f378d10 Tests for zero-length blobs as function arguments 2017-09-03 10:31:02 +02:00
Gwendal Roué 06a8c8b940 GRDB is now able to store and load zero-length blobs. 2017-09-03 10:09:00 +02:00
Gwendal Roué eee80b421a Hide StatementCursor from public interface 2017-09-03 08:48:31 +02:00
Gwendal Roué f6e22c3636 Fix Typo 2017-09-02 16:34:07 +02:00
Gwendal Roué 20d77fbba5 README.md 2017-09-02 16:32:52 +02:00
Gwendal Roué 0393ebe012 Try to force SWIFT_VERSION to 4.0 with pod_target_xcconfig 2017-09-02 12:42:50 +02:00
Gwendal Roué 2beddcf77b Cleanup 2017-09-02 12:42:07 +02:00
Gwendal Roué e784ebbcdd Remove public StatementArguments() 2017-08-31 19:35:11 +02:00
Gwendal Roué 30ee538dbd StatementArguments(), tests, changeling 2017-08-30 20:07:34 +02:00
Gwendal Roué 7939ba6e05 Expose RowCursor.statement, StatementCursor.statement, Statement.index(ofColumn:) 2017-08-30 14:06:50 +02:00
Gwendal Roué 2785e69fc1 Data adopts StatementColumnConvertible 2017-08-29 19:27:47 +02:00
Gwendal Roué d472c1696d Workaround SR-5707 2017-08-28 13:49:08 +02:00
Gwendal Roué d9cfa71fc7 MutablePersistable.databaseDictionary() return [String: DatabaseValue] 2017-08-28 08:13:20 +02:00
Gwendal Roué 715e12912b New MutablePersistable.databaseDictionary() convenience method 2017-08-25 18:20:35 +02:00
Gwendal Roué b182fe27f6 Merge branch 'Swift4' of github.com:groue/GRDB.swift into Swift4 2017-08-25 17:43:19 +02:00
Gwendal Roué 5594b33933 Performance tests: distinguish fetching records with change tracking from simple record structs 2017-08-25 17:43:15 +02:00
Gwendal Roué 059b8800f6 TODO 2017-08-25 14:00:12 +02:00
Gwendal Roué 9f687b1848 Documentation 2017-08-25 06:06:59 +02:00
Gwendal Roué a4a05b1f0a Introduce DatabaseValueCursor, NullableDatabaseValueCursor 2017-08-25 05:54:37 +02:00
Gwendal Roué 1a7b0b0626 Introduce RecordCursor 2017-08-24 09:08:29 +02:00
Gwendal Roué 4c467e46cf CHANGELOG 2017-08-24 08:17:09 +02:00
Gwendal Roué fa71edeb07 Consistently use GRDB as the library name 2017-08-23 13:59:51 +02:00
Gwendal Roué 4ff436371d README 2017-08-23 13:57:25 +02:00
Gwendal Roué 9d8fa0bc5a Documentation 2017-08-23 10:03:03 +02:00
Gwendal Roué 1a8ecd7889 Documentation 2017-08-23 10:01:43 +02:00
Gwendal Roué f6614fdfda Documentation 2017-08-23 10:00:02 +02:00
Gwendal Roué a6055df756 New "Documentation diff" section in CHANGELOG 2017-08-23 08:43:35 +02:00
Gwendal Roué 5af91c5eab Documentation 2017-08-23 08:24:08 +02:00
Gwendal Roué 41974c4a46 Documentation 2017-08-23 08:21:28 +02:00
Gwendal Roué f001b5bd76 Documentation 2017-08-23 08:19:29 +02:00
Gwendal Roué 28cf457853 Add a performance test target that doesn't depend on Core Data, FMDB, Realm, and SQLite.swift. 2017-08-23 08:17:47 +02:00
Gwendal Roué 8ccc23333d Replace DatabaseCursor with new concrete cursors RowCursor, StatementColumnCursor, NullableStatementColumnCursor, and StatementCursor. 2017-08-23 08:16:30 +02:00
Gwendal Roué d95954d980 TODO: learn about Decoder.dateEncodingStrategy 2017-08-22 09:04:00 +02:00
Gwendal Roué 3506881c2a Documentation 2017-08-21 19:23:10 +02:00
Gwendal Roué 51d127c378 TODO.md 2017-08-21 08:48:03 +02:00
Gwendal Roué 2d5dd7ef63 Update GRDBProfiling project 2017-08-21 08:47:53 +02:00
Gwendal Roué ef23ba55a1 sqlite3.h is a private header when the SQLite3 module is used 2017-08-21 08:47:31 +02:00
Gwendal Roué ffdbf2f3f1 TODO.md 2017-08-20 05:33:27 +02:00
Gwendal Roué 56cad83f55 CHANGELOG.md 2017-08-19 16:34:28 +02:00
Gwendal Roué 719f33f7a7 GRDBDemoiOS: use default IPHONEOS_DEPLOYMENT_TARGET 2017-08-19 16:09:30 +02:00
Gwendal Roué 700ffacdb1 Minor 2017-08-19 15:55:36 +02:00
Gwendal Roué a6ef4ed55c Minor 2017-08-19 15:53:50 +02:00
Gwendal Roué c5da564fb3 Use built-in SQLite3 module when available 2017-08-19 15:21:44 +02:00
Gwendal Roué a6b04ebb64 FTS5 Cleanup 2017-08-19 12:35:45 +02:00
Gwendal Roué 99ba6db257 Documentation 2017-08-19 11:42:45 +02:00
Gwendal Roué a3cddb72b9 Documentation: rename "person" to "player" (and avoid both "persons" and "people") 2017-08-19 10:36:28 +02:00
Gwendal Roué 2a9e896095 Remove documentation for PrimaryKeyInfo (reference is enough) 2017-08-19 10:25:20 +02:00
Gwendal Roué 89d522d325 Rename "point of interest" to "place" (addresses #246) 2017-08-19 10:21:57 +02:00
Gwendal Roué 3c4ff587ca Documentation 2017-08-19 10:13:40 +02:00
Gwendal Roué e111529035 Documentation 2017-08-19 10:09:41 +02:00
Gwendal Roué cae1f97032 Update documentation now that TableMapping deletion methods have moved to MutablePersistable 2017-08-18 18:40:57 +02:00
Gwendal Roué 20419834a6 Sequence.Iterator.Element -> Sequence.Element 2017-08-18 18:10:56 +02:00
Gwendal Roué 5dabc2a20b CHANGELOG.md 2017-08-18 18:09:28 +02:00
Gwendal Roué c700f5fc68 Move TableMapping deletion methods to MutablePersistable (prevent TableMapping from being able to modify the database) 2017-08-18 17:15:10 +02:00
Gwendal Roué 0b71cf86f2 Less GRDB 2.0 TODO 2017-08-18 16:49:12 +02:00
Gwendal Roué 96159bd09c RowConvertible.fetchCursor(_:keys:) returns a non-optional cursor. 2017-08-18 16:48:06 +02:00
Gwendal Roué bcff802ccb CHANGELOG.md 2017-08-18 16:29:18 +02:00
Gwendal Roué 376d295853 Replace TableMapping.selectsRowID with TableMapping.databaseSelection 2017-08-18 16:27:24 +02:00
Gwendal Roué 0030ad1804 CHANGELOG.md 2017-08-18 14:57:55 +02:00
Gwendal Roué 4ec3e0f7d8 Drop deprecated TableMapping.primaryKeyRowComparator(_:) 2017-08-18 14:30:28 +02:00
Gwendal Roué e36219e408 Thanks @bfad 2017-08-18 14:22:15 +02:00
Gwendal Roué 8f8f53a697 Fix CocoaPods tests by bumping .swift-version 2017-08-18 14:22:15 +02:00
Gwendal Roué 567292c72f Fix SPM test target
Thanks to @aciidb0mb3r: https://bugs.swift.org/browse/SR-5697?focusedCommentId=27793&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-27793
2017-08-18 14:22:15 +02:00
Gwendal Roué b744f73a76 Restore test target in Package.swift, for swift test 2017-08-18 14:22:15 +02:00
Gwendal Roué da440a5e16 Swift 4 + SPM
- Upgrade Tests/SPM package layout and format to version 4, and have `make test_install_SPM` succeed
- Update .gitignore in order to ignore Package.resolved instead of Package.pins
2017-08-18 14:22:15 +02:00
Brad Lindsay 017af1d5c3 Update Package.swift for version 4 tooling 2017-08-18 14:22:14 +02:00
Gwendal Roué 1f5d75d8e9 Fix a compiler error in Xcode 9 beta 5 (and improve tests for DatabaseValue conformance to Equatable) 2017-08-18 14:22:14 +02:00
Gwendal Roué 8b80abc701 TODO.md 2017-08-18 14:22:14 +02:00
Gwendal Roué dc75ca4caf SE-0166 2017-08-18 14:22:14 +02:00
Gwendal Roué d7d4c0a54d Formatting 2017-08-18 14:22:14 +02:00
Gwendal Roué 823b094b60 SE-0168 2017-08-18 14:22:14 +02:00
Gwendal Roué 06a6c982aa SE-0148 2017-08-18 14:22:14 +02:00
Gwendal Roué 1d15ef01f9 Update Travis CI to use Xcode 9 2017-08-18 14:20:35 +02:00
Gwendal Roué f72ffcbb43 SE-0165 2017-08-18 14:20:35 +02:00
Gwendal Roué e0f2305cd9 SE-0104 2017-08-18 14:20:35 +02:00
Gwendal Roué 210939d2c1 SE-0169 2017-08-18 14:20:35 +02:00
Gwendal Roué 2fd071d90e NSLocalizedDescriptionKey 2017-08-18 14:20:35 +02:00
Gwendal Roué badec62cdd SE-0110 2017-08-18 14:20:35 +02:00
Gwendal Roué 895cda4de7 Xcode 9 beta 3 project updates 2017-08-18 14:20:35 +02:00
Gwendal Roué 21fdc9f350 v1.3.0 2017-08-18 13:13:24 +02:00
Gwendal Roué 398c0ef687 Documentation 2017-08-18 12:25:22 +02:00
Gwendal Roué 3b0a9aef3c No more SQLite 3.20.0 TODO 2017-08-18 08:52:48 +02:00
Gwendal Roué 48ec0916bf Use SQLITE_PREPARE_PERSISTENT flag for cached statements 2017-08-18 08:52:23 +02:00
Gwendal Roué 10af87a7d0 SQLite 3.20.0 2017-08-18 08:35:02 +02:00
Gwendal Roué 96e7996f37 SQLite 3.20.0 TODO 2017-08-03 10:19:52 +02:00
Gwendal Roué 0f7af931a9 SQLite 3.20.0 TODO 2017-08-03 10:16:17 +02:00
Gwendal Roué cfd2d80b78 Fix typo 2017-07-30 15:22:13 +02:00
Gwendal Roué 0386c01aa9 CHANGELOG 2017-07-29 14:36:02 +02:00
Gwendal Roué 2c39c91ac6 CHANGELOG 2017-07-29 13:01:49 +02:00
Gwendal Roué 0eb51e3e8b Int8, Int16, UInt, UInt8, UInt16, UInt32, UInt64 adopt DatabaseValueConvertible and StatementColumnConvertible 2017-07-29 12:58:35 +02:00
Gwendal Roué bb931e9da7 FTS5.api(_:) can now throw an error 2017-07-21 18:34:19 +02:00
Gwendal Roué 7b2e672496 Cleanup 2017-07-21 17:59:04 +02:00
Gwendal Roué cdc6370ee5 Restore column ordering in filter(db, keys: [["a": ..., "b": ...], ...]) removed in 2b2e92c810 2017-07-21 13:45:24 +02:00
Gwendal Roué cc762e4e1d TODO 2017-07-21 12:20:32 +02:00
Gwendal Roué ed525bd1d8 Cleanup 2017-07-21 12:15:35 +02:00
Gwendal Roué 2b2e92c810 Cleanup 2017-07-21 12:13:03 +02:00
Gwendal Roué 44d31ead76 Implement deleteAll(_:keys:), deleteOne(_🔑) on top of the Query Interface 2017-07-21 11:19:24 +02:00
Gwendal Roué ec163e94eb Implement fetchCursor(_:keys:), fetchAll(_:keys:), and fetchOne(_🔑) on top of the Query Interface 2017-07-21 09:13:20 +02:00
Gwendal Roué ec2ac33fec TODO.md 2017-07-21 07:58:25 +02:00
Gwendal Roué 20bda2af26 v1.2.2 2017-07-20 19:30:39 +02:00
Gwendal Roué 7a49f6293d CHANGELOG.md 2017-07-20 17:50:14 +02:00
Gwendal Roué 81b21010f1 Fix memory leak with Configuration.trace 2017-07-20 17:47:11 +02:00
Gwendal Roué 2526e0a2f7 Fix links to reference documentation 2017-07-19 19:40:19 +02:00
Gwendal Roué af1e8470c9 v1.2.1 2017-07-19 09:38:25 +02:00
Gwendal Roué dfd9da68a7 CHANGELOG 2017-07-19 08:32:21 +02:00
Gwendal Roué 5e702234f4 Upgrade SQLite to v3.19.3 2017-07-19 08:31:32 +02:00
Gwendal Roué 9020dcca9a CHANGELOG 2017-07-19 08:28:02 +02:00
Gwendal Roué 930a4e4c1d Improve implementation comments in DatabasePool.readFromCurrentState 2017-07-19 08:22:23 +02:00
Gwendal Roué 4db77f96b7 Improve implementation comments in DatabasePool.readFromCurrentState 2017-07-18 16:34:50 +02:00
Gwendal Roué cc12c046b9 func === (lhs: SQLExpressible?, rhs: SQLCollatedExpression) bugfix 2017-07-18 09:00:49 +02:00
Gwendal Roué f5c63e0997 Remove unused method 2017-07-18 07:48:43 +02:00
Gwendal Roué 29a26800b7 Cleanup 2017-07-17 20:20:20 +02:00
Gwendal Roué bc5eeb3b3a expr == DatabaseValue.null is converted to expr IS NULL. 2017-07-17 20:19:19 +02:00
Gwendal Roué 40d02518b0 Cleanup 2017-07-17 15:33:09 +02:00
Gwendal Roué a2556edc69 Use sqlite3_get_autocommit
This function knows whether the database is currently inside a
transaction or not, and provides robust rollback error handling.
2017-07-17 15:33:01 +02:00
Gwendal Roué 111970fda9 Tests for public protocols and open classes
The goal of those tests is to prevent breaking changes as the one that happened in v1.2, where the DatabaseReader protocol was added a new method without any default implementation.
2017-07-13 16:53:01 +02:00
935 changed files with 195151 additions and 51183 deletions

No files matched your search

-4
View File
@@ -1,4 +0,0 @@
source 'https://rubygems.org'
gem 'xcpretty'
gem 'xcpretty-travis-formatter'
+1
View File
@@ -0,0 +1 @@
github: [groue]
+31
View File
@@ -0,0 +1,31 @@
<!--
ℹ We use Github issues for bug reports, feature requests, general support, and questions about the library.
Please fill out this template when filing an issue.
-->
### What did you do?
<!-- Please replace this with what you did. -->
### What did you expect to happen?
<!-- Please replace this with what you expected to happen. -->
### What happened instead?
<!-- Please replace this with of what happened instead. -->
### Environment
**GRDB flavor(s):** (GRDB, SQLCipher, Custom SQLite build?)
**GRDB version:**
**Installation method:** (CocoaPods, SPM, manual?)
**Xcode version:**
**Swift version:**
**Platform(s) running GRDB:** (iOS, macOS, watchOS?)
**macOS version running Xcode:**
### Demo Project
<!-- Please link to or upload a project we can download that reproduces the issue. -->
+14
View File
@@ -0,0 +1,14 @@
<!-- Please describe your pull request here. -->
### Pull Request Checklist
<!--
Please check the boxes that apply to your pull request:
-->
- [ ] CONTRIBUTING: You have read https://github.com/groue/GRDB.swift/blob/master/CONTRIBUTING.md
- [ ] BRANCH: This pull request is submitted against the `development` branch.
- [ ] DOCUMENTATION: Inline documentation has been updated.
- [ ] DOCUMENTATION: README.md or another dedicated guide has been updated.
- [ ] TESTS: Changes are tested.
- [ ] TESTS: The `make smokeTest` terminal command runs without failure.
+6
View File
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
+189
View File
@@ -0,0 +1,189 @@
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
name: "GRDB CI"
on:
push:
branches:
- master
- development
paths:
- 'GRDB/**'
- 'Tests/**'
- '.github/workflows/**'
- 'Makefile'
- 'Package.swift'
- 'SQLiteCustom/src'
pull_request:
paths:
- 'GRDB/**'
- 'Tests/**'
- '.github/workflows/**'
- 'Makefile'
- 'Package.swift'
- 'SQLiteCustom/src'
concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
jobs:
Framework:
name: Framework
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer"
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- xcode: "Xcode_14.3.1.app"
runsOn: macOS-13
destination: "platform=macOS"
name: "macOS"
- xcode: "Xcode_14.3.1.app"
runsOn: macOS-13
destination: "OS=16.4,name=iPhone 14 Pro"
name: "iOS"
- xcode: "Xcode_14.3.1.app"
runsOn: macOS-13
destination: "OS=16.4,name=Apple TV"
name: "tvOS"
- xcode: "Xcode_14.2.app"
runsOn: macOS-13
destination: "platform=macOS"
name: "macOS"
- xcode: "Xcode_14.2.app"
runsOn: macOS-13
destination: "OS=16.2,name=iPhone 14"
name: "iOS"
- xcode: "Xcode_14.1.app"
runsOn: macOS-13
destination: "platform=macOS"
name: "macOS"
- xcode: "Xcode_14.1.app"
runsOn: macOS-13
destination: "OS=16.1,name=iPhone 14"
name: "iOS"
- xcode: "Xcode_14.0.1.app"
runsOn: macOS-12
destination: "platform=macOS"
name: "macOS"
- xcode: "Xcode_14.0.1.app"
runsOn: macOS-12
destination: "OS=16.0,name=iPhone 14"
name: "iOS"
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.name }}
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project GRDB.xcodeproj -scheme GRDB -destination "${{ matrix.destination }}" OTHER_SWIFT_FLAGS='$(inherited) -D SQLITE_ENABLE_FTS5 -D SQLITE_ENABLE_PREUPDATE_HOOK' GCC_PREPROCESSOR_DEFINITIONS='$(inherited) GRDB_SQLITE_ENABLE_PREUPDATE_HOOK=1' clean test
SPM:
name: SPM
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer"
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- xcode: "Xcode_14.3.1.app"
runsOn: macOS-13
name: "Xcode 14.3.1"
- xcode: "Xcode_14.2.app"
runsOn: macOS-13
name: "Xcode 14.2"
- xcode: "Xcode_14.1.app"
runsOn: macOS-13
name: "Xcode 14.1"
- xcode: "Xcode_14.0.1.app"
runsOn: macOS-12
name: "Xcode 14.0.1"
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.name }}
run: make test_SPM test_install_SPM
SQLCipher3:
name: SQLCipher3
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer"
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- xcode: "Xcode_14.3.1.app"
runsOn: macOS-13
name: "Xcode 14.3.1"
- xcode: "Xcode_14.0.1.app"
runsOn: macOS-12
name: "Xcode 14.0.1"
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.name }}
run: make test_framework_SQLCipher3Encrypted
SQLCipher4:
name: SQLCipher4
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer"
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- xcode: "Xcode_14.3.1.app"
runsOn: macOS-13
name: "Xcode 14.3.1"
- xcode: "Xcode_14.0.1.app"
runsOn: macOS-12
name: "Xcode 14.0.1"
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.name }}
run: make test_framework_SQLCipher4Encrypted
CustomSQLite:
name: CustomSQLite
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer"
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- xcode: "Xcode_14.3.1.app"
runsOn: macOS-13
name: "Xcode 14.3.1"
- xcode: "Xcode_14.0.1.app"
runsOn: macOS-12
name: "Xcode 14.0.1"
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.name }}
run: make test_framework_GRDBCustomSQLiteOSX
XCFramework:
name: XCFramework
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer"
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- xcode: "Xcode_14.3.1.app"
runsOn: macOS-13
name: "Xcode 14.3.1"
- xcode: "Xcode_14.0.1.app"
runsOn: macOS-12
name: "Xcode 14.0.1"
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.name }}
run: make test_universal_xcframework
+7 -3
View File
@@ -1,4 +1,4 @@
## https://github.com/github/gitignore/blob/master/Global/OSX.gitignore
## https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
.DS_Store
.AppleDouble
@@ -101,13 +101,17 @@ SQLiteCustom/GRDBCustomSQLite-USER.h
SQLiteCustom/GRDBCustomSQLite-USER.xcconfig
# CocoaPods test
Podfile.lock
Pods
Podfile.lock
# SPM
.build
Package.pins
GRDB.xcworkspace/xcshareddata/swiftpm
#Package.resolved
Tests/SPM/Packages
# Ruby
.ruby-version
# Test products
Tests/products
+1 -13
View File
@@ -1,15 +1,3 @@
[submodule "Tests/Performance/fmdb"]
path = Tests/Performance/fmdb
url = https://github.com/ccgus/fmdb.git
[submodule "Tests/Performance/SQLite.swift"]
path = Tests/Performance/SQLite.swift
url = https://github.com/stephencelis/SQLite.swift.git
[submodule "Tests/Performance/Realm"]
path = Tests/Performance/Realm
url = https://github.com/realm/realm-cocoa.git
[submodule "SQLCipher/src"]
path = SQLCipher/src
url = https://github.com/groue/sqlcipher.git
[submodule "SQLiteCustom/src"]
path = SQLiteCustom/src
url = https://github.com/swiftlyfalling/SQLiteLib
url = https://github.com/swiftlyfalling/SQLiteLib.git
+4
View File
@@ -0,0 +1,4 @@
version: 1
builder:
configs:
- documentation_targets: [GRDB]
-1
View File
@@ -1 +0,0 @@
3.1
@@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "GRDB_GRDBTests"
BuildableName = "GRDB_GRDBTests"
BlueprintName = "GRDB_GRDBTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "GRDB"
BuildableName = "GRDB"
BlueprintName = "GRDB"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "GRDB-dynamic"
BuildableName = "GRDB-dynamic"
BlueprintName = "GRDB-dynamic"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "GRDBTests"
BuildableName = "GRDBTests"
BlueprintName = "GRDBTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CSQLite"
BuildableName = "CSQLite"
BlueprintName = "CSQLite"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "GRDBTests"
BuildableName = "GRDBTests"
BlueprintName = "GRDBTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "GRDB_GRDBTests"
BuildableName = "GRDB_GRDBTests"
BlueprintName = "GRDB_GRDBTests"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+129 -119
View File
@@ -1,6 +1,24 @@
# The OS X Build Environment
# https://docs.travis-ci.com/user/reference/osx/#xcode-version
branches:
only:
- master
- development
language: objective-c
xcode_project: GRDB.xcodeproj
# Caches
cache:
- bundler
- cocoapods
# Custom CocoaPods installation so that Podfile.lock is honored
install:
- bundle install
- bundle exec pod repo update
# Disable the default Travis-CI submodule logic
# The various make commands ensure that the appropriate submodules are retrieved
git:
@@ -8,144 +26,136 @@ git:
jobs:
include:
###########################################
## Test GRDB
# Test GRDBOSX (Xcode 8.3)
- stage: Test GRDB
## Test GRDB Xcode 11.4
- name: "Test GRDB Xcode 11.4 - GRDBiOS iOS maxTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=GRDBOSX (Xcode 8.3, macOS 10.12)
script: make test_framework_GRDBOSX
# Test GRDBWatchOS (Xcode 8.3)
- stage: Test GRDB
osx_image: xcode11.4
script: make test_framework_GRDBiOS_maxTarget_maxSwift
- name: "Test GRDB Xcode 11.4 - GRDBiOS iOS minTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=GRDBWatchOS (Xcode 8.3, watchOS)
script: make test_framework_GRDBWatchOS
# Test GRDBiOS (Xcode 8.3, iOS <MAXIMUM VERSION>)
- stage: Test GRDB
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=GRDBiOS (Xcode 8.3, iOS <MAX>)
script: make test_framework_GRDBiOS_maxTarget
# Test GRDBiOS (Xcode 8.3, iOS <MINIMUM VERSION>))
- stage: Test GRDB
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=GRDBiOS (Xcode 8.3, iOS <MIN>)
osx_image: xcode11.4
script: make test_framework_GRDBiOS_minTarget
# Test GRDB [SPM] (Xcode 8.3, macOS 10.12)
- stage: Test GRDB
###########################################
## Test GRDB Xcode 12.5
- name: "Test GRDB Xcode 12.5 - GRDBOSX - Swift 5.3"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=GRDB [SPM] (Xcode 8.3, macOS 10.12)
osx_image: xcode12.5
script: make test_framework_GRDBOSX_maxSwift
- name: "Test GRDB Xcode 12.5 - GRDBOSX - Swift 5.2"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.5
script: make test_framework_GRDBOSX_minSwift
- name: "Test GRDB Xcode 12.5 - GRDBWatchOS"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.5
script: make test_framework_GRDBWatchOS
- name: "Test GRDB Xcode 12.5 - GRDBiOS iOS maxTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.5
script: make test_framework_GRDBiOS_maxTarget_maxSwift
- name: "Test GRDB Xcode 12.5 - GRDBiOS iOS minTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.5
script: make test_framework_GRDBiOS_minTarget
- name: "Test GRDB Xcode 12.5 - GRDBtvOS maxTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.5
script: make test_framework_GRDBtvOS_maxTarget_maxSwift
- name: "Test GRDB Xcode 12.5 - GRDBtvOS minTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.5
script: make test_framework_GRDBtvOS_minTarget
- name: "Test GRDB Xcode 12.5 - SPM"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.5
script: make test_SPM
###########################################
## Test GRDB (Custom SQLite)
# Test GRDBCustomSQLiteOSX (Xcode 8.3)
- stage: Test GRDB + Custom SQLite
## Test GRDBCustom Xcode 12.5
- name: "Test GRDBCustom Xcode 12.5 - GRDBOSX"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=GRDBCustomSQLiteOSX (Xcode 8.3, macOS 10.12)
osx_image: xcode12.5
script: make test_framework_GRDBCustomSQLiteOSX
# Test GRDBCustomSQLiteiOS (Xcode 8.3, iOS <MAXIMUM VERSION>)
- stage: Test GRDB + Custom SQLite
- name: "Test GRDBCustom Xcode 12.5 - GRDBiOS maxTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=GRDBCustomSQLiteiOS (Xcode 8.3, iOS <MAX>)
script: make test_framework_GRDBCustomSQLiteiOS_maxTarget
# Test GRDBCustomSQLiteiOS (Xcode 8.3, iOS <MINIMUM VERSION>))
- stage: Test GRDB + Custom SQLite
osx_image: xcode12.5
script: make test_framework_GRDBCustomSQLiteiOS_maxTarget_maxSwift
- name: "Test GRDBCustom Xcode 12.5 - GRDBiOS minTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=GRDBCustomSQLiteiOS (Xcode 8.3, iOS <MIN>)
osx_image: xcode12.5
script: make test_framework_GRDBCustomSQLiteiOS_minTarget
###########################################
## Test GRDB (SQLCipher)
# Test GRDBCipherOSX (Xcode 8.3)
- stage: Test GRDB + SQLCipher
## Test SQLCipher Xcode 12.5
- name: "Test SQLCipher Xcode 12.5 - SQLCipher 3"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=GRDBCipherOSX (Xcode 8.3, macOS 10.12)
script: make test_framework_GRDBCipherOSX
# Test GRDBCipheriOS (Xcode 8.3, iOS <MAXIMUM VERSION>)
- stage: Test GRDB + SQLCipher
osx_image: xcode12.5
script: make test_framework_SQLCipher3
- name: "Test SQLCipher Xcode 12.5 - SQLCipher 4"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=GRDBCipheriOS (Xcode 8.3, iOS <MAX>)
script: make test_framework_GRDBCipheriOS_maxTarget
# Test GRDBCipheriOS (Xcode 8.3, iOS <MINIMUM VERSION>))
- stage: Test GRDB + SQLCipher
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=GRDBCipheriOS (Xcode 8.3, iOS <MIN>)
script: make test_framework_GRDBCipheriOS_minTarget
osx_image: xcode12.5
script: make test_framework_SQLCipher4
###########################################
## Test Installation Methods
## Test Installation Xcode 12.5
# Manual Install
- stage: Test Installation
- name: "Test Installation Xcode 12.5 - Manual Install"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=Manual Install
osx_image: xcode12.5
script: make test_install_manual
# Manual Install (GRDBCipher)
- stage: Test Installation
# Travis is much too slow, and always fail this job
# # CocoaPods Lint
# - name: "Test Installation Xcode 12.5 - CocoaPods Lint"
# gemfile: .ci/gemfiles/Gemfile.travis
# osx_image: xcode12.5
# script: make test_CocoaPodsLint_GRDB
# CocoaPods Install GRDB
- name: "Test Installation Xcode 12.5 - CocoaPods Framework"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode8.3
env:
- TID=Manual Install (GRDBCipher)
script: make test_install_GRDBCipher
# Cocoapods Lint
- stage: Test Installation
osx_image: xcode8.3
install:
- gem install cocoapods # Since Travis is not always on latest version
env:
- TID=Cocoapods
script: make test_CocoaPodsLint
osx_image: xcode12.5
script: make test_install_GRDB_CocoaPods_framework
# CocoaPods Install GRDB
- name: "Test Installation Xcode 12.5 - CocoaPods Static"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.5
script: make test_install_GRDB_CocoaPods_static
# SPM Install
- stage: Test Installation
osx_image: xcode8.3
env:
- TID=SPM
script: make test_install_SPM
## The following doesn’t work, as `make test_CarthageBuild` does not yet work.
## Carthage Build
#- stage: Carthage
# osx_image: xcode8.3
# before_install:
# - brew update
# - brew outdated carthage || brew upgrade carthage
# script: make test_CarthageBuild
- name: "Test Installation Xcode 12.5 - SPM Package"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.5
script: make test_install_SPM_Package
# SPM Install
- name: "Test Installation Xcode 12.5 - SPM Package in Xcode Project"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.5
script: make test_install_SPM_Project
# Custom SQLite Install
- name: "Test Installation Xcode 12.5 - Custom SQLite"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.5
script: make test_install_customSQLite
+181
View File
@@ -0,0 +1,181 @@
# Brag Document
Here is a list of people who were happy to meet GRDB :-)
---
https://twitter.com/DamienPetrilli/status/1623922310976786433
> I can't overstate how much more productive I am since I ditched the obsolete Core Data framework and started to use GRDB instead.
>
> The hard stuff is doable, and the simple stuff is even simpler, as it should be.
---
https://twitter.com/fullqueuedev/status/1603350969357684736
> Yes, I much prefer GRDB. I’ve tested many SQLite wrappers over the years 💜
---
https://twitter.com/cassiuspacheco/status/1574948903857770497
> SQLite using @groue’s GRDB, no brainer! Awesome documentation, support and beautifully designed.
---
https://twitter.com/simrandotdev/status/1552004471122587649
> We get Core Data from Apple which is the worst library to deal with.
> Then there is Realm which is nice but again you do not get the RAW SQL power as it is its own type of Db.
> Then comes the most beautiful library every written which is very close to Room called GRDB.
---
https://twitter.com/bellebcooper/status/1534070340850094080
> When I first started using GRDB I didn't know SQL or much at all about databases 😬 So I've always really liked the query API. But these days I really appreciate that you support raw SQL too, because it gives me more control and freedom when I need it. 👍👍👍
---
https://twitter.com/mikeash/status/1504810545429499909
> Another cool library using SQL interpolation!
---
https://twitter.com/swiftkarim/status/1354753451377483781
> I cannot recommend GRDB enough. It works well with Swift and eliminates whole classes of potential programming errors that can be made with Core Data. Also being able to use raw SQL queries if needed can be extremely useful!
---
https://twitter.com/peres/status/1352219836508729346
> Just the occasional reminder that GRDB and its documentation is the gold standard. That's it.
---
https://twitter.com/steipete/status/1275305583718129664
> This is the future of Core Data
---
https://twitter.com/_maxheld/status/1266509824994553860
> I tried out GRDB since I saw you mention it a few days ago and absolutely love it. It’s so nice and testing the database logic is so much nicer than CoreData
---
https://twitter.com/stephencelis/status/1263518304980918274
> GRDB.swift is great! (I say this as the person that started SQLite.swift long ago.) And @groue’s very helpful and friendly.
---
https://twitter.com/peres/status/1262682199482142720
> GRDB in already in my top3 when it comes to documentation. Clearly and pragmatically explained.
---
https://twitter.com/layoutsubviews/status/1249940744929816582
> Mixing SQLite / GRDB with Combine is my whole world right now, and it is delightful.
---
https://twitter.com/steipete/status/1231105339954802694
> It [Core Data] gets the job done, but folks made some really amazing Swift native sqlite wrappers.
---
https://twitter.com/BelleBCooper/status/1223148814980091904
> I LOVE GRDB and highly recommend it. If you don’t need it now, do keep it in mind for future because it’s great and the documentation and support are top notch.
---
https://twitter.com/layoutSubviews/status/1202092984822648832
> GRDB is quickly becoming the best package I have ever dealt with.
> What an exceptional piece of work: the philosophy, the documentation, the API, the abstractions, the Swiftiness👌
---
https://twitter.com/fpillet/status/1193608995405209607
> GRDB keeps being the best-in-class interface to your database, and if you're not using it you're missing out. As always, amazing work from @groue !
---
https://twitter.com/lordmooch/status/1193537540583755776
> Best SQLite/Swift integration 😀👍🏻
---
https://twitter.com/BelleBCooper/status/1192195655743111168
> I’ve been working on a side project recently that uses SwiftUI (+UIKit for parent controllers and nav), Combine, GRDB, and GRDBCombine for automatic updating based on DB changes. I’m really liking this setup.
---
https://twitter.com/BelleBCooper/status/1186034269577048064
> Working on a new project today and using GRDB by @groue for the backend. This is my go-to for new Swift projects. Highly recommend it!
---
https://twitter.com/krzyzanowskim/status/1156568071303290882
> I think GRDB.swift is a godsend. So far sooooo good. (change my mind?)
---
https://twitter.com/iOSDevWeekly/status/1133780078398021637
> How had I never heard of GRDB before this week? Was I the only one missing out, or is this wonderful database library from @groue news to you all too? https://buff.ly/2X8yHGf #iosdev
----
https://twitter.com/micpringle/status/1132264501812891648
> Spent the last few weeks integrating it and it’s amazing! And this release brings a whole load more features—especially excited about eager loading of hasMany relationships.
>
> Quite possibly one of the best documented open source libs I’ve come across as well👌🏼
---
https://twitter.com/danielemargutti/status/1132217792902647808
> It’s a great successor for FMDB with tons of great stuff. Worth a look, we have choose it in our new project even if, actually, I preferred not using some of the ‘ORM’ like features.
---
https://twitter.com/lordmooch/status/1131664588494254086
> Woohoo! Absolutely superb Swift library for SQLite - I love it 😀
---
https://twitter.com/JadenGeller/status/1115483150564487168
> Wow, there are some *really* good looking SQLite frameworks in Swift.
---
https://twitter.com/strawb3rryx7/status/1073620070784516096
> If you looking for a SQLite wrapper in Swift, just take a look the GRDB library! 👇🏼 https://github.com/groue/GRDB.swift Well-maintained and documented! ✊🏼
---
https://twitter.com/BelleBCooper/status/1047017928112128000
> http://blog.bellebcooper.com/2018-10-02-16-39.html
>
> I love the way issues are handled in GRDB (SQLite for Swift). Groue is so friendly, and always goes above-and-beyond in helping to solve problems or explore new features for the library. It makes me happy to be a GRDB user.
+3761 -29
View File
File diff suppressed because it is too large. Load diff
+50
View File
@@ -0,0 +1,50 @@
# Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing other's private information, such as physical or electronic
addresses, without explicit permission
- Other unethical or unprofessional conduct
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.
This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer at [gr@pierlis.com](mailto:gr@pierlis.com).
All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. Maintainers are
obligated to maintain confidentiality with regard to the reporter of an
incident.
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at
[http://contributor-covenant.org/version/1/3/0/][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/
+99
View File
@@ -0,0 +1,99 @@
How you can Contribute
======================
- [Contribute to the GRDB codebase]
- [Answer issues and contribute to discussions]
- [Financial support and sponsoring]
## Contribute to the GRDB codebase
1. **Install** the following tools:
- For running tests:
- Ruby
- [CocoaPods](https://cocoapods.org) (gem)
- [xcpretty](https://github.com/xcpretty/xcpretty) (gem)
- For contributing code:
- [Swiftlint](https://github.com/realm/SwiftLint) (present in the `$PATH` or in `/opt/homebrew/bin/`)
2. **Clone the `development` branch on your machine.**
3. **Run `make SQLiteCustom` in the terminal**, at the root of the repository.
This step is not strictly necessary if you do not plan to work on custom SQLite builds. But it will avoid a lot of warnings in Xcode.
4. **Open `GRDB.xcworkspace`.** This workspace contains six projects:
- `GRDB.xcodeproj`: the project which contains the GRDB framework and test targets. The sources are organized in two groups:
- `GRDB`: GRDB sources
- `Tests`: GRDB tests
- `GRDBCustom.xcodeproj`: the project which builds GRDB with a custom SQLite build.
- `GRDBProfiling.xcodeproj`: a project which helps profiling GRDB with Instruments. No code here is really precious.
- `GRDBDemoiOS.xcodeproj`, `GRDBCombineDemo.xcodeproj`, `GRDBAsyncDemo.xcodeproj`: the demo apps.
To work with `GRDBCustom.xcodeproj`:
- Make sure Xcode is installed in `/Applications`.
- Run `make SQLiteCustom` in the terminal so that SQLite sources are present.
5. **Run tests**
You can run tests from `GRDB.xcworkspace`, after selecting your scheme (`GRDB` from `GRDB.xcodeproj` or `GRDBCustom` from `GRDBCustom.xcodeproj`).
Before submitting a pull request, please run in the terminal:
```sh
make smokeTest
```
The "smoke tests" perform minimal testing of the system SQLite, SQLCipher, custom SQLite builds, as well as SPM integration.
Before a release, the full test suite must pass:
```sh
make test
```
The full test suite performs many more checks, such as the ability to archive an XCFramework, various installation methods, the demo apps, etc.
6. **Please respect the existing coding style**
- Get familiar with the [Swift API Design Guidelines](https://www.swift.org/documentation/api-design-guidelines/).
- Spaces, not tabs.
- Whitespace-only lines are not trimmed.
- Documentation comments are hard-wrapped at column 76 (Xcode > Preferences > Text Editing > Display > [X] Page guide at column: 76).
- No Swiftlint warning after a build.
7. **Please provide documentation for your changes**
GRDB documentation is provided as a DocC reference, and guides ([README.md](README.md) and the [Documentation](Documentation) folder).
Please keep the reference and the guides up-to-date. To control the quality of your DocC reference documentation, close the workspace, open `Package.swift` in Xcode, and use Product > Build Documentation.
GRDB is "documentation-driven", which means that nothing ships until it is supported by documentation that makes sense. Documentation makes sense when someone who is not you is able to figure out what is the purpose of your contribution, how to use it, and what are its eventual caveats and corner cases. When the documentation is hard to write, or reveals too many caveats, it is the sign that the api needs to be fixed.
8. **Open a pull request with your changes (targeting the `development` branch)!**
9. **If you are granted a push access to the repository**, check [ReleaseProcess.md](Documentation/ReleaseProcess.md) in order to publish a new GRDB version.
## Answer issues and contribute to discussions
Answering [issues](https://github.com/groue/GRDB.swift/issues), participating in [discussions](https://github.com/groue/GRDB.swift/discussions) and in the [forum](https://forums.swift.org/c/related-projects/grdb/36) is a great way to help, get familiar with the library, and shape its direction.
## Financial support and sponsoring
GRDB is free, and openly developed by its contributors, on their free time, according to their will, needs, and availability. It is not controlled by any company.
Support is free as well, as long as it happens publicly, and is available to everyone as well as internet search engines. This excludes the private channels of social networks, closed environments such as Slack, etc.
When you have specific development or support needs, please send an email to [Gwendal Roué](mailto:gr@pierlis.com) so that we can enter a regular business relationship through the [Pierlis](http://pierlis.com/) company, based in Paris, France.
You can also [sponsor @groue via GitHub](https://github.com/sponsors/groue).
[Contribute to the GRDB codebase]: #contribute-to-the-grdb-codebase
[Answer issues and contribute to discussions]: #answer-issues-and-contribute-to-discussions
[Financial support and sponsoring]: #financial-support-and-sponsoring
@@ -1,11 +0,0 @@
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
try! setupDatabase(application)
return true
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

@@ -1,310 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11129.15" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="UAh-8N-CM8">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11103.10"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Hall Of Fame-->
<scene sceneID="8jG-C9-QsI">
<objects>
<tableViewController id="cyv-nk-Plb" customClass="SimplePersonsViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="oON-zg-8kO">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Person" textLabel="XIE-DF-pSO" detailTextLabel="vyz-CH-eMb" style="IBUITableViewCellStyleValue1" id="V5t-oJ-KD9">
<frame key="frameInset" minY="92" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="V5t-oJ-KD9" id="Coo-th-ywF">
<frame key="frameInset" width="342" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="XIE-DF-pSO">
<frame key="frameInset" minX="15" minY="12" width="31.5" height="19.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="vyz-CH-eMb">
<frame key="frameInset" minX="298.5" minY="12" width="41.5" height="19.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="iNr-Oe-muq" kind="show" identifier="EditPerson" id="czF-1h-sYn"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="cyv-nk-Plb" id="uBb-Bn-Lhg"/>
<outlet property="delegate" destination="cyv-nk-Plb" id="nLb-Ak-ZXS"/>
</connections>
</tableView>
<toolbarItems/>
<navigationItem key="navigationItem" title="Hall Of Fame" id="YLU-iz-PGw"/>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<segue destination="ein-Sr-i8w" kind="presentation" identifier="NewPerson" id="zii-bJ-cOA"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="PrM-ex-2C8" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="630" y="640"/>
</scene>
<!--Person Edition View Controller-->
<scene sceneID="Juk-Ad-tZ2">
<objects>
<tableViewController id="iNr-Oe-muq" customClass="PersonEditionViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="vlV-lc-eQA">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<sections>
<tableViewSection id="Nzq-eO-jT3">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="2gb-gB-918">
<rect key="frame" x="0.0" y="64" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2gb-gB-918" id="iyM-TJ-JB4">
<frame key="frameInset" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Name" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="m5m-Zs-j0z">
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="no" spellCheckingType="no" returnKeyType="next"/>
<connections>
<outlet property="delegate" destination="iNr-Oe-muq" id="K2p-7d-teD"/>
</connections>
</textField>
</subviews>
<constraints>
<constraint firstItem="m5m-Zs-j0z" firstAttribute="leading" secondItem="iyM-TJ-JB4" secondAttribute="leadingMargin" constant="10" id="9cK-nj-70V"/>
<constraint firstAttribute="trailingMargin" secondItem="m5m-Zs-j0z" secondAttribute="trailing" id="JsE-8v-XAS"/>
<constraint firstItem="m5m-Zs-j0z" firstAttribute="centerY" secondItem="iyM-TJ-JB4" secondAttribute="centerY" id="psG-tW-QrM"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="vp3-Ft-Gth">
<rect key="frame" x="0.0" y="108" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="vp3-Ft-Gth" id="ccO-0O-u72">
<frame key="frameInset" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Score" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="rZ9-Fa-cyr">
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="numberPad" returnKeyType="done"/>
</textField>
</subviews>
<constraints>
<constraint firstAttribute="trailingMargin" secondItem="rZ9-Fa-cyr" secondAttribute="trailing" id="Gso-FU-Ct1"/>
<constraint firstItem="rZ9-Fa-cyr" firstAttribute="centerY" secondItem="ccO-0O-u72" secondAttribute="centerY" id="UqA-ea-emb"/>
<constraint firstItem="rZ9-Fa-cyr" firstAttribute="leading" secondItem="ccO-0O-u72" secondAttribute="leadingMargin" constant="10" id="WrY-St-72v"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="iNr-Oe-muq" id="67O-XE-MeV"/>
<outlet property="delegate" destination="iNr-Oe-muq" id="vLD-QQ-zR2"/>
</connections>
</tableView>
<toolbarItems/>
<navigationItem key="navigationItem" id="U4g-xG-W8b">
<barButtonItem key="leftBarButtonItem" systemItem="cancel" id="VIN-Hi-Twt">
<connections>
<segue destination="lTz-K0-aRY" kind="unwind" unwindAction="cancelPersonEdition:" id="fOs-ol-qJL"/>
</connections>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" systemItem="done" id="2um-u5-BhV">
<connections>
<segue destination="lTz-K0-aRY" kind="unwind" identifier="" unwindAction="commitPersonEdition:" id="Y1E-dI-wcl"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="cancelBarButtonItem" destination="VIN-Hi-Twt" id="dET-mF-ZXe"/>
<outlet property="commitBarButtonItem" destination="2um-u5-BhV" id="Jym-us-zdP"/>
<outlet property="nameCell" destination="2gb-gB-918" id="ch2-MB-uRm"/>
<outlet property="nameTextField" destination="m5m-Zs-j0z" id="A6a-pw-q8s"/>
<outlet property="scoreCell" destination="vp3-Ft-Gth" id="b8A-42-8Dw"/>
<outlet property="scoreTextField" destination="rZ9-Fa-cyr" id="4kw-gV-uih"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="fNC-Ls-uRw" userLabel="First Responder" sceneMemberID="firstResponder"/>
<exit id="lTz-K0-aRY" userLabel="Exit" sceneMemberID="exit"/>
</objects>
<point key="canvasLocation" x="1450" y="1435"/>
</scene>
<!--GRDB Demo-->
<scene sceneID="XjB-aQ-v94">
<objects>
<tableViewController id="9kw-c5-KTk" customClass="DemoViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="f4Y-o2-7VW">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<sections>
<tableViewSection id="dCg-qU-h2X">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="clL-nG-zPX" style="IBUITableViewCellStyleDefault" id="kJB-sX-YAb">
<rect key="frame" x="0.0" y="64" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="kJB-sX-YAb" id="f5l-ob-3DG">
<frame key="frameInset" width="342" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Simple TableView" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="clL-nG-zPX">
<frame key="frameInset" minX="15" width="325" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="cyv-nk-Plb" kind="show" id="Bgq-9t-jRc"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="I78-c5-0kp" style="IBUITableViewCellStyleDefault" id="q4C-mT-5mi">
<rect key="frame" x="0.0" y="108" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="q4C-mT-5mi" id="2Cu-K1-hiz">
<frame key="frameInset" width="342" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="FetchedRecordsController" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="I78-c5-0kp">
<frame key="frameInset" minX="15" width="325" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="PJp-Eq-ZjA" kind="show" id="1fk-ZR-6XN"/>
</connections>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="9kw-c5-KTk" id="IK7-Os-Odc"/>
<outlet property="delegate" destination="9kw-c5-KTk" id="U7E-yB-s8d"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="GRDB Demo" id="z0z-02-Ucy"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="OhY-4B-BcJ" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-190" y="1435"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="2KX-IU-Z5Q">
<objects>
<navigationController id="ein-Sr-i8w" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="zIT-dB-Mfo">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="iNr-Oe-muq" kind="relationship" relationship="rootViewController" id="e5b-3U-9Vz"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kNr-vk-I5l" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="630" y="1435"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="N1X-4j-Re4">
<objects>
<navigationController id="UAh-8N-CM8" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="U7d-1C-GnL">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="9kw-c5-KTk" kind="relationship" relationship="rootViewController" id="qDW-qI-Hyg"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="sVt-e9-ghQ" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1006" y="1435"/>
</scene>
<!--Hall Of Fame-->
<scene sceneID="9su-ms-vdJ">
<objects>
<tableViewController id="PJp-Eq-ZjA" customClass="PersonsViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="tX0-ON-WSI">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Person" textLabel="G8y-VE-YRu" detailTextLabel="NNc-J4-xiE" style="IBUITableViewCellStyleValue1" id="bFj-Hd-fwd">
<frame key="frameInset" minY="92" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="bFj-Hd-fwd" id="kDf-TZ-xhb">
<frame key="frameInset" width="342" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="G8y-VE-YRu">
<frame key="frameInset" minX="15" minY="12" width="31.5" height="19.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="NNc-J4-xiE">
<frame key="frameInset" minX="298.5" minY="12" width="41.5" height="19.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="iNr-Oe-muq" kind="show" identifier="EditPerson" id="Lgu-Yd-HSy"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="PJp-Eq-ZjA" id="MkQ-WQ-sTh"/>
<outlet property="delegate" destination="PJp-Eq-ZjA" id="quj-Sp-DuL"/>
</connections>
</tableView>
<toolbarItems>
<barButtonItem title="Item" id="hMF-Rv-dAe"/>
</toolbarItems>
<navigationItem key="navigationItem" title="Hall Of Fame" id="QIv-M6-kT1">
<barButtonItem key="rightBarButtonItem" systemItem="add" id="2bK-Fl-55Q"/>
</navigationItem>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<segue destination="ein-Sr-i8w" kind="presentation" identifier="NewPerson" id="7PC-xN-zD4"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="af5-Qo-AkD" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="630" y="2254"/>
</scene>
</scenes>
<inferredMetricsTieBreakers>
<segue reference="7PC-xN-zD4"/>
<segue reference="czF-1h-sYn"/>
</inferredMetricsTieBreakers>
</document>
@@ -1,56 +0,0 @@
import GRDB
import UIKit
// The shared database queue
var dbQueue: DatabaseQueue!
func setupDatabase(_ application: UIApplication) throws {
// Connect to the database
// See https://github.com/groue/GRDB.swift/#database-connections
let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! as NSString
let databasePath = documentsPath.appendingPathComponent("db.sqlite")
dbQueue = try DatabaseQueue(path: databasePath)
// Be a nice iOS citizen, and don't consume too much memory
// See https://github.com/groue/GRDB.swift/#memory-management
dbQueue.setupMemoryManagement(in: application)
// Use DatabaseMigrator to setup the database
// See https://github.com/groue/GRDB.swift/#migrations
var migrator = DatabaseMigrator()
migrator.registerMigration("createPersons") { db in
// Create a table
// See https://github.com/groue/GRDB.swift#create-tables
try db.create(table: "persons") { t in
// An integer primary key auto-generates unique IDs
t.column("id", .integer).primaryKey()
// Sort person names in a localized case insensitive fashion by default
// See https://github.com/groue/GRDB.swift/#unicode
t.column("name", .text).notNull().collate(.localizedCaseInsensitiveCompare)
t.column("score", .integer).notNull()
}
// Populate the persons table with random data
for _ in 0..<8 {
try Person(name: Person.randomName(), score: Person.randomScore()).insert(db)
}
}
// // Migrations for future application versions will be inserted here:
// migrator.registerMigration(...) { db in
// ...
// }
try migrator.migrate(dbQueue)
}
@@ -1,10 +0,0 @@
import UIKit
class DemoViewController: UITableViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(true)
navigationController?.isToolbarHidden = true
navigationItem.backBarButtonItem = UIBarButtonItem(title: "Demo", style: .plain, target: nil, action: nil)
}
}
Binary file not shown.
@@ -1,49 +0,0 @@
import GRDB
class Person: Record {
var id: Int64?
var name: String
var score: Int
init(name: String, score: Int) {
self.name = name
self.score = score
super.init()
}
// MARK: Record overrides
override class var databaseTableName: String {
return "persons"
}
required init(row: Row) {
id = row.value(named: "id")
name = row.value(named: "name")
score = row.value(named: "score")
super.init(row: row)
}
override func encode(to container: inout PersistenceContainer) {
container["id"] = id
container["name"] = name
container["score"] = score
}
override func didInsert(with rowID: Int64, for column: String?) {
id = rowID
}
// MARK: Random
private static let names = ["Arthur", "Anita", "Barbara", "Bernard", "Craig", "Chiara", "David", "Dean", "Éric", "Elena", "Fatima", "Frederik", "Gilbert", "Georgette", "Henriette", "Hassan", "Ignacio", "Irene", "Julie", "Jack", "Karl", "Kristel", "Louis", "Liz", "Masashi", "Mary", "Noam", "Nicole", "Ophelie", "Oleg", "Pascal", "Patricia", "Quentin", "Quinn", "Raoul", "Rachel", "Stephan", "Susie", "Tristan", "Tatiana", "Ursule", "Urbain", "Victor", "Violette", "Wilfried", "Wilhelmina", "Yvon", "Yann", "Zazie", "Zoé"]
class func randomName() -> String {
return names[Int(arc4random_uniform(UInt32(names.count)))]
}
class func randomScore() -> Int {
return 10 * Int(arc4random_uniform(101))
}
}
@@ -1,104 +0,0 @@
import UIKit
protocol PersonEditionViewControllerDelegate: class {
func personEditionControllerDidComplete(_ controller: PersonEditionViewController)
}
class PersonEditionViewController: UITableViewController {
weak var delegate: PersonEditionViewControllerDelegate?
var person: Person! { didSet { configureView() } }
var cancelButtonHidden: Bool = false { didSet { configureView() } }
var commitButtonHidden: Bool = false { didSet { configureView() } }
@IBOutlet fileprivate weak var cancelBarButtonItem: UIBarButtonItem!
@IBOutlet fileprivate weak var commitBarButtonItem: UIBarButtonItem!
@IBOutlet fileprivate weak var nameCell: UITableViewCell!
@IBOutlet fileprivate weak var nameTextField: UITextField!
@IBOutlet fileprivate weak var scoreCell: UITableViewCell!
@IBOutlet fileprivate weak var scoreTextField: UITextField!
func applyChanges() {
if let name = nameTextField.text, !name.isEmpty {
person.name = name
}
person.score = scoreTextField.text.flatMap { Int($0) } ?? 0
}
override func viewDidLoad() {
super.viewDidLoad()
configureView()
}
private func configureView() {
guard isViewLoaded else { return }
nameTextField.text = person.name
if person.score == 0 && person.id == nil {
scoreTextField.text = ""
} else {
scoreTextField.text = "\(person.score)"
}
if cancelButtonHidden {
navigationItem.leftBarButtonItem = nil
} else {
navigationItem.leftBarButtonItem = cancelBarButtonItem
}
if cancelButtonHidden {
navigationItem.rightBarButtonItem = nil
} else {
navigationItem.rightBarButtonItem = commitBarButtonItem
}
}
}
// MARK: - Navigation
extension PersonEditionViewController {
override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
// Force keyboard to dismiss early
view.endEditing(true)
return true
}
override func willMove(toParentViewController parent: UIViewController?) {
super.willMove(toParentViewController: parent)
if parent == nil {
// Self is popping from its navigation controller
delegate?.personEditionControllerDidComplete(self)
}
}
}
// MARK: - Form
extension PersonEditionViewController: UITextFieldDelegate {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
nameTextField.becomeFirstResponder()
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: false)
let cell = tableView.cellForRow(at: indexPath)
if cell === nameCell {
nameTextField.becomeFirstResponder()
} else if cell === scoreCell {
scoreTextField.becomeFirstResponder()
}
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
if textField == nameTextField {
scoreTextField.becomeFirstResponder()
}
return false
}
}
@@ -1,234 +0,0 @@
import UIKit
import GRDB
class PersonsViewController: UITableViewController {
var personsController: FetchedRecordsController<Person>!
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.rightBarButtonItems = [
UIBarButtonItem(barButtonSystemItem: .add, target: self, action: .addPerson),
editButtonItem
]
personsController = try! FetchedRecordsController(dbQueue, request: personsSortedByScore)
personsController.trackChanges(
willChange: { [unowned self] _ in
self.tableView.beginUpdates()
},
onChange: { [unowned self] (controller, record, change) in
switch change {
case .insertion(let indexPath):
self.tableView.insertRows(at: [indexPath], with: .fade)
case .deletion(let indexPath):
self.tableView.deleteRows(at: [indexPath], with: .fade)
case .update(let indexPath, _):
if let cell = self.tableView.cellForRow(at: indexPath) {
self.configure(cell, at: indexPath)
}
case .move(let indexPath, let newIndexPath, _):
// Actually move cells around for more demo effect :-)
let cell = self.tableView.cellForRow(at: indexPath)
self.tableView.moveRow(at: indexPath, to: newIndexPath)
if let cell = cell {
self.configure(cell, at: newIndexPath)
}
// A quieter animation:
// self.tableView.deleteRows(at: [indexPath], with: .fade)
// self.tableView.insertRows(at: [newIndexPath], with: .fade)
}
},
didChange: { [unowned self] _ in
self.tableView.endUpdates()
})
try! personsController.performFetch()
configureToolbar()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.isToolbarHidden = false
}
}
// MARK: - Navigation
extension PersonsViewController : PersonEditionViewControllerDelegate {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "EditPerson" {
let person = personsController.record(at: tableView.indexPathForSelectedRow!)
let controller = segue.destination as! PersonEditionViewController
controller.title = person.name
controller.person = person
controller.delegate = self // we will save person when back button is tapped
controller.cancelButtonHidden = true
controller.commitButtonHidden = true
}
else if segue.identifier == "NewPerson" {
setEditing(false, animated: true)
let navigationController = segue.destination as! UINavigationController
let controller = navigationController.viewControllers.first as! PersonEditionViewController
controller.title = "New Person"
controller.person = Person(name: "", score: 0)
}
}
@IBAction func addPerson(_ sender: AnyObject?) {
performSegue(withIdentifier: "NewPerson", sender: sender)
}
@IBAction func cancelPersonEdition(_ segue: UIStoryboardSegue) {
// Person creation: cancel button was tapped
}
@IBAction func commitPersonEdition(_ segue: UIStoryboardSegue) {
// Person creation: commit button was tapped
let controller = segue.source as! PersonEditionViewController
controller.applyChanges()
let person = controller.person!
if !person.name.isEmpty {
try! dbQueue.inDatabase { db in
try person.save(db)
}
}
}
func personEditionControllerDidComplete(_ controller: PersonEditionViewController) {
// Person edition: back button was tapped
controller.applyChanges()
let person = controller.person!
if !person.name.isEmpty {
try! dbQueue.inDatabase { db in
try person.save(db)
}
}
}
}
// MARK: - UITableViewDataSource
extension PersonsViewController {
func configure(_ cell: UITableViewCell, at indexPath: IndexPath) {
let person = personsController.record(at: indexPath)
cell.textLabel?.text = person.name
cell.detailTextLabel?.text = abs(person.score) > 1 ? "\(person.score) points" : "0 point"
}
override func numberOfSections(in tableView: UITableView) -> Int {
return personsController.sections.count
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return personsController.sections[section].numberOfRecords
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Person", for: indexPath)
configure(cell, at: indexPath)
return cell
}
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
// Delete the person
let person = personsController.record(at: indexPath)
try! dbQueue.inDatabase { db in
_ = try person.delete(db)
}
}
}
// MARK: - FetchedRecordsController Demo
extension PersonsViewController {
fileprivate func configureToolbar() {
toolbarItems = [
UIBarButtonItem(title: "Name ⬆︎", style: .plain, target: self, action: .sortByName),
UIBarButtonItem(title: "Score ⬇︎", style: .plain, target: self, action: .sortByScore),
UIBarButtonItem(title: "Randomize", style: .plain, target: self, action: .randomizeScores),
UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil),
UIBarButtonItem(title: "💣", style: .plain, target: self, action: .stressTest)
]
}
@IBAction func sortByName() {
setEditing(false, animated: true)
try! personsController.setRequest(personsSortedByName)
}
@IBAction func sortByScore() {
setEditing(false, animated: true)
try! personsController.setRequest(personsSortedByScore)
}
@IBAction func randomizeScores() {
setEditing(false, animated: true)
try! dbQueue.inTransaction { db in
for person in try Person.fetchAll(db) {
person.score = Person.randomScore()
try person.update(db)
}
return .commit
}
}
@IBAction func stressTest() {
setEditing(false, animated: true)
for _ in 0..<50 {
DispatchQueue.global().async {
try! dbQueue.inTransaction { db in
if try Person.fetchCount(db) == 0 {
// Insert persons
for _ in 0..<8 {
try Person(name: Person.randomName(), score: Person.randomScore()).insert(db)
}
} else {
// Insert a person
if arc4random_uniform(2) == 0 {
let person = Person(name: Person.randomName(), score: Person.randomScore())
try person.insert(db)
}
// Delete a person
if arc4random_uniform(2) == 0 {
if let person = try Person.order(sql: "RANDOM()").fetchOne(db) {
try person.delete(db)
}
}
// Update some persons
for person in try Person.fetchAll(db) {
if arc4random_uniform(2) == 0 {
person.score = Person.randomScore()
try person.update(db)
}
}
}
return .commit
}
}
}
}
}
// https://medium.com/swift-programming/swift-selector-syntax-sugar-81c8a8b10df3
private extension Selector {
static let addPerson = #selector(PersonsViewController.addPerson(_:))
static let sortByName = #selector(PersonsViewController.sortByName)
static let sortByScore = #selector(PersonsViewController.sortByScore)
static let randomizeScores = #selector(PersonsViewController.randomizeScores)
static let stressTest = #selector(PersonsViewController.stressTest)
}
private let personsSortedByName = Person.order(Column("name"))
private let personsSortedByScore = Person.order(Column("score").desc, Column("name"))
@@ -1,114 +0,0 @@
import UIKit
import GRDB
class SimplePersonsViewController: UITableViewController {
var persons: [Person]!
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.rightBarButtonItems = [
UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(SimplePersonsViewController.addPerson(_:))),
editButtonItem
]
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
loadPersons()
tableView.reloadData()
}
private func loadPersons() {
persons = try! dbQueue.inDatabase { db in
try Person.order(Column("score").desc, Column("name")).fetchAll(db)
}
}
}
// MARK: - Navigation
extension SimplePersonsViewController : PersonEditionViewControllerDelegate {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "EditPerson" {
let person = persons[tableView.indexPathForSelectedRow!.row]
let controller = segue.destination as! PersonEditionViewController
controller.title = person.name
controller.person = person
controller.delegate = self // we will save person when back button is tapped
controller.cancelButtonHidden = true
controller.commitButtonHidden = true
}
else if segue.identifier == "NewPerson" {
setEditing(false, animated: true)
let navigationController = segue.destination as! UINavigationController
let controller = navigationController.viewControllers.first as! PersonEditionViewController
controller.title = "New Person"
controller.person = Person(name: "", score: 0)
}
}
@IBAction func addPerson(_ sender: AnyObject?) {
performSegue(withIdentifier: "NewPerson", sender: sender)
}
@IBAction func cancelPersonEdition(_ segue: UIStoryboardSegue) {
// Person creation: cancel button was tapped
}
@IBAction func commitPersonEdition(_ segue: UIStoryboardSegue) {
// Person creation: commit button was tapped
let controller = segue.source as! PersonEditionViewController
controller.applyChanges()
let person = controller.person!
if !person.name.isEmpty {
try! dbQueue.inDatabase { db in
try person.save(db)
}
}
}
func personEditionControllerDidComplete(_ controller: PersonEditionViewController) {
// Person edition: back button was tapped
controller.applyChanges()
let person = controller.person!
if !person.name.isEmpty {
try! dbQueue.inDatabase { db in
try person.save(db)
}
}
}
}
// MARK: - UITableViewDataSource
extension SimplePersonsViewController {
func configure(_ cell: UITableViewCell, at indexPath: IndexPath) {
let person = persons[indexPath.row]
cell.textLabel?.text = person.name
cell.detailTextLabel?.text = abs(person.score) > 1 ? "\(person.score) points" : "0 point"
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return persons.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Person", for: indexPath)
configure(cell, at: indexPath)
return cell
}
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
// Delete the person
let person = persons[indexPath.row]
try! dbQueue.inDatabase { db in
_ = try person.delete(db)
}
persons.remove(at: indexPath.row)
tableView.deleteRows(at: [indexPath], with: .fade)
}
}
+4
View File
@@ -0,0 +1,4 @@
Sharing a Database in an App Group Container
============================================
This guide [has moved](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databasesharing).
File diff suppressed because it is too large. Load diff
+404
View File
@@ -0,0 +1,404 @@
GRDB ❤️ Combine
===============
**On systems supporting the Combine framework, GRDB offers the ability to publish database values and events using Combine's publishers.**
- [Usage]
- [Demo Application]
- [Asynchronous Database Access]
- [Database Observation]
- [Combine and Data Consistency]: take care when you combine database publishers together
## Usage
To connect to the database, please refer to [Database Connections].
<details>
<summary><strong>Asynchronously read from the database</strong></summary>
This publisher reads a single value and delivers it.
```swift
// DatabasePublishers.Read<[Player]>
let players = dbQueue.readPublisher { db in
try Player.fetchAll(db)
}
```
</details>
<details>
<summary><strong>Asynchronously write in the database</strong></summary>
This publisher updates the database and delivers a single value.
```swift
// DatabasePublishers.Write<Void>
let write = dbQueue.writePublisher { db in
try Player(...).insert(db)
}
// DatabasePublishers.Write<Int>
let newPlayerCount = dbQueue.writePublisher { db -> Int in
try Player(...).insert(db)
return try Player.fetchCount(db)
}
```
</details>
<details>
<summary><strong>Asynchronously migrate the database</strong></summary>
This publisher migrates a database:
```swift
// DatabasePublishers.Migrate
let migrator: DatabaseMigrator = ...
let publisher = migrator.migratePublisher(dbQueue)
```
</details>
<details>
<summary><strong>Observe changes in database values</strong></summary>
This publisher delivers fresh values whenever the database changes:
```swift
// A publisher with output [Player] and failure Error
let publisher = ValueObservation
.tracking { db in try Player.fetchAll(db) }
.publisher(in: dbQueue)
// A publisher with output Int? and failure Error
let publisher = ValueObservation
.tracking { db in try Int.fetchOne(db, sql: "SELECT MAX(score) FROM player") }
.publisher(in: dbQueue)
```
</details>
<details>
<summary><strong>Observe database transactions</strong></summary>
This publisher delivers database connections whenever a database transaction has impacted an observed region:
```swift
// A publisher with output Database and failure Error
let publisher = DatabaseRegionObservation
.tracking(Player.all())
.publisher(in: dbQueue)
let cancellable = publisher.sink(
receiveCompletion: { completion in ... },
receiveValue: { (db: Database) in
print("Exclusive write access to the database after players have been impacted")
})
// A publisher with output Database and failure Error
let publisher = DatabaseRegionObservation
.tracking(SQLRequest<Int>(sql: "SELECT MAX(score) FROM player"))
.publisher(in: dbQueue)
let cancellable = publisher.sink(
receiveCompletion: { completion in ... },
receiveValue: { (db: Database) in
print("Exclusive write access to the database after maximum score has been impacted")
})
```
</details>
# Asynchronous Database Access
GRDB provide publishers that perform asynchronous database accesses:
- [`readPublisher(receiveOn:value:)`]
- [`writePublisher(receiveOn:updates:)`]
- [`writePublisher(receiveOn:updates:thenRead:)`]
- [`migratePublisher(_:receiveOn:)`]
#### `DatabaseReader.readPublisher(receiveOn:value:)`
This methods returns a publisher that completes after database values have been asynchronously fetched.
```swift
// DatabasePublishers.Read<[Player]>
let players = dbQueue.readPublisher { db in
try Player.fetchAll(db)
}
```
Any attempt at modifying the database completes subscriptions with an error.
When you use a [database queue] or a [database snapshot], the read has to wait for any eventual concurrent database access performed by this queue or snapshot to complete.
When you use a [database pool], reads are generally non-blocking, unless the maximum number of concurrent reads has been reached. In this case, a read has to wait for another read to complete. That maximum number can be [configured].
This publisher can be subscribed from any thread. A new database access starts on every subscription.
The fetched value is published on the main queue, unless you provide a specific [scheduler] to the `receiveOn` argument.
#### `DatabaseWriter.writePublisher(receiveOn:updates:)`
This method returns a publisher that completes after database updates have been successfully executed inside a database transaction.
```swift
// DatabasePublishers.Write<Void>
let write = dbQueue.writePublisher { db in
try Player(...).insert(db)
}
// DatabasePublishers.Write<Int>
let newPlayerCount = dbQueue.writePublisher { db -> Int in
try Player(...).insert(db)
return try Player.fetchCount(db)
}
```
This publisher can be subscribed from any thread. A new database access starts on every subscription.
It completes on the main queue, unless you provide a specific [scheduler] to the `receiveOn` argument.
When you use a [database pool], and your app executes some database updates followed by some slow fetches, you may profit from optimized scheduling with [`writePublisher(receiveOn:updates:thenRead:)`]. See below.
#### `DatabaseWriter.writePublisher(receiveOn:updates:thenRead:)`
This method returns a publisher that completes after database updates have been successfully executed inside a database transaction, and values have been subsequently fetched:
```swift
// DatabasePublishers.Write<Int>
let newPlayerCount = dbQueue.writePublisher(
updates: { db in try Player(...).insert(db) }
thenRead: { db, _ in try Player.fetchCount(db) })
}
```
It publishes exactly the same values as [`writePublisher(receiveOn:updates:)`]:
```swift
// DatabasePublishers.Write<Int>
let newPlayerCount = dbQueue.writePublisher { db -> Int in
try Player(...).insert(db)
return try Player.fetchCount(db)
}
```
The difference is that the last fetches are performed in the `thenRead` function. This function accepts two arguments: a readonly database connection, and the result of the `updates` function. This allows you to pass information from a function to the other (it is ignored in the sample code above).
When you use a [database pool], this method applies a scheduling optimization: the `thenRead` function sees the database in the state left by the `updates` function, and yet does not block any concurrent writes. This can reduce database write contention.
When you use a [database queue], the results are guaranteed to be identical, but no scheduling optimization is applied.
This publisher can be subscribed from any thread. A new database access starts on every subscription.
It completes on the main queue, unless you provide a specific [scheduler] to the `receiveOn` argument.
# Database Observation
Database Observation publishers are based on [ValueObservation] and [DatabaseRegionObservation]. Please refer to their documentation for more information. If your application needs change notifications that are not built as Combine publishers, check the general [Database Changes Observation] chapter.
- [`ValueObservation.publisher(in:scheduling:)`]
- [`SharedValueObservation.publisher()`]
- [`DatabaseRegionObservation.publisher(in:)`]
#### `ValueObservation.publisher(in:scheduling:)`
[ValueObservation] tracks changes in database values. You can turn it into a Combine publisher:
```swift
let observation = ValueObservation.tracking { db in
try Player.fetchAll(db)
}
// A publisher with output [Player] and failure Error
let publisher = observation.publisher(in: dbQueue)
```
This publisher has the same behavior as ValueObservation:
- It notifies an initial value before the eventual changes.
- It may coalesce subsequent changes into a single notification.
- It may notify consecutive identical values. You can filter out the undesired duplicates with the `removeDuplicates()` Combine operator, but we suggest you have a look at the [removeDuplicates()](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/valueobservation/removeduplicates()) GRDB operator also.
- It only completes when it is cancelled.
- By default, it notifies the initial value, as well as eventual changes and errors, on the main thread, asynchronously.
This can be configured with the `scheduling` argument. It does not accept a Combine scheduler, but a [ValueObservationScheduler](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/valueobservationscheduler).
For example, the `.immediate` scheduler makes sure the initial value is notified immediately when the publisher is subscribed. It can help your application update the user interface without having to wait for any asynchronous notifications:
```swift
// Immediate notification of the initial value
let cancellable = observation
.publisher(
in: dbQueue,
scheduling: .immediate) // <-
.sink(
receiveCompletion: { completion in ... },
receiveValue: { (players: [Player]) in print("Fresh players: \(players)") })
// <- here "fresh players" is already printed.
```
Note that the `.immediate` scheduler requires that the publisher is subscribed from the main thread. It raises a fatal error otherwise.
#### `SharedValueObservation.publisher()`
[SharedValueObservation] tracks changes in database values. You can turn it into a Combine publisher:
```swift
let sharedObservation = ValueObservation
.tracking { db in try Player.fetchAll(db) }
.shared(in: dbQueue)
// A publisher with output [Player] and failure Error
let publisher = sharedObservation.publisher()
```
This publisher has the same behavior as SharedValueObservation.
#### `DatabaseRegionObservation.publisher(in:)`
[DatabaseRegionObservation] notifies all transactions that impact a tracked database region. You can turn it into a Combine publisher:
```swift
let request = Player.all()
let observation = DatabaseRegionObservation.tracking(request)
// A publisher with output Database and failure Error
let publisher = observation.publisher(in: dbQueue)
```
This publisher can be created and subscribed from any thread. It delivers database connections in a "protected dispatch queue", serialized with all database updates. It only completes when a database error happens.
```swift
let request = Player.all()
let cancellable = DatabaseRegionObservation
.tracking(request)
.publisher(in: dbQueue)
.sink(
receiveCompletion: { completion in ... },
receiveValue: { (db: Database) in
print("Players have changed.")
})
try dbQueue.write { db in
try Player(name: "Arthur").insert(db)
try Player(name: "Barbara").insert(db)
}
// Prints "Players have changed."
try dbQueue.write { db in
try Player.deleteAll(db)
}
// Prints "Players have changed."
```
See [DatabaseRegionObservation] for more information.
## Combine and Data Consistency
When you compose database publishers together with Combine operators such as `combineLatest` or `zip`, you lose all guarantees of [data consistency](https://en.wikipedia.org/wiki/Consistency_(database_systems)).
This is because each database publisher is isolated from others: each one of them sees its own state of the database. Whenever some database change is interleaved between publisher operations, publishers will process or publish values that may not fit well together.
In other words, whenever you need to perform some database access or observation that depends on some database invariant, make sure you define one and only one database publisher instead of combining several publishers. This is how you will prevent eventual concurrent database writes from messing with your app, and introduce bugs.
To this end, remember that *all database publishers can perform several requests*.
In the example below, we are totally sure that the published `HallOfFame` values will never contain inconsistent values, because it is produced by one and only one publisher:
```swift
struct HallOfFame {
// Invariant: bestPlayers.count <= totalPlayerCount
var totalPlayerCount: Int
var bestPlayers: [Player]
}
// CORRECT: DATA CONSISTENCY GUARANTEED
let hallOfFamePublisher = ValueObservation
.tracking { db -> HallOfFame in
// 1st request
let totalPlayerCount = try Player.fetchCount(db)
// 2nd request
let bestPlayers = try Player
.order(Column("score").desc)
.limit(10)
.fetchAll(db)
// 100% guaranteed
assert(bestPlayers.count <= totalPlayerCount)
// Merge results together
return HallOfFame(
totalPlayerCount: totalPlayerCount,
bestPlayers: bestPlayers)
}
.publisher(in: dbQueue)
```
Compare with the incorrect version that combines two database publishers together:
```swift
// OK
let totalPlayerCountPublisher = ValueObservation
.tracking(Player.fetchCount)
.publisher(in: dbQueue)
// OK
let bestPlayerPublisher = ValueObservation
.tracking(Player
.order(Column("score").desc)
.limit(10)
.fetchAll)
.publisher(in: dbQueue)
// NOT OK: DATA CONSISTENCY NOT GUARANTEED
let hallOfFamePublisher = totalPlayerCountPublisher
.combineLatest(bestPlayerPublisher)
.map(HallOfFame.init(totalPlayerCount:bestPlayers))
let cancellable = hallOfFamePublisher.sink(
receiveCompletion: { completion in ... },
receiveValue: { hallOfFame in
// ASSERTION MAY FAIL if some players are deleted
// at the wrong time
assert(hallOfFame.bestPlayers.count <= hallOfFame.totalPlayerCount)
})
```
[Database Connections]: ../README.md#database-connections
[Usage]: #usage
[Asynchronous Database Access]: #asynchronous-database-access
[Combine]: https://developer.apple.com/documentation/combine
[Database Changes Observation]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseobservation
[Database Observation]: #database-observation
[Combine and Data Consistency]: #combine-and-data-consistency
[DatabaseRegionObservation]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseregionobservation
[Demo Application]: DemoApps/GRDBCombineDemo/README.md
[SQLite]: http://sqlite.org
[ValueObservation]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/valueobservation
[SharedValueObservation]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/sharedvalueobservation
[`DatabaseRegionObservation.publisher(in:)`]: #databaseregionobservationpublisherin
[`ValueObservation.publisher(in:scheduling:)`]: #valueobservationpublisherinscheduling
[`SharedValueObservation.publisher()`]: #sharedvalueobservationpublisher
[`readPublisher(receiveOn:value:)`]: #databasereaderreadpublisherreceiveonvalue
[`writePublisher(receiveOn:updates:)`]: #databasewriterwritepublisherreceiveonupdates
[`writePublisher(receiveOn:updates:thenRead:)`]: #databasewriterwritepublisherreceiveonupdatesthenread
[`migratePublisher(_:receiveOn:)`]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databasemigrator/migratepublisher(_:receiveon:)
[configured]: ../README.md#databasepool-configuration
[database pool]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databasepool
[database queue]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databasequeue
[database snapshot]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databasesnapshot
[scheduler]: https://developer.apple.com/documentation/combine/scheduler
+414
View File
@@ -0,0 +1,414 @@
Common Table Expressions
========================
[**:fire: EXPERIMENTAL**](../README.md#what-are-experimental-features)
---
**Common table expressions** (CTEs) can generally be seen as *SQL views that you define on the fly*.
A certain level of familiarity with SQL databases is helpful before you dive into this guide. The starting point is obviously the [SQLite documentation](https://sqlite.org/lang_with.html). Many CTE tutorials exist online as well, including [this good one](https://blog.expensify.com/2015/09/25/the-simplest-sqlite-common-table-expression-tutorial/).
In this guide, you will learn how to:
- [Define Common Table Expressions]
- [Embed Common Table Expressions in Requests]
- [Fetch Values From Common Table Expressions]
- Join CTEs with [Associations to Common Table Expressions]
> **Note**: most code examples will be trivial, and not very "useful". This is because the goal of this guide is to stay focused on the GRDB support for CTEs. Rich setup would just be distracting. So bring your own good ideas with you!
## Define Common Table Expressions
You will create a `CommonTableExpression` definition first. Choose a **name**, and a **request** that provides the content of the common table expression.
The CTE name is like a regular table name: pick one that does not conflict with the names of existing tables.
The CTE request can be provided as a [query interface request]:
```swift
// WITH playerName AS (SELECT name FROM player) ...
let playerNameCTE = CommonTableExpression(
named: "playerName",
request: Player.select(Column("name")))
```
You can feed a CTE with raw SQL as well (second and third examples use [SQL Interpolation]):
```swift
let name = "O'Brien"
// WITH playerName AS (SELECT 'O''Brien') ...
let playerNameCTE = CommonTableExpression(
named: "playerName",
sql: "SELECT ?", arguments: [name])
// WITH playerName AS (SELECT 'O''Brien') ...
let playerNameCTE = CommonTableExpression(
named: "playerName",
literal: "SELECT \(name)")
// WITH playerName AS (SELECT 'O''Brien') ...
let request = SQLRequest("SELECT \(name)")
let playerNameCTE = CommonTableExpression(
named: "playerName",
request: request)
```
All CTEs can be provided with explicit column names:
```swift
// WITH pair(a, b) AS (SELECT 1, 2) ...
let pairCTE = CommonTableExpression(
named: "pair",
columns: ["a", "b"],
sql: "SELECT 1, 2")
```
Recursive CTEs need the `recursive` flag. The example below selects all integers between 1 and 1000:
```swift
// WITH RECURSIVE counter(x) AS
// (VALUES(1) UNION ALL SELECT x+1 FROM counter WHERE x<1000)
let counterCTE = CommonTableExpression(
recursive: true,
named: "counter",
columns: ["x"],
sql: """
VALUES(1)
UNION ALL
SELECT x+1 FROM counter WHERE x<1000
""")
```
> **Note**: many recursive CTEs use the `UNION ALL` SQL operator. The query interface does not provide any Swift support for it, so you'll generally have to write SQL in your definitions of recursive CTEs.
## Embed Common Table Expressions in Requests
A typical SQLite query that uses a common table expression first *defines* the CTE and then *uses* the CTE by mentioning its table name. We'll see below Swift apis that match those two steps.
We will use the (simple) query below as a target. It is the query we'll want to generate in this chapter. It defines a CTE, and uses it in a subquery:
```sql
WITH playerName AS (SELECT 'O''Brien')
SELECT * FROM player
WHERE name = (SELECT * FROM playerName)
```
We first build a `CommonTableExpression`:
```swift
let name = "O'Brien"
let playerNameCTE = CommonTableExpression(
named: "playerName",
literal: "SELECT \(name)")
```
We can then embed the definition of the CTE in a [query interface request] by calling the `with(_:)` method:
```swift
// WITH playerName AS (SELECT 'O''Brien')
// SELECT * FROM player ...
let request = Player
.with(playerNameCTE)...
```
And we can then filter the `player` table with a subquery:
```swift
// WITH playerName AS (SELECT 'O''Brien')
// SELECT * FROM player
// WHERE name = (SELECT * FROM playerName)
let request = Player
.with(playerNameCTE)
.filter(Column("name") == playerNameCTE.all())
```
> **Note**: the `with(_:)` method can be called as many times as a there are common table expressions in your request.
>
> **Note**: the `with(_:)` method can be called at any time, as all request methods: `Player.with(...).filter(...).with(...)`.
>
> **Note**: the `with(_:)` method replaces any previously embedded CTE that has the same table name. This allows you to embed the same CTE several times if you feel like it.
>
> **Note**: the `CommonTableExpression.all()` method builds a regular [query interface request] for the content of the CTE (like `SELECT * FROM <cte name>`, not to be mismatched with the request that was used to define the CTE). You can filter this request, sort it, etc, like all query interface requests:
>
> ```swift
> cte.all().select(...).filter(...).group(...).order(...)
> ```
Common table expressions can also be embedded in [SQLRequest] with [SQL Interpolation]:
```swift
// WITH playerName AS (SELECT 'O''Brien')
// SELECT * FROM player
// WHERE name = (SELECT * FROM playerName)
let request: SQLRequest<Player> = """
WITH \(definitionFor: playerNameCTE)
SELECT * FROM player
WHERE name = (SELECT * FROM \(playerNameCTE))
"""
// WITH playerName AS (SELECT 'O''Brien')
// SELECT * FROM player
// WHERE name = (SELECT * FROM playerName)
let request: SQLRequest<Player> = """
WITH \(definitionFor: playerNameCTE)
SELECT * FROM player
WHERE name = (\(playerNameCTE.all()))
"""
```
Common table expressions can also be used as subqueries, when you update or delete rows in the database:
```swift
// WITH playerName AS (SELECT 'O''Brien')
// UPDATE player SET name = (SELECT * FROM playerName)
try Player
.with(playerNameCTE)
.updateAll(db, Column("name").set(to: playerNameCTE.all()))
// WITH playerName AS (SELECT 'O''Brien')
// DELETE FROM player WHERE name = (SELECT * FROM playerName)
try Player
.with(playerNameCTE)
.filter(Column("name") == playerNameCTE.all())
.deleteAll(db)
```
## Fetch Values From Common Table Expressions
In the previous chapter, a common table expression was embedded as a subquery, with the `CommonTableExpression.all()` method.
`cte.all()` builds a regular [query interface request] that you can filter, sort, etc, like all query interface requests.
You can also fetch from `cte.all()`, as long as the request is given the definition of the CTE: `cte.all().with(cte)`. In SQL, this would give: `WITH cte AS (...) SELECT * FROM cte`:
This request, of type `QueryInterfaceRequest<Row>`, can fetch raw database [rows](../README.md#row-queries):
```swift
let cte = CommonTableExpression(...)
let request = cte.all().with(cte)
let rows = try request.fetchAll(db) // [Row]
```
In order to fetch something else, such as simple [values](../README.md#value-queries), or custom [records](../README.md#records), you have two possible options:
1. Use the `asRequest(of:)` method:
```swift
let cte = CommonTableExpression(...)
let request = cte.all().with(cte).asRequest(of: Player.self)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
let players = try request.fetchAll(db) // [Player]
```
2. Provide the fetched type to the cte itself:
```swift
let cte = CommonTableExpression<Player>(...)
// ~~~~~~~~
let request = cte.all().with(cte)
let players = try request.fetchAll(db) // [Player]
```
## Associations to Common Table Expressions
GRDB [associations] define "to-one" and "to-many" relationships between two database tables. Here we will define associations between regular tables and common table expressions.
We recommend familiarity with the "joining methods", described in [Joining And Prefetching Associated Records]:
```swift
// SELECT parent.* FROM parent LEFT JOIN child ON ...
Parent.joining(optional: childAssociation)
// SELECT parent.* FROM parent JOIN child ON ...
Parent.joining(required: childAssociation)
// SELECT parent.*, child.* FROM parent LEFT JOIN child ON ...
Parent.including(optional: childAssociation)
// SELECT parent.*, child.* FROM parent JOIN child ON ...
Parent.including(required: childAssociation)
```
> **Note**: common table expressions currently only define "to-one" associations, so the `including(all:)` joining method is unavailable.
CTE associations are generally built with the `association(to:on:)` method, which needs:
- The two sides of the association: a `CommonTableExpression` instance, and another CTE or a type that conforms to the [TableRecord] protocol.
- A function that returns the condition that joins the two sides of the association.
The condition function plays the same role as the **foreign key** that defines regular table [associations] such as **BelongsTo** or **HasMany**. It accepts two [TableAlias], from which you can build a joining expression:
For example:
```swift
// An association from LeftRecord to rightCTE
let rightCTE = ...
let association = LeftRecord.association(
to: rightCTE,
on: { left, right in
left[Column("x")] = right[Column("y")]
})
```
Now this association can be used with a joining method:
```swift
// WITH rightCTE AS (...)
// SELECT leftRecord.*, rightCTE.*
// FROM leftRecord
// JOIN rightCTE ON leftRecord.x = rightCTE.y
LeftRecord
.with(rightCTE)
.including(required: association)
```
### CTE Association Example: a Chat App
As an example, let's build the classical main screen of a chat application: a list of all latest messages from all conversations.
The database schema of the chat app contains a `chat` and a `message` table. The application defines the following records:
```swift
struct Chat: Codable, FetchableRecord, PersistableRecord {
var id: Int64
...
}
struct Message: Codable, FetchableRecord, PersistableRecord {
var chatID: Int64
var date: Date
...
}
```
To feed the main app screen, we want to fetch a list of `ChatInfo` records:
```swift
struct ChatInfo: Decodable, FetchableRecord {
/// The chat
var chat: Chat
/// The latest chat message, if any
var latestMessage: Message?
}
```
The SQL request that we want to run is below. It uses an SQLite-specific [special processing](https://sqlite.org/lang_select.html) of `MAX()` that helps the selection of latest messages from all chats:
```sql
WITH latestMessage AS
(SELECT *, MAX(date) FROM message GROUP BY chatID)
SELECT chat.*, latestMessage.*
FROM chat
LEFT JOIN latestMessage ON chat.id = latestMessage.chatID
ORDER BY latestMessage.date DESC
```
We start by defining the CTE request, which loads the latest messages of all chats:
```swift
// SELECT *, MAX(date) FROM message GROUP BY chatID
let latestMessageRequest = Message
.annotated(with: max(Column("date")))
.group(Column("chatID"))
```
We can now define the CTE for the latest messages:
```swift
// WITH latestMessage AS
// (SELECT *, MAX(date) FROM message GROUP BY chatID)
let latestMessageCTE = CommonTableExpression(
named: "latestMessage",
request: latestMessageRequest)
```
The association from a chat to its latest message follows:
```swift
// ... JOIN latestMessage ON chat.id = latestMessage.chatID
let latestMessage = Chat.association(
to: latestMessageCTE,
on: { chat, latestMessage in
chat[Column("id")] == latestMessage[Column("chatID")]
})
.order(Column("date").desc)
```
The final request can now be defined:
```swift
// WITH latestMessage AS
// (SELECT *, MAX(date) FROM message GROUP BY chatID)
// SELECT chat.*, latestMessage.*
// FROM chat
// LEFT JOIN latestMessage ON chat.id = latestMessage.chatID
// ORDER BY latestMessage.date DESC
let request = Chat
.with(latestMessageCTE)
.including(optional: latestMessage)
.asRequest(of: ChatInfo.self)
```
And we can fetch the data that feeds our application screen:
```swift
let chatInfos: [ChatInfos] = try dbQueue.read { db in
try request.fetchAll(db)
}
```
> :bulb: **Tip**: the joining methods are generally type-safe: they won't allow you to join apples to oranges. This works when associations have a *precise* type. In this context, anonymous `CommonTableExpression` CTEs can work against type safety. When you want to define associations between several CTEs, and make sure the compiler will notice wrong uses of those associations, tag your common table expressions with an explicit type: `CommonTableExpression<SomeType>`.
>
> To do so, you can use an existing record type, or an ad-hoc enum. For example:
>
> ```swift
> enum CTE1 { }
> let cte1 = CommonTableExpression<CTE1>(...)
>
> enum CTE2 { }
> let cte2 = CommonTableExpression<CTE2>(...)
>
> let assoc1 = BaseRecord.association(to: cte1, on: ...) // from BaseRecord to CTE1
> let assoc2 = cte1.association(to: cte2, on: ...) // from CTE1 to CTE2
> let assoc3 = cte2.association(to: FarRecord.self, on: ...) // from CTE2 to FarRecord
>
> // WITH ...
> // SELECT base.* FROM base
> // JOIN cte1 ON ...
> // JOIN cte2 ON ...
> // JOIN far ON ...
> let request = BaseRecord
> .with(cte1).with(cte2)
> .joining(required: assoc1. // OK
> .joining(required: assoc2. // OK
> .joining(required: assoc3))) // OK
>
> // Compiler error
> let request = BaseRecord
> .joining(required: assoc2) // Not OK
> .joining(required: assoc3) // Not OK
> ```
[query interface request]: ../README.md#requests
[query interface requests]: ../README.md#requests
[SQLRequest]: ../README.md#custom-requests
[SQLiteral]: SQLInterpolation.md
[SQL Interpolation]: SQLInterpolation.md
[associations]: AssociationsBasics.md
[Joining And Prefetching Associated Records]: AssociationsBasics.md#joining-and-prefetching-associated-records
[Define Common Table Expressions]: #define-common-table-expressions
[Embed Common Table Expressions in Requests]: #embed-common-table-expressions-in-requests
[Fetch Values From Common Table Expressions]: #fetch-values-from-common-table-expressions
[Associations to Common Table Expressions]: #associations-to-common-table-expressions
[TableRecord]: ../README.md#tablerecord-protocol
[TableAlias]: AssociationsBasics.md#table-aliases
+4
View File
@@ -0,0 +1,4 @@
:twisted_rightwards_arrows: Concurrency
=======================================
This guide [has moved](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/concurrency).
+19 -15
View File
@@ -3,23 +3,25 @@ Custom SQLite Builds
By default, GRDB uses the version of SQLite that ships with the target operating system.
**You can build GRDB with a custom build of [SQLite 3.19.2](https://www.sqlite.org/changes.html).**
**You can build GRDB with a custom build of [SQLite 3.44.0](https://www.sqlite.org/changes.html).**
A custom SQLite build can activate extra SQLite features, and extra GRDB features as well, such as support for the [FTS5 full-text search engine](../../../#full-text-search), and [SQLite Pre-Update Hooks](../../../#support-for-sqlite-pre-update-hooks).
A custom SQLite build can activate extra SQLite features, and extra GRDB features as well, such as support for the [FTS5 full-text search engine](../../../#full-text-search), and [SQLite Pre-Update Hooks](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/transactionobserver).
GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfalling/SQLiteLib), which uses the same SQLite configuration as the one used by Apple in its operating systems, and lets you add extra compilation options that leverage the features you need.
**To install GRDB with a custom SQLite build:**
1. Clone the GRDB.swift git repository, checkout the latest tagged version, and download SQLite sources:
1. Clone the GRDB git repository, checkout the latest tagged version:
```sh
cd [GRDB.swift directory]
git checkout v1.2
cd [GRDB directory]
git checkout [latest tag]
git submodule update --init SQLiteCustom/src
````
```
2. Choose your [extra compilation options](https://www.sqlite.org/compile.html). For example, `SQLITE_ENABLE_FTS5` and `SQLITE_ENABLE_PREUPDATE_HOOK`.
2. Choose your [extra compilation options](https://www.sqlite.org/compile.html). For example, `SQLITE_ENABLE_FTS5`, `SQLITE_ENABLE_PREUPDATE_HOOK`.
It is recommended that you enable the `SQLITE_ENABLE_SNAPSHOT` option. It allows GRDB to optimize [ValueObservation](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/valueobservation) when you use a [Database Pool](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databasepool).
3. Create a folder named `GRDBCustomSQLite` somewhere in your project directory.
@@ -30,7 +32,7 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
```xcconfig
// As many -D options as there are custom SQLite compilation options
// Note: there is no space between -D and the option name.
CUSTOM_SQLLIBRARY_CFLAGS = -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_PREUPDATE_HOOK
CUSTOM_SQLLIBRARY_CFLAGS = -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_FTS5
```
- `GRDBCustomSQLite-USER.xcconfig`: this file lets GRDB know about extra compilation flags, and enables extra GRDB APIs.
@@ -38,15 +40,15 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
```xcconfig
// As many -D options as there are custom SQLite compilation options
// Note: there is one space between -D and the option name.
CUSTOM_OTHER_SWIFT_FLAGS = -D SQLITE_ENABLE_FTS5 -D SQLITE_ENABLE_PREUPDATE_HOOK
CUSTOM_OTHER_SWIFT_FLAGS = -D SQLITE_ENABLE_SNAPSHOT -D SQLITE_ENABLE_FTS5
```
- `GRDBCustomSQLite-USER.h`: this file lets your application know about extra compilation flags.
```c
// As many #define as there are custom SQLite compilation options
#define SQLITE_ENABLE_SNAPSHOT
#define SQLITE_ENABLE_FTS5
#define SQLITE_ENABLE_PREUPDATE_HOOK
```
- `GRDBCustomSQLite-INSTALL.sh`: this file installs the three other files.
@@ -60,7 +62,7 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
# !! MODIFY THESE TO MATCH YOUR PROJECT HIERARCHY !!
#######################################################
# The path to the folder containing GRDB.xcodeproj:
# The path to the folder containing GRDBCustom.xcodeproj:
GRDB_SOURCE_PATH="${PROJECT_DIR}/GRDB"
# The path to your custom "SQLiteLib-USER.xcconfig":
@@ -107,11 +109,11 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
Modify the top of `GRDBCustomSQLite-INSTALL.sh` file so that it contains correct paths.
5. Embed the `GRDB.xcodeproj` project in your own project.
5. Embed the `GRDBCustom.xcodeproj` project in your own project.
6. Add the `GRDBCustomSQLiteOSX` or `GRDBCustomSQLiteiOS` target in the **Target Dependencies** section of the **Build Phases** tab of your **application target**.
6. Add the `GRDBCustom` target in the **Target Dependencies** section of the **Build Phases** tab of your **application target**.
7. Add the `GRDBCustomSQLite.framework` from the targetted platform to the **Embedded Binaries** section of the **General** tab of your **application target**.
7. Add the `GRDBCustom.framework` from the targeted platform to the **Embedded Binaries** section of the **General** tab of your **application target**.
8. Add a Run Script phase for your target in the **Pre-actions** section of the **Build** tab of your **application scheme**:
@@ -120,13 +122,15 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
```
The path should be the path to your `GRDBCustomSQLite-INSTALL.sh` file.
Select your application target in the "Provide build settings from" menu.
9. Check the "Shared" checkbox of your application scheme (this lets you commit the pre-action in your Version Control System).
Now you can use GRDB with your custom SQLite build:
```swift
import GRDBCustomSQLite
import GRDB
let dbQueue = try DatabaseQueue(...)
```
@@ -0,0 +1,609 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
56026CAC25B8A7EF00D1DF3F /* PlayerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56026CAA25B8A7EF00D1DF3F /* PlayerTests.swift */; };
56026CAD25B8A7EF00D1DF3F /* AppDatabaseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56026CAB25B8A7EF00D1DF3F /* AppDatabaseTests.swift */; };
56519DCA274FC8E900ED16D8 /* GRDBQuery in Frameworks */ = {isa = PBXBuildFile; productRef = 56519DC9274FC8E900ED16D8 /* GRDBQuery */; };
5671723A261B23C800423B6F /* PlayerList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56717239261B23C800423B6F /* PlayerList.swift */; };
56717252261B334D00423B6F /* PlayerRequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56717251261B334D00423B6F /* PlayerRequestTests.swift */; };
567C3E1A2520B6DE0011F6E9 /* GRDBAsyncDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E192520B6DE0011F6E9 /* GRDBAsyncDemoApp.swift */; };
567C3E1E2520B6DF0011F6E9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E1D2520B6DF0011F6E9 /* Assets.xcassets */; };
567C3E212520B6DF0011F6E9 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E202520B6DF0011F6E9 /* Preview Assets.xcassets */; };
567C3E5D2520B75C0011F6E9 /* Player.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E532520B75C0011F6E9 /* Player.swift */; };
567C3E5E2520B75C0011F6E9 /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E542520B75C0011F6E9 /* Persistence.swift */; };
567C3E612520B75D0011F6E9 /* PlayerFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E592520B75C0011F6E9 /* PlayerFormView.swift */; };
567C3E622520B75D0011F6E9 /* AppView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E5A2520B75C0011F6E9 /* AppView.swift */; };
567C3E632520B75D0011F6E9 /* PlayerCreationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E5B2520B75C0011F6E9 /* PlayerCreationView.swift */; };
567C3E642520B75D0011F6E9 /* PlayerEditionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E5C2520B75C0011F6E9 /* PlayerEditionView.swift */; };
567C3E662520B7880011F6E9 /* AppDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E652520B7880011F6E9 /* AppDatabase.swift */; };
567C3E792520BB650011F6E9 /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E752520BB650011F6E9 /* Localizable.stringsdict */; };
567C3E7A2520BB650011F6E9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E772520BB650011F6E9 /* LaunchScreen.storyboard */; };
56B6D1092619EC1B003CC455 /* PlayerRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B6D1082619EC1B003CC455 /* PlayerRequest.swift */; };
56F8A13527359A5A0011ACBE /* GRDB in Frameworks */ = {isa = PBXBuildFile; productRef = 56F8A13427359A5A0011ACBE /* GRDB */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
56026C9D25B8A7D000D1DF3F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E0E2520B6DE0011F6E9 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 567C3E152520B6DE0011F6E9;
remoteInfo = GRDBAsyncDemo;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
567C3E502520B70E0011F6E9 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
56026C9825B8A7D000D1DF3F /* GRDBAsyncDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GRDBAsyncDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
56026C9C25B8A7D000D1DF3F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
56026CAA25B8A7EF00D1DF3F /* PlayerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerTests.swift; sourceTree = "<group>"; };
56026CAB25B8A7EF00D1DF3F /* AppDatabaseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDatabaseTests.swift; sourceTree = "<group>"; };
56717239261B23C800423B6F /* PlayerList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerList.swift; sourceTree = "<group>"; };
56717251261B334D00423B6F /* PlayerRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerRequestTests.swift; sourceTree = "<group>"; };
567C3E162520B6DE0011F6E9 /* GRDBAsyncDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GRDBAsyncDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
567C3E192520B6DE0011F6E9 /* GRDBAsyncDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GRDBAsyncDemoApp.swift; sourceTree = "<group>"; };
567C3E1D2520B6DF0011F6E9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
567C3E202520B6DF0011F6E9 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
567C3E222520B6DF0011F6E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
567C3E532520B75C0011F6E9 /* Player.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Player.swift; sourceTree = "<group>"; };
567C3E542520B75C0011F6E9 /* Persistence.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = "<group>"; };
567C3E592520B75C0011F6E9 /* PlayerFormView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerFormView.swift; sourceTree = "<group>"; };
567C3E5A2520B75C0011F6E9 /* AppView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppView.swift; sourceTree = "<group>"; };
567C3E5B2520B75C0011F6E9 /* PlayerCreationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerCreationView.swift; sourceTree = "<group>"; };
567C3E5C2520B75C0011F6E9 /* PlayerEditionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerEditionView.swift; sourceTree = "<group>"; };
567C3E652520B7880011F6E9 /* AppDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDatabase.swift; sourceTree = "<group>"; };
567C3E762520BB650011F6E9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
567C3E782520BB650011F6E9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
56B6D1082619EC1B003CC455 /* PlayerRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerRequest.swift; sourceTree = "<group>"; };
56F8A12E27359A350011ACBE /* GRDB.swift */ = {isa = PBXFileReference; lastKnownFileType = folder; name = GRDB.swift; path = ../../..; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
56026C9525B8A7D000D1DF3F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
567C3E132520B6DE0011F6E9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
56519DCA274FC8E900ED16D8 /* GRDBQuery in Frameworks */,
56F8A13527359A5A0011ACBE /* GRDB in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
56026C9925B8A7D000D1DF3F /* GRDBAsyncDemoTests */ = {
isa = PBXGroup;
children = (
56026C9C25B8A7D000D1DF3F /* Info.plist */,
56026CAB25B8A7EF00D1DF3F /* AppDatabaseTests.swift */,
56717251261B334D00423B6F /* PlayerRequestTests.swift */,
56026CAA25B8A7EF00D1DF3F /* PlayerTests.swift */,
);
path = GRDBAsyncDemoTests;
sourceTree = "<group>";
};
56185BC125B8047D00B9C30F /* Resources */ = {
isa = PBXGroup;
children = (
567C3E1D2520B6DF0011F6E9 /* Assets.xcassets */,
567C3E772520BB650011F6E9 /* LaunchScreen.storyboard */,
567C3E752520BB650011F6E9 /* Localizable.stringsdict */,
);
path = Resources;
sourceTree = "<group>";
};
567C3E0D2520B6DE0011F6E9 = {
isa = PBXGroup;
children = (
567C3E182520B6DE0011F6E9 /* GRDBAsyncDemo */,
56026C9925B8A7D000D1DF3F /* GRDBAsyncDemoTests */,
567C3E172520B6DE0011F6E9 /* Products */,
567C3E4D2520B70E0011F6E9 /* Frameworks */,
56F8A12E27359A350011ACBE /* GRDB.swift */,
);
sourceTree = "<group>";
};
567C3E172520B6DE0011F6E9 /* Products */ = {
isa = PBXGroup;
children = (
567C3E162520B6DE0011F6E9 /* GRDBAsyncDemo.app */,
56026C9825B8A7D000D1DF3F /* GRDBAsyncDemoTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
567C3E182520B6DE0011F6E9 /* GRDBAsyncDemo */ = {
isa = PBXGroup;
children = (
567C3E222520B6DF0011F6E9 /* Info.plist */,
567C3E652520B7880011F6E9 /* AppDatabase.swift */,
567C3E192520B6DE0011F6E9 /* GRDBAsyncDemoApp.swift */,
567C3E542520B75C0011F6E9 /* Persistence.swift */,
567C3E532520B75C0011F6E9 /* Player.swift */,
56B6D1082619EC1B003CC455 /* PlayerRequest.swift */,
567C3E1F2520B6DF0011F6E9 /* Preview Content */,
56185BC125B8047D00B9C30F /* Resources */,
567C3E582520B75C0011F6E9 /* Views */,
);
path = GRDBAsyncDemo;
sourceTree = "<group>";
};
567C3E1F2520B6DF0011F6E9 /* Preview Content */ = {
isa = PBXGroup;
children = (
567C3E202520B6DF0011F6E9 /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "<group>";
};
567C3E4D2520B70E0011F6E9 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
567C3E582520B75C0011F6E9 /* Views */ = {
isa = PBXGroup;
children = (
567C3E5A2520B75C0011F6E9 /* AppView.swift */,
567C3E5B2520B75C0011F6E9 /* PlayerCreationView.swift */,
567C3E5C2520B75C0011F6E9 /* PlayerEditionView.swift */,
567C3E592520B75C0011F6E9 /* PlayerFormView.swift */,
56717239261B23C800423B6F /* PlayerList.swift */,
);
path = Views;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
56026C9725B8A7D000D1DF3F /* GRDBAsyncDemoTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 56026CA825B8A7D000D1DF3F /* Build configuration list for PBXNativeTarget "GRDBAsyncDemoTests" */;
buildPhases = (
56026C9425B8A7D000D1DF3F /* Sources */,
56026C9525B8A7D000D1DF3F /* Frameworks */,
56026C9625B8A7D000D1DF3F /* Resources */,
);
buildRules = (
);
dependencies = (
56026C9E25B8A7D000D1DF3F /* PBXTargetDependency */,
);
name = GRDBAsyncDemoTests;
productName = GRDBAsyncDemoTests;
productReference = 56026C9825B8A7D000D1DF3F /* GRDBAsyncDemoTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
567C3E152520B6DE0011F6E9 /* GRDBAsyncDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 567C3E252520B6DF0011F6E9 /* Build configuration list for PBXNativeTarget "GRDBAsyncDemo" */;
buildPhases = (
567C3E122520B6DE0011F6E9 /* Sources */,
567C3E132520B6DE0011F6E9 /* Frameworks */,
567C3E142520B6DE0011F6E9 /* Resources */,
567C3E502520B70E0011F6E9 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
56F8A13127359A540011ACBE /* PBXTargetDependency */,
);
name = GRDBAsyncDemo;
packageProductDependencies = (
56F8A13427359A5A0011ACBE /* GRDB */,
56519DC9274FC8E900ED16D8 /* GRDBQuery */,
);
productName = GRBCombineDemo;
productReference = 567C3E162520B6DE0011F6E9 /* GRDBAsyncDemo.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
567C3E0E2520B6DE0011F6E9 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1250;
LastUpgradeCheck = 1200;
TargetAttributes = {
56026C9725B8A7D000D1DF3F = {
CreatedOnToolsVersion = 12.3;
TestTargetID = 567C3E152520B6DE0011F6E9;
};
567C3E152520B6DE0011F6E9 = {
CreatedOnToolsVersion = 12.0;
};
};
};
buildConfigurationList = 567C3E112520B6DE0011F6E9 /* Build configuration list for PBXProject "GRDBAsyncDemo" */;
compatibilityVersion = "Xcode 12.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 567C3E0D2520B6DE0011F6E9;
packageReferences = (
56519DC8274FC8E900ED16D8 /* XCRemoteSwiftPackageReference "GRDBQuery" */,
);
productRefGroup = 567C3E172520B6DE0011F6E9 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
567C3E152520B6DE0011F6E9 /* GRDBAsyncDemo */,
56026C9725B8A7D000D1DF3F /* GRDBAsyncDemoTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
56026C9625B8A7D000D1DF3F /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
567C3E142520B6DE0011F6E9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
567C3E212520B6DF0011F6E9 /* Preview Assets.xcassets in Resources */,
567C3E7A2520BB650011F6E9 /* LaunchScreen.storyboard in Resources */,
567C3E1E2520B6DF0011F6E9 /* Assets.xcassets in Resources */,
567C3E792520BB650011F6E9 /* Localizable.stringsdict in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
56026C9425B8A7D000D1DF3F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
56026CAC25B8A7EF00D1DF3F /* PlayerTests.swift in Sources */,
56026CAD25B8A7EF00D1DF3F /* AppDatabaseTests.swift in Sources */,
56717252261B334D00423B6F /* PlayerRequestTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
567C3E122520B6DE0011F6E9 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
567C3E5E2520B75C0011F6E9 /* Persistence.swift in Sources */,
567C3E5D2520B75C0011F6E9 /* Player.swift in Sources */,
56B6D1092619EC1B003CC455 /* PlayerRequest.swift in Sources */,
5671723A261B23C800423B6F /* PlayerList.swift in Sources */,
567C3E612520B75D0011F6E9 /* PlayerFormView.swift in Sources */,
567C3E632520B75D0011F6E9 /* PlayerCreationView.swift in Sources */,
567C3E662520B7880011F6E9 /* AppDatabase.swift in Sources */,
567C3E622520B75D0011F6E9 /* AppView.swift in Sources */,
567C3E642520B75D0011F6E9 /* PlayerEditionView.swift in Sources */,
567C3E1A2520B6DE0011F6E9 /* GRDBAsyncDemoApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
56026C9E25B8A7D000D1DF3F /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 567C3E152520B6DE0011F6E9 /* GRDBAsyncDemo */;
targetProxy = 56026C9D25B8A7D000D1DF3F /* PBXContainerItemProxy */;
};
56F8A13127359A540011ACBE /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = 56F8A13027359A540011ACBE /* GRDB */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
567C3E752520BB650011F6E9 /* Localizable.stringsdict */ = {
isa = PBXVariantGroup;
children = (
567C3E762520BB650011F6E9 /* en */,
);
name = Localizable.stringsdict;
sourceTree = "<group>";
};
567C3E772520BB650011F6E9 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
567C3E782520BB650011F6E9 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
56026C9F25B8A7D000D1DF3F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GRDBAsyncDemoTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBAsyncDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBAsyncDemo.app/GRDBAsyncDemo";
};
name = Debug;
};
56026CA025B8A7D000D1DF3F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GRDBAsyncDemoTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBAsyncDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBAsyncDemo.app/GRDBAsyncDemo";
};
name = Release;
};
567C3E232520B6DF0011F6E9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
567C3E242520B6DF0011F6E9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
567C3E262520B6DF0011F6E9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"GRDBAsyncDemo/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = GRDBAsyncDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBAsyncDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
567C3E272520B6DF0011F6E9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"GRDBAsyncDemo/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = GRDBAsyncDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBAsyncDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
56026CA825B8A7D000D1DF3F /* Build configuration list for PBXNativeTarget "GRDBAsyncDemoTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
56026C9F25B8A7D000D1DF3F /* Debug */,
56026CA025B8A7D000D1DF3F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
567C3E112520B6DE0011F6E9 /* Build configuration list for PBXProject "GRDBAsyncDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
567C3E232520B6DF0011F6E9 /* Debug */,
567C3E242520B6DF0011F6E9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
567C3E252520B6DF0011F6E9 /* Build configuration list for PBXNativeTarget "GRDBAsyncDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
567C3E262520B6DF0011F6E9 /* Debug */,
567C3E272520B6DF0011F6E9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
56519DC8274FC8E900ED16D8 /* XCRemoteSwiftPackageReference "GRDBQuery" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/groue/GRDBQuery";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.6.0;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
56519DC9274FC8E900ED16D8 /* GRDBQuery */ = {
isa = XCSwiftPackageProductDependency;
package = 56519DC8274FC8E900ED16D8 /* XCRemoteSwiftPackageReference "GRDBQuery" */;
productName = GRDBQuery;
};
56F8A13027359A540011ACBE /* GRDB */ = {
isa = XCSwiftPackageProductDependency;
productName = GRDB;
};
56F8A13427359A5A0011ACBE /* GRDB */ = {
isa = XCSwiftPackageProductDependency;
productName = GRDB;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 567C3E0E2520B6DE0011F6E9 /* Project object */;
}
@@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:GRDBiOS.xcodeproj">
location = "self:">
</FileRef>
</Workspace>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "grdbquery",
"kind" : "remoteSourceControl",
"location" : "https://github.com/groue/GRDBQuery",
"state" : {
"revision" : "aefc0d7e7a64e841da33e1c8be7429da1bd9b5d6",
"version" : "0.6.0"
}
}
],
"version" : 2
}
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -14,10 +14,10 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3BA7FFD1CFB25E4003DC1BA"
BuildableName = "GRDBCustomSQLite.framework"
BlueprintName = "GRDBCustomSQLiteiOS"
ReferencedContainer = "container:GRDB.xcodeproj">
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
BuildableName = "GRDBAsyncDemo.app"
BlueprintName = "GRDBAsyncDemo"
ReferencedContainer = "container:GRDBAsyncDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
@@ -29,27 +29,17 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3BA80401CFB2AD7003DC1BA"
BuildableName = "GRDBCustomSQLiteiOSTests.xctest"
BlueprintName = "GRDBCustomSQLiteiOSTests"
ReferencedContainer = "container:GRDB.xcodeproj">
BlueprintIdentifier = "56026C9725B8A7D000D1DF3F"
BuildableName = "GRDBAsyncDemoTests.xctest"
BlueprintName = "GRDBAsyncDemoTests"
ReferencedContainer = "container:GRDBAsyncDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3BA7FFD1CFB25E4003DC1BA"
BuildableName = "GRDBCustomSQLite.framework"
BlueprintName = "GRDBCustomSQLiteiOS"
ReferencedContainer = "container:GRDB.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -61,17 +51,23 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3BA7FFD1CFB25E4003DC1BA"
BuildableName = "GRDBCustomSQLite.framework"
BlueprintName = "GRDBCustomSQLiteiOS"
ReferencedContainer = "container:GRDB.xcodeproj">
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
BuildableName = "GRDBAsyncDemo.app"
BlueprintName = "GRDBAsyncDemo"
ReferencedContainer = "container:GRDBAsyncDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "SQL_TRACE"
value = "1"
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -79,15 +75,16 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3BA7FFD1CFB25E4003DC1BA"
BuildableName = "GRDBCustomSQLite.framework"
BlueprintName = "GRDBCustomSQLiteiOS"
ReferencedContainer = "container:GRDB.xcodeproj">
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
BuildableName = "GRDBAsyncDemo.app"
BlueprintName = "GRDBAsyncDemo"
ReferencedContainer = "container:GRDBAsyncDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
@@ -0,0 +1,235 @@
import Foundation
import GRDB
import os.log
/// A database of players.
///
/// You create an `AppDatabase` with a connection to an SQLite database
/// (see <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseconnections>).
///
/// Create those connections with a configuration returned from
/// `AppDatabase/makeConfiguration(_:)`.
///
/// For example:
///
/// ```swift
/// // Create an in-memory AppDatabase
/// let config = AppDatabase.makeConfiguration()
/// let dbQueue = try DatabaseQueue(configuration: config)
/// let appDatabase = try AppDatabase(dbQueue)
/// ```
struct AppDatabase {
/// Creates an `AppDatabase`, and makes sure the database schema
/// is ready.
///
/// - important: Create the `DatabaseWriter` with a configuration
/// returned by ``makeConfiguration(_:)``.
init(_ dbWriter: any DatabaseWriter) throws {
self.dbWriter = dbWriter
try migrator.migrate(dbWriter)
}
/// Provides access to the database.
///
/// Application can use a `DatabasePool`, while SwiftUI previews and tests
/// can use a fast in-memory `DatabaseQueue`.
///
/// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseconnections>
private let dbWriter: any DatabaseWriter
}
// MARK: - Database Configuration
extension AppDatabase {
private static let sqlLogger = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "SQL")
/// Returns a database configuration suited for `PlayerRepository`.
///
/// SQL statements are logged if the `SQL_TRACE` environment variable
/// is set.
///
/// - parameter base: A base configuration.
public static func makeConfiguration(_ base: Configuration = Configuration()) -> Configuration {
var config = base
// An opportunity to add required custom SQL functions or
// collations, if needed:
// config.prepareDatabase { db in
// db.add(function: ...)
// }
// Log SQL statements if the `SQL_TRACE` environment variable is set.
// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/database/trace(options:_:)>
if ProcessInfo.processInfo.environment["SQL_TRACE"] != nil {
config.prepareDatabase { db in
db.trace {
// It's ok to log statements publicly. Sensitive
// information (statement arguments) are not logged
// unless config.publicStatementArguments is set
// (see below).
os_log("%{public}@", log: sqlLogger, type: .debug, String(describing: $0))
}
}
}
#if DEBUG
// Protect sensitive information by enabling verbose debugging in
// DEBUG builds only.
// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/configuration/publicstatementarguments>
config.publicStatementArguments = true
#endif
return config
}
}
// MARK: - Database Migrations
extension AppDatabase {
/// The DatabaseMigrator that defines the database schema.
///
/// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/migrations>
private var migrator: DatabaseMigrator {
var migrator = DatabaseMigrator()
#if DEBUG
// Speed up development by nuking the database when migrations change
// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/migrations>
migrator.eraseDatabaseOnSchemaChange = true
#endif
migrator.registerMigration("createPlayer") { db in
// Create a table
// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseschema>
try db.create(table: "player") { t in
t.autoIncrementedPrimaryKey("id")
t.column("name", .text).notNull()
t.column("score", .integer).notNull()
}
}
// Migrations for future application versions will be inserted here:
// migrator.registerMigration(...) { db in
// ...
// }
return migrator
}
}
// MARK: - Database Access: Writes
// The write methods execute invariant-preserving database transactions.
extension AppDatabase {
/// A validation error that prevents some players from being saved into
/// the database.
enum ValidationError: LocalizedError {
case missingName
var errorDescription: String? {
switch self {
case .missingName:
return "Please provide a name"
}
}
}
/// Saves (inserts or updates) a player. When the method returns, the
/// player is present in the database, and its id is not nil.
func savePlayer(_ player: inout Player) async throws {
if player.name.isEmpty {
throw ValidationError.missingName
}
player = try await dbWriter.write { [player] db in
try player.saved(db)
}
}
/// Delete the specified players
func deletePlayers(ids: [Int64]) async throws {
try await dbWriter.write { db in
_ = try Player.deleteAll(db, ids: ids)
}
}
/// Delete all players
func deleteAllPlayers() async throws {
try await dbWriter.write { db in
_ = try Player.deleteAll(db)
}
}
/// Refresh all players (by performing some random changes, for demo purpose).
func refreshPlayers() async throws {
try await dbWriter.write { db in
if try Player.all().isEmpty(db) {
// When database is empty, insert new random players
try createRandomPlayers(db)
} else {
// Insert a player
if Bool.random() {
_ = try Player.makeRandom().inserted(db) // insert but ignore inserted id
}
// Delete a random player
if Bool.random() {
try Player.order(sql: "RANDOM()").limit(1).deleteAll(db)
}
// Update some players
for var player in try Player.fetchAll(db) where Bool.random() {
try player.updateChanges(db) {
$0.score = Player.randomScore()
}
}
}
}
}
/// Create random players if the database is empty.
func createRandomPlayersIfEmpty() throws {
try dbWriter.write { db in
if try Player.all().isEmpty(db) {
try createRandomPlayers(db)
}
}
}
private static let uiTestPlayers = [
Player(id: nil, name: "Arthur", score: 5),
Player(id: nil, name: "Barbara", score: 6),
Player(id: nil, name: "Craig", score: 8),
Player(id: nil, name: "David", score: 4),
Player(id: nil, name: "Elena", score: 1),
Player(id: nil, name: "Frederik", score: 2),
Player(id: nil, name: "Gilbert", score: 7),
Player(id: nil, name: "Henriette", score: 3)]
func createPlayersForUITests() throws {
try dbWriter.write { db in
try AppDatabase.uiTestPlayers.forEach { player in
_ = try player.inserted(db) // insert but ignore inserted id
}
}
}
/// Support for `createRandomPlayersIfEmpty()` and `refreshPlayers()`.
private func createRandomPlayers(_ db: Database) throws {
for _ in 0..<8 {
_ = try Player.makeRandom().inserted(db) // insert but ignore inserted id
}
}
}
// MARK: - Database Access: Reads
// This demo app does not provide any specific reading method, and instead
// gives an unrestricted read-only access to the rest of the application.
// In your app, you are free to choose another path, and define focused
// reading methods.
extension AppDatabase {
/// Provides a read-only access to the database
var reader: DatabaseReader {
dbWriter
}
}
@@ -0,0 +1,40 @@
import GRDBQuery
import SwiftUI
@main
struct GRDBAsyncDemoApp: App {
var body: some Scene {
WindowGroup {
AppView().environment(\.appDatabase, .shared)
}
}
}
// MARK: - Give SwiftUI access to the database
//
// Define a new environment key that grants access to an AppDatabase.
//
// The technique is documented at
// <https://developer.apple.com/documentation/swiftui/environmentkey>.
private struct AppDatabaseKey: EnvironmentKey {
static var defaultValue: AppDatabase { .empty() }
}
extension EnvironmentValues {
var appDatabase: AppDatabase {
get { self[AppDatabaseKey.self] }
set { self[AppDatabaseKey.self] = newValue }
}
}
// In this demo app, views observe the database with the @Query property
// wrapper, defined in the GRDBQuery package. Its documentation recommends to
// define a dedicated initializer for `appDatabase` access, so we comply:
extension Query where Request.DatabaseContext == AppDatabase {
/// Convenience initializer for requests that feed from `AppDatabase`.
init(_ request: Request) {
self.init(request, in: \.appDatabase)
}
}
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchScreen</key>
<dict/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
@@ -0,0 +1,77 @@
import Foundation
import GRDB
extension AppDatabase {
/// The database for the application
static let shared = makeShared()
private static func makeShared() -> AppDatabase {
do {
// Apply recommendations from
// <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseconnections>
//
// Create the "Application Support/Database" directory if needed
let fileManager = FileManager.default
let appSupportURL = try fileManager.url(
for: .applicationSupportDirectory, in: .userDomainMask,
appropriateFor: nil, create: true)
let directoryURL = appSupportURL.appendingPathComponent("Database", isDirectory: true)
// Support for tests: delete the database if requested
if CommandLine.arguments.contains("-reset") {
try? fileManager.removeItem(at: directoryURL)
}
// Create the database folder if needed
try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true)
// Open or create the database
let databaseURL = directoryURL.appendingPathComponent("db.sqlite")
NSLog("Database stored at \(databaseURL.path)")
let dbPool = try DatabasePool(
path: databaseURL.path,
// Use default AppDatabase configuration
configuration: AppDatabase.makeConfiguration())
// Create the AppDatabase
let appDatabase = try AppDatabase(dbPool)
// Prepare the database with test fixtures if requested
if CommandLine.arguments.contains("-fixedTestData") {
try appDatabase.createPlayersForUITests()
} else {
// Otherwise, populate the database if it is empty, for better
// demo purpose.
try appDatabase.createRandomPlayersIfEmpty()
}
return appDatabase
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate.
//
// Typical reasons for an error here include:
// * The parent directory cannot be created, or disallows writing.
// * The database is not accessible, due to permissions or data protection when the device is locked.
// * The device is out of space.
// * The database could not be migrated to its latest schema version.
// Check the error message to determine what the actual problem was.
fatalError("Unresolved error \(error)")
}
}
/// Creates an empty database for SwiftUI previews
static func empty() -> AppDatabase {
// Connect to an in-memory database
// See https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseconnections
let dbQueue = try! DatabaseQueue(configuration: AppDatabase.makeConfiguration())
return try! AppDatabase(dbQueue)
}
/// Creates a database full of random players for SwiftUI previews
static func random() -> AppDatabase {
let appDatabase = empty()
try! appDatabase.createRandomPlayersIfEmpty()
return appDatabase
}
}
@@ -0,0 +1,105 @@
import GRDB
/// The Player struct.
///
/// Identifiable conformance supports SwiftUI list animations, and type-safe
/// GRDB primary key methods.
/// Equatable conformance supports tests.
struct Player: Identifiable, Equatable {
/// The player id.
///
/// Int64 is the recommended type for auto-incremented database ids.
/// Use nil for players that are not inserted yet in the database.
var id: Int64?
var name: String
var score: Int
}
extension Player {
private static let names = [
"Arthur", "Anita", "Barbara", "Bernard", "Craig", "Chiara", "David",
"Dean", "Éric", "Elena", "Fatima", "Frederik", "Gilbert", "Georgette",
"Henriette", "Hassan", "Ignacio", "Irene", "Julie", "Jack", "Karl",
"Kristel", "Louis", "Liz", "Masashi", "Mary", "Noam", "Nicole",
"Ophelie", "Oleg", "Pascal", "Patricia", "Quentin", "Quinn", "Raoul",
"Rachel", "Stephan", "Susie", "Tristan", "Tatiana", "Ursule", "Urbain",
"Victor", "Violette", "Wilfried", "Wilhelmina", "Yvon", "Yann",
"Zazie", "Zoé"]
/// Creates a new player with empty name and zero score
static func new() -> Player {
Player(id: nil, name: "", score: 0)
}
/// Creates a new player with random name and random score
static func makeRandom() -> Player {
Player(id: nil, name: randomName(), score: randomScore())
}
/// Returns a random name
static func randomName() -> String {
names.randomElement()!
}
/// Returns a random score
static func randomScore() -> Int {
10 * Int.random(in: 0...100)
}
}
// MARK: - Persistence
/// Make Player a Codable Record.
///
/// See <https://github.com/groue/GRDB.swift/blob/master/README.md#records>
extension Player: Codable, FetchableRecord, MutablePersistableRecord {
// Define database columns from CodingKeys
fileprivate enum Columns {
static let name = Column(CodingKeys.name)
static let score = Column(CodingKeys.score)
}
/// Updates a player id after it has been inserted in the database.
mutating func didInsert(_ inserted: InsertionSuccess) {
id = inserted.rowID
}
}
// MARK: - Player Database Requests
/// Define some player requests used by the application.
///
/// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/recordrecommendedpractices>
extension DerivableRequest<Player> {
/// A request of players ordered by name.
///
/// For example:
///
/// let players: [Player] = try dbWriter.read { db in
/// try Player.all().orderedByName().fetchAll(db)
/// }
func orderedByName() -> Self {
// Sort by name in a localized case insensitive fashion
// See https://github.com/groue/GRDB.swift/blob/master/README.md#string-comparison
order(Player.Columns.name.collating(.localizedCaseInsensitiveCompare))
}
/// A request of players ordered by score.
///
/// For example:
///
/// let players: [Player] = try dbWriter.read { db in
/// try Player.all().orderedByScore().fetchAll(db)
/// }
/// let bestPlayer: Player? = try dbWriter.read { db in
/// try Player.all().orderedByScore().fetchOne(db)
/// }
func orderedByScore() -> Self {
// Sort by descending score, and then by name, in a
// localized case insensitive fashion
// See https://github.com/groue/GRDB.swift/blob/master/README.md#string-comparison
order(
Player.Columns.score.desc,
Player.Columns.name.collating(.localizedCaseInsensitiveCompare))
}
}
@@ -0,0 +1,55 @@
import Combine
import GRDB
import GRDBQuery
/// A player request can be used with the `@Query` property wrapper in order to
/// feed a view with a list of players.
///
/// For example:
///
/// struct MyView: View {
/// @Query(PlayerRequest(ordering: .byName)) private var players: [Player]
///
/// var body: some View {
/// List(players) { player in ... )
/// }
/// }
struct PlayerRequest: Queryable {
enum Ordering {
case byScore
case byName
}
/// The ordering used by the player request.
var ordering: Ordering
// MARK: - Queryable Implementation
static var defaultValue: [Player] { [] }
func publisher(in appDatabase: AppDatabase) -> AnyPublisher<[Player], Error> {
// Build the publisher from the general-purpose read-only access
// granted by `appDatabase.reader`.
// Some apps will prefer to call a dedicated method of `appDatabase`.
ValueObservation
.tracking(fetchValue(_:))
.publisher(
in: appDatabase.reader,
// The `.immediate` scheduling feeds the view right on
// subscription, and avoids an undesired animation when the
// application starts.
scheduling: .immediate)
.eraseToAnyPublisher()
}
// This method is not required by Queryable, but it makes it easier
// to test PlayerRequest.
func fetchValue(_ db: Database) throws -> [Player] {
switch ordering {
case .byScore:
return try Player.all().orderedByScore().fetchAll(db)
case .byName:
return try Player.all().orderedByName().fetchAll(db)
}
}
}
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,91 +1,112 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon_20pt@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon_20pt@3x.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon_29pt@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon_29pt@3x.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon_40pt@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon_40pt@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-60@2x.png",
"filename" : "icon_60pt@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-60@3x.png",
"filename" : "icon_60pt@3x.png",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"idiom" : "ipad",
"filename" : "icon_20pt.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"idiom" : "ipad",
"filename" : "icon_20pt@2x-1.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon_29pt.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon_29pt@2x-1.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"idiom" : "ipad",
"filename" : "icon_40pt.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"idiom" : "ipad",
"filename" : "icon_40pt@2x-1.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"idiom" : "ipad",
"filename" : "icon_76pt.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"idiom" : "ipad",
"filename" : "icon_76pt@2x.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "icon_83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon.png",
"scale" : "1x"
}
],
"info" : {
Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "LaunchIcon.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchIcon" translatesAutoresizingMaskIntoConstraints="NO" id="Sgi-te-PKu">
<rect key="frame" x="123.5" y="334.5" width="167" height="237"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Sgi-te-PKu" firstAttribute="centerY" secondItem="6Tk-OE-BBY" secondAttribute="centerY" id="KT7-xd-gV4"/>
<constraint firstItem="Sgi-te-PKu" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="feL-Vs-SeN"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchIcon" width="167" height="237"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>%lld Players</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@VARIABLE@</string>
<key>VARIABLE</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>zero</key>
<string>No Player</string>
<key>one</key>
<string>1 Player</string>
<key>other</key>
<string>%lld Players</string>
</dict>
</dict>
<key>%lld points</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@VARIABLE@</string>
<key>VARIABLE</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>zero</key>
<string>0 point</string>
<key>one</key>
<string>1 point</string>
<key>other</key>
<string>%lld points</string>
</dict>
</dict>
</dict>
</plist>
@@ -0,0 +1,154 @@
import GRDBQuery
import SwiftUI
/// The main application view
struct AppView: View {
/// Write access to the database
@Environment(\.appDatabase) private var appDatabase
/// The `players` property is automatically updated when the database changes
@Query(PlayerRequest(ordering: .byScore)) private var players: [Player]
/// We'll need to leave edit mode in several occasions.
@State private var editMode = EditMode.inactive
/// Tracks the presentation of the player creation sheet.
@State private var newPlayerIsPresented = false
// If you want to define the query on initialization, you will prefer:
//
// @Query<PlayerRequest> private var players: [Player]
//
// init(initialOrdering: PlayerRequest.Ordering) {
// _players = Query(PlayerRequest(ordering: initialOrdering))
// }
var body: some View {
NavigationView {
PlayerList(players: players)
.navigationBarTitle(Text("\(players.count) Players"))
.navigationBarItems(
leading: HStack {
EditButton()
newPlayerButton
},
trailing: ToggleOrderingButton(
ordering: $players.ordering,
willChange: {
// onChange(of: $players.wrappedValue.ordering)
// is not able to leave the editing mode during
// the animation of the list content.
// Workaround: stop editing before the ordering
// is changed, and the list content is updated.
stopEditing()
}))
.toolbar { toolbarContent }
.onChange(of: players) { players in
if players.isEmpty {
stopEditing()
}
}
.environment(\.editMode, $editMode)
}
}
private var toolbarContent: some ToolbarContent {
ToolbarItemGroup(placement: .bottomBar) {
Button {
// Don't stopEditing() here because this is
// performed `onChange(of: players)`
Task {
try? await appDatabase.deleteAllPlayers()
}
} label: {
Image(systemName: "trash").imageScale(.large)
}
Spacer()
Button {
stopEditing()
Task {
try? await appDatabase.refreshPlayers()
}
} label: {
Image(systemName: "arrow.clockwise").imageScale(.large)
}
Spacer()
Button {
stopEditing()
// Perform 50 refreshes in parallel
Task {
try? await withThrowingTaskGroup(of: Void.self) { group in
for _ in 0..<50 {
_ = group.addTaskUnlessCancelled {
try await appDatabase.refreshPlayers()
}
}
try await group.waitForAll()
}
}
} label: {
Image(systemName: "tornado").imageScale(.large)
}
}
}
/// The button that presents the player creation sheet.
private var newPlayerButton: some View {
Button {
stopEditing()
newPlayerIsPresented = true
} label: {
Image(systemName: "plus")
}
.accessibility(label: Text("New Player"))
.sheet(isPresented: $newPlayerIsPresented) {
PlayerCreationView()
}
}
private func stopEditing() {
withAnimation {
editMode = .inactive
}
}
}
private struct ToggleOrderingButton: View {
@Binding var ordering: PlayerRequest.Ordering
let willChange: () -> Void
var body: some View {
switch ordering {
case .byName:
Button {
willChange()
ordering = .byScore
} label: {
Label("Name", systemImage: "arrowtriangle.up.fill").labelStyle(.titleAndIcon)
}
case .byScore:
Button {
willChange()
ordering = .byName
} label: {
Label("Score", systemImage: "arrowtriangle.down.fill").labelStyle(.titleAndIcon)
}
}
}
}
struct AppView_Previews: PreviewProvider {
static var previews: some View {
Group {
// Preview the default, empty database
AppView()
// Preview a database of random players
AppView().environment(\.appDatabase, .random())
}
}
}
@@ -0,0 +1,50 @@
import SwiftUI
/// The view that creates a new player.
struct PlayerCreationView: View {
/// Write access to the database
@Environment(\.appDatabase) private var appDatabase
@Environment(\.dismiss) private var dismiss
@State private var form = PlayerForm(name: "", score: "")
@State private var errorAlertIsPresented = false
@State private var errorAlertTitle = ""
var body: some View {
NavigationView {
PlayerFormView(form: $form)
.alert(
isPresented: $errorAlertIsPresented,
content: { Alert(title: Text(errorAlertTitle)) })
.navigationBarTitle("New Player")
.navigationBarItems(
leading: Button(role: .cancel) {
dismiss()
} label: {
Text("Cancel")
},
trailing: Button {
Task { await save() }
} label: {
Text("Save")
})
}
}
private func save() async {
do {
var player = Player(id: nil, name: "", score: 0)
form.apply(to: &player)
try await appDatabase.savePlayer(&player)
dismiss()
} catch {
errorAlertTitle = (error as? LocalizedError)?.errorDescription ?? "An error occurred"
errorAlertIsPresented = true
}
}
}
struct PlayerCreationSheet_Previews: PreviewProvider {
static var previews: some View {
PlayerCreationView()
}
}
@@ -0,0 +1,40 @@
import SwiftUI
/// The view that edits an existing player.
struct PlayerEditionView: View {
/// Write access to the database
@Environment(\.appDatabase) private var appDatabase
@Environment(\.isPresented) private var isPresented
private let player: Player
@State private var form: PlayerForm
init(player: Player) {
self.player = player
self.form = PlayerForm(player)
}
var body: some View {
PlayerFormView(form: $form)
.onChange(of: isPresented) { isPresented in
// Save when back button is pressed
if !isPresented {
Task {
var savedPlayer = player
form.apply(to: &savedPlayer)
// Ignore error because I don't know how to cancel the
// back button and present the error
try? await appDatabase.savePlayer(&savedPlayer)
}
}
}
}
}
struct PlayerEditionView_Previews: PreviewProvider {
static var previews: some View {
NavigationView {
PlayerEditionView(player: Player.makeRandom())
.navigationBarTitle("Player Edition")
}
}
}
@@ -0,0 +1,47 @@
import SwiftUI
/// The Player editing form, embedded in both
/// `PlayerCreationView` and `PlayerEditionView`.
struct PlayerFormView: View {
@Binding var form: PlayerForm
var body: some View {
List {
TextField("Name", text: $form.name)
.accessibility(label: Text("Player Name"))
TextField("Score", text: $form.score).keyboardType(.numberPad)
.accessibility(label: Text("Player Score"))
}
.listStyle(InsetGroupedListStyle())
}
}
struct PlayerForm {
var name: String
var score: String
}
extension PlayerForm {
init(_ player: Player) {
self.name = player.name
self.score = "\(player.score)"
}
func apply(to player: inout Player) {
player.name = name
player.score = Int(score) ?? 0
}
}
struct PlayerFormView_Previews: PreviewProvider {
static var previews: some View {
Group {
PlayerFormView(form: .constant(PlayerForm(
name: "",
score: "")))
PlayerFormView(form: .constant(PlayerForm(
name: Player.randomName(),
score: "\(Player.randomScore())")))
}
}
}
@@ -0,0 +1,59 @@
import SwiftUI
struct PlayerList: View {
/// Write access to the database
@Environment(\.appDatabase) private var appDatabase
/// The players in the list
var players: [Player]
var body: some View {
List {
ForEach(players) { player in
NavigationLink(destination: editionView(for: player)) {
PlayerRow(player: player)
// Don't animate player update
.animation(nil, value: player)
}
}
.onDelete { offsets in
let playerIds = offsets.compactMap { players[$0].id }
Task {
try? await appDatabase.deletePlayers(ids: playerIds)
}
}
}
// Animate list updates
.animation(.default, value: players)
.listStyle(.plain)
}
/// The view that edits a player in the list.
private func editionView(for player: Player) -> some View {
PlayerEditionView(player: player).navigationBarTitle(player.name)
}
}
private struct PlayerRow: View {
var player: Player
var body: some View {
HStack {
Text(player.name)
Spacer()
Text("\(player.score) points").foregroundColor(.gray)
}
}
}
struct PlayerList_Previews: PreviewProvider {
static var previews: some View {
NavigationView {
PlayerList(players: [
Player(id: 1, name: "Arthur", score: 100),
Player(id: 2, name: "Barbara", score: 1000),
])
.navigationTitle("Preview")
}
}
}
@@ -0,0 +1,144 @@
import XCTest
import GRDB
@testable import GRDBAsyncDemo
class AppDatabaseTests: XCTestCase {
func test_database_schema() throws {
// Given an empty database
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
// When we instantiate an AppDatabase
_ = try AppDatabase(dbQueue)
// Then the player table exists, with id, name & score columns
try dbQueue.read { db in
try XCTAssert(db.tableExists("player"))
let columns = try db.columns(in: "player")
let columnNames = Set(columns.map { $0.name })
XCTAssertEqual(columnNames, ["id", "name", "score"])
}
}
func test_savePlayer_inserts() async throws {
// Given an empty players database
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
let appDatabase = try AppDatabase(dbQueue)
// When we save a new player
var player = Player(id: nil, name: "Arthur", score: 100)
try await appDatabase.savePlayer(&player)
// Then the player exists in the database
let playerExists = try await dbQueue.read { [player] in try player.exists($0) }
XCTAssertTrue(playerExists)
}
func test_savePlayer_updates() async throws {
// Given a players database that contains a player
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
let appDatabase = try AppDatabase(dbQueue)
var player = try await dbQueue.write { db in
try Player(id: nil, name: "Arthur", score: 100).inserted(db)
}
// When we modify and save the player
player.name = "Barbara"
player.score = 1000
try await appDatabase.savePlayer(&player)
// Then the player has been updated in the database
let fetchedPlayer = try await dbQueue.read { [player] db in
try XCTUnwrap(Player.fetchOne(db, key: player.id))
}
XCTAssertEqual(fetchedPlayer, player)
}
func test_deletePlayers() async throws {
// Given a players database that contains four players
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
let appDatabase = try AppDatabase(dbQueue)
let playerIds: [Int64] = try await dbQueue.write { db in
_ = try Player(id: nil, name: "Arthur", score: 100).inserted(db)
_ = try Player(id: nil, name: "Barbara", score: 200).inserted(db)
_ = try Player(id: nil, name: "Craig", score: 150).inserted(db)
_ = try Player(id: nil, name: "David", score: 120).inserted(db)
return try Player.selectPrimaryKey().fetchAll(db)
}
// When we delete two players
let deletedId1 = playerIds[0]
let deletedId2 = playerIds[2]
try await appDatabase.deletePlayers(ids: [deletedId1, deletedId2])
// Then the deleted players no longer exist
try await dbQueue.read { db in
try XCTAssertFalse(Player.exists(db, id: deletedId1))
try XCTAssertFalse(Player.exists(db, id: deletedId2))
}
// Then the database still contains two players
let count = try await dbQueue.read { try Player.fetchCount($0) }
XCTAssertEqual(count, 2)
}
func test_deleteAllPlayers() async throws {
// Given a players database that contains players
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
let appDatabase = try AppDatabase(dbQueue)
try await dbQueue.write { db in
_ = try Player(id: nil, name: "Arthur", score: 100).inserted(db)
_ = try Player(id: nil, name: "Barbara", score: 200).inserted(db)
_ = try Player(id: nil, name: "Craig", score: 150).inserted(db)
_ = try Player(id: nil, name: "David", score: 120).inserted(db)
}
// When we delete all players
try await appDatabase.deleteAllPlayers()
// Then the database does not contain any player
let count = try await dbQueue.read { try Player.fetchCount($0) }
XCTAssertEqual(count, 0)
}
func test_refreshPlayers_populates_an_empty_database() async throws {
// Given an empty players database
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
let appDatabase = try AppDatabase(dbQueue)
// When we refresh players
try await appDatabase.refreshPlayers()
// Then the database is not empty
let count = try await dbQueue.read { try Player.fetchCount($0) }
XCTAssert(count > 0)
}
func test_createRandomPlayersIfEmpty_populates_an_empty_database() throws {
// Given an empty players database
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
let appDatabase = try AppDatabase(dbQueue)
// When we create random players
try appDatabase.createRandomPlayersIfEmpty()
// Then the database is not empty
try XCTAssert(dbQueue.read(Player.fetchCount) > 0)
}
func test_createRandomPlayersIfEmpty_does_not_modify_a_non_empty_database() throws {
// Given a players database that contains one player
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
let appDatabase = try AppDatabase(dbQueue)
var player = Player(id: nil, name: "Arthur", score: 100)
try dbQueue.write { db in
try player.insert(db)
}
// When we create random players
try appDatabase.createRandomPlayersIfEmpty()
// Then the database still only contains the original player
let players = try dbQueue.read(Player.fetchAll)
XCTAssertEqual(players, [player])
}
}
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
@@ -0,0 +1,43 @@
import XCTest
import GRDB
@testable import GRDBAsyncDemo
class PlayerRequestTests: XCTestCase {
func test_PlayerRequest_byName_fetches_well_ordered_players() throws {
// Given a players database that contains two players
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
_ = try AppDatabase(dbQueue)
var player1 = Player(id: nil, name: "Arthur", score: 100)
var player2 = Player(id: nil, name: "Barbara", score: 1000)
try dbQueue.write { db in
try player1.insert(db)
try player2.insert(db)
}
// When we fetch players ordered by name
let playerRequest = PlayerRequest(ordering: .byName)
let players = try dbQueue.read(playerRequest.fetchValue)
// Then the players are the two players ordered by name
XCTAssertEqual(players, [player1, player2])
}
func test_PlayerRequest_byScore_fetches_well_ordered_players() throws {
// Given a players database that contains two players
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
_ = try AppDatabase(dbQueue)
var player1 = Player(id: nil, name: "Arthur", score: 100)
var player2 = Player(id: nil, name: "Barbara", score: 1000)
try dbQueue.write { db in
try player1.insert(db)
try player2.insert(db)
}
// When we fetch players ordered by score
let playerRequest = PlayerRequest(ordering: .byScore)
let players = try dbQueue.read(playerRequest.fetchValue)
// Then the players are the two players ordered by score descending
XCTAssertEqual(players, [player2, player1])
}
}
@@ -0,0 +1,108 @@
import XCTest
import GRDB
@testable import GRDBAsyncDemo
class PlayerTests: XCTestCase {
// MARK: - CRUD
// Test that our Player type properly talks to GRDB.
func testInsert() throws {
// Given an empty players database
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
_ = try AppDatabase(dbQueue)
// When we insert a player
var player = Player(id: nil, name: "Arthur", score: 100)
try dbQueue.write { db in
try player.insert(db)
}
// Then the player gets a non-nil id
XCTAssertNotNil(player.id)
}
func testRoundtrip() throws {
// Given an empty players database
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
_ = try AppDatabase(dbQueue)
// When we insert a player and fetch the player with the same id
var insertedPlayer = Player(id: nil, name: "Arthur", score: 100)
let fetchedPlayer: Player? = try dbQueue.write { db in
try insertedPlayer.insert(db)
return try Player.fetchOne(db, key: insertedPlayer.id)
}
// Then the fetched player is equal to the inserted player
XCTAssertEqual(insertedPlayer, fetchedPlayer)
}
// MARK: - Requests
// Test that requests defined on the Player type behave as expected.
func testOrderedByScore() throws {
// Given a players database that contains players with distinct scores
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
_ = try AppDatabase(dbQueue)
var player1 = Player(id: 1, name: "Arthur", score: 100)
var player2 = Player(id: 2, name: "Barbara", score: 200)
var player3 = Player(id: 3, name: "Craig", score: 150)
var player4 = Player(id: 4, name: "David", score: 120)
try dbQueue.write { db in
try player1.insert(db)
try player2.insert(db)
try player3.insert(db)
try player4.insert(db)
}
// When we fetch players ordered by score
let players = try dbQueue.read(Player.all().orderedByScore().fetchAll)
// Then fetched players are ordered by score descending
XCTAssertEqual(players, [player2, player3, player4, player1])
}
func testOrderedByScoreSortsIdenticalScoresByName() throws {
// Given a players database that contains players with common scores
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
_ = try AppDatabase(dbQueue)
var player1 = Player(id: 1, name: "Arthur", score: 100)
var player2 = Player(id: 2, name: "Barbara", score: 200)
var player3 = Player(id: 3, name: "Craig", score: 200)
var player4 = Player(id: 4, name: "David", score: 200)
try dbQueue.write { db in
try player1.insert(db)
try player2.insert(db)
try player3.insert(db)
try player4.insert(db)
}
// When we fetch players ordered by score
let players = try dbQueue.read(Player.all().orderedByScore().fetchAll)
// Then fetched players are ordered by score descending and by name
XCTAssertEqual(players, [player2, player3, player4, player1])
}
func testOrderedByName() throws {
// Given a players database that contains players with distinct names
let dbQueue = try DatabaseQueue(configuration: AppDatabase.makeConfiguration())
_ = try AppDatabase(dbQueue)
var player1 = Player(id: 1, name: "Arthur", score: 100)
var player2 = Player(id: 2, name: "Barbara", score: 200)
var player3 = Player(id: 3, name: "Craig", score: 150)
var player4 = Player(id: 4, name: "David", score: 120)
try dbQueue.write { db in
try player1.insert(db)
try player2.insert(db)
try player3.insert(db)
try player4.insert(db)
}
// When we fetch players ordered by name
let players = try dbQueue.read(Player.all().orderedByName().fetchAll)
// Then fetched players are ordered by name
XCTAssertEqual(players, [player1, player2, player3, player4])
}
}
@@ -0,0 +1,51 @@
Async/Await + SwiftUI Demo Application
======================================
<img align="right" src="https://github.com/groue/GRDB.swift/raw/master/Documentation/DemoApps/GRDBCombineDemo/Screenshot.png" width="50%">
**This demo application is an Async/Await + SwiftUI application.** For a demo application that uses UIKit, see [GRDBDemoiOS](../GRDBDemoiOS/README.md), and for Combine + SwiftUI, see [GRDBCombineDemo](../GRDBCombineDemo/README.md).
**Requirements**: iOS 15.0+ / Xcode 13.1+
> **Note**: This demo app is not a project template. Do not copy it as a starting point for your application. Instead, create a new project, choose a GRDB [installation method](../../../README.md#installation), and use the demo as an inspiration.
The topics covered in this demo are:
- How to setup a database in an iOS app.
- How to define a simple [Codable Record](../../../README.md#codable-records).
- How to track database changes and animate a SwiftUI List with an async sequence built from [ValueObservation](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/valueobservation).
- How to apply the recommendations of [Recommended Practices for Designing Record Types](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/recordrecommendedpractices).
- How to feed SwiftUI previews with a transient database.
**Files of interest:**
- [GRDBAsyncDemoApp.swift](GRDBAsyncDemo/GRDBAsyncDemoApp.swift)
`GRDBAsyncDemoApp` feeds the app views with a database, through the SwiftUI environment.
- [AppDatabase.swift](GRDBAsyncDemo/AppDatabase.swift)
`AppDatabase` is the type that grants database access. It uses [DatabaseMigrator](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databasemigrator) in order to setup the database schema.
- [Persistence.swift](GRDBAsyncDemo/Persistence.swift)
This file instantiates various `AppDatabase` for the various projects needs: one database on disk for the application, and in-memory databases for SwiftUI previews.
- [Player.swift](GRDBAsyncDemo/Player.swift)
`Player` is a [Record](../../../README.md#records) type, able to read and write in the database. It conforms to the standard Codable protocol in order to gain all advantages of [Codable Records](../../../README.md#codable-records).
- [PlayerRequest.swift](GRDBAsyncDemo/PlayerRequest.swift), [AppView.swift](GRDBAsyncDemo/Views/AppView.swift)
`PlayerRequest` defines the player requests used by the app (sorted by score, or by name).
`PlayerRequest` feeds the `@Query` property wrapper (`@Query`, defined in [GRDBQuery](https://github.com/groue/GRDBQuery), allows SwiftUI views to display up-to-date database content).
`AppView` is the SwiftUI view that uses `@Query` in order to feed its player list.
- [GRDBAsyncDemoTests](GRDBAsyncDemoTests)
- Test the database schema
- Test the `Player` record and its requests
- Test the `PlayerRequest` methods that feed the list of players.
- Test the `AppDatabase` methods that let the app access the database.
Binary file not shown.

After

Width:  |  Height:  |  Size: 799 KiB

@@ -0,0 +1,607 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
56026CAC25B8A7EF00D1DF3F /* PlayerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56026CAA25B8A7EF00D1DF3F /* PlayerTests.swift */; };
56026CAD25B8A7EF00D1DF3F /* AppDatabaseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56026CAB25B8A7EF00D1DF3F /* AppDatabaseTests.swift */; };
56519DC7274FC85600ED16D8 /* GRDBQuery in Frameworks */ = {isa = PBXBuildFile; productRef = 56519DC6274FC85600ED16D8 /* GRDBQuery */; };
5671723A261B23C800423B6F /* PlayerList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56717239261B23C800423B6F /* PlayerList.swift */; };
56717252261B334D00423B6F /* PlayerRequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56717251261B334D00423B6F /* PlayerRequestTests.swift */; };
567C3E1A2520B6DE0011F6E9 /* GRDBCombineDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E192520B6DE0011F6E9 /* GRDBCombineDemoApp.swift */; };
567C3E1E2520B6DF0011F6E9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E1D2520B6DF0011F6E9 /* Assets.xcassets */; };
567C3E212520B6DF0011F6E9 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E202520B6DF0011F6E9 /* Preview Assets.xcassets */; };
567C3E5D2520B75C0011F6E9 /* Player.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E532520B75C0011F6E9 /* Player.swift */; };
567C3E5E2520B75C0011F6E9 /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E542520B75C0011F6E9 /* Persistence.swift */; };
567C3E612520B75D0011F6E9 /* PlayerFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E592520B75C0011F6E9 /* PlayerFormView.swift */; };
567C3E622520B75D0011F6E9 /* AppView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E5A2520B75C0011F6E9 /* AppView.swift */; };
567C3E632520B75D0011F6E9 /* PlayerCreationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E5B2520B75C0011F6E9 /* PlayerCreationView.swift */; };
567C3E642520B75D0011F6E9 /* PlayerEditionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E5C2520B75C0011F6E9 /* PlayerEditionView.swift */; };
567C3E662520B7880011F6E9 /* AppDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E652520B7880011F6E9 /* AppDatabase.swift */; };
567C3E792520BB650011F6E9 /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E752520BB650011F6E9 /* Localizable.stringsdict */; };
567C3E7A2520BB650011F6E9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 567C3E772520BB650011F6E9 /* LaunchScreen.storyboard */; };
56B6D1092619EC1B003CC455 /* PlayerRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B6D1082619EC1B003CC455 /* PlayerRequest.swift */; };
56F8A1202735989D0011ACBE /* GRDB in Frameworks */ = {isa = PBXBuildFile; productRef = 56F8A11F2735989D0011ACBE /* GRDB */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
56026C9D25B8A7D000D1DF3F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E0E2520B6DE0011F6E9 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 567C3E152520B6DE0011F6E9;
remoteInfo = GRDBCombineDemo;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
567C3E502520B70E0011F6E9 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
56026C9825B8A7D000D1DF3F /* GRDBCombineDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GRDBCombineDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
56026C9C25B8A7D000D1DF3F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
56026CAA25B8A7EF00D1DF3F /* PlayerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerTests.swift; sourceTree = "<group>"; };
56026CAB25B8A7EF00D1DF3F /* AppDatabaseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDatabaseTests.swift; sourceTree = "<group>"; };
56717239261B23C800423B6F /* PlayerList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerList.swift; sourceTree = "<group>"; };
56717251261B334D00423B6F /* PlayerRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerRequestTests.swift; sourceTree = "<group>"; };
567C3E162520B6DE0011F6E9 /* GRDBCombineDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GRDBCombineDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
567C3E192520B6DE0011F6E9 /* GRDBCombineDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GRDBCombineDemoApp.swift; sourceTree = "<group>"; };
567C3E1D2520B6DF0011F6E9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
567C3E202520B6DF0011F6E9 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
567C3E222520B6DF0011F6E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
567C3E532520B75C0011F6E9 /* Player.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Player.swift; sourceTree = "<group>"; };
567C3E542520B75C0011F6E9 /* Persistence.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = "<group>"; };
567C3E592520B75C0011F6E9 /* PlayerFormView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerFormView.swift; sourceTree = "<group>"; };
567C3E5A2520B75C0011F6E9 /* AppView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppView.swift; sourceTree = "<group>"; };
567C3E5B2520B75C0011F6E9 /* PlayerCreationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerCreationView.swift; sourceTree = "<group>"; };
567C3E5C2520B75C0011F6E9 /* PlayerEditionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerEditionView.swift; sourceTree = "<group>"; };
567C3E652520B7880011F6E9 /* AppDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDatabase.swift; sourceTree = "<group>"; };
567C3E762520BB650011F6E9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
567C3E782520BB650011F6E9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
56B6D1082619EC1B003CC455 /* PlayerRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerRequest.swift; sourceTree = "<group>"; };
56F8A11C2735988F0011ACBE /* GRDB.swift */ = {isa = PBXFileReference; lastKnownFileType = folder; name = GRDB.swift; path = ../../..; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
56026C9525B8A7D000D1DF3F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
567C3E132520B6DE0011F6E9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
56519DC7274FC85600ED16D8 /* GRDBQuery in Frameworks */,
56F8A1202735989D0011ACBE /* GRDB in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
56026C9925B8A7D000D1DF3F /* GRDBCombineDemoTests */ = {
isa = PBXGroup;
children = (
56026C9C25B8A7D000D1DF3F /* Info.plist */,
56026CAB25B8A7EF00D1DF3F /* AppDatabaseTests.swift */,
56717251261B334D00423B6F /* PlayerRequestTests.swift */,
56026CAA25B8A7EF00D1DF3F /* PlayerTests.swift */,
);
path = GRDBCombineDemoTests;
sourceTree = "<group>";
};
56185BC125B8047D00B9C30F /* Resources */ = {
isa = PBXGroup;
children = (
567C3E1D2520B6DF0011F6E9 /* Assets.xcassets */,
567C3E772520BB650011F6E9 /* LaunchScreen.storyboard */,
567C3E752520BB650011F6E9 /* Localizable.stringsdict */,
);
path = Resources;
sourceTree = "<group>";
};
567C3E0D2520B6DE0011F6E9 = {
isa = PBXGroup;
children = (
567C3E182520B6DE0011F6E9 /* GRDBCombineDemo */,
56026C9925B8A7D000D1DF3F /* GRDBCombineDemoTests */,
567C3E172520B6DE0011F6E9 /* Products */,
567C3E4D2520B70E0011F6E9 /* Frameworks */,
56F8A11C2735988F0011ACBE /* GRDB.swift */,
);
sourceTree = "<group>";
};
567C3E172520B6DE0011F6E9 /* Products */ = {
isa = PBXGroup;
children = (
567C3E162520B6DE0011F6E9 /* GRDBCombineDemo.app */,
56026C9825B8A7D000D1DF3F /* GRDBCombineDemoTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
567C3E182520B6DE0011F6E9 /* GRDBCombineDemo */ = {
isa = PBXGroup;
children = (
567C3E222520B6DF0011F6E9 /* Info.plist */,
567C3E652520B7880011F6E9 /* AppDatabase.swift */,
567C3E192520B6DE0011F6E9 /* GRDBCombineDemoApp.swift */,
567C3E542520B75C0011F6E9 /* Persistence.swift */,
567C3E532520B75C0011F6E9 /* Player.swift */,
56B6D1082619EC1B003CC455 /* PlayerRequest.swift */,
567C3E1F2520B6DF0011F6E9 /* Preview Content */,
56185BC125B8047D00B9C30F /* Resources */,
567C3E582520B75C0011F6E9 /* Views */,
);
path = GRDBCombineDemo;
sourceTree = "<group>";
};
567C3E1F2520B6DF0011F6E9 /* Preview Content */ = {
isa = PBXGroup;
children = (
567C3E202520B6DF0011F6E9 /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "<group>";
};
567C3E4D2520B70E0011F6E9 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
567C3E582520B75C0011F6E9 /* Views */ = {
isa = PBXGroup;
children = (
567C3E5A2520B75C0011F6E9 /* AppView.swift */,
567C3E5B2520B75C0011F6E9 /* PlayerCreationView.swift */,
567C3E5C2520B75C0011F6E9 /* PlayerEditionView.swift */,
567C3E592520B75C0011F6E9 /* PlayerFormView.swift */,
56717239261B23C800423B6F /* PlayerList.swift */,
);
path = Views;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
56026C9725B8A7D000D1DF3F /* GRDBCombineDemoTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 56026CA825B8A7D000D1DF3F /* Build configuration list for PBXNativeTarget "GRDBCombineDemoTests" */;
buildPhases = (
56026C9425B8A7D000D1DF3F /* Sources */,
56026C9525B8A7D000D1DF3F /* Frameworks */,
56026C9625B8A7D000D1DF3F /* Resources */,
);
buildRules = (
);
dependencies = (
56026C9E25B8A7D000D1DF3F /* PBXTargetDependency */,
);
name = GRDBCombineDemoTests;
productName = GRDBCombineDemoTests;
productReference = 56026C9825B8A7D000D1DF3F /* GRDBCombineDemoTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
567C3E152520B6DE0011F6E9 /* GRDBCombineDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 567C3E252520B6DF0011F6E9 /* Build configuration list for PBXNativeTarget "GRDBCombineDemo" */;
buildPhases = (
567C3E122520B6DE0011F6E9 /* Sources */,
567C3E132520B6DE0011F6E9 /* Frameworks */,
567C3E142520B6DE0011F6E9 /* Resources */,
567C3E502520B70E0011F6E9 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
56F8A11E273598960011ACBE /* PBXTargetDependency */,
);
name = GRDBCombineDemo;
packageProductDependencies = (
56F8A11F2735989D0011ACBE /* GRDB */,
56519DC6274FC85600ED16D8 /* GRDBQuery */,
);
productName = GRBCombineDemo;
productReference = 567C3E162520B6DE0011F6E9 /* GRDBCombineDemo.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
567C3E0E2520B6DE0011F6E9 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1250;
LastUpgradeCheck = 1200;
TargetAttributes = {
56026C9725B8A7D000D1DF3F = {
CreatedOnToolsVersion = 12.3;
TestTargetID = 567C3E152520B6DE0011F6E9;
};
567C3E152520B6DE0011F6E9 = {
CreatedOnToolsVersion = 12.0;
};
};
};
buildConfigurationList = 567C3E112520B6DE0011F6E9 /* Build configuration list for PBXProject "GRDBCombineDemo" */;
compatibilityVersion = "Xcode 12.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 567C3E0D2520B6DE0011F6E9;
packageReferences = (
56519DC5274FC85600ED16D8 /* XCRemoteSwiftPackageReference "GRDBQuery" */,
);
productRefGroup = 567C3E172520B6DE0011F6E9 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
567C3E152520B6DE0011F6E9 /* GRDBCombineDemo */,
56026C9725B8A7D000D1DF3F /* GRDBCombineDemoTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
56026C9625B8A7D000D1DF3F /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
567C3E142520B6DE0011F6E9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
567C3E212520B6DF0011F6E9 /* Preview Assets.xcassets in Resources */,
567C3E7A2520BB650011F6E9 /* LaunchScreen.storyboard in Resources */,
567C3E1E2520B6DF0011F6E9 /* Assets.xcassets in Resources */,
567C3E792520BB650011F6E9 /* Localizable.stringsdict in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
56026C9425B8A7D000D1DF3F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
56026CAC25B8A7EF00D1DF3F /* PlayerTests.swift in Sources */,
56026CAD25B8A7EF00D1DF3F /* AppDatabaseTests.swift in Sources */,
56717252261B334D00423B6F /* PlayerRequestTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
567C3E122520B6DE0011F6E9 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
567C3E5E2520B75C0011F6E9 /* Persistence.swift in Sources */,
567C3E5D2520B75C0011F6E9 /* Player.swift in Sources */,
56B6D1092619EC1B003CC455 /* PlayerRequest.swift in Sources */,
5671723A261B23C800423B6F /* PlayerList.swift in Sources */,
567C3E612520B75D0011F6E9 /* PlayerFormView.swift in Sources */,
567C3E632520B75D0011F6E9 /* PlayerCreationView.swift in Sources */,
567C3E662520B7880011F6E9 /* AppDatabase.swift in Sources */,
567C3E622520B75D0011F6E9 /* AppView.swift in Sources */,
567C3E642520B75D0011F6E9 /* PlayerEditionView.swift in Sources */,
567C3E1A2520B6DE0011F6E9 /* GRDBCombineDemoApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
56026C9E25B8A7D000D1DF3F /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 567C3E152520B6DE0011F6E9 /* GRDBCombineDemo */;
targetProxy = 56026C9D25B8A7D000D1DF3F /* PBXContainerItemProxy */;
};
56F8A11E273598960011ACBE /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = 56F8A11D273598960011ACBE /* GRDB */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
567C3E752520BB650011F6E9 /* Localizable.stringsdict */ = {
isa = PBXVariantGroup;
children = (
567C3E762520BB650011F6E9 /* en */,
);
name = Localizable.stringsdict;
sourceTree = "<group>";
};
567C3E772520BB650011F6E9 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
567C3E782520BB650011F6E9 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
56026C9F25B8A7D000D1DF3F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GRDBCombineDemoTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBCombineDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBCombineDemo.app/GRDBCombineDemo";
};
name = Debug;
};
56026CA025B8A7D000D1DF3F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GRDBCombineDemoTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBCombineDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBCombineDemo.app/GRDBCombineDemo";
};
name = Release;
};
567C3E232520B6DF0011F6E9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
567C3E242520B6DF0011F6E9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
567C3E262520B6DF0011F6E9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"GRDBCombineDemo/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = GRDBCombineDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBCombineDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
567C3E272520B6DF0011F6E9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"GRDBCombineDemo/Preview Content\"";
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = GRDBCombineDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBCombineDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
56026CA825B8A7D000D1DF3F /* Build configuration list for PBXNativeTarget "GRDBCombineDemoTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
56026C9F25B8A7D000D1DF3F /* Debug */,
56026CA025B8A7D000D1DF3F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
567C3E112520B6DE0011F6E9 /* Build configuration list for PBXProject "GRDBCombineDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
567C3E232520B6DF0011F6E9 /* Debug */,
567C3E242520B6DF0011F6E9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
567C3E252520B6DF0011F6E9 /* Build configuration list for PBXNativeTarget "GRDBCombineDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
567C3E262520B6DF0011F6E9 /* Debug */,
567C3E272520B6DF0011F6E9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
56519DC5274FC85600ED16D8 /* XCRemoteSwiftPackageReference "GRDBQuery" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/groue/GRDBQuery";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.6.0;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
56519DC6274FC85600ED16D8 /* GRDBQuery */ = {
isa = XCSwiftPackageProductDependency;
package = 56519DC5274FC85600ED16D8 /* XCRemoteSwiftPackageReference "GRDBQuery" */;
productName = GRDBQuery;
};
56F8A11D273598960011ACBE /* GRDB */ = {
isa = XCSwiftPackageProductDependency;
productName = GRDB;
};
56F8A11F2735989D0011ACBE /* GRDB */ = {
isa = XCSwiftPackageProductDependency;
productName = GRDB;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 567C3E0E2520B6DE0011F6E9 /* Project object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "grdbquery",
"kind" : "remoteSourceControl",
"location" : "https://github.com/groue/GRDBQuery",
"state" : {
"revision" : "aefc0d7e7a64e841da33e1c8be7429da1bd9b5d6",
"version" : "0.6.0"
}
}
],
"version" : 2
}
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
BuildableName = "GRDBCombineDemo.app"
BlueprintName = "GRDBCombineDemo"
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56026C9725B8A7D000D1DF3F"
BuildableName = "GRDBCombineDemoTests.xctest"
BlueprintName = "GRDBCombineDemoTests"
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
BuildableName = "GRDBCombineDemo.app"
BlueprintName = "GRDBCombineDemo"
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "SQL_TRACE"
value = "1"
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
BuildableName = "GRDBCombineDemo.app"
BlueprintName = "GRDBCombineDemo"
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,235 @@
import Foundation
import GRDB
import os.log
/// A database of players.
///
/// You create an `AppDatabase` with a connection to an SQLite database
/// (see <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseconnections>).
///
/// Create those connections with a configuration returned from
/// `AppDatabase/makeConfiguration(_:)`.
///
/// For example:
///
/// ```swift
/// // Create an in-memory AppDatabase
/// let config = AppDatabase.makeConfiguration()
/// let dbQueue = try DatabaseQueue(configuration: config)
/// let appDatabase = try AppDatabase(dbQueue)
/// ```
struct AppDatabase {
/// Creates an `AppDatabase`, and makes sure the database schema
/// is ready.
///
/// - important: Create the `DatabaseWriter` with a configuration
/// returned by ``makeConfiguration(_:)``.
init(_ dbWriter: any DatabaseWriter) throws {
self.dbWriter = dbWriter
try migrator.migrate(dbWriter)
}
/// Provides access to the database.
///
/// Application can use a `DatabasePool`, while SwiftUI previews and tests
/// can use a fast in-memory `DatabaseQueue`.
///
/// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseconnections>
private let dbWriter: any DatabaseWriter
}
// MARK: - Database Configuration
extension AppDatabase {
private static let sqlLogger = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "SQL")
/// Returns a database configuration suited for `PlayerRepository`.
///
/// SQL statements are logged if the `SQL_TRACE` environment variable
/// is set.
///
/// - parameter base: A base configuration.
public static func makeConfiguration(_ base: Configuration = Configuration()) -> Configuration {
var config = base
// An opportunity to add required custom SQL functions or
// collations, if needed:
// config.prepareDatabase { db in
// db.add(function: ...)
// }
// Log SQL statements if the `SQL_TRACE` environment variable is set.
// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/database/trace(options:_:)>
if ProcessInfo.processInfo.environment["SQL_TRACE"] != nil {
config.prepareDatabase { db in
db.trace {
// It's ok to log statements publicly. Sensitive
// information (statement arguments) are not logged
// unless config.publicStatementArguments is set
// (see below).
os_log("%{public}@", log: sqlLogger, type: .debug, String(describing: $0))
}
}
}
#if DEBUG
// Protect sensitive information by enabling verbose debugging in
// DEBUG builds only.
// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/configuration/publicstatementarguments>
config.publicStatementArguments = true
#endif
return config
}
}
// MARK: - Database Migrations
extension AppDatabase {
/// The DatabaseMigrator that defines the database schema.
///
/// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/migrations>
private var migrator: DatabaseMigrator {
var migrator = DatabaseMigrator()
#if DEBUG
// Speed up development by nuking the database when migrations change
// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/migrations>
migrator.eraseDatabaseOnSchemaChange = true
#endif
migrator.registerMigration("createPlayer") { db in
// Create a table
// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseschema>
try db.create(table: "player") { t in
t.autoIncrementedPrimaryKey("id")
t.column("name", .text).notNull()
t.column("score", .integer).notNull()
}
}
// Migrations for future application versions will be inserted here:
// migrator.registerMigration(...) { db in
// ...
// }
return migrator
}
}
// MARK: - Database Access: Writes
// The write methods execute invariant-preserving database transactions.
extension AppDatabase {
/// A validation error that prevents some players from being saved into
/// the database.
enum ValidationError: LocalizedError {
case missingName
var errorDescription: String? {
switch self {
case .missingName:
return "Please provide a name"
}
}
}
/// Saves (inserts or updates) a player. When the method returns, the
/// player is present in the database, and its id is not nil.
func savePlayer(_ player: inout Player) throws {
if player.name.isEmpty {
throw ValidationError.missingName
}
try dbWriter.write { db in
try player.save(db)
}
}
/// Delete the specified players
func deletePlayers(ids: [Int64]) throws {
try dbWriter.write { db in
_ = try Player.deleteAll(db, ids: ids)
}
}
/// Delete all players
func deleteAllPlayers() throws {
try dbWriter.write { db in
_ = try Player.deleteAll(db)
}
}
/// Refresh all players (by performing some random changes, for demo purpose).
func refreshPlayers() throws {
try dbWriter.write { db in
if try Player.all().isEmpty(db) {
// When database is empty, insert new random players
try createRandomPlayers(db)
} else {
// Insert a player
if Bool.random() {
_ = try Player.makeRandom().inserted(db) // insert but ignore inserted id
}
// Delete a random player
if Bool.random() {
try Player.order(sql: "RANDOM()").limit(1).deleteAll(db)
}
// Update some players
for var player in try Player.fetchAll(db) where Bool.random() {
try player.updateChanges(db) {
$0.score = Player.randomScore()
}
}
}
}
}
/// Create random players if the database is empty.
func createRandomPlayersIfEmpty() throws {
try dbWriter.write { db in
if try Player.all().isEmpty(db) {
try createRandomPlayers(db)
}
}
}
private static let uiTestPlayers = [
Player(id: nil, name: "Arthur", score: 5),
Player(id: nil, name: "Barbara", score: 6),
Player(id: nil, name: "Craig", score: 8),
Player(id: nil, name: "David", score: 4),
Player(id: nil, name: "Elena", score: 1),
Player(id: nil, name: "Frederik", score: 2),
Player(id: nil, name: "Gilbert", score: 7),
Player(id: nil, name: "Henriette", score: 3)]
func createPlayersForUITests() throws {
try dbWriter.write { db in
try AppDatabase.uiTestPlayers.forEach { player in
_ = try player.inserted(db) // insert but ignore inserted id
}
}
}
/// Support for `createRandomPlayersIfEmpty()` and `refreshPlayers()`.
private func createRandomPlayers(_ db: Database) throws {
for _ in 0..<8 {
_ = try Player.makeRandom().inserted(db) // insert but ignore inserted id
}
}
}
// MARK: - Database Access: Reads
// This demo app does not provide any specific reading method, and instead
// gives an unrestricted read-only access to the rest of the application.
// In your app, you are free to choose another path, and define focused
// reading methods.
extension AppDatabase {
/// Provides a read-only access to the database
var reader: DatabaseReader {
dbWriter
}
}
@@ -0,0 +1,40 @@
import GRDBQuery
import SwiftUI
@main
struct GRDBCombineDemoApp: App {
var body: some Scene {
WindowGroup {
AppView().environment(\.appDatabase, .shared)
}
}
}
// MARK: - Give SwiftUI access to the database
//
// Define a new environment key that grants access to an AppDatabase.
//
// The technique is documented at
// <https://developer.apple.com/documentation/swiftui/environmentkey>.
private struct AppDatabaseKey: EnvironmentKey {
static var defaultValue: AppDatabase { .empty() }
}
extension EnvironmentValues {
var appDatabase: AppDatabase {
get { self[AppDatabaseKey.self] }
set { self[AppDatabaseKey.self] = newValue }
}
}
// In this demo app, views observe the database with the @Query property
// wrapper, defined in the GRDBQuery package. Its documentation recommends to
// define a dedicated initializer for `appDatabase` access, so we comply:
extension Query where Request.DatabaseContext == AppDatabase {
/// Convenience initializer for requests that feed from `AppDatabase`.
init(_ request: Request) {
self.init(request, in: \.appDatabase)
}
}
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchScreen</key>
<dict/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
@@ -0,0 +1,77 @@
import Foundation
import GRDB
extension AppDatabase {
/// The database for the application
static let shared = makeShared()
private static func makeShared() -> AppDatabase {
do {
// Apply recommendations from
// <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseconnections>
//
// Create the "Application Support/Database" directory if needed
let fileManager = FileManager.default
let appSupportURL = try fileManager.url(
for: .applicationSupportDirectory, in: .userDomainMask,
appropriateFor: nil, create: true)
let directoryURL = appSupportURL.appendingPathComponent("Database", isDirectory: true)
// Support for tests: delete the database if requested
if CommandLine.arguments.contains("-reset") {
try? fileManager.removeItem(at: directoryURL)
}
// Create the database folder if needed
try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true)
// Open or create the database
let databaseURL = directoryURL.appendingPathComponent("db.sqlite")
NSLog("Database stored at \(databaseURL.path)")
let dbPool = try DatabasePool(
path: databaseURL.path,
// Use default AppDatabase configuration
configuration: AppDatabase.makeConfiguration())
// Create the AppDatabase
let appDatabase = try AppDatabase(dbPool)
// Prepare the database with test fixtures if requested
if CommandLine.arguments.contains("-fixedTestData") {
try appDatabase.createPlayersForUITests()
} else {
// Otherwise, populate the database if it is empty, for better
// demo purpose.
try appDatabase.createRandomPlayersIfEmpty()
}
return appDatabase
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate.
//
// Typical reasons for an error here include:
// * The parent directory cannot be created, or disallows writing.
// * The database is not accessible, due to permissions or data protection when the device is locked.
// * The device is out of space.
// * The database could not be migrated to its latest schema version.
// Check the error message to determine what the actual problem was.
fatalError("Unresolved error \(error)")
}
}
/// Creates an empty database for SwiftUI previews
static func empty() -> AppDatabase {
// Connect to an in-memory database
// See https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseconnections
let dbQueue = try! DatabaseQueue(configuration: AppDatabase.makeConfiguration())
return try! AppDatabase(dbQueue)
}
/// Creates a database full of random players for SwiftUI previews
static func random() -> AppDatabase {
let appDatabase = empty()
try! appDatabase.createRandomPlayersIfEmpty()
return appDatabase
}
}
@@ -0,0 +1,105 @@
import GRDB
/// The Player struct.
///
/// Identifiable conformance supports SwiftUI list animations, and type-safe
/// GRDB primary key methods.
/// Equatable conformance supports tests.
struct Player: Identifiable, Equatable {
/// The player id.
///
/// Int64 is the recommended type for auto-incremented database ids.
/// Use nil for players that are not inserted yet in the database.
var id: Int64?
var name: String
var score: Int
}
extension Player {
private static let names = [
"Arthur", "Anita", "Barbara", "Bernard", "Craig", "Chiara", "David",
"Dean", "Éric", "Elena", "Fatima", "Frederik", "Gilbert", "Georgette",
"Henriette", "Hassan", "Ignacio", "Irene", "Julie", "Jack", "Karl",
"Kristel", "Louis", "Liz", "Masashi", "Mary", "Noam", "Nicole",
"Ophelie", "Oleg", "Pascal", "Patricia", "Quentin", "Quinn", "Raoul",
"Rachel", "Stephan", "Susie", "Tristan", "Tatiana", "Ursule", "Urbain",
"Victor", "Violette", "Wilfried", "Wilhelmina", "Yvon", "Yann",
"Zazie", "Zoé"]
/// Creates a new player with empty name and zero score
static func new() -> Player {
Player(id: nil, name: "", score: 0)
}
/// Creates a new player with random name and random score
static func makeRandom() -> Player {
Player(id: nil, name: randomName(), score: randomScore())
}
/// Returns a random name
static func randomName() -> String {
names.randomElement()!
}
/// Returns a random score
static func randomScore() -> Int {
10 * Int.random(in: 0...100)
}
}
// MARK: - Persistence
/// Make Player a Codable Record.
///
/// See <https://github.com/groue/GRDB.swift/blob/master/README.md#records>
extension Player: Codable, FetchableRecord, MutablePersistableRecord {
// Define database columns from CodingKeys
fileprivate enum Columns {
static let name = Column(CodingKeys.name)
static let score = Column(CodingKeys.score)
}
/// Updates a player id after it has been inserted in the database.
mutating func didInsert(_ inserted: InsertionSuccess) {
id = inserted.rowID
}
}
// MARK: - Player Database Requests
/// Define some player requests used by the application.
///
/// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/recordrecommendedpractices>
extension DerivableRequest<Player> {
/// A request of players ordered by name.
///
/// For example:
///
/// let players: [Player] = try dbWriter.read { db in
/// try Player.all().orderedByName().fetchAll(db)
/// }
func orderedByName() -> Self {
// Sort by name in a localized case insensitive fashion
// See https://github.com/groue/GRDB.swift/blob/master/README.md#string-comparison
order(Player.Columns.name.collating(.localizedCaseInsensitiveCompare))
}
/// A request of players ordered by score.
///
/// For example:
///
/// let players: [Player] = try dbWriter.read { db in
/// try Player.all().orderedByScore().fetchAll(db)
/// }
/// let bestPlayer: Player? = try dbWriter.read { db in
/// try Player.all().orderedByScore().fetchOne(db)
/// }
func orderedByScore() -> Self {
// Sort by descending score, and then by name, in a
// localized case insensitive fashion
// See https://github.com/groue/GRDB.swift/blob/master/README.md#string-comparison
order(
Player.Columns.score.desc,
Player.Columns.name.collating(.localizedCaseInsensitiveCompare))
}
}
@@ -0,0 +1,55 @@
import Combine
import GRDB
import GRDBQuery
/// A player request can be used with the `@Query` property wrapper in order to
/// feed a view with a list of players.
///
/// For example:
///
/// struct MyView: View {
/// @Query(PlayerRequest(ordering: .byName)) private var players: [Player]
///
/// var body: some View {
/// List(players) { player in ... )
/// }
/// }
struct PlayerRequest: Queryable {
enum Ordering {
case byScore
case byName
}
/// The ordering used by the player request.
var ordering: Ordering
// MARK: - Queryable Implementation
static var defaultValue: [Player] { [] }
func publisher(in appDatabase: AppDatabase) -> AnyPublisher<[Player], Error> {
// Build the publisher from the general-purpose read-only access
// granted by `appDatabase.reader`.
// Some apps will prefer to call a dedicated method of `appDatabase`.
ValueObservation
.tracking(fetchValue(_:))
.publisher(
in: appDatabase.reader,
// The `.immediate` scheduling feeds the view right on
// subscription, and avoids an undesired animation when the
// application starts.
scheduling: .immediate)
.eraseToAnyPublisher()
}
// This method is not required by Queryable, but it makes it easier
// to test PlayerRequest.
func fetchValue(_ db: Database) throws -> [Player] {
switch ordering {
case .byScore:
return try Player.all().orderedByScore().fetchAll(db)
case .byName:
return try Player.all().orderedByName().fetchAll(db)
}
}
}
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,116 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon_20pt@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon_20pt@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon_29pt@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon_29pt@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon_40pt@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon_40pt@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "icon_60pt@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "icon_60pt@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "icon_20pt.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "icon_20pt@2x-1.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon_29pt.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon_29pt@2x-1.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "icon_40pt.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "icon_40pt@2x-1.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "icon_76pt.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "icon_76pt@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "icon_83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

Loaded 100 of 935 files, more files were not shown because too many files have changed in this diff. Show more