Skip to content

Commit b9489a7

Browse files
authored
Native user_version support in Connection
1 parent 1c86a47 commit b9489a7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/SQLite/Core/Connection.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ public final class Connection {
151151
public var totalChanges: Int {
152152
Int(sqlite3_total_changes(handle))
153153
}
154+
155+
/// The user version of the database.
156+
/// See SQLite [PRAGMA user_version](https://sqlite.org/pragma.html#pragma_user_version)
157+
public var userVersion: Int32 {
158+
get { return Int32(try! scalar("PRAGMA user_version") as! Int64)}
159+
set { try! run("PRAGMA user_version = \(newValue)") }
160+
}
154161

155162
// MARK: - Execute
156163

0 commit comments

Comments
 (0)