diff --git a/CHANGELOG.md b/CHANGELOG.md index 34fabdb28..313cc3c94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception: #### 6.x Releases +- `6.18.x` Releases - [6.18.0](#6180) - `6.17.x` Releases - [6.17.0](#6170) - `6.16.x` Releases - [6.16.0](#6160) - `6.15.x` Releases - [6.15.0](#6150) - [6.15.1](#6151) @@ -115,6 +116,12 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception: --- +## 6.18.0 + +Released September 1, 2023 • [diff](https://github.com/groue/GRDB.swift/compare/v6.17.0...v6.18.0) + +- **New**: Expose the database path from `DatabaseReader`. + ## 6.17.0 Released August 26, 2023 • [diff](https://github.com/groue/GRDB.swift/compare/v6.16.0...v6.17.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 79f129cfe..8175ac90f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,7 +69,7 @@ How you can Contribute GRDB documentation is provided as a DocC reference, and guides ([README.md](README.md) and the [Documentation](Documentation) folder). - Please keep the reference and the guides up-to-date. Use Xcode > Product > Build Documentation in order to control the quality of your reference documentation. + Please keep the reference and the guides up-to-date. To control the quality of your DocC reference documentation, close the workspace, open `Package.swift` in Xcode, and use Product > Build Documentation. GRDB is "documentation-driven", which means that nothing ships until it is supported by documentation that makes sense. Documentation makes sense when someone who is not you is able to figure out what is the purpose of your contribution, how to use it, and what are its eventual caveats and corner cases. When the documentation is hard to write, or reveals too many caveats, it is the sign that the api needs to be fixed. diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec index 1b20f7355..0a43f6275 100644 --- a/GRDB.swift.podspec +++ b/GRDB.swift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'GRDB.swift' - s.version = '6.17.0' + s.version = '6.18.0' s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'A toolkit for SQLite databases, with a focus on application development.' diff --git a/GRDB/Core/DatabaseQueue.swift b/GRDB/Core/DatabaseQueue.swift index 79252cb25..13ecfb6e9 100644 --- a/GRDB/Core/DatabaseQueue.swift +++ b/GRDB/Core/DatabaseQueue.swift @@ -16,9 +16,6 @@ public final class DatabaseQueue { writer.configuration } - /// The path to the database file. - /// - /// The path is `:memory:` for in-memory databases. public var path: String { writer.path } diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index 2ac917d1f..ae947cae4 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -17,6 +17,7 @@ import Dispatch /// ### Database Information /// /// - ``configuration`` +/// - ``path`` /// /// ### Reading from the Database /// @@ -46,6 +47,12 @@ public protocol DatabaseReader: AnyObject, Sendable { /// The database configuration. var configuration: Configuration { get } + /// The path to the database file. + /// + /// In-memory databases also have a path: + /// see [In-Memory Databases](https://www.sqlite.org/inmemorydb.html). + var path: String { get } + /// Closes the database connection. /// /// - note: You do not have to call this method, and you should not call @@ -644,6 +651,10 @@ extension AnyDatabaseReader: DatabaseReader { base.configuration } + public var path: String { + base.path + } + public func close() throws { try base.close() } diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 7d9480e11..939092e37 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -964,6 +964,10 @@ extension AnyDatabaseWriter: DatabaseReader { base.configuration } + public var path: String { + base.path + } + public func close() throws { try base.close() } diff --git a/README.md b/README.md index ddd865de7..c31d94741 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ CI Status

-**Latest release**: August 26, 2023 • [version 6.17.0](https://github.com/groue/GRDB.swift/tree/v6.17.0) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md) +**Latest release**: September 1, 2023 • [version 6.18.0](https://github.com/groue/GRDB.swift/tree/v6.18.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+ • SQLite 3.19.3+ • Swift 5.7+ / Xcode 14+ diff --git a/Support/Info.plist b/Support/Info.plist index c9117a319..3c0450ca8 100644 --- a/Support/Info.plist +++ b/Support/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 6.17.0 + 6.18.0 CFBundleSignature ???? CFBundleVersion