beginReadOnly() runs `PRAGMA query_only = 1` before it increases
readOnlyDepth. When a cancelled task interrupts the PRAGMA after it has
enabled query_only, the PRAGMA throws, the depth is not increased, and
endReadOnly() never runs. The connection then stays read-only, and every
later write fails with SQLITE_READONLY.
Run the PRAGMA with ignoringInterruption, as endReadOnly() already does
since #1839.
Fixes#1899
sqlite_compileoption_used('USE_URI') reports whether the option is
defined, not its value, and is missing when compile-option diagnostics
are omitted. Check the error from the open instead: without URI
filenames, the path is in a missing "file:" directory and fails with
SQLITE_CANTOPEN.
This commit is inspired by #1873 from @guidedways, who detected an unexpectedly quadratic behavior in the way we build database regions from the statement authorizer
The issue with `observesAllDatabaseChanges` is that this was a misleading name: transaction observers are not notified of changes that are performed in a save point that is eventually rollbacked.
By exposing the DatabaseEventObservationStrategy type, we allow for a future extra flag that ignores save points, trading observation precision for a reduced memory footprint.
- Adds Database+SQLCipher extension with SQLCipher operations, enabled by #if SQLITE_HAS_CODEC
- Adjusts Import Statements to import SQLCipher when SQLCipher trait is enabled (or SQLCipher swiftSetting is set)
I did not know statement compilation could fail when database is interrupted until #1838. A ROLLBACK statement would not even compile due to the FTS5 statement leak reported in https://sqlite.org/forum/forumpost/137c7662b389fa18
This pull request fixes#1826, which broke `make test_GRDBDemo` with Xcode 26.0.1.
To reproduce the failure:
- Remove from ~/Library/Developer/Xcode/DerivedData all previous builds of GRDB and related stuff
- Run `make distclean test_GRDBDemo`
We expect a success, but it fails with error "Unable to find module dependency: 'GRDBSQLite'".
GRDBCIPHER is now just a marker for importing SQLCipher with CocoaPods.
Also, enable all APIs that used to be disabled with SQLCipher, and skip tests that require a specific SQLite version.
We can not use `#if Trait` because Xcode does not enable those compiler flags. Always count on Apple for delivering the best quality software.
So now we import the default SPM SQLite last, after all other cases have been excluded.
The GRDB framework (GRDB.xcodeproj and GRDB via CocoaPods) is distinct from the default SPM trait, so we detect it with GRDBFRAMEWORK.
When GRDB eventually adds methods to the DatabaseSchemaSource protocol, our chained schema source will implement chaining on those new methods.
When users write their own custom chaining schema source, the compiler will not tell them that they have to chain the new methods when they upgrade GRDB. The built-in (and correct) implementation of chaining helps avoiding this scenario.
Database.changesCount calls sqlite3_changes(), whose documentation says:
> https://sqlite.org/c3ref/changes.html
> Changes to a view that are intercepted by INSTEAD OF triggers are not counted.
Since we want to support INSTEAD OF triggers well, so that record types can be based on views, we switch to sqlite3_total_changes().
This method is necessary for the customization of schema introspection: it must be possible to fallback on the primitive SQLite schema introspection when needed.
This allows us to apply the encoding strategies for Data, Date, UUID when we know we need it, i.e. when we know the primary key, and this happens when we access the database - in a nonisolated fashion.
This is required because the value of databaseSelection is not required to be Sendable. This forces TableRecord.relationForAll to postpone the definition of the selection until we access the database - in a nonisolated fashion.
DatabaseAggregate does not support isolated conformances: it must be able to aggregate values whenever a database access is performed. This can happen in a nonisolated fashion.
If we don't have warnings about explicit nil initialization, then we have a warning about the name of a disabled rule which is now deprecated. In all cases, we have a warning.
So let's just write 2025 Swift, ignore that rule, and call it a day.
We now recommend:
enum Columns {
static let id = Column("id")
static let title = Column("title")
static let latitude = Column("latitude")
static let longitude = Column("longitude")
}
Instead of the previous recommendation:
enum Columns: String, ColumnExpression {
case id, title, latitude, longitude
}
This is because SE-0438 does not support Metatype Keypaths for enums. A request like `Place.order(\.title)` does not compile with a String enum.
This reverts 7ffc332327
At the time, selectID was replaced with selectPrimaryKey(as:) because:
> Since Optional is a database value like others, selectID would be a request of optionals for records with an optional ID type:
>
> struct Player: Identifiable, MutablePersistableRecord {
> var id: Int64?
> }
>
> Player.selectID() // QueryInterface<Int64?>
>
> This is not good, because primary keys are not null. And those requests would fetch impractical types such as [Int64?], Set<Int64?>, Int64??.
This problem is reintroduced, but we now recommend against optional ids in https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/recordrecommendedpractices. And record with optional ids can use selectPrimaryKey(as:).
This uses the deprecated `strcmp` interface on Windows, which requires
the C library to be imported. Add the missing import to allow building
on Windows.
This allows the user to call those methods with an Array, or any other collection at hand (including lazy ones)
This change makes `return coalesce(columns.lazy.map { $0.name })` iterate lazily. Before this commit, `map` was returning a non-lazy Array.
ChatGPT remarks:
# Overview Section:
The phrase "GRDB optimally schedules those database access closures, in the best interest of the application" is vague and could benefit from more detail on how the scheduling optimizes for concurrency.
# Concurrency Warnings in Swift 6:
"We will address these issues, and provide general guidance in the following sections." This sentence suggests that detailed solutions will be discussed, but it is unclear how each error is related to the following section titles. A more specific reference to which section will cover what would help orient the reader.
# Non-Sendable Record Types Section:
The FAQ format is useful, but it could overwhelm the reader. Breaking up the FAQ into subsections with more concise answers or reordering it based on common issues could improve readability.
# Shorthand Closure Notation Section:
The explanation of why shorthand notation leads to warnings is somewhat technical. It may be helpful to clarify what "may introduce data races" means in practical terms for less experienced developers.
# Choosing Between Synchronous and Asynchronous Database Access:
The section recommends using asynchronous access but leaves open-ended guidance like "this may slow down other tasks". Adding a more concrete explanation of how to balance performance between synchronous and asynchronous approaches would benefit developers.
# General Clarification on Sendable:
Throughout the document, Sendable is mentioned frequently, but less-experienced developers might not fully understand why it matters. A short section or footnote on what Sendable is and why it’s important in Swift 6 concurrency might help provide context for readers unfamiliar with the concept.
We can not tell the compiler that we can safely return `sending` results, because fetched values are in the same region as the `db` argument, according to SE-0414 (https://github.com/swiftlang/swift-evolution/blob/main/proposals/0414-region-based-isolation.md#rules-for-merging-isolation-regions).
```
class NotSendable { init() { } }
func fetchNotSendable(_ db: Database) -> NotSendable { fatalError() }
func notOK<T>(_ make: (Database) -> sending T) { }
func ok<T>(_ make: () -> sending T) { }
func usage() {
ok { NotSendable() }
// Returning a task-isolated 'NotSendable' value as a 'sending' result
// risks causing data races.
notOK { db in fetchNotSendable(db) }
}
```
Various attempts at modifying all fetching methods so that they have a `sending` return value have failed.
We were frequently turning those sequences into an Array in order to check their emptiness, and generally were not sure we'd iterate a sequence only once.
Also use `some Sequence` and `some Collection` whenever possible.
Those optionals were just an annoyance. Now, nil results are replaced with `RecordError.recordNotFound`. Such an error is only expected with the IGNORE conflict policy.
Been there, done that: when one feeds a SwiftUI view from an async sequence, the view MUST display an initial empty state, until the Swift Concurrency runtime provides the initial value of the sequence. That's why the demo app uses a Combine publisher for feeding views with database value. This commit removes a misleading reference to async sequences.
Fix#1532
Previous fix would not correctly address #1357 when invalid double-quoted identifiers are interpreted as string literals (Configuration.acceptsDoubleQuotedStringLiterals = true, or SQLCipher 3)
SerializedDatabase hides its allowsUnsafeTransactions property, and makes it thread-safe by protecting it inside its serialized dispatch queue.
WALSnapshotTransaction always notifies when the reader connection is no longer used, and reuses the "isInsideTransaction" wording.
Since #1248, ValueObservation on DatabasePool creates a new database connection when it starts. #1256 has revealed that opening a connection can take too much time, which unfortunate consequences: the first value is notified too late, and we block the main thread when the observation is started in the `.immediate` scheduling :-/
In this commit, ValueObservation on DatabasePool just uses one of the available readers, thus avoiding creating a new connection.
When WAL snapshots are available, a long-running read-only transaction is kept opened on this reader, until we can start observing the write transactions, compare database versions, and perform a fetch+notification if and only if the database was modified.
When WAL snapshots are not available (Xcode 14.0 and macOS, or specific SQLCipher or SQLite builds), a double notification of the initial value is always performed, since we can't prove that the database was not changed between the initial fetch and the write access.
Also:
- Redirect the "Custom Value Types" README chapter to DatabaseValueConvertible documentation.
- Document how to support Tagged https://github.com/pointfreeco/swift-tagged
If the user would forget the PrimaryKeyDefinition, the primary was not defined:
try db.create(table: "membership") { t in
// WRONG: pk is unused
t.primaryKey { pk in
t.column("playerId", .integer)
t.column("teamId", .text)
}
}
The fix is to remove the PrimaryKeyDefinition:
try db.create(table: "membership") { t in
t.primaryKey {
t.column("playerId", .integer)
t.column("teamId", .text)
}
}
In the previous implementation, the snapshot pool would use the same reader connections as the database pool. This would create problem with reentrant reads. Let's make things simple, and not share any database connection.
One can create a snapshot from a read-only pool on a non-WAL database, and that's OK. The snaphost still sees an unchanging database content (but other connections can't write).
This helps tools that intend to declare an observed region without directly accessing it. This will be necessary for (future) snapshot-based observations that postpone actual database access.
This helps tools that perform their own asynchronous jobs that depend on database scheduling. By using the same QoS as the database, they won't create priority inversion or similar scheduling misuses.
Tokenizer arguments only need to be quoted ("foo" -> "'foo'") when we generate SQL for a tokenizer. They must not be quoted when we instantiate a tokenizer with the fts5_tokenizer.xCreate function.
This commit fixes tokenizer instantiation by not quoting arguments when we call the fts5_tokenizer.xCreate function.
Before this fix, the FTS5Tokenizer.tokenize(query:) method would return incorrect tokens.
This creates an opportunity for future `request.filter { ... }` apis that look like standard ones. Why not `Player.filter { $0.score > 1000 }` eventually, perhaps with code generation?
While writing SingletonRecordTest.swift, I tried the solution below, in order to turn a failed update into an insert:
func aroundUpdate(_ db: Database, columns: Set<String>, update: () throws -> PersistenceSuccess) throws {
do {
_ = try update()
} catch {
insert(db)
}
}
But this can't work. This `insert(db)` is unable to provide the information we need in `update()`: the result of the eventual RETURNING clause, and the PersistenceSuccess that contains the persisted PersistenceContainer.
So we now detect two misuses: 1) not calling the action method, and 2) not rethrowing the error of the action method.
The regression was probably due to a bad interaction between Implicitly Opened Existentials (SE-0352) and Opaque Parameter Declarations (SE-0341) which GRDB 6 now uses in a lot of places.
Considering the sample code below:
try db.create(table: ...) { t in
t.column(...).check { $0 != Column(...) }
}
- The `check` method accepts a closure that returns `any SQLExpressible` (the same as GRDB 5)
- The `!=` SQL comparison operator is `(some SQLSpecificExpressible, some SQLSpecificExpressible) -> SQLExpression`, when it was `(SQLSpecificExpressible, SQLSpecificExpressible) -> SQLExpression` in GRDB 5
The compiler has started preferring interpreting the != operator as Column's Equatable implementation, instead of the `!=` SQL comparison operator
We force the compiler to use the SQL comparison operator by removing the Equatable conformance from Column. It was introduced in a70b42c, as a support for a feature that has been removed since then.
This is a breaking change, but this also is an improvement. Now `column1 != column2` has a single meaning, and the library is less prone to similar regressions in the future.
A cool upsert feature is to overwrite an existing value in case of conflict, but another cool upsert feature is to NOT overwrite an existing value. This commit makes it possible to create a ColumnAssignement that does nothing.
Since Optional is a database value like others, selectID would be a request of optionals for records with an optional ID type:
struct Player: Identifiable, MutablePersistableRecord {
var id: Int64?
}
Player.selectID() // QueryInterface<Int64?>
This is not good, because primary keys are not null. And those requests would fetch impractical types such as [Int64?], Set<Int64?>, Int64??.
Instead, we introduce selectPrimaryKey(as:), which allows the user to provide the desired type.
Player.selectPrimaryKey(as: Int64.self) // QueryInterface<Int64>
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.
Make it possible to test SQLITE_ENABLE_FTS5 and SQLITE_ENABLE_PREUPDATE_HOOK with `make test_SPM`.
This is very handy because Xcode 14 beta 3 has difficulties testing GRDBCustom.
Memory management may not be desirable for all
users of GRDB. `DatabasePool.releaseMemory`
creates a barrier which may cause normally fast
readers to block for a long time. If this is not a
desirable tradeoff, the new
`automaticMemoryManagement` flag in
`Configuration` allows you to disable this feature
of GRDB.
This change:
1. Makes all links use HTTPS (there were a few that used insecure HTTP)
2. Corrects a few links, which previously went to the wrong place
It was easy to find HTTP links—a simple search. I wrote a silly script,
to be run in the browser console, to find the rest:
```js
(() => {
for (const a of document.getElementsByTagName("a")) {
if (!/^#\d+$/.test(a.innerText)) {
continue;
}
const id = a.innerText.slice(1);
const expectedPullHref = `https://github.com/groue/GRDB.swift/pull/${id}`;
const expectedIssueHref = `https://github.com/groue/GRDB.swift/issues/${id}`;
if (a.href !== expectedPullHref && a.href !== expectedIssueHref) {
console.error(`"${a.innerText}" has an invalid href, ${a.href}`);
}
}
})();
```
Hope this helps!
> When I first started using GRDB I didn't know SQL or much at all about databases 😬 So I've always really liked the query API. But these days I really appreciate that you support raw SQL too, because it gives me more control and freedom when I need it. 👍👍👍
> I cannot recommend GRDB enough. It works well with Swift and eliminates whole classes of potential programming errors that can be made with Core Data. Also being able to use raw SQL queries if needed can be extremely useful!
- [Swiftlint](https://github.com/realm/SwiftLint) (present in the `$PATH` or in `/opt/homebrew/bin/`)
- For generating documentation:
- [Jazzy](https://github.com/realm/jazzy) (gem)
2.**Clone the `development` branch on your machine.**
@@ -30,7 +28,7 @@ How you can Contribute
-`GRDB`: GRDB sources
-`Tests`: GRDB tests
-`GRDBCustom.xcodeproj`: the project which builds GRDB with a custom SQLite build.
-`GRDBProfiling.xcodeproj`: a project which helps profiling GRDB with Instruments. No code here is really precious.
-`GRDBProfiling.xcodeproj`: a project which helps profile GRDB with Instruments. No code here is really precious.
-`GRDBDemoiOS.xcodeproj`, `GRDBCombineDemo.xcodeproj`, `GRDBAsyncDemo.xcodeproj`: the demo apps.
To work with `GRDBCustom.xcodeproj`:
@@ -40,7 +38,7 @@ How you can Contribute
5.**Run tests**
You can run tests from `GRDB.xcworkspace`, after selecting your target (GRDBOSX, GRDBiOS, GRDBtvOS, from `GRDB.xcodeproj` or `GRDBCustom.xcodeproj`).
You can run tests from `GRDB.xcworkspace`, after selecting your scheme (`GRDB` from `GRDB.xcodeproj` or `GRDBCustom` from `GRDBCustom.xcodeproj`).
Before submitting a pull request, please run in the terminal:
@@ -63,19 +61,21 @@ How you can Contribute
- Get familiar with the [Swift API Design Guidelines](https://www.swift.org/documentation/api-design-guidelines/).
- Spaces, not tabs.
- Whitespace-only lines are not trimmed.
- Documentation comments are hard-wrapped at column 80 (Xcode > Preferences > Text Editing > Display > [X] Page guide at column: 80).
- Documentation comments are hard-wrapped at column 76 (Xcode > Preferences > Text Editing > Display > [X] Page guide at column: 76).
- No Swiftlint warning after a build.
7. **Please provide documentation for your changes**
GRDB documentation is provided as reference (inline doc comments starting with `///`, see [Documentation Comment Syntax](https://github.com/apple/swift/blob/main/docs/DocumentationComments.md)), and guides ([README.md](README.md) and the [Documentation](Documentation) folder).
GRDB documentation is provided as a DocC reference, and guides ([README.md](README.md) and the [Documentation](Documentation) folder).
GRDB is "documentation-driven", which means that nothing ships until it is supported by documentation that makes sense. Documentation makes sense when someone who is not you is able to figure out what is the purpose of your contribution, how to use it, and what are its eventual caveats and corner cases. When the documentation is hard to write, or reveals too many caveats, it is the sign that the api needs to be fixed.
Please keep the reference and the guides up-to-date. To control the quality of your DocC reference documentation, close the workspace, open `Package.swift` in Xcode, and use Product > Build Documentation.
GRDB is "documentation-driven", which means that nothing ships until it is supported by documentation that makes sense. Documentation makes sense when someone who is not you is able to figure out what the purpose of your contribution is, how to use it, and what its caveats and corner cases are. When the documentation is hard to write, or reveals too many caveats, it is a sign that the api needs to be fixed.
8. **Open a pull request with your changes (targeting the `development` branch)!**
9.**If you are granted a push access to the repository**, check [ReleaseProcess.md](Documentation/ReleaseProcess.md) in order to publish a new GRDB version.
9.**If you are granted push access to the repository**, check [ReleaseProcess.md](Documentation/ReleaseProcess.md) in order to publish a new GRDB version.
## Answer issues and contribute to discussions
@@ -85,7 +85,7 @@ Answering [issues](https://github.com/groue/GRDB.swift/issues), participating in
## Financial support and sponsoring
GRDB is free, and openly developed by its contributors, on their free time, according to their will, needs, and availability. It is not controlled by any company.
GRDB is free, and openly developed by its contributors, in their free time, according to their will, needs, and availability. It is not controlled by any company.
Support is free as well, as long as it happens publicly, and is available to everyone as well as internet search engines. This excludes the private channels of social networks, closed environments such as Slack, etc.
This methods returns a publisher that completes after database values have been asynchronously fetched.
This method returns a publisher that completes after database values have been asynchronously fetched.
```swift
//DatabasePublishers.Read<[Player]>
@@ -134,7 +134,7 @@ let players = dbQueue.readPublisher { db in
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 queue] or a [database snapshot], the read has to wait for any 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].
@@ -174,9 +174,8 @@ This method returns a publisher that completes after database updates have been
```swift
//DatabasePublishers.Write<Int>
letnewPlayerCount=dbQueue.writePublisher(
updates:{dbintryPlayer(...).insert(db)}
updates:{dbintryPlayer(...).insert(db)},
thenRead:{db,_intryPlayer.fetchCount(db)})
}
```
It publishes exactly the same values as [`writePublisher(receiveOn:updates:)`]:
@@ -189,9 +188,9 @@ let newPlayerCount = dbQueue.writePublisher { db -> Int in
}
```
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).
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 one 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](Concurrency.md#advanced-databasepool) for more information.
When you use a [database pool], this method applies a scheduling optimization: the `thenRead` function sees the database in the state left by the `updates` function, and yet does not block any concurrent writes. This can reduce database write contention.
When you use a [database queue], the results are guaranteed to be identical, but no scheduling optimization is applied.
@@ -224,13 +223,13 @@ let publisher = observation.publisher(in: dbQueue)
This publisher has the same behavior as ValueObservation:
- It notifies an initial value before the eventual changes.
- It notifies an initial value before subsequent 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 may notify consecutive identical values. You can filter out the undesired duplicates with the `removeDuplicates()` Combine operator, but we suggest you have a look at the [removeDuplicates()](https://swiftpackageindex.com/groue/GRDB.swift/documentation/grdb/valueobservation/removeduplicates()) GRDB operator also.
- It only completes when it is cancelled.
- By default, it notifies the initial value, as well as eventual changes and errors, on the main thread, asynchronously.
- By default, it notifies the initial value, as well as subsequent 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).
This can be configured with the `scheduling` argument. It does not accept a Combine scheduler, but a [ValueObservationScheduler](https://swiftpackageindex.com/groue/GRDB.swift/documentation/grdb/valueobservationscheduler).
For example, the `.immediate` scheduler makes sure the initial value is notified immediately when the publisher is subscribed. It can help your application update the user interface without having to wait for any asynchronous notifications:
@@ -248,8 +247,6 @@ This publisher has the same behavior as ValueObservation:
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.
#### `SharedValueObservation.publisher()`
@@ -313,7 +310,7 @@ When you compose database publishers together with Combine operators such as `co
This is because each database publisher is isolated from others: each one of them sees its own state of the database. Whenever some database change is interleaved between publisher operations, publishers will process or publish values that may not fit well together.
In other words, whenever you need to perform some database access or observation that depends on some database invariant, make sure you define one and only one database publisher instead of combining several publishers. This is how you will prevent eventual concurrent database writes from messing with your app, and introduce bugs.
In other words, whenever you need to perform some database access or observation that depends on some database invariant, make sure you define one and only one database publisher instead of combining several publishers. This is how you will prevent concurrent database writes from messing with your app, and introducing bugs.
To this end, remember that *all database publishers can perform several requests*.
@@ -334,7 +331,7 @@ let hallOfFamePublisher = ValueObservation
// 2nd request
let bestPlayers = try Player
.order(Column("score").desc)
.order(\.score.desc)
.limit(10)
.fetchAll(db)
@@ -360,7 +357,7 @@ let totalPlayerCountPublisher = ValueObservation
// OK
let bestPlayerPublisher = ValueObservation
.tracking(Player
.order(Column("score").desc)
.order(\.score.desc)
.limit(10)
.fetchAll)
.publisher(in: dbQueue)
@@ -384,23 +381,23 @@ let cancellable = hallOfFamePublisher.sink(
@@ -16,7 +16,7 @@ In this guide, you will learn how to:
- [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!
> **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
@@ -31,7 +31,7 @@ The CTE request can be provided as a [query interface request]:
//WITHplayerNameAS(SELECTnameFROMplayer)...
letplayerNameCTE=CommonTableExpression(
named:"playerName",
request:Player.select(Column("name")))
request:Player.select(\.name))
```
You can feed a CTE with raw SQL as well (second and third examples use [SQL Interpolation]):
@@ -82,7 +82,7 @@ let counterCTE = CommonTableExpression(
""")
```
> :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.
> **Note**: many recursive CTEs use the `UNION ALL` SQL operator. The query interface does not provide any Swift support for it, so you'll generally have to write SQL in your definitions of recursive CTEs.
## Embed Common Table Expressions in Requests
@@ -123,16 +123,16 @@ And we can then filter the `player` table with a subquery:
//WHEREname=(SELECT*FROMplayerName)
letrequest=Player
.with(playerNameCTE)
.filter(Column("name")==playerNameCTE.all())
.filter{$0.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.
> **Note**: the `with(_:)` method can be called as many times as 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(...)`.
> **Note**: the `with(_:)` method can be called at any time, like 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.
> **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:
> **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 confused with the request that was used to define the CTE). You can filter this request, sort it, etc, like all query interface requests:
@@ -362,7 +368,9 @@ And we can fetch the data that feeds our application screen:
```swift
let chatInfos: [ChatInfos] = try dbQueue.read(request.fetchAll)
let chatInfos: [ChatInfo] = try dbQueue.read { db in
try request.fetchAll(db)
}
```
> :bulb: **Tip**: the joining methods are generally type-safe: they won't allow you to join apples to oranges. This works when associations have a *precise* type. In this context, anonymous `CommonTableExpression` CTEs can work against type safety. When you want to define associations between several CTEs, and make sure the compiler will notice wrong uses of those associations, tag your common table expressions with an explicit type: `CommonTableExpression<SomeType>`.
@@ -387,8 +395,8 @@ let chatInfos: [ChatInfos] = try dbQueue.read(request.fetchAll)
**GRDB helps your app deal with SQLite concurrency.**
If your app moves slow database jobs off the main thread, so that the user interface remains responsive, then this guide is for you. In the case of apps that share a database with other processes, such as an iOS app and its extensions, don't miss the dedicated [Sharing a Database] guide after this one.
**In all cases, and first and foremost, follow the [Concurrency Rules] right from the start.**
The other chapters cover, with more details, the fundamentals of SQLite concurrency, and how GRDB makes it manageable from your Swift code.
- [Concurrency Rules]
- [Synchronous and Asynchronous Database Accesses]
- [Safe and Unsafe Database Accesses]
- [Differences between Database Queues and Pools]
- [Concurrent Thinking]
- [Advanced DatabasePool]
- [Database Snapshots]
- [Sharing a Database]
## Concurrency Rules
**The two concurrency rules are strongly recommended practices.** They are all about SQLite, a robust and reliable database that takes great care of your data: don't miss an opportunity to put it on your side!
<a id="rule-1"></a>:point_up: **[Rule 1](#rule-1): Connect to any database file only once**
Open one single [DatabaseQueue] or [DatabasePool] per database file, for the whole duration of your use of the database. Not for the duration of _each_ database access, but really for the duration of _all_ database accesses to this file.
> *Why does this rule exist?* - Since SQLite does not support parallel writes, each [DatabaseQueue] and [DatabasePool] makes sure application threads perform writes one by one, without overlap.
>
> *Practical advice* - An app that uses a single database will connect only once. A document-based app will connect each time a document is opened, and disconnect when the document is closed. See the [demo apps] in order to see how to setup a UIKit or SwiftUI application for a single database.
>
> *What if you do not follow this rule?*
>
> - You will not be able to use the [Database Observation] features.
> - You will see SQLite errors with code 5 ([SQLITE_BUSY]).
<a id="rule-2"></a>:point_up: **[Rule 2](#rule-2): Mind your transactions**
Database operations that are grouped in an SQLite transaction are guaranteed to be either fully saved on disk, or not at all. Read-only transactions have an interesting property as well: they guarantee a stable and immutable view of the database[^1], and do not see changes performed by eventual concurrent writes. In other words, transactions are the one and single tool that helps you enforce and rely on the important invariants of your database (such as "all credits have a matching debit", or "all books have an author").
**You are responsible**, in your Swift code, for delimiting transactions. You do so by grouping database accesses inside a pair of `{ db in ... }` brackets:
> *Why does this rule exist?* - Because GRDB and SQLite can not guess where to insert the transaction boundaries that protect the invariants of your database. This is your task.
>
> *Practical advice* - See below a correct example, as well as frequent mistakes you should avoid:
>
> <details><summary>Sample code</summary>
>
> In order to insert a money transfer in the database, in a way that enforces the "all credits have a matching debit" invariant, you can write:
>
> ```swift
> // CORRECT: the "all credits have a matching debit" invariant is preserved.
> do {
> try dbQueue.write { db in
> try credit.insert(db)
> try debit.insert(db)
> }
> } catch {
> print("An error occurred: \(error)")
> }
> ```
>
> A frequent mistake is to forget about grouping inside a pair of `{ db in ... }` brackets:
>
> ```swift
> // INCORRECT. Related database operations are not grouped inside
> // one transaction. The invariant is not enforced.
> do {
> try dbQueue.write { db in try credit.insert(db) }
> try dbQueue.write { db in try debit.insert(db) }
> } catch {
> print("An error occurred: \(error)")
> }
> ```
>
> Another frequent mistake is to catch database errors at the wrong place:
>
> ```swift
> // INCORRECT. Related database operations are not grouped inside
> // one transaction, and a failed operation does not prevent
> // subsequent operations from being performed. The invariant is
> // not enforced.
> do {
> try dbQueue.write { db in try credit.insert(db) }
> } catch {
> print("An error occurred: \(error)")
> }
>
> do {
> try dbQueue.write { db in try debit.insert(db) }
> } catch {
> print("An error occurred: \(error)")
> }
> ```
>
> </details>
>
> *What if you do not follow this rule?* - You will see broken database invariants, at runtime, and when your apps wakes up after a crash. You may have a hard time fixing this mess.
## Synchronous and Asynchronous Database Accesses
**You can access the database from any thread, in a synchronous or asynchronous way.**
:arrow_right: **A sync access blocks the current thread** until the database operations are completed:
```swift
letplayerCount=trydbQueue.read{dbin
tryPlayer.fetchCount(db)
}
letnewPlayerCount=trydbQueue.write{db->Intin
tryPlayer(id:12,name:"Arthur").insert(db)
returntryPlayer.fetchCount(db)
}
```
It is a programmer error to perform a sync access from any other database access (this restriction can be lifted: see [Safe and Unsafe Database Accesses]):
```swift
trydbQueue.write{dbin
//FatalError:Databasemethodsarenotreentrant.
trydbQueue.write{dbin...}
}
```
:twisted_rightwards_arrows: **An async access does not block the current thread.** Instead, it notifies you when the database operations are completed. There are four ways to access the database asynchronously:
Those observables do not access the database until they are subscribed. They complete on the main dispatch queue by default. See the companion library [RxGRDB].
During one async access, all individual database operations grouped inside (fetch, insert, etc.) are synchronous:
```swift
//Oneasynchronousaccess...
tryawaitdbQueue.write{dbin
//...alwaysperformssynchronousdatabaseoperations:
tryPlayer(...).insert(db)
tryPlayer(...).insert(db)
letplayers=tryPlayer.fetchAll(db)
}
```
This is true for all async techniques.
This prevents the database operations from various concurrent accesses from being interleaved, with disastrous consequences. For example, one access must not be able to issue a `COMMIT` statement in the middle of an unfinished concurrent write!
## Safe and Unsafe Database Accesses
**You will generally use the safe database access methods `read` and `write`.** In this context, "safe" means that a database access is concurrency-friendly, because GRDB provides the following guarantees:
- <a id="guarantee-serialized-writes"></a>**[Serialized Writes]** - All writes performed by one [DatabaseQueue] or [DatabasePool] instance are serialized. *Why is it important?* - this guarantee prevents [SQLITE_BUSY] errors during concurrent writes.
- <a id="guarantee-write-transactions"></a>**[Write Transactions]** - All writes are wrapped in a transaction. *Why is it important?* - concurrent reads can not see partial database updates (even reads performed by other processes).
- <a id="guarantee-isolated-reads"></a>**[Isolated Reads]** - All reads are wrapped in a transaction. *Why is it important?* - an isolated read sees a stable and immutable state of the database[^1], and does not see changes performed by eventual concurrent writes (even writes performed by other processes).
- <a id="guarantee-forbidden-writes"></a>**[Forbidden Writes]** - Inside a read access, all attempts to write raise an error. *Why is it important?* - this enforces the immutability of the database during a read.
- <a id="guarantee-non-reentrancy"></a>**[Non-Reentrancy]** - Database accesses are not reentrant. *Why is it important?* - this reduces the opportunities for deadlocks, and fosters the clear transaction boundaries of the [second concurrency rule](#rule-2).
Some applications need to relax this safety net, in order to achieve specific SQLite operations. In this case, replace `read` and `write` with one of the methods below:
- **Write outside of any transaction**
(Lifted guarantee: [Write Transactions])
```swift
try dbQueue.writeWithoutTransaction { db in ... }
```
`writeWithoutTransaction` is also available as an `async` function. You can also use `asyncWriteWithoutTransaction`.
- **Write outside of any transaction, and prevents concurrent reads**
(Lifted guarantee: [Write Transactions])
```swift
try dbQueue.barrierWriteWithoutTransaction { db in ... }
```
The barrier write guarantees an exclusive access to the database: the method blocks until all concurrent database accesses are completed, reads and writes, and postpones all other accesses until it completes.
There is a known limitation: database accesses performed by other processes, and reads performed by [DatabaseSnapshot] are out of scope of this barrier, and can run concurrently with the barrier.
You will use this method, for example, when you [change the password](../README.md#changing-the-passphrase-of-an-encrypted-database) of an encrypted database.
`barrierWriteWithoutTransaction` is also available as an `async` function. You can also use `asyncBarrierWriteWithoutTransaction`.
Reentrant reads can be performed from any other database access:
```swift
try dbQueue.write { db in
// No fatal error
try dbQueue.unsafeReentrantRead { db in ... }
}
```
`unsafeReentrantRead` has no async version.
:point_up: **By using one of the methods above, you become responsible of the thread-safety of your application.** Please understand the consequences of lifting each concurrency guarantee. Some guarantees can also be restored at your convenience:
- The [Write Transactions] and [Isolated Reads] guarantees can be restored at any point, by opening an [explicit transaction](../README.md#transactions-and-savepoints). For example:
```swift
try dbQueue.writeWithoutTransaction { db in
try db.inTransaction {
...
return .commit
}
}
```
- The [Forbidden Writes] guarantee can only be lifted with [DatabaseQueue]. It can be restored with [`PRAGMA query_only`](https://www.sqlite.org/pragma.html#pragma_query_only).
## Differences between Database Queues and Pools
Despite the common [guarantees](#safe-and-unsafe-database-accesses) and [rules](#concurrency-rules) shared by database queues and pools, those two database accessors don't have the same behavior.
[DatabaseQueue] opens a single database connection, and serializes all database accesses, reads, and writes. There is never more than one thread that uses the database. In the image below, we see how three threads can see the database as time passes:
[DatabasePool] manages a pool of several database connections, and allows concurrent reads and writes thanks to the [WAL mode](https://www.sqlite.org/wal.html). A database pool serializes all writes (the [Serialized Writes] guarantee). Reads are isolated so that they don't see changes performed by other threads (the [Isolated Reads] guarantee). This gives a very different picture:
See how, with database pools, two reads can see different database states at the same time. This may look scary! Please see the next [Concurrent Thinking] chapter below for a relief.
## Concurrent Thinking
Despite their [differences](#differences-between-database-queues-and-pools), you can write robust code that works equally well with both database queues and pools.
This allows your app to switch between queues and pools, at your convenience:
- The [demo applications] share the same database code for the on-disk pool that feeds the app, and the in-memory queue that feeds tests and SwiftUI previews. This makes sure tests and previews run fast, without any temporary file, with the same behavior as the app.
- Applications that perform slow write transactions (when saving a lot of data from a remote server, for example) may want to replace their queue with a pool so that the reads that feed their user interface can run in parallel.
All you need is a little "concurrent thinking", based on those two basic facts:
- You are sure, when you perform a write access, that you deal with the latest database state on disk. This is enforced by SQLite, which simply can't perform parallel writes, and by GRDB database queues and pools, which make sure [only one thread can write](#guarantee-serialized-writes). As for writes performed by other processes, they can only trigger [SQLITE_BUSY] errors [that you can handle](SharingADatabase.md).
- Whenever you extract some data from a database access, immediately consider it as _stale_. It is stale, whether you use a database queue or a database pool. It is stale because nothing prevents other application threads or processes from overwriting the value you have just fetched:
Does this mean you can't rely on anything? Of course not:
- If you intend to display the database content on screen, use [ValueObservation]: it always eventually notifies the latest state of the database. You won't display stale values for a long time [^2].
- As said above, the moment of truth is the next write access!
## Advanced DatabasePool
[DatabasePool] is very concurrent, since all reads can run in parallel, and can even run during write operations. But writes are still serialized: at any given point in time, there is no more than a single thread that is writing into the database.
When your application modifies the database, and then reads some value that depends on those modifications, you may want to avoid blocking concurrent writes longer than necessary:
```swift
try dbPool.write { db in
// Increment the number of players
try Player(...).insert(db)
try Player(...).insert(db)
// Read the number of players. Concurrent writes are blocked :-(
let newPlayerCount = try Player.fetchCount(db)
}
```
:arrow_right: The solution is the `concurrentRead` method. It must be called from within a write access, outside of any transaction. It returns a *future value* which you consume any time later, with the `wait()` method.
```swift
let future: DatabaseFuture<Int> = try dbPool.writeWithoutTransaction { db in
// Increment the number of players
try db.inTransaction {
try Player(...).insert(db)
try Player(...).insert(db)
return .commit
}
// <- Not in a transaction here
let future = dbPool.concurrentRead { db
try Player.fetchCount(db)
}
return future
}
// <- Concurrent writes can be performed :-)
// Wait and handle newPlayerCount
let newPlayerCount = try future.wait()
```
:twisted_rightwards_arrows: The async version of `concurrentRead` is `asyncConcurrentRead`:
```swift
try dbPool.writeWithoutTransaction { db in
// Increment the number of players
try db.inTransaction {
try Player(...).insert(db)
try Player(...).insert(db)
return .commit
}
// <- Not in a transaction here
dbPool.asyncConcurrentRead { dbResult in
do {
// Maybe read access could not be established
let db = try dbResult.get()
let newPlayerCount = try Player.fetchCount(db)
// Handle newPlayerCount
} catch {
// Handle error
}
}
}
```
`concurrentRead` and `asyncConcurrentRead` block until they can guarantee their closure argument an isolated access to the database, in the exact state left by the last transaction. It then asynchronously executes this closure.
In the illustration below, the striped band shows the delay needed for the reading thread to acquire isolation. Until then, no other thread can write:
[Transaction Observers](../README.md#transactionobserver-protocol) can also use those methods in their `databaseDidCommit` method, in order to process database changes without blocking other threads that want to write into the database.
## Database Snapshots
**[DatabasePool] can take snapshots.** A database snapshot sees an unchanging database content, as it existed at the moment it was created.
"Unchanging" means that a snapshot never sees any database modifications during all its lifetime. And yet it doesn't prevent database updates. This "magic" is made possible by SQLite's WAL mode (see [Isolation In SQLite](https://sqlite.org/isolation.html)).
```swift
let snapshot = try dbPool.makeSnapshot()
```
You can create as many snapshots as you need, regardless of the [maximum number of readers](../README.md#database-configuration) in the pool. A snapshot database connection is closed when the snapshot is deinitialized.
**A snapshot can be used from any thread.** It has the same [synchronous and asynchronous reading methods](#synchronous-and-asynchronous-database-accesses) as database queues and pools:
```swift
let playerCount = try snapshot.read { db in
try Player.fetchCount(db)
}
```
When you want to control the latest committed changes seen by a snapshot, create the snapshot from within a write, outside of any transaction:
```swift
let snapshot1 = try dbPool.writeWithoutTransaction { db -> DatabaseSnapshot in
try db.inTransaction {
// delete all players
try Player.deleteAll()
return .commit
}
// <- not in a transaction here
return dbPool.makeSnapshot()
}
// <- Other threads may modify the database here
let snapshot2 = try dbPool.makeSnapshot()
try snapshot1.read { db in
// Guaranteed to be zero
try Player.fetchCount(db)
}
try snapshot2.read { db in
// Could be anything
try Player.fetchCount(db)
}
```
> :point_up: **Note**: snapshots currently serialize all database accesses. In the future, snapshots may allow concurrent reads.
[^1]: This immutable view of the database is called [snapshot isolation](https://www.sqlite.org/isolation.html).
[^2]: After the database has been changed on disk, GRDB has to fetch the fresh value, and then hop to the main thread. Only then your screen can be updated.
[Concurrency Rules]: #concurrency-rules
[Synchronous and Asynchronous Database Accesses]: #synchronous-and-asynchronous-database-accesses
[Safe and Unsafe Database Accesses]: #safe-and-unsafe-database-accesses
[Differences between Database Queues and Pools]: #differences-between-database-queues-and-pools
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.37.2](https://www.sqlite.org/changes.html).**
**You can build GRDB with a custom build of [SQLite 3.47.2](https://www.sqlite.org/changes.html).**
A custom SQLite build can activate extra SQLite features, and extra GRDB features as well, such as support for the [FTS5 full-text search engine](../../../#full-text-search), and [SQLite Pre-Update Hooks](../../../#support-for-sqlite-pre-update-hooks).
A custom SQLite build can activate extra SQLite features, and extra GRDB features as well, such as support for the [FTS5 full-text search engine](FullTextSearch.md), and [SQLite Pre-Update Hooks](https://swiftpackageindex.com/groue/GRDB.swift/documentation/grdb/transactionobserver).
GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfalling/SQLiteLib), which uses the same SQLite configuration as the one used by Apple in its operating systems, and lets you add extra compilation options that leverage the features you need.
> Warning: The technique described here is not compatible with the Swift Package Manager (SPM). It will create [build issues](https://github.com/groue/GRDB.swift/issues/1709) with SPM companion libraries such as [GRDBQuery](https://github.com/groue/GRDBQuery) or [GRDBSnapshotTesting](https://github.com/groue/GRDBSnapshotTesting).
**To install GRDB with a custom SQLite build:**
1. Clone the GRDB git repository, checkout the latest tagged version:
```sh
cd [GRDB directory]
git checkout [latest tag]
git submodule update --init SQLiteCustom/src
```
2. Choose your [extra compilation options](https://www.sqlite.org/compile.html). For example, `SQLITE_ENABLE_FTS5`, `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).
It is recommended that you enable the `SQLITE_ENABLE_SNAPSHOT` option. It allows GRDB to optimize [ValueObservation](https://swiftpackageindex.com/groue/GRDB.swift/documentation/grdb/valueobservation) when you use a [Database Pool](https://swiftpackageindex.com/groue/GRDB.swift/documentation/grdb/databasepool).
3. Create a folder named `GRDBCustomSQLite` somewhere in your project directory.
4. Create four files in the `GRDBCustomSQLite` folder:
- `SQLiteLib-USER.xcconfig`: this file sets the extra SQLite compilation flags.
```xcconfig
// As many -D options as there are custom SQLite compilation options
// Note: there is no space between -D and the option name.
Modify the top of `GRDBCustomSQLite-INSTALL.sh` file so that it contains correct paths.
Modify the top of the `GRDBCustomSQLite-INSTALL.sh` file so that it contains correct paths.
5. Embed the `GRDBCustom.xcodeproj` project in your own project.
6. Add the `GRDBCustomSQLiteOSX` or `GRDBCustomSQLiteiOS` target in the **Target Dependencies** section of the **Build Phases** tab of your **application target**.
6. Add the `GRDBCustom` target in the **Target Dependencies** section of the **Build Phases** tab of your **application target**.
7. Add the `GRDBCustomSQLite.framework` from the targeted platform to the **Embedded Binaries** section of the **General** tab of your **application target**.
7. Add the `GRDBCustom.framework` from the targeted platform to the **Embedded Binaries** section of the **General** tab of your **application target**.
8. Add a Run Script phase for your target in the **Pre-actions** section of the **Build** tab of your **application scheme**:
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).
10. If you have enabled "Hardened Runtime" for your target (**Build Settings**/**Signing**) then you may need to check **Disable Library Validation** under the **Hardened Runtime** section of the **Signing & Capabilities** tab.
(The build error without this exception is "Library not loaded ... different Team IDs")
Now you can use GRDB with your custom SQLite build:
**This demo application is an Async/Await + SwiftUI application.** For a demo application that uses UIKit, see [GRDBDemoiOS](../GRDBDemoiOS/README.md), and for Combine + SwiftUI, see [GRDBCombineDemo](../GRDBCombineDemo/README.md).
**Requirements**: iOS 15.0+ / Xcode 13.1+
> :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 an async sequence built from [ValueObservation](../../../README.md#valueobservation).
- How to apply the recommendations of [Good Practices for Designing Record Types](../../GoodPracticesForDesigningRecordTypes.md).
- How to feed SwiftUI previews with a transient database.
This file instantiates various `AppDatabase` for the various projects needs: one database on disk for the application, and in-memory databases for SwiftUI previews.
- [Player.swift](GRDBAsyncDemo/Player.swift)
`Player` is a [Record](../../../README.md#records) type, able to read and write in the database. It conforms to the standard Codable protocol in order to gain all advantages of [Codable Records](../../../README.md#codable-records).
`PlayerRequest` defines the player requests used by the app (sorted by score, or by name).
`PlayerRequest` feeds the `@Query` property wrapper (`@Query`, defined in [GRDBQuery](https://github.com/groue/GRDBQuery), allows SwiftUI views to display up-to-date database content).
`AppView` is the SwiftUI view that uses `@Query` in order to feed its player list.
- [GRDBAsyncDemoTests](GRDBAsyncDemoTests)
- Test the database schema
- Test the `Player` record and its requests
- Test the `PlayerRequest` methods that feed the list of players.
- Test the `AppDatabase` methods that let the app access the database.
<!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>
Loaded 100 of 804 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.