Skip to content

Commit 0401d44

Browse files
committed
Database.sqliteLibVersionNumber
1 parent 4de97e6 commit 0401d44

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

GRDB/Core/Database.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ let SQLITE_TRANSIENT = unsafeBitCast(OpaquePointer(bitPattern: -1), to: sqlite3_
121121
/// - ``clearSchemaCache()``
122122
/// - ``logError``
123123
/// - ``releaseMemory()``
124+
/// - ``sqliteLibVersionNumber``
124125
/// - ``trace(options:_:)``
125126
///
126127
/// ### Supporting Types
@@ -302,6 +303,21 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib
302303
}
303304
}
304305

306+
307+
/// An integer equal to [`SQLITE_VERSION_NUMBER`](https://www.sqlite.org/c3ref/c_source_id.html).
308+
///
309+
/// This property returns the result of `sqlite3_libversion_number()`.
310+
///
311+
/// ```swift
312+
/// // Prints, for example, "3048000"
313+
/// print(Database.sqliteLibVersionNumber)
314+
/// ```
315+
@inline(__always)
316+
@inlinable
317+
public static var sqliteLibVersionNumber: CInt {
318+
sqlite3_libversion_number()
319+
}
320+
305321
/// Whether the database region selected by statement execution is
306322
/// recorded into `selectedRegion` by `track(_:)`.
307323
///

0 commit comments

Comments
 (0)