Expose path on DatabaseReader

This commit is contained in:
Gwendal Roué committed 2023-08-31 09:42:13 +02:00
1 parent c12fff16d3
commit 7cbcbe12f0
3 files changed
+15 -3

No files matched your search

-3
View File
@@ -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
}
+11
View File
@@ -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()
}
+4
View File
@@ -964,6 +964,10 @@ extension AnyDatabaseWriter: DatabaseReader {
base.configuration
}
public var path: String {
base.path
}
public func close() throws {
try base.close()
}