From 7cbcbe12f0018956c8cc8c3de4a55fa3a3b2fd30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Thu, 31 Aug 2023 09:42:13 +0200
Subject: [PATCH 1/3] Expose path on DatabaseReader
---
GRDB/Core/DatabaseQueue.swift | 3 ---
GRDB/Core/DatabaseReader.swift | 11 +++++++++++
GRDB/Core/DatabaseWriter.swift | 4 ++++
3 files changed, 15 insertions(+), 3 deletions(-)
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()
}
From 5f103df04d87f96bf705788facfa32c16d610c4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Thu, 31 Aug 2023 09:45:37 +0200
Subject: [PATCH 2/3] Update CONTRIBUTING.md for DocC
---
CONTRIBUTING.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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.
From 92f5b2a9ddf7ac34ae53f20cf06fcda4dcae3856 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Rou=C3=A9?=
Date: Fri, 1 Sep 2023 11:39:48 +0200
Subject: [PATCH 3/3] v6.18.0
---
CHANGELOG.md | 7 +++++++
GRDB.swift.podspec | 2 +-
README.md | 2 +-
Support/Info.plist | 2 +-
4 files changed, 10 insertions(+), 3 deletions(-)
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/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/README.md b/README.md
index ddd865de7..c31d94741 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
-**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