diff --git a/Sources/SQLite/Core/Blob.swift b/Sources/SQLite/Core/Blob.swift index a709fb42..6bf8f3a0 100644 --- a/Sources/SQLite/Core/Blob.swift +++ b/Sources/SQLite/Core/Blob.swift @@ -22,7 +22,7 @@ // THE SOFTWARE. // -public struct Blob { +public struct Blob: Sendable { public let bytes: [UInt8] diff --git a/Sources/SQLite/Core/Errors.swift b/Sources/SQLite/Core/Errors.swift index 3cd7ae9f..d95d544d 100644 --- a/Sources/SQLite/Core/Errors.swift +++ b/Sources/SQLite/Core/Errors.swift @@ -1,6 +1,6 @@ import Foundation -public enum QueryError: Error, CustomStringConvertible { +public enum QueryError: Error, CustomStringConvertible, Sendable { case noSuchTable(name: String) case noSuchColumn(name: String, columns: [String]) case ambiguousColumn(name: String, similar: [String]) diff --git a/Sources/SQLite/Core/SQLiteVersion.swift b/Sources/SQLite/Core/SQLiteVersion.swift index fa7358da..7ae4aa51 100644 --- a/Sources/SQLite/Core/SQLiteVersion.swift +++ b/Sources/SQLite/Core/SQLiteVersion.swift @@ -1,6 +1,6 @@ import Foundation -public struct SQLiteVersion: Comparable, CustomStringConvertible { +public struct SQLiteVersion: Comparable, CustomStringConvertible, Sendable { public let major: Int public let minor: Int public var point: Int = 0 @@ -17,6 +17,6 @@ public struct SQLiteVersion: Comparable, CustomStringConvertible { lhs.tuple == rhs.tuple } - static var zero: SQLiteVersion = .init(major: 0, minor: 0) + static let zero: SQLiteVersion = .init(major: 0, minor: 0) private var tuple: (Int, Int, Int) { (major, minor, point) } } diff --git a/Sources/SQLite/Core/Value.swift b/Sources/SQLite/Core/Value.swift index 249a7728..5e1c6a92 100644 --- a/Sources/SQLite/Core/Value.swift +++ b/Sources/SQLite/Core/Value.swift @@ -27,7 +27,7 @@ /// /// Do not conform custom types to the Binding protocol. See the `Value` /// protocol, instead. -public protocol Binding {} +public protocol Binding: Sendable {} public protocol Number: Binding {} diff --git a/Sources/SQLite/Typed/AggregateFunctions.swift b/Sources/SQLite/Typed/AggregateFunctions.swift index 17fc4a20..11c6a9b7 100644 --- a/Sources/SQLite/Typed/AggregateFunctions.swift +++ b/Sources/SQLite/Typed/AggregateFunctions.swift @@ -22,7 +22,7 @@ // THE SOFTWARE. // -private enum Function: String { +private enum Function: String, Sendable { case count case max case min diff --git a/Sources/SQLite/Typed/Collation.swift b/Sources/SQLite/Typed/Collation.swift index fec66129..ad42313d 100644 --- a/Sources/SQLite/Typed/Collation.swift +++ b/Sources/SQLite/Typed/Collation.swift @@ -25,7 +25,7 @@ /// A collating function used to compare to strings. /// /// - SeeAlso: -public enum Collation { +public enum Collation: Sendable { /// Compares string by raw data. case binary diff --git a/Sources/SQLite/Typed/CoreFunctions.swift b/Sources/SQLite/Typed/CoreFunctions.swift index c4359d8b..19657714 100644 --- a/Sources/SQLite/Typed/CoreFunctions.swift +++ b/Sources/SQLite/Typed/CoreFunctions.swift @@ -23,7 +23,7 @@ // import Foundation -private enum Function: String { +private enum Function: String, Sendable { case abs case round case random diff --git a/Sources/SQLite/Typed/DateAndTimeFunctions.swift b/Sources/SQLite/Typed/DateAndTimeFunctions.swift index b4382194..e1b55b5f 100644 --- a/Sources/SQLite/Typed/DateAndTimeFunctions.swift +++ b/Sources/SQLite/Typed/DateAndTimeFunctions.swift @@ -29,7 +29,7 @@ import Foundation /// The strftime() function also takes a format string as its first argument. /// /// https://www.sqlite.org/lang_datefunc.html -public class DateFunctions { +public final class DateFunctions: Sendable { /// The date() function returns the date in this format: YYYY-MM-DD. public static func date(_ timestring: String, _ modifiers: String...) -> Expression { timefunction("date", timestring: timestring, modifiers: modifiers) diff --git a/Sources/SQLite/Typed/Expression.swift b/Sources/SQLite/Typed/Expression.swift index dcc44fe4..93d70f0c 100644 --- a/Sources/SQLite/Typed/Expression.swift +++ b/Sources/SQLite/Typed/Expression.swift @@ -22,7 +22,7 @@ // THE SOFTWARE. // -public protocol ExpressionType: Expressible, CustomStringConvertible { // extensions cannot have inheritance clauses +public protocol ExpressionType: Expressible, CustomStringConvertible, Sendable { // extensions cannot have inheritance clauses associatedtype UnderlyingType = Void @@ -67,7 +67,7 @@ public struct Expression: ExpressionType { } -public protocol Expressible { +public protocol Expressible: Sendable { var expression: Expression { get } diff --git a/Sources/SQLite/Typed/Operators.swift b/Sources/SQLite/Typed/Operators.swift index 1c611cbc..04676920 100644 --- a/Sources/SQLite/Typed/Operators.swift +++ b/Sources/SQLite/Typed/Operators.swift @@ -24,7 +24,7 @@ // TODO: use `@warn_unused_result` by the time operator functions support it -private enum Operator: String { +private enum Operator: String, Sendable { case plus = "+" case minus = "-" case or = "OR" diff --git a/Sources/SQLite/Typed/Query+with.swift b/Sources/SQLite/Typed/Query+with.swift index d06c8896..d1def1cf 100644 --- a/Sources/SQLite/Typed/Query+with.swift +++ b/Sources/SQLite/Typed/Query+with.swift @@ -95,15 +95,15 @@ extension QueryType { } /// Materialization hints for `WITH` clause -public enum MaterializationHint: String { +public enum MaterializationHint: String, Sendable { case materialized = "MATERIALIZED" case notMaterialized = "NOT MATERIALIZED" } -struct WithClauses { - struct Clause { +struct WithClauses: Sendable { + struct Clause: Sendable { var alias: Table var columns: [Expressible]? var hint: MaterializationHint? diff --git a/Sources/SQLite/Typed/Query.swift b/Sources/SQLite/Typed/Query.swift index 6162fcc7..d82761c8 100644 --- a/Sources/SQLite/Typed/Query.swift +++ b/Sources/SQLite/Typed/Query.swift @@ -1168,7 +1168,7 @@ extension Connection { } -public struct Row { +public struct Row: Sendable { let columnNames: [String: Int] @@ -1242,7 +1242,7 @@ public struct Row { } /// Determines the join operator for a query’s `JOIN` clause. -public enum JoinType: String { +public enum JoinType: String, Sendable { /// A `CROSS` join. case cross = "CROSS" @@ -1256,7 +1256,7 @@ public enum JoinType: String { } /// ON CONFLICT resolutions. -public enum OnConflict: String { +public enum OnConflict: String, Sendable { case replace = "REPLACE" @@ -1272,7 +1272,7 @@ public enum OnConflict: String { // MARK: - Private -public struct QueryClauses { +public struct QueryClauses: Sendable { var select = (distinct: false, columns: [Expression(literal: "*") as Expressible]) diff --git a/Sources/SQLite/Typed/Schema.swift b/Sources/SQLite/Typed/Schema.swift index 919042ab..e0cf2654 100644 --- a/Sources/SQLite/Typed/Schema.swift +++ b/Sources/SQLite/Typed/Schema.swift @@ -495,7 +495,7 @@ public final class TableBuilder { } -public enum PrimaryKey { +public enum PrimaryKey: Sendable { case `default` @@ -503,7 +503,7 @@ public enum PrimaryKey { } -public struct Module { +public struct Module: Sendable { fileprivate let name: String @@ -592,7 +592,7 @@ private func reference(_ primary: (QueryType, Expressible)) -> Expressible { ]) } -private enum Modifier: String { +private enum Modifier: String, Sendable { case unique = "UNIQUE" diff --git a/Sources/SQLite/Typed/Setter.swift b/Sources/SQLite/Typed/Setter.swift index 8dc8a0e0..a1d57baa 100644 --- a/Sources/SQLite/Typed/Setter.swift +++ b/Sources/SQLite/Typed/Setter.swift @@ -30,7 +30,7 @@ precedencegroup ColumnAssignment { infix operator <- : ColumnAssignment -public struct Setter { +public struct Setter: Sendable { let column: Expressible let value: Expressible diff --git a/Sources/SQLite/Typed/WindowFunctions.swift b/Sources/SQLite/Typed/WindowFunctions.swift index e71e1ada..7695c352 100644 --- a/Sources/SQLite/Typed/WindowFunctions.swift +++ b/Sources/SQLite/Typed/WindowFunctions.swift @@ -1,7 +1,7 @@ import Foundation // see https://www.sqlite.org/windowfunctions.html#builtins -private enum WindowFunction: String { +private enum WindowFunction: String, Sendable { // swiftlint:disable identifier_name case ntile case row_number