We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 92f578c + 8c37f90 commit 674f9edCopy full SHA for 674f9ed
Sources/DuckDB/Database.swift
@@ -80,15 +80,11 @@ public final class Database: Sendable {
80
public convenience init(
81
store: Store = .inMemory, configuration: Configuration? = nil
82
) throws {
83
- var fileURL: URL?
84
- if case .file(let url) = store {
85
- guard url.isFileURL else {
86
- throw DatabaseError.databaseFailedToInitialize(
87
- reason: "provided URL for database store file must be local")
88
- }
89
- fileURL = url
90
91
- try self.init(path: fileURL?.path, config: configuration)
+ let path: String? = {
+ guard case .file(let url) = store else { return nil }
+ return url.path
+ }()
+ try self.init(path: path, config: configuration)
92
}
93
94
private init(path: String?, config: Configuration?) throws {
0 commit comments