Compare commits

...
2890 Commits
Author SHA1 Message Date
Gwendal Roué 4c2290f84b Move Design Notes 2021-01-28 08:29:48 +01:00
Gwendal Roué efc8e4bbf9 Fetching players 2021-01-28 08:27:41 +01:00
Gwendal Roué 5c986b142b Saving playerrs 2021-01-28 08:10:30 +01:00
Gwendal Roué 4ec77f8d02 TODO 2021-01-28 08:10:30 +01:00
Gwendal Roué d7dfb4c2ed Precise documentation 2021-01-28 08:10:30 +01:00
Gwendal Roué f4a32edbb9 TODO 2021-01-28 08:10:30 +01:00
Gwendal Roué 8bb9ef0849 Indent raw SQL versions 2021-01-28 08:10:30 +01:00
Gwendal Roué 0210144ea9 Extract Player definition 2021-01-28 08:10:30 +01:00
Gwendal Roué 2842bc92ca Wording 2021-01-28 08:10:30 +01:00
Gwendal Roué 2ca857d895 Fix typo 2021-01-28 08:10:30 +01:00
Gwendal Roué 95ec107134 Group design notes at the end of the chapter 2021-01-28 08:10:30 +01:00
Gwendal Roué 18c65eecb6 Wording 2021-01-28 08:10:30 +01:00
Gwendal Roué 3c1ab47843 Group design notes at the end of the chapter 2021-01-28 08:10:30 +01:00
Gwendal Roué 6b706bbc85 Group design notes 2021-01-28 08:10:30 +01:00
Gwendal Roué e6435ade96 Talk about sample code 2021-01-28 08:10:30 +01:00
Gwendal Roué c854b5a88a Wording 2021-01-28 08:10:30 +01:00
Gwendal Roué f2d51d2feb The Database Service rewrite 2021-01-28 08:10:30 +01:00
Gwendal Roué 95cd6f3c4f Introduction 2021-01-28 08:10:30 +01:00
Gwendal Roué 4a0d8602e2 Clarify the tutorial scope 2021-01-28 08:10:30 +01:00
Gwendal Roué a83f76be10 Remove a missing logical link 2021-01-28 08:10:30 +01:00
Gwendal Roué 10420e6426 Wording 2021-01-28 08:10:30 +01:00
Gwendal Roué 5ab90c1b6c More achievements 2021-01-28 08:10:30 +01:00
Gwendal Roué 5c70477a04 SwiftUI use in-memory databases 2021-01-28 08:10:30 +01:00
Gwendal Roué cb4a0f349e Rename the tutorial 2021-01-28 08:10:30 +01:00
Gwendal Roué 9a0db52c9b The Initial Application State 2021-01-28 08:10:30 +01:00
Gwendal Roué 7cf7300129 Fix typo and wording 2021-01-28 08:10:30 +01:00
Gwendal Roué 6fbeed1a2a Wording 2021-01-28 08:10:30 +01:00
Gwendal Roué 1defe3aaf1 Why columns are hidden 2021-01-28 08:10:30 +01:00
Gwendal Roué 074af18152 Wording 2021-01-28 08:10:30 +01:00
Gwendal Roué 43c9aa3474 Wording 2021-01-28 08:10:30 +01:00
Gwendal Roué d95a76a47a Compare with ActiveRecord 2021-01-28 08:10:30 +01:00
Gwendal Roué ae8c1f11a9 Player requests 2021-01-28 08:10:30 +01:00
Gwendal Roué 4decdd7dea SQL Interpolation: add support for collations 2021-01-28 08:10:30 +01:00
Gwendal Roué 1d41807e25 Add link 2021-01-28 08:10:30 +01:00
Gwendal Roué 571a70e073 Organization 2021-01-28 08:10:30 +01:00
Gwendal Roué 2822c959f8 Repurpose the focus of the tutorial 2021-01-28 08:10:30 +01:00
Gwendal Roué d8c5d85fcb Postpone name collation until the fetch 2021-01-28 08:10:30 +01:00
Gwendal Roué 3f493fa7a8 Mention ACID robustness against errors and crashes 2021-01-28 08:10:29 +01:00
Gwendal Roué cecc3cffdc Emphasis 2021-01-28 08:10:29 +01:00
Gwendal Roué 5ea0cf6cdd Introduce fetchable records 2021-01-28 08:10:29 +01:00
Gwendal Roué 3ebbddb9f3 Tip about helper methods 2021-01-28 08:10:29 +01:00
Gwendal Roué 238f01725b SQL version of AppDatabase.refreshPlayers() 2021-01-28 08:10:29 +01:00
Gwendal Roué 51b975e872 Fix typo 2021-01-28 08:10:29 +01:00
Gwendal Roué 4b9643daf2 Modifying Players chapter 2021-01-28 08:10:29 +01:00
Gwendal Roué 6daf078fc3 Fix focus 2021-01-28 08:10:29 +01:00
Gwendal Roué 7aced9b925 Documentation 2021-01-28 08:10:29 +01:00
Gwendal Roué 16fc88ba09 Wording 2021-01-28 08:10:29 +01:00
Gwendal Roué 4ac7e3d15c Avoid "such as" repetition 2021-01-28 08:10:29 +01:00
Gwendal Roué 48b8c1ee14 More notes about SQL injection prevention 2021-01-28 08:10:29 +01:00
Gwendal Roué 1af981255d How to deal with missing Swift versions of SQLite functions or operators? 2021-01-28 08:10:29 +01:00
Gwendal Roué 6a07361614 Indent design notes 2021-01-28 08:10:29 +01:00
Gwendal Roué f32f5e2d7b Describe the tutorial audience 2021-01-28 08:10:29 +01:00
Gwendal Roué 322959f1c4 Deleting players 2021-01-28 08:10:29 +01:00
Gwendal Roué eaca12aed1 Fix typo 2021-01-28 08:10:29 +01:00
Gwendal Roué 96a8b46214 Wording 2021-01-28 08:10:29 +01:00
Gwendal Roué 7f2f4fdfcc Wording 2021-01-28 08:10:29 +01:00
Gwendal Roué ceccbb38fb Wording 2021-01-28 08:10:29 +01:00
Gwendal Roué af21c82dd6 Better explain why id is autoincremented 2021-01-28 08:10:29 +01:00
Gwendal Roué b2573a12bc Explain why id is autoincremented 2021-01-28 08:10:29 +01:00
Gwendal Roué d00de45e4f Links & wording 2021-01-28 08:10:29 +01:00
Gwendal Roué 6512e7bf61 Fix typo 2021-01-28 08:10:29 +01:00
Gwendal Roué 1cd88114ec Rewrite introduction to migrations 2021-01-28 08:10:29 +01:00
Gwendal Roué 86cf024a78 AppDatabase error handling suggestion 2021-01-28 08:10:29 +01:00
Gwendal Roué afdde192cd Rewrite the AppDatabase introduction 2021-01-28 08:10:29 +01:00
Gwendal Roué 0b321dfedf Rewrite the introduction 2021-01-28 08:10:29 +01:00
Gwendal Roué 7617bb258d Getting Started tutorial 2021-01-28 08:10:29 +01:00
Gwendal Roué 104466170b Demo app feeds from a single observation 2021-01-28 08:10:29 +01:00
Gwendal Roué 4b5a1340aa Demo apps: store the database in its own folder
This is a recommended good practice
2021-01-28 08:10:29 +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
699 changed files with 88506 additions and 34598 deletions

No files matched your search

+2 -1
View File
@@ -1,4 +1,5 @@
source 'https://rubygems.org'
gem 'xcpretty'
gem 'xcpretty-travis-formatter'
gem 'xcpretty-travis-formatter'
gem 'cocoapods', '~> 1.7'
+1
View File
@@ -0,0 +1 @@
github: [groue]
+1 -1
View File
@@ -18,7 +18,7 @@ Please fill out this template when filing an issue.
### Environment
**GRDB flavor(s):** (GRDB, GRDBCipher, GRDBCustom?)
**GRDB flavor(s):** (GRDB, SQLCipher, Custom SQLite build?)
**GRDB version:**
**Installation method:** (CocoaPods, SPM, manual?)
**Xcode version:**
+4 -10
View File
@@ -1,18 +1,12 @@
<!-- Please describe your pull request here. -->
### One more thing…
### Pull Request Checklist
<!--
When relevant, please check as many checkboxes in this list as possible.
Documentation makes sure that you are not the only one who knows about the changes. Tests make sure your changes will be supported in the future.
Write documentation and tests if you can, because if nobody else has the time to do it, the pull request will simply be rejected.
Ask for help and guidance when needed.
Please verify that your pull request checks those boxes:
-->
- [ ] This pull request is submitted against the `development` branch.
- [ ] Inline documentation has been updated.
- [ ] README.md or another dedicated guide has been updated.
- [ ] Changes are tested, for all flavors of GRDB, GRDBCipher, and GRDBCustomSQLite.
- [ ] Updated CHANGELOG.md
- [ ] Changes are tested.
+3 -3
View File
@@ -101,13 +101,13 @@ SQLiteCustom/GRDBCustomSQLite-USER.h
SQLiteCustom/GRDBCustomSQLite-USER.xcconfig
# CocoaPods test
Podfile.lock
Pods
Tests/CocoaPods/*/*.xcworkspace
Podfile.lock
# SPM
.build
Package.resolved
GRDB.xcworkspace/xcshareddata/swiftpm
#Package.resolved
Tests/SPM/Packages
# Ruby
+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
-1
View File
@@ -1 +0,0 @@
4.1
+64
View File
@@ -0,0 +1,64 @@
included:
- GRDB
disabled_rules:
- comment_spacing
- cyclomatic_complexity
- duplicate_enum_cases
- file_length
- force_cast
- force_try
- function_body_length
- function_parameter_count
- identifier_name
- is_disjoint
- nesting
- opening_brace
- redundant_optional_initialization
- syntactic_sugar
- todo
- trailing_comma
- trailing_whitespace
- type_body_length
- type_name
- unused_setter_value
opt_in_rules:
- anyobject_protocol
- array_init
- closure_spacing
- collection_alignment
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
- contains_over_range_nil_comparison
- convenience_type
- empty_collection_literal
- empty_count
- empty_string
- explicit_init
- fatal_error_message
- first_where
- flatmap_over_map_reduce
- identical_operands
- joined_default_parameter
- last_where
- legacy_multiple
- legacy_random
- lower_acl_than_parent
- modifier_order
- no_extension_access_modifier
- overridden_super_call
- pattern_matching_keywords
- prohibited_super_call
- reduce_into
- redundant_type_annotation
- sorted_first_last
- toggle_bool
- unused_declaration
- unused_import
- yoda_condition
vertical_whitespace:
max_empty_lines: 2
+120 -199
View File
@@ -1,9 +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:
@@ -13,228 +28,134 @@ jobs:
include:
###########################################
## Test GRDB
# Test GRDBOSX (Xcode 10)
- stage: Test GRDB
## Test GRDB Xcode 12.2
- name: "Test GRDB Xcode 12.2 - GRDBOSX - Swift 5.3"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=GRDBOSX (Xcode 10, Swift 4.2, macOS)
osx_image: xcode12.2
script: make test_framework_GRDBOSX_maxSwift
# Test GRDBOSX (Xcode 10)
- stage: Test GRDB
- name: "Test GRDB Xcode 12.2 - GRDBOSX - Swift 5.2"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=GRDBOSX (Xcode 10, Swift 4.0, macOS)
osx_image: xcode12.2
script: make test_framework_GRDBOSX_minSwift
# Test GRDBWatchOS (Xcode 10)
- stage: Test GRDB
- name: "Test GRDB Xcode 12.2 - GRDBWatchOS"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=GRDBWatchOS (Xcode 10, watchOS)
osx_image: xcode12.2
script: make test_framework_GRDBWatchOS
# Test GRDBiOS (Xcode 10, iOS <MAXIMUM VERSION>)
- stage: Test GRDB
- name: "Test GRDB Xcode 12.2 - GRDBiOS iOS maxTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=GRDBiOS (Xcode 10, Swift 4.2, iOS <MAX>)
osx_image: xcode12.2
script: make test_framework_GRDBiOS_maxTarget_maxSwift
# Test GRDBiOS (Xcode 9.4, iOS <MAXIMUM VERSION>)
- stage: Test GRDB
- name: "Test GRDB Xcode 12.2 - GRDBiOS iOS minTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode9.4
env:
- TID=GRDBiOS (Xcode 9.4, iOS <MAX>)
script: make test_framework_GRDBiOS_maxTarget_maxSwift
# Test GRDBiOS (Xcode 9.3, iOS <MINIMUM VERSION>))
- stage: Test GRDB
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode9.3
env:
- TID=GRDBiOS (Xcode 9.3, iOS <MIN>)
osx_image: xcode12.2
script: make test_framework_GRDBiOS_minTarget
# Test GRDB [SPM] (Xcode 10, macOS)
- stage: Test GRDB
- name: "Test GRDB Xcode 12.2 - GRDBtvOS maxTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=GRDB [SPM] (Xcode 10, macOS)
osx_image: xcode12.2
script: make test_framework_GRDBtvOS_maxTarget_maxSwift
- name: "Test GRDB Xcode 12 - GRDBtvOS minTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.2
script: make test_framework_GRDBtvOS_minTarget
- name: "Test GRDB Xcode 12.2 - SPM"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.2
script: make test_SPM
###########################################
## Test GRDB (Custom SQLite)
# Test GRDBCustomSQLiteOSX (Xcode 10)
- stage: Test GRDB + Custom SQLite
## Test GRDBCustom Xcode 12.2
- name: "Test GRDBCustom Xcode 12.2 - GRDBOSX"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=GRDBCustomSQLiteOSX (Xcode 10, macOS)
osx_image: xcode12.2
script: make test_framework_GRDBCustomSQLiteOSX
# Test GRDBCustomSQLiteiOS (Xcode 10, iOS <MAXIMUM VERSION>)
- stage: Test GRDB + Custom SQLite
- name: "Test GRDBCustom Xcode 12.2 - GRDBiOS maxTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=GRDBCustomSQLiteiOS (Xcode 10, Swift 4.2, iOS <MAX>)
osx_image: xcode12.2
script: make test_framework_GRDBCustomSQLiteiOS_maxTarget_maxSwift
# Test GRDBCustomSQLiteiOS (Xcode 10, iOS <MAXIMUM VERSION>)
- stage: Test GRDB + Custom SQLite
- name: "Test GRDBCustom Xcode 12.2 - GRDBiOS minTarget"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=GRDBCustomSQLiteiOS (Xcode 10, Swift 4.0, iOS <MAX>)
script: make test_framework_GRDBCustomSQLiteiOS_maxTarget_minSwift
# Test GRDBCustomSQLiteiOS (Xcode 9.4, iOS <MAXIMUM VERSION>)
- stage: Test GRDB + Custom SQLite
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode9.4
env:
- TID=GRDBCustomSQLiteiOS (Xcode 9.4, iOS <MAX>)
script: make test_framework_GRDBCustomSQLiteiOS_maxTarget
# Test GRDBCustomSQLiteiOS (Xcode 9.3, iOS <MINIMUM VERSION>))
- stage: Test GRDB + Custom SQLite
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode9.3
env:
- TID=GRDBCustomSQLiteiOS (Xcode 9.3, iOS <MIN>)
osx_image: xcode12.2
script: make test_framework_GRDBCustomSQLiteiOS_minTarget
###########################################
## Test GRDB (SQLCipher)
# Test GRDBCipherOSX (Xcode 10)
- stage: Test GRDB + SQLCipher
## Test SQLCipher Xcode 12.2
- name: "Test SQLCipher Xcode 12.2 - SQLCipher 3"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=GRDBCipherOSX (Xcode 10, macOS)
script: make test_framework_GRDBCipherOSX
# Test GRDBCipheriOS (Xcode 10, iOS <MAXIMUM VERSION>)
- stage: Test GRDB + SQLCipher
osx_image: xcode12.2
script: make test_framework_SQLCipher3
- name: "Test SQLCipher Xcode 12.2 - SQLCipher 4"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=GRDBCipheriOS (Xcode 10, iOS <MAX>)
script: make test_framework_GRDBCipheriOS_maxTarget
# Test GRDBCipheriOS (Xcode 9.4, iOS <MAXIMUM VERSION>)
- stage: Test GRDB + SQLCipher
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode9.4
env:
- TID=GRDBCipheriOS (Xcode 9.4, iOS <MAX>)
script: make test_framework_GRDBCipheriOS_maxTarget
# Test GRDBCipheriOS (Xcode 9.3, iOS <MINIMUM VERSION>))
- stage: Test GRDB + SQLCipher
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode9.3
env:
- TID=GRDBCipheriOS (Xcode 9.3, iOS <MIN>)
script: make test_framework_GRDBCipheriOS_minTarget
osx_image: xcode12.2
script: make test_framework_SQLCipher4
###########################################
## Test Installation Methods
# Manual Install (Xcode 10)
- stage: Test Installation
## Test Installation Xcode 12.2
# Manual Install
- name: "Test Installation Xcode 12.2 - Manual Install"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=Manual Install (Xcode 10)
osx_image: xcode12.2
script: make test_install_manual
# Manual Install (GRDBCipher, Xcode 10)
- stage: Test Installation
# Travis is much too slow, and always fail this job
# # CocoaPods Lint
# - name: "Test Installation Xcode 12.2 - CocoaPods Lint"
# gemfile: .ci/gemfiles/Gemfile.travis
# osx_image: xcode12.2
# script: make test_CocoaPodsLint_GRDB
# CocoaPods Install GRDB
- name: "Test Installation Xcode 12.2 - CocoaPods Framework"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode10
env:
- TID=Manual Install (GRDBCipher, Xcode 10)
script: make test_install_GRDBCipher
# CocoaPods Lint (Xcode 10)
- stage: Test Installation
osx_image: xcode10
install:
- gem install cocoapods --pre # >= 1.6.0.beta.1 for cocoapods lint
env:
- TID=CocoaPods Lint GRDB.swift (Xcode 10)
script: make test_CocoaPodsLint_GRDB
# CocoaPods Lint (Xcode 10)
- stage: Test Installation
osx_image: xcode10
install:
- gem install cocoapods --pre # >= 1.6.0.beta.1 for cocoapods lint
env:
- TID=CocoaPods Lint GRDBPlus (Xcode 10)
script: make test_CocoaPodsLint_GRDBPlus
# CocoaPods Lint (Xcode 10)
- stage: Test Installation
osx_image: xcode10
install:
- gem install cocoapods --pre # >= 1.6.0.beta.1 for cocoapods lint
env:
- TID=CocoaPods Lint GRDBCipher (Xcode 10)
script: make test_CocoaPodsLint_GRDBCipher
# CocoaPods Install (Xcode 10)
- stage: Test Installation
osx_image: xcode10
install:
- gem install cocoapods --pre # >= 1.6.0.beta.1 for cocoapods lint
env:
- TID=CocoaPods GRDB (Xcode 10)
script: make test_install_GRDB_CocoaPods
# CocoaPods Install (Xcode 10)
- stage: Test Installation
osx_image: xcode10
install:
- gem install cocoapods --pre # >= 1.6.0.beta.1 for cocoapods lint
env:
- TID=CocoaPods GRDB+FTS5 (Xcode 10)
script: make test_install_GRDBFTS5_CocoaPods
# CocoaPods Install (Xcode 10)
- stage: Test Installation
osx_image: xcode10
install:
- gem install cocoapods --pre # >= 1.6.0.beta.1 for cocoapods lint
env:
- TID=CocoaPods GRDBCipher (Xcode 10)
script: make test_install_GRDBCipher_CocoaPods
# SPM Install (Xcode 10)
- stage: Test Installation
osx_image: xcode10
env:
- TID=SPM (Xcode 10)
script: make test_install_SPM
## Carthage Build
- stage: Test Installation
osx_image: xcode10
before_install:
- brew update
- brew outdated carthage || brew upgrade carthage
env:
- TID=Carthages
script: make test_CarthageBuild
osx_image: xcode12.2
script: make test_install_GRDB_CocoaPods_framework
# CocoaPods Install GRDB
- name: "Test Installation Xcode 12.2 - CocoaPods Static"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.2
script: make test_install_GRDB_CocoaPods_static
# SPM Install
- name: "Test Installation Xcode 12.2 - SPM Package"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.2
script: make test_install_SPM_Package
# SPM Install
- name: "Test Installation Xcode 12.2 - SPM Package in Xcode Project"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.2
script: make test_install_SPM_Project
# Custom SQLite Install
- name: "Test Installation Xcode 12.2 - Custom SQLite"
gemfile: .ci/gemfiles/Gemfile.travis
osx_image: xcode12.2
script: make test_install_customSQLite
###########################################
## Test GRDB Xcode 11.4
- name: "Test GRDB Xcode 11.4 - GRDBiOS iOS maxTarget"
gemfile: .ci/gemfiles/Gemfile.travis
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: xcode11.4
script: make test_framework_GRDBiOS_minTarget
+135
View File
@@ -0,0 +1,135 @@
# Brag Document
Here is a list of people who were happy to meet GRDB :-)
---
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.
+1821 -5
View File
File diff suppressed because it is too large. Load diff
+19 -84
View File
@@ -72,23 +72,18 @@ Legend:
The ideas, in alphabetical order:
- [Associations]
- [Carthage]
- [CloudKit]
- [Concurrency]
- [Database Observation]
- [Custom FTS5 Auxiliary Functions]
- [Date and Time Functions]
- [Decode NSDecimalNumber from Text Columns]
- [Documentation]
- [FetchedRecordsController Diffing Algorithm]
- [FetchedRecordsController Support for Any Request]
- [FetchedRecordsController Support for Sections]
- [Full Text Search Demo Application]
- [JSON]
- [Linux]
- [More SQL Generation]
- [SQL Console in the Debugger]
- [SQLCipher in a Shared App Container]
- [Static Library]
- [Typed Expressions]
@@ -96,16 +91,7 @@ The ideas, in alphabetical order:
:bowtie: Public API Challenge :muscle: Hard :fire: Experimental
Associations can be enhanced in several ways. See the "Known Issues" and "Future Directions" chapter of the [Associations Guide](Documentation/AssociationsBasics.md)
### Carthage
:question: Unknown Difficulty
[Carthage](https://github.com/Carthage/Carthage) can build GRDB frameworks, but it can also inexplicably fail. This installation method is thus currently **unsupported**, which means that support has to be found directly in the [Carthage repo](https://github.com/Carthage/Carthage/issues), or on [Stack Overflow](http://stackoverflow.com). See [#262](https://github.com/groue/GRDB.swift/pull/262) for more information.
I would be a nice improvement if GRDB Carthage builds were made robust.
Associations can be enhanced in several ways. See the "Known Issues" chapter of the [Associations Guide](Documentation/AssociationsBasics.md)
### CloudKit
@@ -155,22 +141,17 @@ And this creates improvement opportunities:
- The introduction of an "ultra-safe" concurrency mode. Maybe something that restricts all database accesses to the main thread, like [FCModel](https://github.com/marcoarment/FCModel). Maybe in a separate companion library.
### Database Observation
### Custom FTS5 Auxiliary Functions
:muscle: Hard
:question: Unknown Difficulty
[Database Observation](README#database-changes-observation) is currently available in three flavors:
The SQLite documentation provides [this description](https://www.sqlite.org/fts5.html) of FTS5 auxiliary functions:
- The [TransactionObserver](README.md#transactionobserver-protocol) protocol: versatile, but low-level and challenging in terms of concurrency, especially when used in conjunction with database pools.
> An application may use FTS5 auxiliary functions to retrieve extra information regarding the matched row. For example, an auxiliary function may be used to retrieve a copy of a column value for a matched row with all instances of the matched term surrounded by html <b></b> tags.
- [FetchedRecordsController]: high-level and easier to use.
Applications can define their own [custom FTS5 auxiliary functions](https://www.sqlite.org/fts5.html#custom_auxiliary_functions) with SQLite, but GRDB does not yet provide any Swift API for that.
- [RxGRDB]: high-level and easier to use, depends on [RxSwift](https://github.com/ReactiveX/RxSwift).
Suggested contributions are:
- Enhancements to FetchedRecordsController (see below).
- More choices of reactive engines.
See issue [#421](https://github.com/groue/GRDB.swift/issues/421) for more information.
### Date and Time Functions
@@ -220,50 +201,6 @@ Inline documentation, the one which is embedded right into the source code and i
If you are a good writer, your help will be very warmly welcomed.
### FetchedRecordsController Diffing Algorithm
:muscle: Hard
[FetchedRecordsController] uses a Levenshtein-based diffing algorithm which has a terrible algorithmic complexity. This makes this very useful class unable to deal with more than hundreds of elements.
There exists much more efficient O(n) diffing algorithms that would lift this limitation.
Starting points:
- [RxSwiftCommunity/RxDataSources](https://github.com/RxSwiftCommunity/RxDataSources)
- [ra1028/DifferenceKit](https://github.com/ra1028/DifferenceKit)
- [tonyarnold/Differ](https://github.com/tonyarnold/Differ)
- [onmyway133/DeepDiff](https://github.com/onmyway133/DeepDiff)
- [mcudich/HeckelDiff](https://github.com/mcudich/HeckelDiff)
### FetchedRecordsController Support for Any Request
:muscle: Hard
[FetchedRecordsController] is able to deal with records, but not with raw rows or values:
```swift
// Supported by FetchedRecordsController
let recordRequest = Player.all()
// Not supported by FetchedRecordsController
let stringRequest = Player.select(Column("name"), as: String.self)
let rowRequest = SQLRequest<Row>("SELECT ...")
```
This limitation does not apply to [RxGRDB], the reactive sibling of FetchedRecordsController. It would be nice if FetchedRecordsController would become just as versatile.
### FetchedRecordsController Support for Sections
:muscle: Hard
[FetchedRecordsController] mimics the API of Core Data's [NSFetchedResultsController](https://developer.apple.com/documentation/coredata/nsfetchedresultscontroller), but does not yet support table and collection view sections.
This improvement most certainly depends on a refreshing of the [FetchedRecordsController Diffing Algorithm].
### Full Text Search Demo Application
:baby: Starter Task :pencil: Documentation
@@ -297,13 +234,17 @@ Swift on Linux is currently focused on the server (Vapor, Perfect, Kitura). Whil
There are several SQLite features that GRDB could natively support:
- [ALTER TABLE ... RENAME COLUMN ... TO ...](https://www.sqlite.org/lang_altertable.html)
- [ATTACH DATABASE](https://www.sqlite.org/lang_attach.html)
- [UPSERT](https://www.sqlite.org/lang_UPSERT.html)
- [INSERT INTO ... SELECT ...](https://www.sqlite.org/lang_insert.html)
- [WITH RECURSIVE ...](https://www.sqlite.org/lang_with.html)
- [RTree](https://sqlite.org/rtree.html)
- [Windows Functions](https://www.sqlite.org/windowfunctions.html)
- [More ideas](https://www.sqlite.org/lang.html)
See [issue #575](https://github.com/groue/GRDB.swift/issues/575) for more information and guidance about the implementation of extra table alterations.
### SQL Console in the Debugger
@@ -319,13 +260,6 @@ Sometimes one needs, in lldb, a console similar to the [Command Line Shell For S
See issue [#302](https://github.com/groue/GRDB.swift/issues/302).
### Static Library
:question: Unknown Difficulty :hammer: Tooling
It would be nice to be able to integrate GRDB as a static library.
### Typed Expressions
:bowtie: Public API Challenge :muscle: Hard :fire: Experimental
@@ -362,28 +296,24 @@ Features that blur this focus are non-goals:
[Ask Questions]: #ask-questions
[Associations]: #associations
[Carthage]: #carthage
[CloudKit]: #cloudkit
[Codable Records]: README.md#codable-records
[Custom FTS5 Auxiliary Functions]: #custom-fts5-auxiliary-functions
[Database Observation]: #database-observation
[Date and Time Functions]: #date-and-time-functions
[Decode NSDecimalNumber from Text Columns]: #decode-nsdecimalnumber-from-text-columns
[Documentation]: #documentation
[FetchedRecordsController]: README.md#fetchedrecordscontroller
[FetchedRecordsController Diffing Algorithm]: #fetchedrecordscontroller-diffing-algorithm
[FetchedRecordsController Support for Any Request]: #fetchedrecordscontroller-support-for-any-request
[FetchedRecordsController Support for Sections]: #fetchedrecordscontroller-support-for-sections
[Full Text Search Demo Application]: #full-text-search-demo-application
[How is the Library Organized?]: Documentation/LibraryOrganization.md
[How is the Repository Organized?]: Documentation/RepositoryOrganization.md
[JSON]: #json
[Linux]: #linux
[More SQL Generation]: #more-sql-generation
[Records: Splitting Database Encoding from Ability to Write in the Database]: #records-splitting-database-encoding-from-ability-to-write-in-the-database
[Non-Goals]: #non-goals
[Report Bugs]: #report-bugs
[RxGRDB]: http://github.com/RxSwiftCommunity/RxGRDB
[Concurrency]: #concurrency
[Static Library]: #static-library
[Sponsoring and Professional Support]: #sponsoring-and-professional-support
[SQL Console in the Debugger]: #sql-console-in-the-debugger
[SQLCipher in a Shared App Container]: #sqlcipher-in-a-shared-app-container
@@ -391,3 +321,8 @@ Features that blur this focus are non-goals:
[Suggest an Enhancement]: #suggest-an-enhancement
[Suggested Contributions]: #suggested-contributions
[Typed Expressions]: #typed-expressions
[persistence methods]: README.md#persistence-methods
[PersistableRecord]: README.md#persistablerecord-protocol
[Record Comparison]: README.md#record-comparison
[Requesting Associated Records]: Documentation/AssociationsBasics.md#requesting-associated-records
[ValueObservation]: README.md#valueobservation
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
</Workspace>
@@ -1,59 +0,0 @@
import GRDB
/// A type responsible for initializing the application database.
///
/// See AppDelegate.setupDatabase()
struct AppDatabase {
/// Creates a fully initialized database at path
static func openDatabase(atPath path: String) throws -> DatabaseQueue {
// Connect to the database
// See https://github.com/groue/GRDB.swift/#database-connections
dbQueue = try DatabaseQueue(path: path)
// Use DatabaseMigrator to define the database schema
// See https://github.com/groue/GRDB.swift/#migrations
try migrator.migrate(dbQueue)
return dbQueue
}
/// The DatabaseMigrator that defines the database schema.
///
/// This migrator is exposed so that migrations can be tested.
// See https://github.com/groue/GRDB.swift/#migrations
static var migrator: DatabaseMigrator {
var migrator = DatabaseMigrator()
migrator.registerMigration("createPlayer") { db in
// Create a table
// See https://github.com/groue/GRDB.swift#create-tables
try db.create(table: "player") { t in
// An integer primary key auto-generates unique IDs
t.column("id", .integer).primaryKey()
// Sort player 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()
}
}
migrator.registerMigration("fixtures") { db in
// Populate the players table with random data
for _ in 0..<8 {
var player = Player(id: nil, name: Player.randomName(), score: Player.randomScore())
try player.insert(db)
}
}
// // Migrations for future application versions will be inserted here:
// migrator.registerMigration(...) { db in
// ...
// }
return migrator
}
}
@@ -1,26 +0,0 @@
import UIKit
import GRDB
// The shared database queue
var dbQueue: DatabaseQueue!
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
try! setupDatabase(application)
return true
}
private func setupDatabase(_ application: UIApplication) throws {
let databaseURL = try FileManager.default
.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
.appendingPathComponent("db.sqlite")
dbQueue = try AppDatabase.openDatabase(atPath: databaseURL.path)
// 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)
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
@@ -1,28 +0,0 @@
import GRDB
struct Player: Codable, FetchableRecord, MutablePersistableRecord {
var id: Int64?
var name: String
var score: Int
enum Columns: String, ColumnExpression {
case id, name, score
}
/// Update player id after successful insertion
mutating func didInsert(with rowID: Int64, for column: String?) {
id = rowID
}
}
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é"]
static func randomName() -> String {
return names[Int(arc4random_uniform(UInt32(names.count)))]
}
static func randomScore() -> Int {
return 10 * Int(arc4random_uniform(101))
}
}
@@ -1,250 +0,0 @@
import UIKit
import GRDB
class PlayersViewController: UITableViewController {
enum PlayerOrdering {
case byName
case byScore
var request: QueryInterfaceRequest<Player> {
switch self {
case .byName:
return Player.order(Player.Columns.name)
case .byScore:
return Player.order(Player.Columns.score.desc, Player.Columns.name)
}
}
}
var playersController: FetchedRecordsController<Player>!
var playerOrdering: PlayerOrdering = .byScore {
didSet {
try! playersController.setRequest(playerOrdering.request)
configureNavigationItem()
}
}
@IBOutlet weak var newPlayerButtonItem: UIBarButtonItem!
override func viewDidLoad() {
super.viewDidLoad()
configureTableView()
configureToolbar()
configureNavigationItem()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.isToolbarHidden = false
}
}
// MARK: - Navigation
extension PlayersViewController : PlayerEditionViewControllerDelegate {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "Edit" {
let player = playersController.record(at: tableView.indexPathForSelectedRow!)
let controller = segue.destination as! PlayerEditionViewController
controller.title = player.name
controller.player = player
controller.delegate = self // See playerEditionControllerDidComplete
controller.commitButtonHidden = true
}
else if segue.identifier == "New" {
setEditing(false, animated: true)
let navigationController = segue.destination as! UINavigationController
let controller = navigationController.viewControllers.first as! PlayerEditionViewController
controller.title = "New Player"
controller.player = Player(id: nil, name: "", score: 0)
}
}
@IBAction func cancelPlayerEdition(_ segue: UIStoryboardSegue) {
// Player creation: cancel button was tapped
}
@IBAction func commitPlayerEdition(_ segue: UIStoryboardSegue) {
// Player creation: commit button was tapped
let controller = segue.source as! PlayerEditionViewController
try! dbQueue.write { db in
try controller.player.save(db)
}
}
func playerEditionControllerDidComplete(_ controller: PlayerEditionViewController) {
// Player edition: user has finished editing the player
try! dbQueue.write { db in
try controller.player.save(db)
}
}
}
// MARK: - UITableViewDataSource
extension PlayersViewController {
private func configureTableView() {
playersController = try! FetchedRecordsController(dbQueue, request: playerOrdering.request)
playersController.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! playersController.performFetch()
}
override func numberOfSections(in tableView: UITableView) -> Int {
return playersController.sections.count
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return playersController.sections[section].numberOfRecords
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Player", for: indexPath)
configure(cell, at: indexPath)
return cell
}
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
// Delete the player
let player = playersController.record(at: indexPath)
try! dbQueue.write { db in
_ = try player.delete(db)
}
}
private func configure(_ cell: UITableViewCell, at indexPath: IndexPath) {
let player = playersController.record(at: indexPath)
if player.name.isEmpty {
cell.textLabel?.text = "(anonymous)"
} else {
cell.textLabel?.text = player.name
}
cell.detailTextLabel?.text = abs(player.score) > 1 ? "\(player.score) points" : "0 point"
}
}
// MARK: - Actions
extension PlayersViewController {
private func configureNavigationItem() {
navigationItem.leftBarButtonItems = [editButtonItem, newPlayerButtonItem]
switch playerOrdering {
case .byScore:
navigationItem.rightBarButtonItem = UIBarButtonItem(
title: "Score ⬇︎",
style: .plain,
target: self, action: #selector(sortByName))
case .byName:
navigationItem.rightBarButtonItem = UIBarButtonItem(
title: "Name ⬆︎",
style: .plain,
target: self, action: #selector(sortByScore))
}
}
private func configureToolbar() {
toolbarItems = [
UIBarButtonItem(barButtonSystemItem: .trash, target: self, action: #selector(deletePlayers)),
UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil),
UIBarButtonItem(barButtonSystemItem: .refresh, target: self, action: #selector(refresh)),
UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil),
UIBarButtonItem(title: "💣", style: .plain, target: self, action: #selector(stressTest)),
]
}
@IBAction func sortByName() {
setEditing(false, animated: true)
playerOrdering = .byName
}
@IBAction func sortByScore() {
setEditing(false, animated: true)
playerOrdering = .byScore
}
@IBAction func deletePlayers() {
setEditing(false, animated: true)
try! dbQueue.write { db in
_ = try Player.deleteAll(db)
}
}
@IBAction func refresh() {
setEditing(false, animated: true)
refreshPlayers()
}
@IBAction func stressTest() {
setEditing(false, animated: true)
for _ in 0..<50 {
DispatchQueue.global().async {
self.refreshPlayers()
}
}
}
private func refreshPlayers() {
try! dbQueue.write { db in
if try Player.fetchCount(db) == 0 {
// Insert new random players
for _ in 0..<8 {
var player = Player(id: nil, name: Player.randomName(), score: Player.randomScore())
try player.insert(db)
}
} else {
// Insert a player
if arc4random_uniform(2) == 0 {
var player = Player(id: nil, name: Player.randomName(), score: Player.randomScore())
try player.insert(db)
}
// Delete a random player
if arc4random_uniform(2) == 0 {
try Player.order(sql: "RANDOM()").limit(1).deleteAll(db)
}
// Update some players
for var player in try Player.fetchAll(db) where arc4random_uniform(2) == 0 {
player.score = Player.randomScore()
try player.update(db)
}
}
}
}
}
+4
View File
@@ -0,0 +1,4 @@
Sharing a Database in an App Group Container
============================================
This guide [has moved](SharingADatabase.md).
File diff suppressed because it is too large. Load diff
+328
View File
@@ -0,0 +1,328 @@
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]
## 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>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:)`]
#### `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. See [Advanced DatabasePool](../README.md#advanced-databasepool) for more information.
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:)`]
- [`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()](../README.md#valueobservationremoveduplicates) GRDB operator also.
- It stops emitting any value after the database connection is closed. But it never completes.
- 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 [ValueObservation scheduler](../README.md#valueobservation-scheduling).
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.
See [ValueObservation Scheduling](../README.md#valueobservation-scheduling) for more information.
:warning: **ValueObservation and Data Consistency**
When you compose ValueObservation publishers together with the [combineLatest](https://developer.apple.com/documentation/combine/publisher/3333677-combinelatest) operator, you lose all guarantees of [data consistency](https://en.wikipedia.org/wiki/Consistency_(database_systems)).
Instead, compose requests together into **one single** ValueObservation, as below:
```swift
struct HallOfFame {
var totalPlayerCount: Int
var bestPlayers: [Player]
}
// DATA CONSISTENCY GUARANTEED
let hallOfFamePublisher = ValueObservation
.tracking { db -> HallOfFame in
let totalPlayerCount = try Player.fetchCount(db)
let bestPlayers = try Player
.order(Column("score").desc)
.limit(10)
.fetchAll(db)
return HallOfFame(
totalPlayerCount: totalPlayerCount,
bestPlayers: bestPlayers)
}
.publisher(in: dbQueue)
```
See [ValueObservation] for more information.
#### `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.
[Database Connections]: ../README.md#database-connections
[Usage]: #usage
[Asynchronous Database Access]: #asynchronous-database-access
[Combine]: https://developer.apple.com/documentation/combine
[Database Changes Observation]: ../README.md#database-changes-observation
[Database Observation]: #database-observation
[DatabaseRegionObservation]: ../README.md#databaseregionobservation
[Demo Application]: DemoApps/GRDBCombineDemo/README.md
[SQLite]: http://sqlite.org
[ValueObservation]: ../README.md#valueobservation
[`DatabaseRegionObservation.publisher(in:)`]: #databaseregionobservationpublisherin
[`ValueObservation.publisher(in:scheduling:)`]: #valueobservationpublisherinscheduling
[`readPublisher(receiveOn:value:)`]: #databasereaderreadpublisherreceiveonvalue
[`writePublisher(receiveOn:updates:)`]: #databasewriterwritepublisherreceiveonupdates
[`writePublisher(receiveOn:updates:thenRead:)`]: #databasewriterwritepublisherreceiveonupdatesthenread
[configured]: ../README.md#databasepool-configuration
[database pool]: ../README.md#database-pools
[database queue]: ../README.md#database-queues
[database snapshot]: ../README.md#database-snapshots
[scheduler]: https://developer.apple.com/documentation/combine/scheduler
+423
View File
@@ -0,0 +1,423 @@
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]
> :point_up: **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<Void>(
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<Void>(
named: "playerName",
sql: "SELECT ?", arguments: [name])
// WITH playerName AS (SELECT 'O''Brien') ...
let playerNameCTE = CommonTableExpression<Void>(
named: "playerName",
literal: "SELECT \(name)")
// WITH playerName AS (SELECT 'O''Brien') ...
let request: SQLRequest<String> = "SELECT \(name)"
let playerNameCTE = CommonTableExpression<Void>(
named: "playerName",
request: requests)
```
All CTEs can be provided with explicit column names:
```swift
// WITH pair(a, b) AS (SELECT 1, 2) ...
let pairCTE = CommonTableExpression<Void>(
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<Int>(
recursive: true,
named: "counter",
columns: ["x"],
sql: """
VALUES(1)
UNION ALL
SELECT x+1 FROM counter WHERE x<1000
""")
```
> :point_up: **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.
As you can see in all above examples, `CommonTableExpression` is a generic type: `CommonTableExpression<Void>`, `CommonTableExpression<Int>`. The generic argument (`Void`, `Int`) turns useful when you [join common table expressions](#associations-to-common-table-expressions), or when you [fetch values directly from a common table expression](#fetch-values-from-common-table-expressions). Otherwise, you can just use `Void`.
## 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<Void>(
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())
```
> :point_up: **Note**: the `with(_:)` method can be called as many times as a there are common table expressions in your request.
>
> :point_up: **Note**: the `with(_:)` method can be called at any time, as all request methods: `Player.with(...).filter(...).with(...)`.
>
> :point_up: **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.
>
> :point_up: **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.
`all()` builds a regular [query interface request] that you can filter, sort, etc, like all query interface requests. You can also fetch from it, but only as long as it is provided with the definition of the CTE.
This will generally give requests of the form `cte.all().with(cte)`. In SQL, this would give: `WITH cte AS (...) SELECT * FROM cte`.
The generic type of `CommonTableExpression<...>` now turns out useful, so that you can fetch the desired outcome (database [rows](../README.md#row-queries), simple [values](../README.md#value-queries), or custom [records](../README.md#records)).
For example, let's fetch a range of integer:
```swift
func counterRequest(range: ClosedRange<Int>) -> QueryInterfaceRequest<Int> {
// WITH RECURSIVE counter(x) AS
// (VALUES(...) UNION ALL SELECT x+1 FROM counter WHERE x<...)
// SELECT * FROM counter
let counter = CommonTableExpression<Int>(
recursive: true,
named: "counter",
columns: ["x"],
literal: """
VALUES(\(range.lowerBound)) \
UNION ALL \
SELECT x+1 FROM counter WHERE x < \(range.upperBound)
""")
return counter.all().with(counter)
}
let values = try dbQueue.read { db in
try counterRequest(range: 3...7).fetchAll(db)
}
print(values) // prints "[3, 4, 5, 6, 7]"
```
When you have to fetch from a `CommonTableExpression` which does not have the desired generic type, you can still use the `asRequest(of:)` method:
```swift
let cte: CommonTableExpression<Void> = ...
let rows: [Row] = try dbQueue.read { db in
try cte.all().with(cte)
.asRequest(of: Row.self)
.fetchAll(db)
}
```
## 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)
```
> :point_up: **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<Void>(
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(request.fetchAll)
```
> :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, our go-to `CommonTableExpression<Void>` CTEs can work against type safety. So when you want to define associations between several CTEs, and make sure the compiler will notice wrong uses of those associations, tag your `CommonTableExpression` with a type instead of `Void`.
>
> 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: ...)
> let assoc2 = cte1.association(to: cte2, on: ...)
> let assoc3 = cte2.association(to: FarRecord.self, on: ...)
>
> // WITH ...
> // SELECT base.* FROM base
> // JOIN cte1 ON ...
> // JOIN cte2 ON ...
> // JOIN far ON ...
> let request = BaseRecord
> .with(cte1).with(cte2)
> .joining(required: assoc1
> .joining(required: assoc2
> .joining(required: assoc3)))
>
> // Compiler error
> let request = BaseRecord.joining(required: assoc2)
> ```
[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
+14 -10
View File
@@ -3,7 +3,7 @@ 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.24.0](https://www.sqlite.org/changes.html).**
**You can build GRDB with a custom build of [SQLite 3.33.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).
@@ -11,15 +11,17 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
**To install GRDB with a custom SQLite build:**
1. Clone the GRDB 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 directory]
git checkout v3.3.0
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](../README.md#valueobservation) when you use a [Database Pool](../README.md#database-pools).
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.
@@ -111,7 +113,7 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
6. Add the `GRDBCustomSQLiteOSX` or `GRDBCustomSQLiteiOS` 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 `GRDBCustomSQLite.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,732 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
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 */; };
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 */; };
567C3E4E2520B70E0011F6E9 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 567C3E3B2520B7000011F6E9 /* GRDB.framework */; };
567C3E4F2520B70E0011F6E9 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 567C3E3B2520B7000011F6E9 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
567C3E5D2520B75C0011F6E9 /* Player.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E532520B75C0011F6E9 /* Player.swift */; };
567C3E5E2520B75C0011F6E9 /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E542520B75C0011F6E9 /* Persistence.swift */; };
567C3E5F2520B75C0011F6E9 /* PlayerListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E562520B75C0011F6E9 /* PlayerListViewModel.swift */; };
567C3E602520B75C0011F6E9 /* PlayerFormViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E572520B75C0011F6E9 /* PlayerFormViewModel.swift */; };
567C3E612520B75D0011F6E9 /* PlayerForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E592520B75C0011F6E9 /* PlayerForm.swift */; };
567C3E622520B75D0011F6E9 /* PlayerList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E5A2520B75C0011F6E9 /* PlayerList.swift */; };
567C3E632520B75D0011F6E9 /* PlayerCreationSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567C3E5B2520B75C0011F6E9 /* PlayerCreationSheet.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 */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
56026C9D25B8A7D000D1DF3F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E0E2520B6DE0011F6E9 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 567C3E152520B6DE0011F6E9;
remoteInfo = GRDBCombineDemo;
};
567C3E342520B7000011F6E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = DC3773F319C8CBB3004FCF85;
remoteInfo = GRDBOSX;
};
567C3E362520B7000011F6E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56E5D7F91B4D422D00430942;
remoteInfo = GRDBOSXTests;
};
567C3E382520B7000011F6E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56553C181C3E906C00522B5C;
remoteInfo = GRDBOSXCrashTests;
};
567C3E3A2520B7000011F6E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56E5D7CA1B4D3FED00430942;
remoteInfo = GRDBiOS;
};
567C3E3C2520B7000011F6E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56E5D7D31B4D3FEE00430942;
remoteInfo = GRDBiOSTests;
};
567C3E3E2520B7000011F6E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 565490A01D5A4798005622CB;
remoteInfo = GRDBWatchOS;
};
567C3E402520B7000011F6E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = AAA4DCFE230F1E0600C74B15;
remoteInfo = GRDBtvOS;
};
567C3E422520B7000011F6E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = AAA4DDD4230F262000C74B15;
remoteInfo = GRDBtvOSTests;
};
567C3E512520B71C0011F6E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 56E5D7C91B4D3FED00430942;
remoteInfo = GRDBiOS;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
567C3E502520B70E0011F6E9 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
567C3E4F2520B70E0011F6E9 /* GRDB.framework in Embed Frameworks */,
);
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>"; };
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>"; };
567C3E292520B7000011F6E9 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../../GRDB.xcodeproj; 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>"; };
567C3E562520B75C0011F6E9 /* PlayerListViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerListViewModel.swift; sourceTree = "<group>"; };
567C3E572520B75C0011F6E9 /* PlayerFormViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerFormViewModel.swift; sourceTree = "<group>"; };
567C3E592520B75C0011F6E9 /* PlayerForm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerForm.swift; sourceTree = "<group>"; };
567C3E5A2520B75C0011F6E9 /* PlayerList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerList.swift; sourceTree = "<group>"; };
567C3E5B2520B75C0011F6E9 /* PlayerCreationSheet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerCreationSheet.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>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
56026C9525B8A7D000D1DF3F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
567C3E132520B6DE0011F6E9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
567C3E4E2520B70E0011F6E9 /* GRDB.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
56026C9925B8A7D000D1DF3F /* GRDBCombineDemoTests */ = {
isa = PBXGroup;
children = (
56026C9C25B8A7D000D1DF3F /* Info.plist */,
56026CAB25B8A7EF00D1DF3F /* AppDatabaseTests.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>";
};
56185BC225B8048B00B9C30F /* Support */ = {
isa = PBXGroup;
children = (
567C3E222520B6DF0011F6E9 /* Info.plist */,
);
name = Support;
sourceTree = "<group>";
};
567C3E0D2520B6DE0011F6E9 = {
isa = PBXGroup;
children = (
567C3E292520B7000011F6E9 /* GRDB.xcodeproj */,
567C3E182520B6DE0011F6E9 /* GRDBCombineDemo */,
56026C9925B8A7D000D1DF3F /* GRDBCombineDemoTests */,
567C3E172520B6DE0011F6E9 /* Products */,
567C3E4D2520B70E0011F6E9 /* Frameworks */,
);
sourceTree = "<group>";
};
567C3E172520B6DE0011F6E9 /* Products */ = {
isa = PBXGroup;
children = (
567C3E162520B6DE0011F6E9 /* GRDBCombineDemo.app */,
56026C9825B8A7D000D1DF3F /* GRDBCombineDemoTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
567C3E182520B6DE0011F6E9 /* GRDBCombineDemo */ = {
isa = PBXGroup;
children = (
567C3E652520B7880011F6E9 /* AppDatabase.swift */,
567C3E192520B6DE0011F6E9 /* GRDBCombineDemoApp.swift */,
567C3E542520B75C0011F6E9 /* Persistence.swift */,
567C3E532520B75C0011F6E9 /* Player.swift */,
567C3E1F2520B6DF0011F6E9 /* Preview Content */,
56185BC125B8047D00B9C30F /* Resources */,
56185BC225B8048B00B9C30F /* Support */,
567C3E552520B75C0011F6E9 /* ViewModels */,
567C3E582520B75C0011F6E9 /* Views */,
);
path = GRDBCombineDemo;
sourceTree = "<group>";
};
567C3E1F2520B6DF0011F6E9 /* Preview Content */ = {
isa = PBXGroup;
children = (
567C3E202520B6DF0011F6E9 /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "<group>";
};
567C3E2A2520B7000011F6E9 /* Products */ = {
isa = PBXGroup;
children = (
567C3E352520B7000011F6E9 /* GRDB.framework */,
567C3E372520B7000011F6E9 /* GRDBOSXTests.xctest */,
567C3E392520B7000011F6E9 /* GRDBOSXCrashTests.xctest */,
567C3E3B2520B7000011F6E9 /* GRDB.framework */,
567C3E3D2520B7000011F6E9 /* GRDBiOSTests.xctest */,
567C3E3F2520B7000011F6E9 /* GRDB.framework */,
567C3E412520B7000011F6E9 /* GRDB.framework */,
567C3E432520B7000011F6E9 /* GRDBtvOSTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
567C3E4D2520B70E0011F6E9 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
567C3E552520B75C0011F6E9 /* ViewModels */ = {
isa = PBXGroup;
children = (
567C3E562520B75C0011F6E9 /* PlayerListViewModel.swift */,
567C3E572520B75C0011F6E9 /* PlayerFormViewModel.swift */,
);
path = ViewModels;
sourceTree = "<group>";
};
567C3E582520B75C0011F6E9 /* Views */ = {
isa = PBXGroup;
children = (
567C3E592520B75C0011F6E9 /* PlayerForm.swift */,
567C3E5A2520B75C0011F6E9 /* PlayerList.swift */,
567C3E5B2520B75C0011F6E9 /* PlayerCreationSheet.swift */,
567C3E5C2520B75C0011F6E9 /* PlayerEditionView.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 = (
567C3E522520B71C0011F6E9 /* PBXTargetDependency */,
);
name = GRDBCombineDemo;
productName = GRBCombineDemo;
productReference = 567C3E162520B6DE0011F6E9 /* GRDBCombineDemo.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
567C3E0E2520B6DE0011F6E9 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1230;
LastUpgradeCheck = 1200;
TargetAttributes = {
56026C9725B8A7D000D1DF3F = {
CreatedOnToolsVersion = 12.3;
TestTargetID = 567C3E152520B6DE0011F6E9;
};
567C3E152520B6DE0011F6E9 = {
CreatedOnToolsVersion = 12.0;
};
};
};
buildConfigurationList = 567C3E112520B6DE0011F6E9 /* Build configuration list for PBXProject "GRDBCombineDemo" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 567C3E0D2520B6DE0011F6E9;
productRefGroup = 567C3E172520B6DE0011F6E9 /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 567C3E2A2520B7000011F6E9 /* Products */;
ProjectRef = 567C3E292520B7000011F6E9 /* GRDB.xcodeproj */;
},
);
projectRoot = "";
targets = (
567C3E152520B6DE0011F6E9 /* GRDBCombineDemo */,
56026C9725B8A7D000D1DF3F /* GRDBCombineDemoTests */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
567C3E352520B7000011F6E9 /* GRDB.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = GRDB.framework;
remoteRef = 567C3E342520B7000011F6E9 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
567C3E372520B7000011F6E9 /* GRDBOSXTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GRDBOSXTests.xctest;
remoteRef = 567C3E362520B7000011F6E9 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
567C3E392520B7000011F6E9 /* GRDBOSXCrashTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GRDBOSXCrashTests.xctest;
remoteRef = 567C3E382520B7000011F6E9 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
567C3E3B2520B7000011F6E9 /* GRDB.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = GRDB.framework;
remoteRef = 567C3E3A2520B7000011F6E9 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
567C3E3D2520B7000011F6E9 /* GRDBiOSTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GRDBiOSTests.xctest;
remoteRef = 567C3E3C2520B7000011F6E9 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
567C3E3F2520B7000011F6E9 /* GRDB.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = GRDB.framework;
remoteRef = 567C3E3E2520B7000011F6E9 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
567C3E412520B7000011F6E9 /* GRDB.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = GRDB.framework;
remoteRef = 567C3E402520B7000011F6E9 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
567C3E432520B7000011F6E9 /* GRDBtvOSTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GRDBtvOSTests.xctest;
remoteRef = 567C3E422520B7000011F6E9 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy 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 */,
);
runOnlyForDeploymentPostprocessing = 0;
};
567C3E122520B6DE0011F6E9 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
567C3E5E2520B75C0011F6E9 /* Persistence.swift in Sources */,
567C3E5D2520B75C0011F6E9 /* Player.swift in Sources */,
567C3E612520B75D0011F6E9 /* PlayerForm.swift in Sources */,
567C3E632520B75D0011F6E9 /* PlayerCreationSheet.swift in Sources */,
567C3E662520B7880011F6E9 /* AppDatabase.swift in Sources */,
567C3E622520B75D0011F6E9 /* PlayerList.swift in Sources */,
567C3E642520B75D0011F6E9 /* PlayerEditionView.swift in Sources */,
567C3E1A2520B6DE0011F6E9 /* GRDBCombineDemoApp.swift in Sources */,
567C3E5F2520B75C0011F6E9 /* PlayerListViewModel.swift in Sources */,
567C3E602520B75C0011F6E9 /* PlayerFormViewModel.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
56026C9E25B8A7D000D1DF3F /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 567C3E152520B6DE0011F6E9 /* GRDBCombineDemo */;
targetProxy = 56026C9D25B8A7D000D1DF3F /* PBXContainerItemProxy */;
};
567C3E522520B71C0011F6E9 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = GRDBiOS;
targetProxy = 567C3E512520B71C0011F6E9 /* PBXContainerItemProxy */;
};
/* 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;
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
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;
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
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 = 14.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 = 14.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 = AMD8W895CT;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = GRDBCombineDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
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 = AMD8W895CT;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = GRDBCombineDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
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 */
};
rootObject = 567C3E0E2520B6DE0011F6E9 /* Project object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:/Users/groue/Documents/git/groue/GRDB.swift/Documentation/DemoApps/GRBCombineDemo/GRDBCombineDemo.xcodeproj">
</FileRef>
</Workspace>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "1230"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -14,10 +14,10 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56B037261E8E31D0003B6DA4"
BuildableName = "GRDBiOS.app"
BlueprintName = "GRDBiOS"
ReferencedContainer = "container:GRDBiOS.xcodeproj">
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
BuildableName = "GRDBCombineDemo.app"
BlueprintName = "GRDBCombineDemo"
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
@@ -26,27 +26,24 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56026C9725B8A7D000D1DF3F"
BuildableName = "GRDBCombineDemoTests.xctest"
BlueprintName = "GRDBCombineDemoTests"
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56B037261E8E31D0003B6DA4"
BuildableName = "GRDBiOS.app"
BlueprintName = "GRDBiOS"
ReferencedContainer = "container:GRDBiOS.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -57,14 +54,12 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56B037261E8E31D0003B6DA4"
BuildableName = "GRDBiOS.app"
BlueprintName = "GRDBiOS"
ReferencedContainer = "container:GRDBiOS.xcodeproj">
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
BuildableName = "GRDBCombineDemo.app"
BlueprintName = "GRDBCombineDemo"
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -76,10 +71,10 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56B037261E8E31D0003B6DA4"
BuildableName = "GRDBiOS.app"
BlueprintName = "GRDBiOS"
ReferencedContainer = "container:GRDBiOS.xcodeproj">
BlueprintIdentifier = "567C3E152520B6DE0011F6E9"
BuildableName = "GRDBCombineDemo.app"
BlueprintName = "GRDBCombineDemo"
ReferencedContainer = "container:GRDBCombineDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
@@ -0,0 +1,143 @@
import Combine
import GRDB
/// AppDatabase lets the application access the database.
///
/// It applies the pratices recommended at
/// https://github.com/groue/GRDB.swift/blob/master/Documentation/GoodPracticesForDesigningRecordTypes.md
struct AppDatabase {
/// Creates an `AppDatabase`, and make sure the database schema is ready.
init(_ dbWriter: 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://github.com/groue/GRDB.swift/blob/master/README.md#database-connections
private let dbWriter: DatabaseWriter
/// The DatabaseMigrator that defines the database schema.
///
/// See https://github.com/groue/GRDB.swift/blob/master/Documentation/Migrations.md
private var migrator: DatabaseMigrator {
var migrator = DatabaseMigrator()
#if DEBUG
// Speed up development by nuking the database when migrations change
// See https://github.com/groue/GRDB.swift/blob/master/Documentation/Migrations.md#the-erasedatabaseonschemachange-option
migrator.eraseDatabaseOnSchemaChange = true
#endif
migrator.registerMigration("createPlayer") { db in
// Create a table
// See https://github.com/groue/GRDB.swift#create-tables
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
extension AppDatabase {
/// 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 {
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, keys: 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.fetchCount(db) == 0 {
// When database is empty, insert new random players
try createRandomPlayers(db)
} else {
// Insert a player
if Bool.random() {
var player = Player.newRandom()
try player.insert(db)
}
// 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.fetchCount(db) == 0 {
try createRandomPlayers(db)
}
}
}
/// Support for `createRandomPlayersIfEmpty()` and `refreshPlayers()`.
private func createRandomPlayers(_ db: Database) throws {
for _ in 0..<8 {
var player = Player.newRandom()
try player.insert(db)
}
}
}
// MARK: - Database Access: Reads
extension AppDatabase {
/// Returns a publisher that tracks changes in players ordered by name
func playersOrderedByNamePublisher() -> AnyPublisher<[Player], Error> {
ValueObservation
.tracking(Player.all().orderedByName().fetchAll)
.publisher(in: dbWriter, scheduling: .immediate)
.eraseToAnyPublisher()
}
/// Returns a publisher that tracks changes in players ordered by score
func playersOrderedByScorePublisher() -> AnyPublisher<[Player], Error> {
ValueObservation
.tracking(Player.all().orderedByScore().fetchAll)
.publisher(in: dbWriter, scheduling: .immediate)
.eraseToAnyPublisher()
}
}
@@ -0,0 +1,12 @@
import SwiftUI
@main
struct GRDBCombineDemoApp: App {
let appDatabase = AppDatabase.shared
var body: some Scene {
WindowGroup {
PlayerList(viewModel: PlayerListViewModel(database: 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,58 @@
import GRDB
extension AppDatabase {
/// The database for the application
static let shared = makeShared()
private static func makeShared() -> AppDatabase {
do {
// Create a folder for storing the SQLite database, as well as
// the various temporary files created during normal database
// operations (https://sqlite.org/tempfiles.html).
let fileManager = FileManager()
let folderURL = try fileManager
.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
.appendingPathComponent("database", isDirectory: true)
try fileManager.createDirectory(at: folderURL, withIntermediateDirectories: true)
// Connect to a database on disk
// See https://github.com/groue/GRDB.swift/blob/master/README.md#database-connections
let dbURL = folderURL.appendingPathComponent("db.sqlite")
let dbPool = try DatabasePool(path: dbURL.path)
// Create the AppDatabase
let appDatabase = try AppDatabase(dbPool)
// 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://github.com/groue/GRDB.swift/blob/master/README.md#database-connections
let dbQueue = DatabaseQueue()
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.
/// 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 newRandom() -> 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(with rowID: Int64, for column: String?) {
id = rowID
}
}
// MARK: - Player Database Requests
/// Define some player requests used by the application.
///
/// See https://github.com/groue/GRDB.swift/blob/master/README.md#requests
/// See https://github.com/groue/GRDB.swift/blob/master/Documentation/GoodPracticesForDesigningRecordTypes.md
extension DerivableRequest where RowDecoder == 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,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,71 +1,112 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"size" : "29x29",
"filename" : "icon_20pt@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"size" : "29x29",
"filename" : "icon_20pt@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"size" : "40x40",
"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-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"
},
{
"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"
},
{
"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

@@ -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,67 @@
import Combine
import Foundation
/// The view model that validates and saves an edited player into the database.
///
/// It feeds `PlayerForm`, `PlayerCreationSheet` and `PlayerEditionView`.
final class PlayerFormViewModel: ObservableObject {
/// A validation error that prevents the player from being saved into
/// the database.
enum ValidationError: LocalizedError {
case missingName
var errorDescription: String? {
switch self {
case .missingName:
return "Please give a name to this player."
}
}
}
@Published var name: String = ""
@Published var score: String = ""
private let database: AppDatabase
private var player: Player
init(database: AppDatabase, player: Player) {
self.database = database
self.player = player
updateViewFromPlayer()
}
// MARK: - Manage the Player Form
/// Validates and saves the player into the database.
func savePlayer() throws {
if name.isEmpty {
throw ValidationError.missingName
}
player.name = name
player.score = Int(score) ?? 0
try database.savePlayer(&player)
}
/// Resets form values to the original player values.
func reset() {
updateViewFromPlayer()
}
/// Edits a new player
func editNewPlayer() {
player = .new()
updateViewFromPlayer()
}
// MARK: - Private
private func updateViewFromPlayer() {
self.name = player.name
if player.score == 0 && player.id == nil {
// Avoid displaying "0" for a new player: it does not look good.
self.score = ""
} else {
self.score = "\(player.score)"
}
}
}
@@ -0,0 +1,118 @@
import Combine
import Foundation
/// The view model that feeds `PlayerList`, and performs list modifications
/// in the database.
final class PlayerListViewModel: ObservableObject {
enum Ordering {
case byScore
case byName
}
struct PlayerList {
var players: [Player]
var animatedChanges: Bool
}
/// The list ordering
@Published var ordering: Ordering = .byScore
/// The players in the list
@Published var playerList = PlayerList(players: [], animatedChanges: false)
/// The view model that edits a new player
let newPlayerViewModel: PlayerFormViewModel
private let database: AppDatabase
private var playersCancellable: AnyCancellable?
init(database: AppDatabase) {
self.database = database
newPlayerViewModel = PlayerFormViewModel(database: database, player: .new())
playersCancellable = playersPublisher(in: database)
.scan(nil) { (previousList: PlayerList?, players: [Player]) in
if previousList == nil {
// Do not animate first view update
return PlayerList(players: players, animatedChanges: false)
} else {
return PlayerList(players: players, animatedChanges: true)
}
}
.compactMap { $0 }
.sink { [weak self] playerList in
self?.playerList = playerList
}
}
// MARK: - Players List Management
/// Deletes all players
func deleteAllPlayers() {
// Eventual error presentation is left as an exercise for the reader.
try! database.deleteAllPlayers()
}
func deletePlayers(atOffsets offsets: IndexSet) {
// Eventual error presentation is left as an exercise for the reader.
let playerIDs = offsets.compactMap { playerList.players[$0].id }
try! database.deletePlayers(ids: playerIDs)
}
/// Refreshes the list of players
func refreshPlayers() {
// Eventual error presentation is left as an exercise for the reader.
try! database.refreshPlayers()
}
/// Spawns many concurrent database updates, for demo purpose
func stressTest() {
for _ in 0..<50 {
DispatchQueue.global().async {
self.refreshPlayers()
}
}
}
// MARK: - Change Player Ordering
/// Toggles between the available orderings
func toggleOrdering() {
switch ordering {
case .byName:
ordering = .byScore
case .byScore:
ordering = .byName
}
}
// MARK: - Player Edition
/// Returns a view model suitable for editing a player.
func formViewModel(for player: Player) -> PlayerFormViewModel {
PlayerFormViewModel(database: database, player: player)
}
// MARK: - Private
/// Returns a publisher of the players in the list
private func playersPublisher(in database: AppDatabase) -> AnyPublisher<[Player], Never> {
// Players depend on the current ordering
$ordering.map { ordering -> AnyPublisher<[Player], Error> in
switch ordering {
case .byScore:
return database.playersOrderedByScorePublisher()
case .byName:
return database.playersOrderedByNamePublisher()
}
}
.map { playersPublisher in
// Turn database errors into an empty players list.
// Eventual error presentation is left as an exercise for the reader.
playersPublisher.catch { error in
Just<[Player]>([])
}
}
.switchToLatest()
.eraseToAnyPublisher()
}
}
@@ -0,0 +1,52 @@
import SwiftUI
/// The Player creation sheet
struct PlayerCreationSheet: View {
/// Manages the player form
let viewModel: PlayerFormViewModel
/// Executed when user cancels or saves the new user.
let dismissAction: () -> Void
@State private var errorAlertIsPresented = false
@State private var errorAlertTitle = ""
var body: some View {
NavigationView {
PlayerForm(viewModel: viewModel)
.alert(
isPresented: $errorAlertIsPresented,
content: { Alert(title: Text(errorAlertTitle)) })
.navigationBarTitle("New Player")
.navigationBarItems(
leading: Button(
action: self.dismissAction,
label: { Text("Cancel") }),
trailing: Button(
action: self.save,
label: { Text("Save") }))
}
}
private func save() {
do {
try viewModel.savePlayer()
dismissAction()
} catch {
errorAlertTitle = (error as? LocalizedError)?.errorDescription ?? "An error occurred"
errorAlertIsPresented = true
}
}
}
struct PlayerCreationSheet_Previews: PreviewProvider {
static var previews: some View {
let viewModel = PlayerFormViewModel(
database: .empty(),
player: .new())
return PlayerCreationSheet(
viewModel: viewModel,
dismissAction: { })
}
}
@@ -0,0 +1,29 @@
import SwiftUI
/// The Player edition view, designed to be the destination of
/// a NavigationLink.
struct PlayerEditionView: View {
/// Manages the player form
let viewModel: PlayerFormViewModel
var body: some View {
PlayerForm(viewModel: viewModel)
.onDisappear(perform: {
// Ignore validation errors
try? self.viewModel.savePlayer()
})
}
}
struct PlayerEditionView_Previews: PreviewProvider {
static var previews: some View {
let viewModel = PlayerFormViewModel(
database: .empty(),
player: .newRandom())
return NavigationView {
PlayerEditionView(viewModel: viewModel)
.navigationBarTitle("Player Edition")
}
}
}
@@ -0,0 +1,39 @@
import SwiftUI
/// The Player editing form, embedded in both
/// `PlayerCreationSheet` and `PlayerEditionView`.
struct PlayerForm: View {
/// Manages the player form
@ObservedObject var viewModel: PlayerFormViewModel
var body: some View {
List {
TextField("Name", text: $viewModel.name)
TextField("Score", text: $viewModel.score)
.keyboardType(.numberPad)
}
.listStyle(GroupedListStyle())
// Make sure the form is reset, in case a previous edition ended
// with a validation error.
//
// The bug we want to prevent is the following:
//
// 1. Launch the app
// 2. Tap a player
// 3. Erase the name so that validation fails
// 4. Hit the back button
// 5. Tap the same player
// 6. Bug: the form displays an empty name.
.onAppear(perform: viewModel.reset)
}
}
struct PlayerFormView_Previews: PreviewProvider {
static var previews: some View {
let viewModel = PlayerFormViewModel(
database: .empty(),
player: .newRandom())
return PlayerForm(viewModel: viewModel)
}
}
@@ -0,0 +1,131 @@
import SwiftUI
/// The list of players
struct PlayerList: View {
/// Manages the list of players
@ObservedObject var viewModel: PlayerListViewModel
/// Controls the presentation of the player creation sheet.
@State private var newPlayerIsPresented = false
var body: some View {
NavigationView {
VStack {
playerList
toolbar
}
.navigationBarTitle(Text("\(viewModel.playerList.players.count) Players"))
.navigationBarItems(
leading: HStack {
EditButton()
newPlayerButton
},
trailing: toggleOrderingButton)
}
}
private var playerList: some View {
List {
ForEach(viewModel.playerList.players) { player in
NavigationLink(destination: self.editionView(for: player)) {
PlayerRow(player: player)
.animation(nil)
}
}
.onDelete(perform: { offsets in
self.viewModel.deletePlayers(atOffsets: offsets)
})
}
.listStyle(PlainListStyle())
.animation(viewModel.playerList.animatedChanges ? .default : nil)
}
private var toolbar: some View {
HStack {
Button(
action: viewModel.deleteAllPlayers,
label: { Image(systemName: "trash").imageScale(.large) })
Spacer()
Button(
action: viewModel.refreshPlayers,
label: { Image(systemName: "arrow.clockwise").imageScale(.large) })
Spacer()
Button(
action: viewModel.stressTest,
label: { Image(systemName: "tornado").imageScale(.large) })
}
.padding()
}
/// The button that toggles between name/score ordering.
private var toggleOrderingButton: some View {
switch viewModel.ordering {
case .byName:
return Button(action: viewModel.toggleOrdering, label: {
HStack {
Text("Name")
Image(systemName: "arrowtriangle.up.fill")
.imageScale(.small)
}
})
case .byScore:
return Button(action: viewModel.toggleOrdering, label: {
HStack {
Text("Score")
Image(systemName: "arrowtriangle.down.fill")
.imageScale(.small)
}
})
}
}
/// The view that edits a player in the list.
private func editionView(for player: Player) -> some View {
PlayerEditionView(
viewModel: viewModel.formViewModel(for: player))
.navigationBarTitle(player.name)
}
/// The button that presents the player creation sheet.
private var newPlayerButton: some View {
Button(
action: {
// Make sure we do not edit a previously created player.
self.viewModel.newPlayerViewModel.editNewPlayer()
self.newPlayerIsPresented = true
},
label: { Image(systemName: "plus").imageScale(.large) })
.sheet(
isPresented: $newPlayerIsPresented,
content: { self.newPlayerCreationSheet })
}
/// The player creation sheet.
private var newPlayerCreationSheet: some View {
PlayerCreationSheet(
viewModel: self.viewModel.newPlayerViewModel,
dismissAction: {
self.newPlayerIsPresented = false
})
}
}
struct PlayerRow: View {
var player: Player
var body: some View {
HStack {
Text(player.name)
Spacer()
Text("\(player.score) points").foregroundColor(.gray)
}
}
}
struct PlayerListView_Previews: PreviewProvider {
static var previews: some View {
let viewModel = PlayerListViewModel(database: .random())
return PlayerList(viewModel: viewModel)
}
}
@@ -0,0 +1,254 @@
import XCTest
import GRDB
@testable import GRDBCombineDemo
class AppDatabaseTests: XCTestCase {
func test_database_schema() throws {
// Given an empty database
let dbQueue = DatabaseQueue()
// 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() throws {
// Given an empty players database
let dbQueue = DatabaseQueue()
let appDatabase = try AppDatabase(dbQueue)
// When we save a new player
var player = Player(id: nil, name: "Arthur", score: 100)
try appDatabase.savePlayer(&player)
// Then the player exists in the database
try XCTAssertTrue(dbQueue.read(player.exists))
}
func test_savePlayer_updates() throws {
// Given a players database that contains a player
let dbQueue = DatabaseQueue()
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 modify and save the player
player.name = "Barbara"
player.score = 1000
try appDatabase.savePlayer(&player)
// Then the player has been updated in the database
let fetchedPlayer = try dbQueue.read { db in
try XCTUnwrap(Player.fetchOne(db, key: player.id))
}
XCTAssertEqual(fetchedPlayer, player)
}
func test_deletePlayers() throws {
// Given a players database that contains four players
let dbQueue = DatabaseQueue()
let appDatabase = try AppDatabase(dbQueue)
var player1 = Player(id: nil, name: "Arthur", score: 100)
var player2 = Player(id: nil, name: "Barbara", score: 200)
var player3 = Player(id: nil, name: "Craig", score: 150)
var player4 = Player(id: nil, 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 delete two players
try appDatabase.deletePlayers(ids: [player1.id!, player3.id!])
// Then the deleted players no longer exist
try dbQueue.read { db in
try XCTAssertFalse(player1.exists(db))
try XCTAssertFalse(player3.exists(db))
}
// Then the database still contains two players
try XCTAssertEqual(dbQueue.read(Player.fetchCount), 2)
}
func test_deleteAllPlayers() throws {
// Given a players database that contains players
let dbQueue = DatabaseQueue()
let appDatabase = try AppDatabase(dbQueue)
var player1 = Player(id: nil, name: "Arthur", score: 100)
var player2 = Player(id: nil, name: "Barbara", score: 200)
var player3 = Player(id: nil, name: "Craig", score: 150)
var player4 = Player(id: nil, 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 delete all players
try appDatabase.deleteAllPlayers()
// Then the database does not contain any player
try XCTAssertEqual(dbQueue.read(Player.fetchCount), 0)
}
func test_refreshPlayers_populates_an_empty_database() throws {
// Given an empty players database
let dbQueue = DatabaseQueue()
let appDatabase = try AppDatabase(dbQueue)
// When we refresh players
try appDatabase.refreshPlayers()
// Then the database is not empty
try XCTAssert(dbQueue.read(Player.fetchCount) > 0)
}
func test_createRandomPlayersIfEmpty_populates_an_empty_database() throws {
// Given an empty players database
let dbQueue = DatabaseQueue()
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 = DatabaseQueue()
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])
}
func test_playersOrderedByNamePublisher_publishes_well_ordered_players() throws {
// Given a players database that contains two players
let dbQueue = DatabaseQueue()
let appDatabase = 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 observe players and wait for the first value
let exp = expectation(description: "Players")
var players: [Player]?
let cancellable = appDatabase.playersOrderedByNamePublisher().sink { completion in
if case let .failure(error) = completion {
XCTFail("Unexpected error \(error)")
}
} receiveValue: {
players = $0
exp.fulfill()
}
withExtendedLifetime(cancellable) {
waitForExpectations(timeout: 1, handler: nil)
}
// Then the players are the two players ordered by name
XCTAssertEqual(players, [player1, player2])
}
func test_playersOrderedByNamePublisher_publishes_right_on_subscripion() throws {
// Our SwiftUI views have no "waiting" state, and must be fed with
// players without any delay in order to avoid any rendering glitch.
// This test makes sure `playersOrderedByNamePublisher` publishes right
// on subscription.
// Given a players database
let dbQueue = DatabaseQueue()
let appDatabase = try AppDatabase(dbQueue)
// When we observe players
var players: [Player]?
_ = appDatabase.playersOrderedByNamePublisher().sink { completion in
if case let .failure(error) = completion {
XCTFail("Unexpected error \(error)")
}
} receiveValue: {
players = $0
}
// Then the players are published right on subscription
XCTAssertNotNil(players)
}
func test_playersOrderedByScorePublisher_publishes_well_ordered_players() throws {
// Given a players database that contains two players
let dbQueue = DatabaseQueue()
let appDatabase = 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 observe players and wait for the first value
let exp = expectation(description: "Players")
var players: [Player]?
let cancellable = appDatabase.playersOrderedByScorePublisher().sink { completion in
if case let .failure(error) = completion {
XCTFail("Unexpected error \(error)")
}
} receiveValue: {
players = $0
exp.fulfill()
}
withExtendedLifetime(cancellable) {
waitForExpectations(timeout: 1, handler: nil)
}
// Then the players are the two players ordered by score descending
XCTAssertEqual(players, [player2, player1])
}
func test_playersOrderedByScorePublisher_publishes_right_on_subscripion() throws {
// Our SwiftUI views have no "waiting" state, and must be fed with
// players without any delay in order to avoid any rendering glitch.
// This test makes sure `playersOrderedByScorePublisher` publishes right
// on subscription.
// Given a players database
let dbQueue = DatabaseQueue()
let appDatabase = try AppDatabase(dbQueue)
// When we observe players
var players: [Player]?
_ = appDatabase.playersOrderedByScorePublisher().sink { completion in
if case let .failure(error) = completion {
XCTFail("Unexpected error \(error)")
}
} receiveValue: {
players = $0
}
// Then the players are published right on subscription
XCTAssertNotNil(players)
}
}
@@ -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,108 @@
import XCTest
import GRDB
@testable import GRDBCombineDemo
class PlayerTests: XCTestCase {
// MARK: - CRUD
// Test that our Player type properly talks to GRDB.
func testInsert() throws {
// Given an empty players database
let dbQueue = DatabaseQueue()
_ = 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 = DatabaseQueue()
_ = 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 = DatabaseQueue()
_ = 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 = DatabaseQueue()
_ = 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 = DatabaseQueue()
_ = 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,48 @@
Combine + 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 a Combine + SwiftUI application, based on the MVVM design pattern.** For a demo application that uses UIKit, see [GRDBDemoiOS](../GRDBDemoiOS/README.md).
> :point_up: **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 [ValueObservation](../../../README.md#valueobservation) Combine publishers.
- How to apply the recommendations of [Good Practices for Designing Record Types](../../GoodPracticesForDesigningRecordTypes.md).
- How to feed SwiftUI previews with a transient database.
**Files of interest:**
- [GRDBCombineDemoApp.swift](GRDBCombineDemo/GRDBCombineDemoApp.swift)
`GRDBCombineDemoApp` feeds the app views with a database.
- [AppDatabase.swift](GRDBCombineDemo/AppDatabase.swift)
`AppDatabase` is the type that grants database access. It uses [DatabaseMigrator](../../Migrations.md) in order to setup the database schema, and [ValueObservation](../../../README.md#valueobservation) in order to let the application observe database changes.
- [Persistence.swift](GRDBCombineDemo/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](GRDBCombineDemo/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). It defines the database requests used by the application.
- [PlayerList.swift](GRDBCombineDemo/Views/PlayerList.swift) and [PlayerListViewModel.swift](GRDBCombineDemo/ViewModels/PlayerListViewModel.swift)
`PlayerList` is the SwiftUI view that displays the list of players, fed by `PlayerListViewModel`.
- [PlayerForm.swift](GRDBCombineDemo/Views/PlayerForm.swift), [PlayerEditionView.swift](GRDBCombineDemo/Views/PlayerEditionView.swift), [PlayerCreationSheet.swift](GRDBCombineDemo/Views/PlayerCreationSheet.swift) and [PlayerFormViewModel.swift](GRDBCombineDemo/ViewModels/PlayerFormViewModel.swift).
`PlayerForm` is the SwiftUI view that displays a Player editing form. It is embedded in `PlayerEditionView` and `PlayerCreationSheet`, two SwiftUI views that edit or create a player. All those views are fed by `PlayerFormViewModel`.
- [GRDBCombineDemoTests](GRDBCombineDemoTests)
- Test the database schema
- Test the `Player` record and its requests
- Test the `AppDatabase` methods that let the app access the database.
Binary file not shown.

After

Width:  |  Height:  |  Size: 799 KiB

@@ -15,6 +15,7 @@ class ExtensionDelegate: NSObject, WKExtensionDelegate {
// Use this method to pause ongoing tasks, disable timers, etc.
}
@available(watchOSApplicationExtension 3.0, *)
func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) {
// Sent when the system needs to launch the application in the background to process tasks. Tasks arrive in a set, so loop through and process each one.
for task in backgroundTasks {
@@ -1,7 +1,6 @@
import WatchKit
import Foundation
import GRDB
import SQLite3
class InterfaceController: WKInterfaceController {
@@ -7,6 +7,13 @@
objects = {
/* Begin PBXBuildFile section */
56185BBF25B8036100B9C30F /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56185BBE25B8036100B9C30F /* Persistence.swift */; };
56185BF325B80B8900B9C30F /* AppDatabaseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56185BF225B80B8900B9C30F /* AppDatabaseTests.swift */; };
56185C0725B80CEC00B9C30F /* PlayerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56185C0625B80CEC00B9C30F /* PlayerTests.swift */; };
56606D202355938A00185962 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 56606D142355931F00185962 /* GRDB.framework */; };
56606D212355938A00185962 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 56606D142355931F00185962 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
56606D24235593AB00185962 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 56606D182355931F00185962 /* GRDB.framework */; };
56606D25235593AB00185962 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 56606D182355931F00185962 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
568E5FC31E926430002582E0 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 568E5FC11E926430002582E0 /* Interface.storyboard */; };
568E5FC51E926430002582E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 568E5FC41E926430002582E0 /* Assets.xcassets */; };
568E5FCC1E926430002582E0 /* GRDBDemoWatchOS Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 568E5FCB1E926430002582E0 /* GRDBDemoWatchOS Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
@@ -14,8 +21,6 @@
568E5FD31E926430002582E0 /* ExtensionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568E5FD21E926430002582E0 /* ExtensionDelegate.swift */; };
568E5FD51E926430002582E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 568E5FD41E926430002582E0 /* Assets.xcassets */; };
568E5FD91E926430002582E0 /* GRDBDemoWatchOS.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 568E5FBF1E926430002582E0 /* GRDBDemoWatchOS.app */; };
568E5FE41E926547002582E0 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 56B0365B1E8D9F79003B6DA4 /* GRDB.framework */; };
568E5FE51E926547002582E0 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 56B0365B1E8D9F79003B6DA4 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
56B036071E8D9EBE003B6DA4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B036061E8D9EBE003B6DA4 /* AppDelegate.swift */; };
56B0360C1E8D9EBE003B6DA4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 56B0360A1E8D9EBE003B6DA4 /* Main.storyboard */; };
56B0360E1E8D9EBE003B6DA4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 56B0360D1E8D9EBE003B6DA4 /* Assets.xcassets */; };
@@ -23,18 +28,87 @@
56B0361B1E8D9F38003B6DA4 /* AppDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B036191E8D9F38003B6DA4 /* AppDatabase.swift */; };
56B0361C1E8D9F38003B6DA4 /* Player.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B0361A1E8D9F38003B6DA4 /* Player.swift */; };
56B036231E8D9F4C003B6DA4 /* PlayerEditionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B0361F1E8D9F4C003B6DA4 /* PlayerEditionViewController.swift */; };
56B036241E8D9F4C003B6DA4 /* PlayersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B036201E8D9F4C003B6DA4 /* PlayersViewController.swift */; };
56B0365E1E8D9FB1003B6DA4 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 56B0364D1E8D9F79003B6DA4 /* GRDB.framework */; };
56B0365F1E8D9FB1003B6DA4 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 56B0364D1E8D9F79003B6DA4 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
56B036241E8D9F4C003B6DA4 /* PlayerListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B036201E8D9F4C003B6DA4 /* PlayerListViewController.swift */; };
56FE6F2624A90CE400711EDF /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56FE6F2524A90CE400711EDF /* SceneDelegate.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
563BD2F01F8364C1006A5390 /* PBXContainerItemProxy */ = {
56185BF525B80B8900B9C30F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B035FB1E8D9EBE003B6DA4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 56B036021E8D9EBE003B6DA4;
remoteInfo = GRDBDemoiOS;
};
56606D092355931F00185962 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56439B501F4CA1DC0066043F;
remoteInfo = GRDBOSXPerformanceComparisonTests;
remoteGlobalIDString = DC3773F319C8CBB3004FCF85;
remoteInfo = GRDBOSX;
};
56606D0B2355931F00185962 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56E5D7F91B4D422D00430942;
remoteInfo = GRDBOSXTests;
};
56606D112355931F00185962 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56553C181C3E906C00522B5C;
remoteInfo = GRDBOSXCrashTests;
};
56606D132355931F00185962 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56E5D7CA1B4D3FED00430942;
remoteInfo = GRDBiOS;
};
56606D152355931F00185962 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56E5D7D31B4D3FEE00430942;
remoteInfo = GRDBiOSTests;
};
56606D172355931F00185962 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 565490A01D5A4798005622CB;
remoteInfo = GRDBWatchOS;
};
56606D192355931F00185962 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = AAA4DCFE230F1E0600C74B15;
remoteInfo = GRDBtvOS;
};
56606D1B2355931F00185962 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = AAA4DDD4230F262000C74B15;
remoteInfo = GRDBtvOSTests;
};
56606D1D2355937900185962 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 56E5D7C91B4D3FED00430942;
remoteInfo = GRDBiOS;
};
56606D22235593A300185962 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 5654909F1D5A4798005622CB;
remoteInfo = GRDBWatchOS;
};
568E5FCD1E926430002582E0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
@@ -50,83 +124,6 @@
remoteGlobalIDString = 568E5FBE1E926430002582E0;
remoteInfo = GRDBDemoWatchOS;
};
568E5FE21E926535002582E0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 5654909F1D5A4798005622CB;
remoteInfo = GRDBWatchOS;
};
568E5FE61E926547002582E0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 5654909F1D5A4798005622CB;
remoteInfo = GRDBWatchOS;
};
56B0363A1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = DC3773F319C8CBB3004FCF85;
remoteInfo = GRDBOSX;
};
56B0363C1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56E5D7F91B4D422D00430942;
remoteInfo = GRDBOSXTests;
};
56B0363E1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 560C981A1C0E22D300BF8471;
remoteInfo = GRDBOSXPerformanceTests;
};
56B036401E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56553C181C3E906C00522B5C;
remoteInfo = GRDBOSXCrashTests;
};
56B0364C1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56E5D7CA1B4D3FED00430942;
remoteInfo = GRDBiOS;
};
56B0364E1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 56E5D7D31B4D3FEE00430942;
remoteInfo = GRDBiOSTests;
};
56B0365A1E8D9F79003B6DA4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 565490A01D5A4798005622CB;
remoteInfo = GRDBWatchOS;
};
56B0365C1E8D9F8F003B6DA4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 56E5D7C91B4D3FED00430942;
remoteInfo = GRDBiOS;
};
56B036601E8D9FB1003B6DA4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 56E5D7C91B4D3FED00430942;
remoteInfo = GRDBiOS;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -158,7 +155,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
568E5FE51E926547002582E0 /* GRDB.framework in Embed Frameworks */,
56606D25235593AB00185962 /* GRDB.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
@@ -169,7 +166,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
56B0365F1E8D9FB1003B6DA4 /* GRDB.framework in Embed Frameworks */,
56606D212355938A00185962 /* GRDB.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
@@ -177,6 +174,11 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
56185BBE25B8036100B9C30F /* Persistence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = "<group>"; };
56185BF025B80B8900B9C30F /* GRDBDemoiOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GRDBDemoiOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
56185BF225B80B8900B9C30F /* AppDatabaseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDatabaseTests.swift; sourceTree = "<group>"; };
56185BF425B80B8900B9C30F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
56185C0625B80CEC00B9C30F /* PlayerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerTests.swift; sourceTree = "<group>"; };
568E5FBF1E926430002582E0 /* GRDBDemoWatchOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GRDBDemoWatchOS.app; sourceTree = BUILT_PRODUCTS_DIR; };
568E5FC21E926430002582E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Interface.storyboard; sourceTree = "<group>"; };
568E5FC41E926430002582E0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -195,16 +197,24 @@
56B036191E8D9F38003B6DA4 /* AppDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDatabase.swift; sourceTree = "<group>"; };
56B0361A1E8D9F38003B6DA4 /* Player.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Player.swift; sourceTree = "<group>"; };
56B0361F1E8D9F4C003B6DA4 /* PlayerEditionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerEditionViewController.swift; sourceTree = "<group>"; };
56B036201E8D9F4C003B6DA4 /* PlayersViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayersViewController.swift; sourceTree = "<group>"; };
56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../GRDB.xcodeproj; sourceTree = "<group>"; };
56B036201E8D9F4C003B6DA4 /* PlayerListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlayerListViewController.swift; sourceTree = "<group>"; };
56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../../GRDB.xcodeproj; sourceTree = "<group>"; };
56FE6F2524A90CE400711EDF /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
56185BED25B80B8900B9C30F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
568E5FC81E926430002582E0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
568E5FE41E926547002582E0 /* GRDB.framework in Frameworks */,
56606D24235593AB00185962 /* GRDB.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -212,13 +222,45 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
56B0365E1E8D9FB1003B6DA4 /* GRDB.framework in Frameworks */,
56606D202355938A00185962 /* GRDB.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
56185BF125B80B8900B9C30F /* GRDBDemoiOSTests */ = {
isa = PBXGroup;
children = (
56185BF425B80B8900B9C30F /* Info.plist */,
56185BF225B80B8900B9C30F /* AppDatabaseTests.swift */,
56185C0625B80CEC00B9C30F /* PlayerTests.swift */,
);
path = GRDBDemoiOSTests;
sourceTree = "<group>";
};
56606CFD2355931F00185962 /* Products */ = {
isa = PBXGroup;
children = (
56606D0A2355931F00185962 /* GRDB.framework */,
56606D0C2355931F00185962 /* GRDBOSXTests.xctest */,
56606D122355931F00185962 /* GRDBOSXCrashTests.xctest */,
56606D142355931F00185962 /* GRDB.framework */,
56606D162355931F00185962 /* GRDBiOSTests.xctest */,
56606D182355931F00185962 /* GRDB.framework */,
56606D1A2355931F00185962 /* GRDB.framework */,
56606D1C2355931F00185962 /* GRDBtvOSTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
56606D1F2355938A00185962 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
568E5FC01E926430002582E0 /* GRDBDemoWatchOS */ = {
isa = PBXGroup;
children = (
@@ -247,7 +289,9 @@
56B036051E8D9EBE003B6DA4 /* GRDBDemoiOS */,
568E5FC01E926430002582E0 /* GRDBDemoWatchOS */,
568E5FCF1E926430002582E0 /* GRDBDemoWatchOS Extension */,
56185BF125B80B8900B9C30F /* GRDBDemoiOSTests */,
56B036041E8D9EBE003B6DA4 /* Products */,
56606D1F2355938A00185962 /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -257,6 +301,7 @@
56B036031E8D9EBE003B6DA4 /* GRDBDemoiOS.app */,
568E5FBF1E926430002582E0 /* GRDBDemoWatchOS.app */,
568E5FCB1E926430002582E0 /* GRDBDemoWatchOS Extension.appex */,
56185BF025B80B8900B9C30F /* GRDBDemoiOSTests.xctest */,
);
name = Products;
sourceTree = "<group>";
@@ -264,37 +309,66 @@
56B036051E8D9EBE003B6DA4 /* GRDBDemoiOS */ = {
isa = PBXGroup;
children = (
56B036061E8D9EBE003B6DA4 /* AppDelegate.swift */,
56B036191E8D9F38003B6DA4 /* AppDatabase.swift */,
56B036061E8D9EBE003B6DA4 /* AppDelegate.swift */,
56185BBE25B8036100B9C30F /* Persistence.swift */,
56B0361A1E8D9F38003B6DA4 /* Player.swift */,
56B0361F1E8D9F4C003B6DA4 /* PlayerEditionViewController.swift */,
56B036201E8D9F4C003B6DA4 /* PlayersViewController.swift */,
56B0360A1E8D9EBE003B6DA4 /* Main.storyboard */,
56B0360D1E8D9EBE003B6DA4 /* Assets.xcassets */,
56B0360F1E8D9EBE003B6DA4 /* LaunchScreen.storyboard */,
56B036121E8D9EBE003B6DA4 /* Info.plist */,
56FE6F2524A90CE400711EDF /* SceneDelegate.swift */,
56FE6F4E24A9112900711EDF /* Resources */,
56FE6F5124A9118000711EDF /* Support */,
56FE6F4F24A9114200711EDF /* ViewControllers */,
);
path = GRDBDemoiOS;
sourceTree = "<group>";
};
56B036271E8D9F79003B6DA4 /* Products */ = {
56FE6F4E24A9112900711EDF /* Resources */ = {
isa = PBXGroup;
children = (
56B0363B1E8D9F79003B6DA4 /* GRDB.framework */,
56B0363D1E8D9F79003B6DA4 /* GRDBOSXTests.xctest */,
56B0363F1E8D9F79003B6DA4 /* GRDBOSXPerformanceTests.xctest */,
563BD2F11F8364C1006A5390 /* GRDBOSXPerformanceComparisonTests.xctest */,
56B036411E8D9F79003B6DA4 /* GRDBOSXCrashTests.xctest */,
56B0364D1E8D9F79003B6DA4 /* GRDB.framework */,
56B0364F1E8D9F79003B6DA4 /* GRDBiOSTests.xctest */,
56B0365B1E8D9F79003B6DA4 /* GRDB.framework */,
56B0360D1E8D9EBE003B6DA4 /* Assets.xcassets */,
56B0360F1E8D9EBE003B6DA4 /* LaunchScreen.storyboard */,
56B0360A1E8D9EBE003B6DA4 /* Main.storyboard */,
);
name = Products;
path = Resources;
sourceTree = "<group>";
};
56FE6F4F24A9114200711EDF /* ViewControllers */ = {
isa = PBXGroup;
children = (
56B0361F1E8D9F4C003B6DA4 /* PlayerEditionViewController.swift */,
56B036201E8D9F4C003B6DA4 /* PlayerListViewController.swift */,
);
path = ViewControllers;
sourceTree = "<group>";
};
56FE6F5124A9118000711EDF /* Support */ = {
isa = PBXGroup;
children = (
56B036121E8D9EBE003B6DA4 /* Info.plist */,
);
name = Support;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
56185BEF25B80B8900B9C30F /* GRDBDemoiOSTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 56185BFF25B80B8900B9C30F /* Build configuration list for PBXNativeTarget "GRDBDemoiOSTests" */;
buildPhases = (
56185BEC25B80B8900B9C30F /* Sources */,
56185BED25B80B8900B9C30F /* Frameworks */,
56185BEE25B80B8900B9C30F /* Resources */,
);
buildRules = (
);
dependencies = (
56185BF625B80B8900B9C30F /* PBXTargetDependency */,
);
name = GRDBDemoiOSTests;
productName = GRDBDemoiOSTests;
productReference = 56185BF025B80B8900B9C30F /* GRDBDemoiOSTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
568E5FBE1E926430002582E0 /* GRDBDemoWatchOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 568E5FDE1E926430002582E0 /* Build configuration list for PBXNativeTarget "GRDBDemoWatchOS" */;
@@ -324,8 +398,7 @@
buildRules = (
);
dependencies = (
568E5FE31E926535002582E0 /* PBXTargetDependency */,
568E5FE71E926547002582E0 /* PBXTargetDependency */,
56606D23235593A300185962 /* PBXTargetDependency */,
);
name = "GRDBDemoWatchOS Extension";
productName = "GRDBDemoWatchOS Extension";
@@ -345,8 +418,7 @@
buildRules = (
);
dependencies = (
56B0365D1E8D9F8F003B6DA4 /* PBXTargetDependency */,
56B036611E8D9FB1003B6DA4 /* PBXTargetDependency */,
56606D1E2355937900185962 /* PBXTargetDependency */,
568E5FD81E926430002582E0 /* PBXTargetDependency */,
);
name = GRDBDemoiOS;
@@ -360,10 +432,16 @@
56B035FB1E8D9EBE003B6DA4 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0930;
LastSwiftUpdateCheck = 1230;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = "Gwendal Roué";
TargetAttributes = {
56185BEF25B80B8900B9C30F = {
CreatedOnToolsVersion = 12.3;
DevelopmentTeam = AMD8W895CT;
ProvisioningStyle = Automatic;
TestTargetID = 56B036021E8D9EBE003B6DA4;
};
568E5FBE1E926430002582E0 = {
CreatedOnToolsVersion = 8.3;
DevelopmentTeam = AMD8W895CT;
@@ -372,18 +450,20 @@
568E5FCA1E926430002582E0 = {
CreatedOnToolsVersion = 8.3;
DevelopmentTeam = AMD8W895CT;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
56B036021E8D9EBE003B6DA4 = {
CreatedOnToolsVersion = 8.3;
DevelopmentTeam = AMD8W895CT;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 56B035FE1E8D9EBE003B6DA4 /* Build configuration list for PBXProject "GRDBDemoiOS" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -394,7 +474,7 @@
projectDirPath = "";
projectReferences = (
{
ProductGroup = 56B036271E8D9F79003B6DA4 /* Products */;
ProductGroup = 56606CFD2355931F00185962 /* Products */;
ProjectRef = 56B036261E8D9F79003B6DA4 /* GRDB.xcodeproj */;
},
);
@@ -403,70 +483,78 @@
56B036021E8D9EBE003B6DA4 /* GRDBDemoiOS */,
568E5FBE1E926430002582E0 /* GRDBDemoWatchOS */,
568E5FCA1E926430002582E0 /* GRDBDemoWatchOS Extension */,
56185BEF25B80B8900B9C30F /* GRDBDemoiOSTests */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
563BD2F11F8364C1006A5390 /* GRDBOSXPerformanceComparisonTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GRDBOSXPerformanceComparisonTests.xctest;
remoteRef = 563BD2F01F8364C1006A5390 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
56B0363B1E8D9F79003B6DA4 /* GRDB.framework */ = {
56606D0A2355931F00185962 /* GRDB.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = GRDB.framework;
remoteRef = 56B0363A1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
remoteRef = 56606D092355931F00185962 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
56B0363D1E8D9F79003B6DA4 /* GRDBOSXTests.xctest */ = {
56606D0C2355931F00185962 /* GRDBOSXTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GRDBOSXTests.xctest;
remoteRef = 56B0363C1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
remoteRef = 56606D0B2355931F00185962 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
56B0363F1E8D9F79003B6DA4 /* GRDBOSXPerformanceTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GRDBOSXPerformanceTests.xctest;
remoteRef = 56B0363E1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
56B036411E8D9F79003B6DA4 /* GRDBOSXCrashTests.xctest */ = {
56606D122355931F00185962 /* GRDBOSXCrashTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GRDBOSXCrashTests.xctest;
remoteRef = 56B036401E8D9F79003B6DA4 /* PBXContainerItemProxy */;
remoteRef = 56606D112355931F00185962 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
56B0364D1E8D9F79003B6DA4 /* GRDB.framework */ = {
56606D142355931F00185962 /* GRDB.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = GRDB.framework;
remoteRef = 56B0364C1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
remoteRef = 56606D132355931F00185962 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
56B0364F1E8D9F79003B6DA4 /* GRDBiOSTests.xctest */ = {
56606D162355931F00185962 /* GRDBiOSTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GRDBiOSTests.xctest;
remoteRef = 56B0364E1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
remoteRef = 56606D152355931F00185962 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
56B0365B1E8D9F79003B6DA4 /* GRDB.framework */ = {
56606D182355931F00185962 /* GRDB.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = GRDB.framework;
remoteRef = 56B0365A1E8D9F79003B6DA4 /* PBXContainerItemProxy */;
remoteRef = 56606D172355931F00185962 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
56606D1A2355931F00185962 /* GRDB.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = GRDB.framework;
remoteRef = 56606D192355931F00185962 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
56606D1C2355931F00185962 /* GRDBtvOSTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GRDBtvOSTests.xctest;
remoteRef = 56606D1B2355931F00185962 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
56185BEE25B80B8900B9C30F /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
568E5FBD1E926430002582E0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -497,6 +585,15 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
56185BEC25B80B8900B9C30F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
56185C0725B80CEC00B9C30F /* PlayerTests.swift in Sources */,
56185BF325B80B8900B9C30F /* AppDatabaseTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
568E5FC71E926430002582E0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -510,10 +607,12 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
56FE6F2624A90CE400711EDF /* SceneDelegate.swift in Sources */,
56B0361C1E8D9F38003B6DA4 /* Player.swift in Sources */,
56B0361B1E8D9F38003B6DA4 /* AppDatabase.swift in Sources */,
56185BBF25B8036100B9C30F /* Persistence.swift in Sources */,
56B036071E8D9EBE003B6DA4 /* AppDelegate.swift in Sources */,
56B036241E8D9F4C003B6DA4 /* PlayersViewController.swift in Sources */,
56B036241E8D9F4C003B6DA4 /* PlayerListViewController.swift in Sources */,
56B036231E8D9F4C003B6DA4 /* PlayerEditionViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -521,6 +620,21 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
56185BF625B80B8900B9C30F /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 56B036021E8D9EBE003B6DA4 /* GRDBDemoiOS */;
targetProxy = 56185BF525B80B8900B9C30F /* PBXContainerItemProxy */;
};
56606D1E2355937900185962 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = GRDBiOS;
targetProxy = 56606D1D2355937900185962 /* PBXContainerItemProxy */;
};
56606D23235593A300185962 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = GRDBWatchOS;
targetProxy = 56606D22235593A300185962 /* PBXContainerItemProxy */;
};
568E5FCE1E926430002582E0 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 568E5FCA1E926430002582E0 /* GRDBDemoWatchOS Extension */;
@@ -531,26 +645,6 @@
target = 568E5FBE1E926430002582E0 /* GRDBDemoWatchOS */;
targetProxy = 568E5FD71E926430002582E0 /* PBXContainerItemProxy */;
};
568E5FE31E926535002582E0 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = GRDBWatchOS;
targetProxy = 568E5FE21E926535002582E0 /* PBXContainerItemProxy */;
};
568E5FE71E926547002582E0 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = GRDBWatchOS;
targetProxy = 568E5FE61E926547002582E0 /* PBXContainerItemProxy */;
};
56B0365D1E8D9F8F003B6DA4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = GRDBiOS;
targetProxy = 56B0365C1E8D9F8F003B6DA4 /* PBXContainerItemProxy */;
};
56B036611E8D9FB1003B6DA4 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = GRDBiOS;
targetProxy = 56B036601E8D9FB1003B6DA4 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@@ -581,6 +675,51 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
56185BF725B80B8900B9C30F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = AMD8W895CT;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = GRDBDemoiOSTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOSTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemoiOS.app/GRDBDemoiOS";
};
name = Debug;
};
56185BF825B80B8900B9C30F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = AMD8W895CT;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = GRDBDemoiOSTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOSTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemoiOS.app/GRDBDemoiOS";
};
name = Release;
};
568E5FDB1E926430002582E0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -594,7 +733,6 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 3.2;
};
name = Debug;
};
@@ -611,7 +749,6 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 3.2;
};
name = Release;
};
@@ -629,7 +766,6 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 3.2;
};
name = Debug;
};
@@ -647,7 +783,6 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 3.2;
};
name = Release;
};
@@ -655,6 +790,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -676,6 +812,7 @@
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;
@@ -700,12 +837,14 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
name = Debug;
};
@@ -713,6 +852,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -734,6 +874,7 @@
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;
@@ -752,11 +893,13 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
name = Release;
};
@@ -791,6 +934,15 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
56185BFF25B80B8900B9C30F /* Build configuration list for PBXNativeTarget "GRDBDemoiOSTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
56185BF725B80B8900B9C30F /* Debug */,
56185BF825B80B8900B9C30F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
568E5FDA1E926430002582E0 /* Build configuration list for PBXNativeTarget "GRDBDemoWatchOS Extension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -56,18 +56,17 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56185BEF25B80B8900B9C30F"
BuildableName = "GRDBDemoiOSTests.xctest"
BlueprintName = "GRDBDemoiOSTests"
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "568E5FBE1E926430002582E0"
BuildableName = "GRDBDemoWatchOS.app"
BlueprintName = "GRDBDemoWatchOS"
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -79,10 +78,8 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.carousel"
RemotePath = "/GRDBDemoiOS">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "568E5FBE1E926430002582E0"
@@ -90,18 +87,7 @@
BlueprintName = "GRDBDemoWatchOS"
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "568E5FBE1E926430002582E0"
BuildableName = "GRDBDemoWatchOS.app"
BlueprintName = "GRDBDemoWatchOS"
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -109,10 +95,8 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.carousel"
RemotePath = "/GRDBDemoiOS">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "568E5FBE1E926430002582E0"
@@ -120,16 +104,7 @@
BlueprintName = "GRDBDemoWatchOS"
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "568E5FBE1E926430002582E0"
BuildableName = "GRDBDemoWatchOS.app"
BlueprintName = "GRDBDemoWatchOS"
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1230"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -28,21 +28,20 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56185BEF25B80B8900B9C30F"
BuildableName = "GRDBDemoiOSTests.xctest"
BlueprintName = "GRDBDemoiOSTests"
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56B036021E8D9EBE003B6DA4"
BuildableName = "GRDBDemoiOS.app"
BlueprintName = "GRDBDemoiOS"
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
@@ -61,8 +60,6 @@
ReferencedContainer = "container:GRDBDemoiOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -0,0 +1,154 @@
import GRDB
/// AppDatabase lets the application access the database.
///
/// It applies the pratices recommended at
/// https://github.com/groue/GRDB.swift/blob/master/Documentation/GoodPracticesForDesigningRecordTypes.md
final class AppDatabase {
/// Creates an `AppDatabase`, and make sure the database schema is ready.
init(_ dbWriter: DatabaseWriter) throws {
self.dbWriter = dbWriter
try migrator.migrate(dbWriter)
}
/// Provides access to the database.
///
/// Application can use a `DatabasePool`, and tests can use a fast
/// in-memory `DatabaseQueue`.
///
/// See https://github.com/groue/GRDB.swift/blob/master/README.md#database-connections
private let dbWriter: DatabaseWriter
/// The DatabaseMigrator that defines the database schema.
///
/// See https://github.com/groue/GRDB.swift/blob/master/Documentation/Migrations.md
private var migrator: DatabaseMigrator {
var migrator = DatabaseMigrator()
#if DEBUG
// Speed up development by nuking the database when migrations change
// See https://github.com/groue/GRDB.swift/blob/master/Documentation/Migrations.md#the-erasedatabaseonschemachange-option
migrator.eraseDatabaseOnSchemaChange = true
#endif
migrator.registerMigration("createPlayer") { db in
// Create a table
// See https://github.com/groue/GRDB.swift#create-tables
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
extension AppDatabase {
/// 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 {
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, keys: 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.fetchCount(db) == 0 {
// When database is empty, insert new random players
try createRandomPlayers(db)
} else {
// Insert a player
if Bool.random() {
var player = Player.newRandom()
try player.insert(db)
}
// 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.fetchCount(db) == 0 {
try createRandomPlayers(db)
}
}
}
/// Support for `createRandomPlayersIfEmpty()` and `refreshPlayers()`.
private func createRandomPlayers(_ db: Database) throws {
for _ in 0..<8 {
var player = Player.newRandom()
try player.insert(db)
}
}
}
// MARK: - Database Access: Reads
extension AppDatabase {
/// Tracks changes in players ordered by name
func observePlayersOrderedByName(
onError: @escaping (Error) -> Void,
onChange: @escaping ([Player]) -> Void)
-> DatabaseCancellable
{
ValueObservation
.tracking(Player.all().orderedByName().fetchAll)
.start(
in: dbWriter,
onError: onError,
onChange: onChange)
}
/// Tracks changes in players ordered by score
func observePlayersOrderedByScore(
onError: @escaping (Error) -> Void,
onChange: @escaping ([Player]) -> Void)
-> DatabaseCancellable
{
ValueObservation
.tracking(Player.all().orderedByScore().fetchAll)
.start(
in: dbWriter,
onError: onError,
onChange: onChange)
}
}
@@ -0,0 +1,22 @@
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
@@ -0,0 +1,62 @@
<?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>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</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,43 @@
import GRDB
extension AppDatabase {
/// The database for the application
static let shared = makeShared()
private static func makeShared() -> AppDatabase {
do {
// Create a folder for storing the SQLite database, as well as
// the various temporary files created during normal database
// operations (https://sqlite.org/tempfiles.html).
let fileManager = FileManager()
let folderURL = try fileManager
.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
.appendingPathComponent("database", isDirectory: true)
try fileManager.createDirectory(at: folderURL, withIntermediateDirectories: true)
// Connect to a database on disk
// See https://github.com/groue/GRDB.swift/blob/master/README.md#database-connections
let dbURL = folderURL.appendingPathComponent("db.sqlite")
let dbPool = try DatabasePool(path: dbURL.path)
// Create the AppDatabase
let appDatabase = try AppDatabase(dbPool)
// 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)")
}
}
}
@@ -0,0 +1,104 @@
import GRDB
/// The Player struct.
///
/// Hashable conformance supports table view updates
struct Player: Hashable {
/// 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 newRandom() -> 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(with rowID: Int64, for column: String?) {
id = rowID
}
}
// MARK: - Player Database Requests
/// Define some player requests used by the application.
///
/// See https://github.com/groue/GRDB.swift/blob/master/README.md#requests
/// See https://github.com/groue/GRDB.swift/blob/master/Documentation/GoodPracticesForDesigningRecordTypes.md
extension DerivableRequest where RowDecoder == 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,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

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: 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

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