From 0401d449bbce07f98d9ceb1aa4e6587c9a9e87ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 1 Feb 2025 11:59:04 +0100 Subject: [PATCH] Database.sqliteLibVersionNumber --- GRDB/Core/Database.swift | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/GRDB/Core/Database.swift b/GRDB/Core/Database.swift index 859c7f42a..3d7419ce5 100644 --- a/GRDB/Core/Database.swift +++ b/GRDB/Core/Database.swift @@ -121,6 +121,7 @@ let SQLITE_TRANSIENT = unsafeBitCast(OpaquePointer(bitPattern: -1), to: sqlite3_ /// - ``clearSchemaCache()`` /// - ``logError`` /// - ``releaseMemory()`` +/// - ``sqliteLibVersionNumber`` /// - ``trace(options:_:)`` /// /// ### Supporting Types @@ -302,6 +303,21 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib } } + + /// An integer equal to [`SQLITE_VERSION_NUMBER`](https://www.sqlite.org/c3ref/c_source_id.html). + /// + /// This property returns the result of `sqlite3_libversion_number()`. + /// + /// ```swift + /// // Prints, for example, "3048000" + /// print(Database.sqliteLibVersionNumber) + /// ``` + @inline(__always) + @inlinable + public static var sqliteLibVersionNumber: CInt { + sqlite3_libversion_number() + } + /// Whether the database region selected by statement execution is /// recorded into `selectedRegion` by `track(_:)`. ///