Create directory before establishing connection
This commit is contained in:
parent
edb78d3936
commit
e3eac6a9fe
@ -73,6 +73,12 @@ public enum DatabaseInformation {
|
|||||||
if let privateConnection {
|
if let privateConnection {
|
||||||
return privateConnection
|
return privateConnection
|
||||||
}
|
}
|
||||||
|
if let url = URL(string: path) {
|
||||||
|
try? FileManager.default.createDirectory(
|
||||||
|
at: url.deletingLastPathComponent(),
|
||||||
|
withIntermediateDirectories: true
|
||||||
|
)
|
||||||
|
}
|
||||||
let connection = try? Connection(path)
|
let connection = try? Connection(path)
|
||||||
privateConnection = connection
|
privateConnection = connection
|
||||||
_ = try? connection?.run(table.create { table in
|
_ = try? connection?.run(table.create { table in
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user