mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
Expose path on DatabaseReader
This commit is contained in:
1 parent
c12fff16d3
commit
7cbcbe12f0
3 files changed
+15
-3
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -964,6 +964,10 @@ extension AnyDatabaseWriter: DatabaseReader {
|
||||
base.configuration
|
||||
}
|
||||
|
||||
public var path: String {
|
||||
base.path
|
||||
}
|
||||
|
||||
public func close() throws {
|
||||
try base.close()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user