Origin
The origin of an index.
struct Origin
The origin of an index.
struct Origin
import GRDB
A toolkit for SQLite databases, with a focus on application development
struct IndexInfo
Information about an index.
let columns: [String]
The indexed columns.
let isUnique: Bool
A boolean value indicating if the index is unique.
let name: String
The name of the index.
let origin: Origin
The origin of the index.
protocol DatabaseValueConvertible : SQLExpressible, StatementBinding
A type that can convert itself into and out of a database value.
protocol Equatable
A type that can be compared for value equality.
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol SQLExpressible
A type that can be used as an SQL expression.
protocol Sendable
protocol StatementBinding
A type that can bind a statement argument.
init(rawValue: String)
static let createIndex: IndexInfo.Origin
An index created from a CREATE INDEX
statement.
static let primaryKeyConstraint: IndexInfo.Origin
An index created by a PRIMARY KEY
constraint.
static let uniqueConstraint: IndexInfo.Origin
An index created by a UNIQUE
constraint.
var rawValue: String
static func databaseJSONDecoder() -> JSONDecoder
Returns the JSONDecoder
that decodes the value.
static func databaseJSONEncoder() -> JSONEncoder
Returns the JSONEncoder
that encodes the value.
static func fetchAll(_ db: Database, _ request: some FetchRequest) throws -> [Self]
Returns an array of values fetched from a fetch request.
static func fetchAll(_ statement: Statement, arguments: StatementArguments? = nil, adapter: (any RowAdapter)? = nil) throws -> [Self]
Returns an array of values fetched from a prepared statement.
static func fetchAll(_ db: Database, sql: String, arguments: StatementArguments = StatementArguments(), adapter: (any RowAdapter)? = nil) throws -> [Self]
Returns an array of values fetched from an SQL query.
static func fetchCursor(_ db: Database, _ request: some FetchRequest) throws -> DatabaseValueCursor<Self>
Returns a cursor over values fetched from a fetch request.
static func fetchCursor(_ statement: Statement, arguments: StatementArguments? = nil, adapter: (any RowAdapter)? = nil) throws -> DatabaseValueCursor<Self>
Returns a cursor over values fetched from a prepared statement.
static func fetchCursor(_ db: Database, sql: String, arguments: StatementArguments = StatementArguments(), adapter: (any RowAdapter)? = nil) throws -> DatabaseValueCursor<Self>
Returns a cursor over values fetched from an SQL query.
static func fetchOne(_ db: Database, _ request: some FetchRequest) throws -> Self?
Returns a single value fetched from a fetch request.
static func fetchOne(_ statement: Statement, arguments: StatementArguments? = nil, adapter: (any RowAdapter)? = nil) throws -> Self?
Returns a single value fetched from a prepared statement.
static func fetchOne(_ db: Database, sql: String, arguments: StatementArguments = StatementArguments(), adapter: (any RowAdapter)? = nil) throws -> Self?
Returns a single value fetched from an SQL query.
static func fromMissingColumn() -> Self?
Default implementation fails to decode a value from a missing column.
var sqlExpression: SQLExpression { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
func bind(to sqliteStatement: SQLiteStatement, at index: CInt) -> CInt