Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/SQLite/Core/Blob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// THE SOFTWARE.
//

public struct Blob {
public struct Blob: Sendable {

public let bytes: [UInt8]

Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Core/Errors.swift
Original file line number Diff line number Diff line change
@@ -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])
Expand Down
4 changes: 2 additions & 2 deletions Sources/SQLite/Core/SQLiteVersion.swift
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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) }
}
2 changes: 1 addition & 1 deletion Sources/SQLite/Core/Value.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Typed/AggregateFunctions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// THE SOFTWARE.
//

private enum Function: String {
private enum Function: String, Sendable {
case count
case max
case min
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Typed/Collation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/// A collating function used to compare to strings.
///
/// - SeeAlso: <https://www.sqlite.org/datatype3.html#collation>
public enum Collation {
public enum Collation: Sendable {

/// Compares string by raw data.
case binary
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Typed/CoreFunctions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//
import Foundation

private enum Function: String {
private enum Function: String, Sendable {
case abs
case round
case random
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Typed/DateAndTimeFunctions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Date?> {
timefunction("date", timestring: timestring, modifiers: modifiers)
Expand Down
4 changes: 2 additions & 2 deletions Sources/SQLite/Typed/Expression.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -67,7 +67,7 @@ public struct Expression<Datatype>: ExpressionType {

}

public protocol Expressible {
public protocol Expressible: Sendable {

var expression: Expression<Void> { get }

Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Typed/Operators.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions Sources/SQLite/Typed/Query+with.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
8 changes: 4 additions & 4 deletions Sources/SQLite/Typed/Query.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ extension Connection {

}

public struct Row {
public struct Row: Sendable {

let columnNames: [String: Int]

Expand Down Expand Up @@ -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"
Expand All @@ -1256,7 +1256,7 @@ public enum JoinType: String {
}

/// ON CONFLICT resolutions.
public enum OnConflict: String {
public enum OnConflict: String, Sendable {

case replace = "REPLACE"

Expand All @@ -1272,7 +1272,7 @@ public enum OnConflict: String {

// MARK: - Private

public struct QueryClauses {
public struct QueryClauses: Sendable {

var select = (distinct: false, columns: [Expression<Void>(literal: "*") as Expressible])

Expand Down
6 changes: 3 additions & 3 deletions Sources/SQLite/Typed/Schema.swift
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,15 @@ public final class TableBuilder {

}

public enum PrimaryKey {
public enum PrimaryKey: Sendable {

case `default`

case autoincrement

}

public struct Module {
public struct Module: Sendable {

fileprivate let name: String

Expand Down Expand Up @@ -592,7 +592,7 @@ private func reference(_ primary: (QueryType, Expressible)) -> Expressible {
])
}

private enum Modifier: String {
private enum Modifier: String, Sendable {

case unique = "UNIQUE"

Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Typed/Setter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ precedencegroup ColumnAssignment {

infix operator <- : ColumnAssignment

public struct Setter {
public struct Setter: Sendable {

let column: Expressible
let value: Expressible
Expand Down
2 changes: 1 addition & 1 deletion Sources/SQLite/Typed/WindowFunctions.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down