Skip to content

Commit

Permalink
v6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
groue committed Sep 9, 2022
1 parent 125f112 commit 589e53b
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 30 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:

#### 6.x Releases

- `6.0.x` Releases - [6.0.0](#600)
- `6.0.0` Betas - [6.0.0-beta](#600-beta) | [6.0.0-beta.2](#600-beta2) | [6.0.0-beta.3](#600-beta3) | [6.0.0-beta.4](#600-beta4)

#### 5.x Releases
Expand Down Expand Up @@ -97,7 +98,9 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:

---

## Next Release
## 6.0.0

Released September 9, 2022 • [diff](https://github.com/groue/GRDB.swift/compare/v6.0.0-beta.4...v6.0.0)

- **New**: Bump custom SQLite builds v3.39.3
- **Fixed**: [#1274](https://github.com/groue/GRDB.swift/discussions/1274) Fixed a bug with HasManyThrough associations when the "through" association has the same association key as the association itself.
Expand Down
4 changes: 2 additions & 2 deletions Documentation/FullTextSearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ let pattern = FTS3Pattern(matchingAnyTokenIn: "") // nil
let pattern = FTS3Pattern(matchingAnyTokenIn: "*") // nil
```

FTS3Pattern are regular [values](../README.md#values). You can use them as query [arguments](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/StatementArguments.html):
FTS3Pattern are regular [values](../README.md#values). You can use them as query [arguments](http://groue.github.io/GRDB.swift/docs/6.0/Structs/StatementArguments.html):

```swift
let documents = try Document.fetchAll(db,
Expand Down Expand Up @@ -587,7 +587,7 @@ let pattern = FTS5Pattern(matchingAnyTokenIn: "") // nil
let pattern = FTS5Pattern(matchingAnyTokenIn: "*") // nil
```

FTS5Pattern are regular [values](../README.md#values). You can use them as query [arguments](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/StatementArguments.html):
FTS5Pattern are regular [values](../README.md#values). You can use them as query [arguments](http://groue.github.io/GRDB.swift/docs/6.0/Structs/StatementArguments.html):

```swift
let documents = try Document.fetchAll(db,
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ try dbQueue.read { db in
}
```

See the [DatabaseMigrator reference](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/DatabaseMigrator.html) for more migrator methods.
See the [DatabaseMigrator reference](http://groue.github.io/GRDB.swift/docs/6.0/Structs/DatabaseMigrator.html) for more migrator methods.


## The `eraseDatabaseOnSchemaChange` Option
Expand Down
2 changes: 1 addition & 1 deletion GRDB.swift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'GRDB.swift'
s.version = '6.0.0-beta.4'
s.version = '6.0.0'

s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'A toolkit for SQLite databases, with a focus on application development.'
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,10 @@ ifdef JAZZY
--author_url https://github.com/groue \
--source-host github \
--source-host-url https://github.com/groue/GRDB.swift \
--source-host-files-url https://github.com/groue/GRDB.swift/tree/v6.0.0-beta.4 \
--module-version 6.0.0-beta.4 \
--source-host-files-url https://github.com/groue/GRDB.swift/tree/v6.0.0 \
--module-version 6.0.0 \
--module GRDB \
--root-url http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/ \
--root-url http://groue.github.io/GRDB.swift/docs/6.0/ \
--output Documentation/Reference \
--swift-build-tool xcodebuild \
--undocumented-text '' \
Expand Down
44 changes: 23 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@
<a href="https://developer.apple.com/swift/"><img alt="Swift 5.7" src="https://img.shields.io/badge/swift-5.7-orange.svg?style=flat"></a>
<a href="https://developer.apple.com/swift/"><img alt="Platforms" src="https://img.shields.io/cocoapods/p/GRDB.swift.svg"></a>
<a href="https://github.com/groue/GRDB.swift/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/github/license/groue/GRDB.swift.svg?maxAge=2592000"></a>
<!-- no CI badge until actions can run Xcode 14
<a href="https://github.com/groue/GRDB.swift/actions/workflows/CI.yml"><img alt="CI Status" src="https://github.com/groue/GRDB.swift/actions/workflows/CI.yml/badge.svg?branch=master"></a>
-->
</p>

---

**Latest release**: August 28, 2022 • [version 6.0.0-beta.4](https://github.com/groue/GRDB.swift/tree/v6.0.0-beta.4)[CHANGELOG](CHANGELOG.md)[Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
**Latest release**: September 9, 2022 • [version 6.0.0](https://github.com/groue/GRDB.swift/tree/v6.0.0)[CHANGELOG](CHANGELOG.md)[Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)

**Requirements**: iOS 11.0+ / macOS 10.13+ / tvOS 11.0+ / watchOS 4.0+ &bull; SQLite 3.19.3+ &bull; Swift 5.7+ / Xcode 14+

| Swift version | GRDB version |
| -------------- | ----------------------------------------------------------- |
| **Swift 5.7+** | **v6.0.0-beta.4** |
| **Swift 5.7+** | **v6.0.0** |
| Swift 5.3 | [v5.26.0](https://github.com/groue/GRDB.swift/tree/v5.26.0) |
| Swift 5.2 | [v5.12.0](https://github.com/groue/GRDB.swift/tree/v5.12.0) |
| Swift 5.1 | [v4.14.0](https://github.com/groue/GRDB.swift/tree/v4.14.0) |
Expand Down Expand Up @@ -322,7 +324,7 @@ Documentation

#### Reference

- [GRDB Reference](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/index.html) (generated by [Jazzy](https://github.com/realm/jazzy))
- [GRDB Reference](http://groue.github.io/GRDB.swift/docs/6.0/index.html) (generated by [Jazzy](https://github.com/realm/jazzy))

#### Getting Started

Expand Down Expand Up @@ -616,7 +618,7 @@ do {

> **Warning**: It is your responsibility to prevent sensitive information from leaking in unexpected locations, so you should not set the `publicStatementArguments` flag in release builds (think about GDPR and other privacy-related rules).
See [Configuration](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/Configuration.html) for more details and configuration options.
See [Configuration](http://groue.github.io/GRDB.swift/docs/6.0/Structs/Configuration.html) for more details and configuration options.


SQLite API
Expand Down Expand Up @@ -673,7 +675,7 @@ try dbQueue.write { db in
}
```

The `?` and colon-prefixed keys like `:score` in the SQL query are the **statements arguments**. You pass arguments with arrays or dictionaries, as in the example above. See [Values](#values) for more information on supported arguments types (Bool, Int, String, Date, Swift enums, etc.), and [StatementArguments](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/StatementArguments.html) for a detailed documentation of SQLite arguments.
The `?` and colon-prefixed keys like `:score` in the SQL query are the **statements arguments**. You pass arguments with arrays or dictionaries, as in the example above. See [Values](#values) for more information on supported arguments types (Bool, Int, String, Date, Swift enums, etc.), and [StatementArguments](http://groue.github.io/GRDB.swift/docs/6.0/Structs/StatementArguments.html) for a detailed documentation of SQLite arguments.

You can also embed query arguments right into your SQL queries, with the `literal` argument label, as in the example below. See [SQL Interpolation] for more details.

Expand Down Expand Up @@ -931,7 +933,7 @@ try dbQueue.read { db in
let dictionary = try Dictionary(uniqueKeysWithValues: cursor)
```

- **Cursors adopt the [Cursor](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Protocols/Cursor.html) protocol, which looks a lot like standard [lazy sequences](https://developer.apple.com/reference/swift/lazysequenceprotocol) of Swift.** As such, cursors come with many convenience methods: `compactMap`, `contains`, `dropFirst`, `dropLast`, `drop(while:)`, `enumerated`, `filter`, `first`, `flatMap`, `forEach`, `joined`, `joined(separator:)`, `max`, `max(by:)`, `min`, `min(by:)`, `map`, `prefix`, `prefix(while:)`, `reduce`, `reduce(into:)`, `suffix`:
- **Cursors adopt the [Cursor](http://groue.github.io/GRDB.swift/docs/6.0/Protocols/Cursor.html) protocol, which looks a lot like standard [lazy sequences](https://developer.apple.com/reference/swift/lazysequenceprotocol) of Swift.** As such, cursors come with many convenience methods: `compactMap`, `contains`, `dropFirst`, `dropLast`, `drop(while:)`, `enumerated`, `filter`, `first`, `flatMap`, `forEach`, `joined`, `joined(separator:)`, `max`, `max(by:)`, `min`, `min(by:)`, `map`, `prefix`, `prefix(while:)`, `reduce`, `reduce(into:)`, `suffix`:

```swift
// Prints all Github links
Expand Down Expand Up @@ -1010,7 +1012,7 @@ let rows = try Row.fetchAll(db,
arguments: ["name": "Arthur"])
```

See [Values](#values) for more information on supported arguments types (Bool, Int, String, Date, Swift enums, etc.), and [StatementArguments](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/StatementArguments.html) for a detailed documentation of SQLite arguments.
See [Values](#values) for more information on supported arguments types (Bool, Int, String, Date, Swift enums, etc.), and [StatementArguments](http://groue.github.io/GRDB.swift/docs/6.0/Structs/StatementArguments.html) for a detailed documentation of SQLite arguments.

Unlike row arrays that contain copies of the database rows, row cursors are close to the SQLite metal, and require a little care:

Expand Down Expand Up @@ -1318,7 +1320,7 @@ GRDB ships with built-in support for the following value types:

- Generally speaking, all types that adopt the [DatabaseValueConvertible](#custom-value-types) protocol.

Values can be used as [statement arguments](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/StatementArguments.html):
Values can be used as [statement arguments](http://groue.github.io/GRDB.swift/docs/6.0/Structs/StatementArguments.html):

```swift
let url: URL = ...
Expand Down Expand Up @@ -1789,7 +1791,7 @@ try dbQueue.inDatabase { db in // or dbPool.writeWithoutTransaction
}
```

Transactions can't be left opened unless you set the [allowsUnsafeTransactions](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/Configuration.html) configuration flag:
Transactions can't be left opened unless you set the [allowsUnsafeTransactions](http://groue.github.io/GRDB.swift/docs/6.0/Structs/Configuration.html) configuration flag:

```swift
// fatal error: A transaction has been left opened at the end of a database access
Expand Down Expand Up @@ -1901,7 +1903,7 @@ try dbQueue.write { db in
}
```

The `?` and colon-prefixed keys like `:name` in the SQL query are the statement arguments. You set them with arrays or dictionaries (arguments are actually of type [StatementArguments](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/StatementArguments.html), which happens to adopt the ExpressibleByArrayLiteral and ExpressibleByDictionaryLiteral protocols).
The `?` and colon-prefixed keys like `:name` in the SQL query are the statement arguments. You set them with arrays or dictionaries (arguments are actually of type [StatementArguments](http://groue.github.io/GRDB.swift/docs/6.0/Structs/StatementArguments.html), which happens to adopt the ExpressibleByArrayLiteral and ExpressibleByDictionaryLiteral protocols).

```swift
insertStatement.arguments = ["name": "Arthur", "score": 1000]
Expand Down Expand Up @@ -1984,7 +1986,7 @@ See also `Database.execute(sql:)` in the [Executing Updates](#executing-updates)

> **Note**: it is a programmer error to reuse a prepared statement that has failed: GRDB may crash if you do so.

For more information about prepared statements, see the [Statement reference](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Classes/Statement.html).
For more information about prepared statements, see the [Statement reference](http://groue.github.io/GRDB.swift/docs/6.0/Classes/Statement.html).


### Prepared Statements Cache
Expand Down Expand Up @@ -2728,7 +2730,7 @@ try Place.fetchSet(db, sql: "SELECT ...", arguments:...) // Set<Place>
try Place.fetchOne(db, sql: "SELECT ...", arguments:...) // Place?
```

See [fetching methods](#fetching-methods) for information about the `fetchCursor`, `fetchAll`, `fetchSet` and `fetchOne` methods. See [StatementArguments](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/StatementArguments.html) for more information about the query arguments.
See [fetching methods](#fetching-methods) for information about the `fetchCursor`, `fetchAll`, `fetchSet` and `fetchOne` methods. See [StatementArguments](http://groue.github.io/GRDB.swift/docs/6.0/Structs/StatementArguments.html) for more information about the query arguments.

> **Note**: for performance reasons, the same row argument to `init(row:)` is reused during the iteration of a fetch query. If you want to keep the row for later use, make sure to store a copy: `self.row = row.copy()`.

Expand Down Expand Up @@ -3238,7 +3240,7 @@ Here is a list with all the available [persistence callbacks], listed in the sam
- `aroundDelete`
- `didDelete`

For detailed information about each callback, check the [reference](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Protocols/MutablePersistableRecord.html).
For detailed information about each callback, check the [reference](http://groue.github.io/GRDB.swift/docs/6.0/Protocols/MutablePersistableRecord.html).

In the `MutablePersistableRecord` protocol, `willInsert` and `didInsert` are mutating methods. In `PersistableRecord`, they are not mutating.

Expand Down Expand Up @@ -3431,7 +3433,7 @@ protocol EncodableRecord {
}
```

See [DatabaseColumnDecodingStrategy](https://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Enums/DatabaseColumnDecodingStrategy.html) and [DatabaseColumnEncodingStrategy](https://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Enums/DatabaseColumnEncodingStrategy.html) to learn about all available strategies.
See [DatabaseColumnDecodingStrategy](https://groue.github.io/GRDB.swift/docs/6.0/Enums/DatabaseColumnDecodingStrategy.html) and [DatabaseColumnEncodingStrategy](https://groue.github.io/GRDB.swift/docs/6.0/Enums/DatabaseColumnEncodingStrategy.html) to learn about all available strategies.


### Date and UUID Coding Strategies
Expand All @@ -3453,7 +3455,7 @@ protocol EncodableRecord {
}
```

See [DatabaseDateDecodingStrategy](https://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Enums/DatabaseDateDecodingStrategy.html), [DatabaseDateEncodingStrategy](https://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Enums/DatabaseDateEncodingStrategy.html), and [DatabaseUUIDEncodingStrategy](https://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Enums/DatabaseUUIDEncodingStrategy.html) to learn about all available strategies.
See [DatabaseDateDecodingStrategy](https://groue.github.io/GRDB.swift/docs/6.0/Enums/DatabaseDateDecodingStrategy.html), [DatabaseDateEncodingStrategy](https://groue.github.io/GRDB.swift/docs/6.0/Enums/DatabaseDateEncodingStrategy.html), and [DatabaseUUIDEncodingStrategy](https://groue.github.io/GRDB.swift/docs/6.0/Enums/DatabaseUUIDEncodingStrategy.html) to learn about all available strategies.

There is no customization of uuid decoding, because UUID can already decode all its encoded variants (16-bytes blobs and uuid strings, both uppercase and lowercase).

Expand Down Expand Up @@ -5013,7 +5015,7 @@ Player // SELECT * FROM player
```
Raw SQL snippets are also accepted, with eventual [arguments](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/StatementArguments.html):
Raw SQL snippets are also accepted, with eventual [arguments](http://groue.github.io/GRDB.swift/docs/6.0/Structs/StatementArguments.html):
```swift
// SELECT DATE(creationDate), COUNT(*) FROM player WHERE name = 'Arthur' GROUP BY date(creationDate)
Expand Down Expand Up @@ -5919,7 +5921,7 @@ try Player.customRequest().fetchAll(db) // [Player]
- The `adapted(_:)` method eases the consumption of complex rows with [row adapters](#row-adapters). See [Joined Queries Support](#joined-queries-support) for some sample code that uses this method.
- [AnyFetchRequest](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/AnyFetchRequest.html): a type-erased request.
- [AnyFetchRequest](http://groue.github.io/GRDB.swift/docs/6.0/Structs/AnyFetchRequest.html): a type-erased request.
## Joined Queries Support
Expand Down Expand Up @@ -7252,7 +7254,7 @@ DatabaseRegion helps [ValueObservation] and [DatabaseRegionObservation] track ch
For example, if you observe the region of `Player.select(max(Column("score")))`, then you'll get be notified of all changes performed on the `score` column of the `player` table (updates, insertions and deletions), even if they do not modify the value of the maximum score. However, you will not get any notification for changes performed on other database tables, or updates to other columns of the player table.
For more details, see the [reference](https://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/DatabaseRegion.html).
For more details, see the [reference](https://groue.github.io/GRDB.swift/docs/6.0/Structs/DatabaseRegion.html).
#### The DatabaseRegionConvertible Protocol
Expand Down Expand Up @@ -8616,7 +8618,7 @@ When this is the case, there are two possible explanations:
try db.execute(sql: "UPDATE player SET name = ?", arguments: [name])
```
For more information, see [Double-quoted String Literals Are Accepted](https://sqlite.org/quirks.html#dblquote), and [Configuration.acceptsDoubleQuotedStringLiterals](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/Configuration.html#/s:4GRDB13ConfigurationV33acceptsDoubleQuotedStringLiteralsSbvp).
For more information, see [Double-quoted String Literals Are Accepted](https://sqlite.org/quirks.html#dblquote), and [Configuration.acceptsDoubleQuotedStringLiterals](http://groue.github.io/GRDB.swift/docs/6.0/Structs/Configuration.html#/s:4GRDB13ConfigurationV33acceptsDoubleQuotedStringLiteralsSbvp).
Expand Down Expand Up @@ -8765,7 +8767,7 @@ This chapter has [moved](Documentation/Concurrency.md#database-snapshots).
#### DatabaseWriter and DatabaseReader Protocols
This chapter was removed. See the references of [DatabaseReader](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Protocols/DatabaseReader.html) and [DatabaseWriter](http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Protocols/DatabaseWriter.html).
This chapter was removed. See the references of [DatabaseReader](http://groue.github.io/GRDB.swift/docs/6.0/Protocols/DatabaseReader.html) and [DatabaseWriter](http://groue.github.io/GRDB.swift/docs/6.0/Protocols/DatabaseWriter.html).
#### Asynchronous APIs
Expand Down Expand Up @@ -8819,7 +8821,7 @@ This chapter was renamed to [Embedding SQL in Query Interface Requests].
[Sharing a Database]: Documentation/SharingADatabase.md
[FAQ]: #faq
[Database Observation]: #database-changes-observation
[SQLRequest]: http://groue.github.io/GRDB.swift/docs/6.0.0-beta.4/Structs/SQLRequest.html
[SQLRequest]: http://groue.github.io/GRDB.swift/docs/6.0/Structs/SQLRequest.html
[SQL literal]: Documentation/SQLInterpolation.md#sql-literal
[Identifiable]: https://developer.apple.com/documentation/swift/identifiable
[Query Interface Organization]: Documentation/QueryInterfaceOrganization.md
Expand Down
2 changes: 1 addition & 1 deletion Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>6.0.0-beta.4</string>
<string>6.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit 589e53b

Please sign in to comment.