Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use URL.path instead of URL.absoluteString when initializing SQLite.Connection #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Sources/Bodega/SQLiteStorageEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ public actor SQLiteStorageEngine: StorageEngine {
try Self.createDirectory(url: directory.url)
}

self.connection = try Connection(directory.url.appendingPathComponent(filename).appendingPathExtension("sqlite3").absoluteString)
if #available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) {
self.connection = try Connection(directory.url.appendingPathComponent(filename).appendingPathExtension("sqlite3").path())
} else {
self.connection = try Connection(directory.url.appendingPathComponent(filename).appendingPathExtension("sqlite3").path)
}

self.connection.busyTimeout = 3

try self.connection.run(Self.storageTable.create(ifNotExists: true) { table in
Expand Down