Commit Graph
59 Commits
Author SHA1 Message Date
Gwendal Roué 78545f2c8c Tests for #1541 2024-06-09 13:02:27 +02:00
Gwendal Roué 5a91340671 CHANGELOG 2023-04-13 08:02:41 +02:00
Gwendal Roué 4074fcfcc7 Failing test for #1360 2023-04-12 08:00:19 +02:00
Gwendal Roué d3c289a320 Availability checks cleanup 2023-01-22 12:37:40 +01:00
baegteun a9feac1339 ♻️ :: OSX -> macOS in Availability Check 2023-01-17 13:58:37 +09:00
Gwendal Roué a9fcf1b9c1 SE-0335, SE-0341, SE-0346, SE-0352, SE-0358: some, any, primary associated types 2022-08-21 21:22:34 +02:00
Gwendal Roué 458e1e2675 BREAKING: throwing DatabaseQueue() initializer
As a consequence, FTS3.tokenize(_:) is a throwing method as well.
2022-08-21 21:22:33 +02:00
Gwendal Roué 6f0d45eedb BREAKING: throwing DatabaseWriter.barrierWriteWithoutTransaction
It used to be rethrowing, but it was then unable to deal with closed databases.

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

DatabaseMigrator.asyncMigrate is impacted as well: it accepts a Result<Database, Error>, instead of a (Database, Error?) tuple.
2022-08-21 19:21:57 +02:00
Gwendal Roué 26fedd2702 CI: raise timeouts 2022-05-24 20:47:34 +02:00
Gwendal Roué 95ce4a3f8a Drop async apis from DatabaseMigrator
This is because DatabaseMigrator can't be Sendable as long as it runs migrations that embed non-@Sendable closures.
2022-02-01 09:53:20 +01:00
Gwendal Roué 936fd3ed5f Test that DatabaseMigrator.eraseDatabaseOnSchemaChange does not deadlock on Configuration.writeTargetQueue 2022-01-29 17:47:30 +01:00
BB9z 6d3f309cad Fix typos 2022-01-19 00:10:42 +08:00
Gwendal Roué 61b0df8017 Enable async APIs on Xcode 13.2+ only
Xcode 13.1 won't have access to async apis. This simplifies our availability checks.

The techniques were inspired from:

- https://github.com/swift-server/guides/blob/main/docs/concurrency-adoption-guidelines.md#api-design
- https://github.com/swift-server/guides/blob/main/docs/concurrency-adoption-guidelines.md#backwards-compatibility-of-declarations-and-checked-swift-concurrency
2021-12-08 11:17:40 +01:00
Gwendal Roué f74ce91a17 Merge branch 'development' into dev/async
# Conflicts:
#	CHANGELOG.md
#	Documentation/Concurrency.md
#	README.md
2021-11-07 11:47:01 +01:00
Gwendal Roué c81a4dbf32 Distinguish "FOREIGN KEY constraint failed" from "FOREIGN KEY constraint violation" errors 2021-11-04 18:44:44 +01:00
Gwendal Roué 127c4e0440 Rename methods that check foreign keys 2021-11-04 18:26:24 +01:00
Gwendal Roué 8a36f4d94e Clean up tests 2021-11-04 15:10:41 +01:00
Gwendal Roué 63ba4fb294 Rename unsafeWithoutDeferredForeignKeyChecks to disablingDeferredForeignKeyChecks 2021-11-04 15:10:33 +01:00
Gwendal Roué 6193c6aa00 foreignKeyViolations() and checkForeignKeyViolations() 2021-11-04 14:19:11 +01:00
Gwendal Roué 51c15e9db6 Precise handling of foreign key checks in migrations 2021-11-03 13:26:24 +01:00
Gwendal Roué c755dc70ef Restrict async/await to Xcode 13.1+ 2021-10-30 20:09:39 +02:00
Gwendal Roué 2ad6131d08 Require canImport(_Concurrency)
This fixes the build for macOS 11.5
2021-10-17 13:26:41 +02:00
Gwendal Roué 8936ef6a40 DatabaseMigrator async methods
migrate(_:)
migrate(_:upTo:)
2021-10-17 13:24:10 +02:00
Gwendal Roué d63429ea23 DatabaseMigrator.migrations 2021-09-03 14:31:46 +02:00
Gwendal Roué fcff9b34ba Make sure empty migrator publisher is async as well 2021-03-27 15:23:30 +01:00
Gwendal Roué 21a2206443 Remove asynchronous migration to target identifier
Migrating up to a specific identifier is a test-oriented use case: it does not need any async version.
2021-03-20 14:20:41 +01:00
Gwendal Roué f38c2ff754 Test DatabasePublishers.Migrate 2021-03-20 14:12:09 +01:00
Gwendal Roué 50cec3fce7 Asynchronous migrations tests 2021-03-20 13:27:40 +01:00
Gwendal Roué 8e2fb1fb22 Update tests 2020-09-06 13:57:16 +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é d60fe3c22f Replace import GRDBCustomSQLite with import GRDB 2020-04-04 16:44:01 +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é 70c6f3ec44 Failing test for #741 2020-03-29 12:09:24 +02: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é c1d1797576 Address #725 2020-03-18 20:36:56 +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é b9d4a5215a Remove deprecated DatabaseMigrator methods 2020-03-08 17:13:31 +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é 7af846c87f Rename new DatabaseMigrator methods 2020-02-29 15:07:36 +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é 91a3557281 Rename hasUnappliedMigrations to isMigrated 2020-02-28 07:40:19 +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é 4f9878a1da Update tests for the deprecated registerMigrationWithDeferredForeignKeyCheck method 2020-02-26 13:57:49 +01: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é 6b83ba3585 Failing test for eraseDatabaseOnSchemaChange 2019-09-17 08:18:45 +02:00
Gwendal Roué 1c1ee4e92a GRDBCipher is no longer. Long live GRDB.swift/SQLCipher. 2019-04-19 13:11:55 +02:00
Gwendal Roué db67d3840b Principle of least astonishment: rrename argument label rawSQL to sql 2019-02-17 13:28:41 +01:00