@@ -70,6 +70,7 @@ let SQLITE_TRANSIENT = unsafeBitCast(OpaquePointer(bitPattern: -1), to: sqlite3_
7070///
7171/// - ``dumpContent(format:to:)``
7272/// - ``dumpRequest(_:format:to:)``
73+ /// - ``dumpSchema(to:)``
7374/// - ``dumpSQL(_:format:to:)``
7475/// - ``dumpTables(_:format:tableHeader:stableOrder:to:)``
7576/// - ``DumpFormat``
@@ -114,6 +115,7 @@ let SQLITE_TRANSIENT = unsafeBitCast(OpaquePointer(bitPattern: -1), to: sqlite3_
114115/// - ``trace(options:_:)``
115116/// - ``CheckpointMode``
116117/// - ``DatabaseBackupProgress``
118+ /// - ``StorageClass``
117119/// - ``TraceEvent``
118120/// - ``TracingOptions``
119121public final class Database : CustomStringConvertible , CustomDebugStringConvertible {
@@ -1729,6 +1731,11 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib
17291731 }
17301732}
17311733
1734+ // Explicit non-conformance to Sendable: `Database` must be used from a
1735+ // serialized database access dispatch queue (see `SerializedDatabase`).
1736+ @available ( * , unavailable)
1737+ extension Database : Sendable { }
1738+
17321739#if SQLITE_HAS_CODEC
17331740extension Database {
17341741
@@ -1854,7 +1861,7 @@ extension Database {
18541861 /// The available checkpoint modes.
18551862 ///
18561863 /// Related SQLite documentation: <https://www.sqlite.org/c3ref/wal_checkpoint_v2.html>
1857- public enum CheckpointMode : CInt {
1864+ public enum CheckpointMode : CInt , Sendable {
18581865 /// The `SQLITE_CHECKPOINT_PASSIVE` mode.
18591866 case passive = 0
18601867
@@ -1873,7 +1880,7 @@ extension Database {
18731880 /// Related SQLite documentation:
18741881 /// - <https://www.sqlite.org/datatype3.html#collating_sequences>
18751882 /// - <https://www.sqlite.org/datatype3.html#collation>
1876- public struct CollationName : RawRepresentable , Hashable {
1883+ public struct CollationName : RawRepresentable , Hashable , Sendable {
18771884 public let rawValue : String
18781885
18791886 /// Creates a collation name.
@@ -1910,7 +1917,7 @@ extension Database {
19101917 ///
19111918 /// For more information, see
19121919 /// [Datatypes In SQLite](https://www.sqlite.org/datatype3.html).
1913- public struct ColumnType : RawRepresentable , Hashable {
1920+ public struct ColumnType : RawRepresentable , Hashable , Sendable {
19141921 /// The SQL for the column type (`"TEXT"`, `"BLOB"`, etc.)
19151922 public let rawValue : String
19161923
@@ -1962,7 +1969,7 @@ extension Database {
19621969 /// An SQLite conflict resolution.
19631970 ///
19641971 /// Related SQLite documentation: <https://www.sqlite.org/lang_conflict.html>
1965- public enum ConflictResolution : String {
1972+ public enum ConflictResolution : String , Sendable {
19661973 /// The `ROLLBACK` conflict resolution.
19671974 case rollback = " ROLLBACK "
19681975
@@ -1982,7 +1989,7 @@ extension Database {
19821989 /// A foreign key action.
19831990 ///
19841991 /// Related SQLite documentation: <https://www.sqlite.org/foreignkeys.html>
1985- public enum ForeignKeyAction : String {
1992+ public enum ForeignKeyAction : String , Sendable {
19861993 /// The `CASCADE` foreign key action.
19871994 case cascade = " CASCADE "
19881995
@@ -1999,13 +2006,39 @@ extension Database {
19992006 /// An error log function that takes an error code and message.
20002007 public typealias LogErrorFunction = ( _ resultCode: ResultCode , _ message: String ) -> Void
20012008
2009+ /// An SQLite storage class.
2010+ ///
2011+ /// For more information, see
2012+ /// [Datatypes In SQLite](https://www.sqlite.org/datatype3.html).
2013+ public struct StorageClass : RawRepresentable , Hashable , Sendable {
2014+ /// The SQL for the storage class (`"INTEGER"`, `"REAL"`, etc.)
2015+ public let rawValue : String
2016+
2017+ /// Creates an SQL storage class.
2018+ public init ( rawValue: String ) {
2019+ self . rawValue = rawValue
2020+ }
2021+
2022+ /// The `INTEGER` storage class.
2023+ public static let integer = StorageClass ( rawValue: " INTEGER " )
2024+
2025+ /// The `REAL` storage class.
2026+ public static let real = StorageClass ( rawValue: " REAL " )
2027+
2028+ /// The `TEXT` storage class.
2029+ public static let text = StorageClass ( rawValue: " TEXT " )
2030+
2031+ /// The `BLOB` storage class.
2032+ public static let blob = StorageClass ( rawValue: " BLOB " )
2033+ }
2034+
20022035 /// An option for the SQLite tracing feature.
20032036 ///
20042037 /// You use `TracingOptions` with the `Database`
20052038 /// ``Database/trace(options:_:)`` method.
20062039 ///
20072040 /// Related SQLite documentation: <https://www.sqlite.org/c3ref/c_trace.html>
2008- public struct TracingOptions : OptionSet {
2041+ public struct TracingOptions : OptionSet , Sendable {
20092042 /// The raw trace event code.
20102043 public let rawValue : CInt
20112044
@@ -2138,15 +2171,15 @@ extension Database {
21382171 ///
21392172 /// Related SQLite documentation: <https://www.sqlite.org/lang_transaction.html>.
21402173 @frozen
2141- public enum TransactionCompletion {
2174+ public enum TransactionCompletion : Sendable {
21422175 case commit
21432176 case rollback
21442177 }
21452178
21462179 /// A transaction kind.
21472180 ///
21482181 /// Related SQLite documentation: <https://www.sqlite.org/lang_transaction.html>.
2149- public enum TransactionKind : String {
2182+ public enum TransactionKind : String , Sendable {
21502183 /// The `DEFERRED` transaction kind.
21512184 case deferred = " DEFERRED "
21522185
@@ -2179,3 +2212,13 @@ extension Database {
21792212 }
21802213 }
21812214}
2215+
2216+ // Explicit non-conformance to Sendable: a trace event contains transient
2217+ // information.
2218+ @available ( * , unavailable)
2219+ extension Database . TraceEvent : Sendable { }
2220+
2221+ // Explicit non-conformance to Sendable: a trace event contains transient
2222+ // information.
2223+ @available ( * , unavailable)
2224+ extension Database . TraceEvent . Statement : Sendable { }
0 commit comments