Optional (ext)
You’re viewing third-party extensions to Optional
, an enum from the Swift standard library.
You can also read the documentation forOptional
itself.
extension Optional
You’re viewing third-party extensions to Optional
, an enum from the Swift standard library.
You can also read the documentation forOptional
itself.
extension Optional
@frozen enum Optional<Wrapped> where Wrapped : ~Copyable
A type that represents either a wrapped value or the absence of a value.
import GRDB
A toolkit for SQLite databases, with a focus on application development
protocol SQLSelectable
A type that can be used as SQL result columns.
var sqlSelection: SQLSelection { get }
protocol SQLExpressible
A type that can be used as an SQL expression.
var sqlExpression: SQLExpression { get }
protocol SQLOrderingTerm
A type that can be used as an SQL ordering term.
var sqlOrdering: SQLOrdering { get }
protocol StatementBinding
A type that can bind a statement argument.
func bind(to sqliteStatement: SQLiteStatement, at index: CInt) -> CInt
protocol SQLSpecificExpressible : SQLExpressible, SQLOrderingTerm, SQLSelectable
A database-specific type that can be used as an SQL expression.
var asJSON: AnySQLJSONExpressible { get }
Returns an expression that is interpreted as a JSON value.
var asc: SQLOrdering { get }
An ordering term for ascending order (nulls first).
var ascNullsLast: SQLOrdering { get }
An ordering term for ascending order (nulls last).
var capitalized: SQLExpression { get }
An SQL expression that calls the Foundation String.capitalized
property.
var desc: SQLOrdering { get }
An ordering term for descending order (nulls last).
var descNullsFirst: SQLOrdering { get }
An ordering term for descending order (nulls first).
var localizedCapitalized: SQLExpression { get }
An SQL expression that calls the Foundation String.localizedCapitalized
property.
var localizedLowercased: SQLExpression { get }
An SQL expression that calls the Foundation String.localizedLowercase
property.
var localizedUppercased: SQLExpression { get }
An SQL expression that calls the Foundation String.localizedUppercase
property.
var lowercased: SQLExpression { get }
An SQL expression that calls the Swift String.lowercased()
method.
var sqlOrdering: SQLOrdering { get }
var sqlSelection: SQLSelection { get }
var uppercased: SQLExpression { get }
An SQL expression that calls the Swift String.uppercased()
method.
static func ! (value: Self) -> SQLExpression
A negated logical SQL expression.
static func != (lhs: (any SQLExpressible)?, rhs: Self) -> SQLExpression
Compares two SQL expressions.
static func != (lhs: Bool, rhs: Self) -> SQLExpression
The <>
SQL operator.
static func != (lhs: Self, rhs: (any SQLExpressible)?) -> SQLExpression
Compares two SQL expressions.
static func != (lhs: Self, rhs: Bool) -> SQLExpression
The <>
SQL operator.
static func != (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The <>
SQL operator.
static func !== (lhs: (any SQLExpressible)?, rhs: Self) -> SQLExpression
The IS NOT
SQL operator.
static func !== (lhs: Self, rhs: (any SQLExpressible)?) -> SQLExpression
The IS NOT
SQL operator.
static func !== (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The IS NOT
SQL operator.
static func && (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The AND
SQL operator.
static func && (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The AND
SQL operator.
static func && (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The AND
SQL operator.
static func & (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The &
SQL operator.
static func & (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The &
SQL operator.
static func & (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The &
SQL operator.
static func * (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The *
SQL operator.
static func * (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The *
SQL operator.
static func * (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The *
SQL operator.
static func + (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The +
SQL operator.
static func + (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The +
SQL operator.
static func + (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The +
SQL operator.
static func - (value: Self) -> SQLExpression
The -
SQL operator.
static func - (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The -
SQL operator.
static func - (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The -
SQL operator.
static func - (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The -
SQL operator.
static func / (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The /
SQL operator.
static func / (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The /
SQL operator.
static func / (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The /
SQL operator.
static func < (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The <
SQL operator.
static func < (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The <
SQL operator.
static func < (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The <
SQL operator.
static func << (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The <<
SQL operator.
static func << (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The <<
SQL operator.
static func << (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The <<
SQL operator.
static func <= (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The <=
SQL operator.
static func <= (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The <=
SQL operator.
static func <= (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The <=
SQL operator.
static func == (lhs: (any SQLExpressible)?, rhs: Self) -> SQLExpression
Compares two SQL expressions.
static func == (lhs: Bool, rhs: Self) -> SQLExpression
The =
SQL operator.
static func == (lhs: Self, rhs: (any SQLExpressible)?) -> SQLExpression
Compares two SQL expressions.
static func == (lhs: Self, rhs: Bool) -> SQLExpression
The =
SQL operator.
static func == (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The =
SQL operator.
static func === (lhs: (any SQLExpressible)?, rhs: Self) -> SQLExpression
The IS
SQL operator.
static func === (lhs: Self, rhs: (any SQLExpressible)?) -> SQLExpression
The IS
SQL operator.
static func === (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The IS
SQL operator.
static func > (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The >
SQL operator.
static func > (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The >
SQL operator.
static func > (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The >
SQL operator.
static func >= (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The >=
SQL operator.
static func >= (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The >=
SQL operator.
static func >= (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The >=
SQL operator.
static func >> (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The >>
SQL operator.
static func >> (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The >>
SQL operator.
static func >> (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The >>
SQL operator.
static func ?? (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The IFNULL
SQL function.
static func | (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The |
SQL operator.
static func | (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The |
SQL operator.
static func | (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The |
SQL operator.
static func || (lhs: some SQLExpressible, rhs: Self) -> SQLExpression
The OR
SQL operator.
static func || (lhs: Self, rhs: some SQLExpressible) -> SQLExpression
The OR
SQL operator.
static func || (lhs: Self, rhs: some SQLSpecificExpressible) -> SQLExpression
The OR
SQL operator.
static func ~ (value: Self) -> SQLExpression
The ~
SQL operator.
func collating(_ collation: DatabaseCollation) -> SQLExpression
Returns a collated expression.
func collating(_ collation: Database.CollationName) -> SQLExpression
Returns a collated expression.
func forKey(_ key: String) -> SQLSelection
Returns an aliased result column.
func forKey(_ key: some CodingKey) -> SQLSelection
Returns an aliased column with the same name as the coding key.
func like(_ pattern: some SQLExpressible, escape: (any SQLExpressible)? = nil) -> SQLExpression
The LIKE
SQL operator.
protocol DatabaseValueConvertible : SQLExpressible, StatementBinding
A type that can convert itself into and out of a database value.
static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Self?
static func fromMissingColumn() -> Self?
var databaseValue: DatabaseValue { get }
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(_ 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(_ 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 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 -> FastDatabaseValueCursor<Self>
Returns a cursor over values fetched from a fetch request.
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 -> FastDatabaseValueCursor<Self>
Returns a cursor over values fetched from a prepared statement.
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 -> FastDatabaseValueCursor<Self>
Returns a cursor over values fetched from an SQL query.
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(_ 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(_ 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 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 fetchSet(_ db: Database, _ request: some FetchRequest) throws -> Set<Self>
Returns a set of values fetched from a fetch request.
static func fetchSet(_ db: Database, _ request: some FetchRequest) throws -> Set<Self>
Returns a set of values fetched from a fetch request.
static func fetchSet(_ statement: Statement, arguments: StatementArguments? = nil, adapter: (any RowAdapter)? = nil) throws -> Set<Self>
Returns a set of values fetched from a prepared statement.
static func fetchSet(_ statement: Statement, arguments: StatementArguments? = nil, adapter: (any RowAdapter)? = nil) throws -> Set<Self>
Returns a set of values fetched from a prepared statement.
static func fetchSet(_ db: Database, sql: String, arguments: StatementArguments = StatementArguments(), adapter: (any RowAdapter)? = nil) throws -> Set<Self>
Returns a set of values fetched from an SQL query.
static func fetchSet(_ db: Database, sql: String, arguments: StatementArguments = StatementArguments(), adapter: (any RowAdapter)? = nil) throws -> Set<Self>
Returns a set of values fetched from an SQL query.
static func fromDatabaseValue(_ databaseValue: DatabaseValue) -> Self?
static func fromMissingColumn() -> Self?
Default implementation fails to decode a value from a missing column.
var databaseValue: DatabaseValue { get }
var sqlExpression: SQLExpression { get }
func bind(to sqliteStatement: SQLiteStatement, at index: CInt) -> CInt
protocol StatementColumnConvertible
A type that can decode itself from the low-level C interface to SQLite results.
init?(sqliteStatement: SQLiteStatement, index: CInt)
static func fromStatement(_ sqliteStatement: SQLiteStatement, atUncheckedIndex index: CInt) -> Self?
static func fromStatement(_ sqliteStatement: SQLiteStatement, atUncheckedIndex index: CInt) -> Self?
Default implementation fails on decoding NULL.