diff --git a/docs/4.8/Classes.html b/docs/4.8/Classes.html new file mode 100644 index 000000000..4c0caf6d8 --- /dev/null +++ b/docs/4.8/Classes.html @@ -0,0 +1,2372 @@ + + + + Classes Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Classes

+

The following classes are available globally.

+ +
+
+
+
+ + +
+ +

Specialized Cursors

+

+
+
+
    +
  • +
    + + + + AnyCursor + +
    +
    +
    +
    +
    +
    +

    A type-erased cursor of Element.

    + +

    This cursor forwards its next() method to an arbitrary underlying cursor +having the same Element type, hiding the specifics of the underlying +cursor.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class AnyCursor<Element> : Cursor
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Database + +
    +
    +
    +
    +
    +
    +

    A Database connection.

    + +

    You don’t create a database directly. Instead, you use a DatabaseQueue, or +a DatabasePool:

    +
    let dbQueue = DatabaseQueue(...)
    +
    +// The Database is the `db` in the closure:
    +try dbQueue.write { db in
    +    try Player(...).insert(db)
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Database
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseCollation + +
    +
    +
    +
    +
    +
    +

    A Collation is a string comparison function used by SQLite.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DatabaseCollation
    +
    extension DatabaseCollation: Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseFunction + +
    +
    +
    +
    +
    +
    +

    An SQL function or aggregate.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DatabaseFunction : Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabasePool + +
    +
    +
    +
    +
    +
    +

    A DatabasePool grants concurrent accesses to an SQLite database.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DatabasePool : DatabaseWriter
    +
    extension DatabasePool: DatabaseReader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseQueue + +
    +
    +
    +
    +
    +
    +

    A DatabaseQueue serializes access to an SQLite database.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DatabaseQueue : DatabaseWriter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + AnyDatabaseReader + +
    +
    +
    +
    +
    +
    +

    A type-erased DatabaseReader

    + +

    Instances of AnyDatabaseReader forward their methods to an arbitrary +underlying database reader.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class AnyDatabaseReader : DatabaseReader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseSnapshot + +
    +
    +
    +
    +
    +
    +

    A DatabaseSnapshot sees an unchanging database content, as it existed at the +moment it was created.

    + +

    See DatabasePool.makeSnapshot()

    + +

    For more information, read about “snapshot isolation” at https://sqlite.org/isolation.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class DatabaseSnapshot : DatabaseReader
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseValueConvertible

+

+
+
+
    +
  • +
    + + + + DatabaseValueCursor + +
    +
    +
    +
    +
    +
    +

    A cursor of database values extracted from a single column. +For example:

    +
    try dbQueue.read { db in
    +    let urls: DatabaseValueCursor<URL> = try URL.fetchCursor(db, sql: "SELECT url FROM link")
    +    while let url = urls.next() { // URL
    +        print(url)
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DatabaseValueCursor<Value> : Cursor where Value : DatabaseValueConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A cursor of optional database values extracted from a single column. +For example:

    +
    try dbQueue.read { db in
    +    let urls: NullableDatabaseValueCursor<URL> = try Optional<URL>.fetchCursor(db, sql: "SELECT url FROM link")
    +    while let url = urls.next() { // URL?
    +        print(url)
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class NullableDatabaseValueCursor<Value> : Cursor where Value : DatabaseValueConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseFuture + +
    +
    +
    +
    +
    +
    +

    A future database value, returned by the DatabaseWriter.concurrentRead(_:) +method.

    +
    let futureCount: Future<Int> = try writer.writeWithoutTransaction { db in
    +    try Player(...).insert()
    +
    +    // Count players concurrently
    +    return writer.concurrentRead { db in
    +        return try Player.fetchCount()
    +    }
    +}
    +
    +let count: Int = try futureCount.wait()
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class DatabaseFuture<Value>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + AnyDatabaseWriter + +
    +
    +
    +
    +
    +
    +

    A type-erased DatabaseWriter

    + +

    Instances of AnyDatabaseWriter forward their methods to an arbitrary +underlying database writer.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class AnyDatabaseWriter : DatabaseWriter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Row + +
    +
    +
    +
    +
    +
    +

    A database row.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Row: Equatable, Hashable, RandomAccessCollection,
    +    ExpressibleByDictionaryLiteral, CustomStringConvertible,
    +    CustomDebugStringConvertible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

RowCursor

+

+
+
+
    +
  • +
    + + + + RowCursor + +
    +
    +
    +
    +
    +
    +

    A cursor of database rows. For example:

    +
    try dbQueue.read { db in
    +    let rows: RowCursor = try Row.fetchCursor(db, sql: "SELECT * FROM player")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class RowCursor : Cursor
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SelectStatement

+

+
+
+
    +
  • +
    + + + + SelectStatement + +
    +
    +
    +
    +
    +
    +

    A subclass of Statement that fetches database rows.

    + +

    You create SelectStatement with the Database.makeSelectStatement() method:

    +
    try dbQueue.read { db in
    +    let statement = try db.makeSelectStatement(sql: "SELECT COUNT(*) FROM player WHERE score > ?")
    +    let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
    +    let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SelectStatement : Statement
    +
    extension SelectStatement: RowLayout
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Statement + +
    +
    +
    +
    +
    +
    +

    A statement represents an SQL query.

    + +

    It is the base class of UpdateStatement that executes update statements, +and SelectStatement that fetches rows.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class Statement
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

UpdateStatement

+

+
+
+
    +
  • +
    + + + + UpdateStatement + +
    +
    +
    +
    +
    +
    +

    A subclass of Statement that executes SQL queries.

    + +

    You create UpdateStatement with the Database.makeUpdateStatement() method:

    +
    try dbQueue.inTransaction { db in
    +    let statement = try db.makeUpdateStatement(sql: "INSERT INTO player (name) VALUES (?)")
    +    try statement.execute(arguments: ["Arthur"])
    +    try statement.execute(arguments: ["Barbara"])
    +    return .commit
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UpdateStatement : Statement
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A cursor of database values extracted from a single column. +For example:

    +
    try dbQueue.read { db in
    +    let names: ColumnCursor<String> = try String.fetchCursor(db, sql: "SELECT name FROM player")
    +    while let name = names.next() { // String
    +        print(name)
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FastDatabaseValueCursor<Value> : Cursor where Value : DatabaseValueConvertible, Value : StatementColumnConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A cursor of optional database values extracted from a single column. +For example:

    +
    try dbQueue.read { db in
    +    let emails: FastNullableDatabaseValueCursor<String> =
    +        try Optional<String>.fetchCursor(db, sql: "SELECT email FROM player")
    +    while let email = emails.next() { // String?
    +        print(email ?? "<NULL>")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FastNullableDatabaseValueCursor<Value>: Cursor
    +    where Value: DatabaseValueConvertible & StatementColumnConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS3TableDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS3TableDefinition class lets you define columns of a FTS3 virtual table.

    + +

    You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "document", using: FTS3()) { t in // t is FTS3TableDefinition
    +    t.column("content")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FTS3TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS4TableDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS4TableDefinition class lets you define columns of a FTS4 virtual table.

    + +

    You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "document", using: FTS4()) { t in // t is FTS4TableDefinition
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FTS4TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS4ColumnDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS4ColumnDefinition class lets you refine a column of an FTS4 +virtual table.

    + +

    You get instances of this class when you create an FTS4 table:

    +
    try db.create(virtualTable: "document", using: FTS4()) { t in
    +    t.column("content")      // FTS4ColumnDefinition
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FTS4ColumnDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5TableDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS5TableDefinition class lets you define columns of a FTS5 virtual table.

    + +

    You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "document", using: FTS5()) { t in // t is FTS5TableDefinition
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS5ColumnDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS5ColumnDefinition class lets you refine a column of an FTS5 +virtual table.

    + +

    You get instances of this class when you create an FTS5 table:

    +
    try db.create(virtualTable: "document", using: FTS5()) { t in
    +    t.column("content")      // FTS5ColumnDefinition
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

TableAlias

+

+
+
+
    +
  • +
    + + + + TableAlias + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    A TableAlias identifies a table in a request.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class TableAlias : Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TableDefinition + +
    +
    +
    +
    +
    +
    +

    The TableDefinition class lets you define table columns and constraints.

    + +

    You don’t create instances of this class. Instead, you use the Database +create(table:) method:

    +
    try db.create(table: "player") { t in // t is TableDefinition
    +    t.column(...)
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TableAlteration + +
    +
    +
    +
    +
    +
    +

    The TableAlteration class lets you alter database tables.

    + +

    You don’t create instances of this class. Instead, you use the Database +alter(table:) method:

    +
    try db.alter(table: "player") { t in // t is TableAlteration
    +    t.add(column: ...)
    +}
    +
    + +

    See https://www.sqlite.org/lang_altertable.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class TableAlteration
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ColumnDefinition + +
    +
    +
    +
    +
    +
    +

    The ColumnDefinition class lets you refine a table column.

    + +

    You get instances of this class when you create or alter a database table:

    +
    try db.create(table: "player") { t in
    +    t.column(...)      // ColumnDefinition
    +}
    +
    +try db.alter(table: "player") { t in
    +    t.add(column: ...) // ColumnDefinition
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html and +https://www.sqlite.org/lang_altertable.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class ColumnDefinition
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

RecordCursor

+

+
+
+ +
+
+
+ + +
+ +

Record

+

+
+
+
    +
  • +
    + + + + Record + +
    +
    +
    +
    +
    +
    +

    Record is a class that wraps a table row, or the result of any query. It is +designed to be subclassed.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class Record : FetchableRecord, TableRecord, PersistableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5TableDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS5TableDefinition class lets you define columns of a FTS5 virtual table.

    + +

    You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "document", using: FTS5()) { t in // t is FTS5TableDefinition
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FTS5TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5ColumnDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS5ColumnDefinition class lets you refine a column of an FTS5 +virtual table.

    + +

    You get instances of this class when you create an FTS5 table:

    +
    try db.create(virtualTable: "document", using: FTS5()) { t in
    +    t.column("content")      // FTS5ColumnDefinition
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FTS5ColumnDefinition
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/AnyCursor.html b/docs/4.8/Classes/AnyCursor.html new file mode 100644 index 000000000..643c1ba58 --- /dev/null +++ b/docs/4.8/Classes/AnyCursor.html @@ -0,0 +1,1205 @@ + + + + AnyCursor Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyCursor

+
+
+
public final class AnyCursor<Element> : Cursor
+ +
+
+

A type-erased cursor of Element.

+ +

This cursor forwards its next() method to an arbitrary underlying cursor +having the same Element type, hiding the specifics of the underlying +cursor.

+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a cursor that wraps a base cursor but whose type depends only on +the base cursor’s element type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<C>(_ base: C) where Element == C.Element, C : Cursor
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(iterator:) + +
    +
    +
    +
    +
    +
    +

    Creates a cursor that wraps a base iterator but whose type depends only +on the base iterator’s element type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init<I>(iterator: I) where Element == I.Element, I : IteratorProtocol
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a cursor that wraps a base sequence but whose type depends only +on the base sequence’s element type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init<S>(_ s: S) where Element == S.Element, S : Sequence
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a cursor that wraps the given closure in its next() method

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ body: @escaping () throws -> Element?)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/AnyDatabaseReader.html b/docs/4.8/Classes/AnyDatabaseReader.html new file mode 100644 index 000000000..8f2c9f971 --- /dev/null +++ b/docs/4.8/Classes/AnyDatabaseReader.html @@ -0,0 +1,1111 @@ + + + + AnyDatabaseReader Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyDatabaseReader

+
+
+
public final class AnyDatabaseReader : DatabaseReader
+ +
+
+

A type-erased DatabaseReader

+ +

Instances of AnyDatabaseReader forward their methods to an arbitrary +underlying database reader.

+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a database reader that wraps a base database reader.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ base: DatabaseReader)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/AnyDatabaseWriter.html b/docs/4.8/Classes/AnyDatabaseWriter.html new file mode 100644 index 000000000..1e3504189 --- /dev/null +++ b/docs/4.8/Classes/AnyDatabaseWriter.html @@ -0,0 +1,1111 @@ + + + + AnyDatabaseWriter Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyDatabaseWriter

+
+
+
public final class AnyDatabaseWriter : DatabaseWriter
+ +
+
+

A type-erased DatabaseWriter

+ +

Instances of AnyDatabaseWriter forward their methods to an arbitrary +underlying database writer.

+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a database writer that wraps a base database writer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ base: DatabaseWriter)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/ColumnDefinition.html b/docs/4.8/Classes/ColumnDefinition.html new file mode 100644 index 000000000..5fe59acd4 --- /dev/null +++ b/docs/4.8/Classes/ColumnDefinition.html @@ -0,0 +1,1736 @@ + + + + ColumnDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ColumnDefinition

+
+
+
public final class ColumnDefinition
+ +
+
+

The ColumnDefinition class lets you refine a table column.

+ +

You get instances of this class when you create or alter a database table:

+
try db.create(table: "player") { t in
+    t.column(...)      // ColumnDefinition
+}
+
+try db.alter(table: "player") { t in
+    t.add(column: ...) // ColumnDefinition
+}
+
+ +

See https://www.sqlite.org/lang_createtable.html and +https://www.sqlite.org/lang_altertable.html

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Adds a primary key constraint on the column.

    +
    try db.create(table: "player") { t in
    +    t.column("id", .integer).primaryKey()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#primkeyconst and +https://www.sqlite.org/lang_createtable.html#rowid

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func primaryKey(
    +    onConflict conflictResolution: Database.ConflictResolution? = nil,
    +    autoincrement: Bool = false)
    +    -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    + + autoincrement + + +
    +

    If true, the primary key is autoincremented.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + notNull(onConflict:) + +
    +
    +
    +
    +
    +
    +

    Adds a NOT NULL constraint on the column.

    +
    try db.create(table: "player") { t in
    +    t.column("name", .text).notNull()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#notnullconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func notNull(onConflict conflictResolution: Database.ConflictResolution? = nil) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + unique(onConflict:) + +
    +
    +
    +
    +
    +
    +

    Adds a UNIQUE constraint on the column.

    +
    try db.create(table: "player") { t in
    +    t.column("email", .text).unique()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#uniqueconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func unique(onConflict conflictResolution: Database.ConflictResolution? = nil) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + indexed() + +
    +
    +
    +
    +
    +
    +

    Adds an index of the column.

    +
    try db.create(table: "player") { t in
    +    t.column("email", .text).indexed()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#uniqueconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func indexed() -> Self
    + +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + check(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a CHECK constraint on the column.

    +
    try db.create(table: "player") { t in
    +    t.column("name", .text).check { length($0) > 0 }
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#ckconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func check(_ condition: (Column) -> SQLExpressible) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + condition + + +
    +

    A closure whose argument is an Column that +represents the defined column, and returns the expression to check.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + check(sql:) + +
    +
    +
    +
    +
    +
    +

    Adds a CHECK constraint on the column.

    +
    try db.create(table: "player") { t in
    +    t.column("name", .text).check(sql: "LENGTH(name) > 0")
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#ckconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func check(sql: String) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL snippet.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + defaults(to:) + +
    +
    +
    +
    +
    +
    +

    Defines the default column value.

    +
    try db.create(table: "player") { t in
    +    t.column("name", .text).defaults(to: "Anonymous")
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#dfltval

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func defaults(to value: DatabaseValueConvertible) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    A DatabaseValueConvertible value.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + defaults(sql:) + +
    +
    +
    +
    +
    +
    +

    Defines the default column value.

    +
    try db.create(table: "player") { t in
    +    t.column("creationDate", .DateTime).defaults(sql: "CURRENT_TIMESTAMP")
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#dfltval

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func defaults(sql: String) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL snippet.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + collate(_:) + +
    +
    +
    +
    +
    +
    +
    try db.create(table: "player") { t in
    +    t.column("email", .text).collate(.nocase)
    +}
    +
    + +

    See https://www.sqlite.org/datatype3.html#collation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func collate(_ collation: Database.CollationName) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + collation + + +
    +

    An Database.CollationName.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + collate(_:) + +
    +
    +
    +
    +
    +
    +
    try db.create(table: "player") { t in
    +    t.column("name", .text).collate(.localizedCaseInsensitiveCompare)
    +}
    +
    + +

    See https://www.sqlite.org/datatype3.html#collation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func collate(_ collation: DatabaseCollation) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + collation + + +
    +

    A custom DatabaseCollation.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Defines a foreign key.

    +
    try db.create(table: "book") { t in
    +    t.column("authorId", .integer).references("author", onDelete: .cascade)
    +}
    +
    + +

    See https://www.sqlite.org/foreignkeys.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func references(
    +    _ table: String,
    +    column: String? = nil,
    +    onDelete deleteAction: Database.ForeignKeyAction? = nil,
    +    onUpdate updateAction: Database.ForeignKeyAction? = nil,
    +    deferred: Bool = false) -> Self
    + +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Database.html b/docs/4.8/Classes/Database.html new file mode 100644 index 000000000..6fc9c37df --- /dev/null +++ b/docs/4.8/Classes/Database.html @@ -0,0 +1,4754 @@ + + + + Database Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Database

+
+
+
public final class Database
+ +
+
+

A Database connection.

+ +

You don’t create a database directly. Instead, you use a DatabaseQueue, or +a DatabasePool:

+
let dbQueue = DatabaseQueue(...)
+
+// The Database is the `db` in the closure:
+try dbQueue.write { db in
+    try Player(...).insert(db)
+}
+
+ +
+
+
+
+ + +
+ +

SQLite C API

+

+
+
+ +
+
+
+ + +
+ +

Configuration

+

+
+
+
    +
  • +
    + + + + logError + +
    +
    +
    +
    +
    +
    +

    The error logging function.

    + +

    Quoting https://www.sqlite.org/errlog.html:

    + +
    +

    SQLite can be configured to invoke a callback function containing an +error code and a terse error message whenever anomalies occur. This +mechanism is very helpful in tracking obscure problems that occur +rarely and in the field. Application developers are encouraged to take +advantage of the error logging facility of SQLite in their products, +as it is very low CPU and memory cost but can be a huge aid +for debugging.

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var logError: Database.LogErrorFunction? { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The database configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configuration: Configuration
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Information

+

+
+
+
    +
  • +
    + + + + lastInsertedRowID + +
    +
    +
    +
    +
    +
    +

    The rowID of the most recently inserted row.

    + +

    If no row has ever been inserted using this database connection, +returns zero.

    + +

    For more detailed information, see https://www.sqlite.org/c3ref/last_insert_rowid.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lastInsertedRowID: Int64 { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + changesCount + +
    +
    +
    +
    +
    +
    +

    The number of rows modified, inserted or deleted by the most recent +successful INSERT, UPDATE or DELETE statement.

    + +

    For more detailed information, see https://www.sqlite.org/c3ref/changes.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var changesCount: Int { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + totalChangesCount + +
    +
    +
    +
    +
    +
    +

    The total number of rows modified, inserted or deleted by all successful +INSERT, UPDATE or DELETE statements since the database connection was +opened.

    + +

    For more detailed information, see https://www.sqlite.org/c3ref/total_changes.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var totalChangesCount: Int { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isInsideTransaction + +
    +
    +
    +
    +
    +
    +

    True if the database connection is currently in a transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isInsideTransaction: Bool { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Internal properties

+

+
+
+
    +
  • +
    + + + + lastErrorCode + +
    +
    +
    +
    +
    +
    +

    The last error code

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lastErrorCode: ResultCode { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lastErrorMessage + +
    +
    +
    +
    +
    +
    +

    The last error message

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lastErrorMessage: String? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Functions

+

+
+
+
    +
  • +
    + + + + add(function:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine an SQL function.

    +
    let fn = DatabaseFunction("succ", argumentCount: 1) { dbValues in
    +    guard let int = Int.fromDatabaseValue(dbValues[0]) else {
    +        return nil
    +    }
    +    return int + 1
    +}
    +db.add(function: fn)
    +try Int.fetchOne(db, sql: "SELECT succ(1)")! // 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(function:) + +
    +
    +
    +
    +
    +
    +

    Remove an SQL function.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Collations

+

+
+
+
    +
  • +
    + + + + add(collation:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine a collation.

    +
    let collation = DatabaseCollation("localized_standard") { (string1, string2) in
    +    return (string1 as NSString).localizedStandardCompare(string2)
    +}
    +db.add(collation: collation)
    +try db.execute(sql: "CREATE TABLE files (name TEXT COLLATE localized_standard")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(collation:) + +
    +
    +
    +
    +
    +
    +

    Remove a collation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Suspension

+

+
+
+ +
+
+
+ + +
+ +

Transactions & Savepoint

+

+
+
+
    +
  • +
    + + + + inTransaction(_:_:) + +
    +
    +
    +
    +
    +
    +

    Executes a block inside a database transaction.

    +
    try dbQueue.inDatabase do {
    +    try db.inTransaction {
    +        try db.execute(sql: "INSERT ...")
    +        return .commit
    +    }
    +}
    +
    + +

    If the block throws an error, the transaction is rollbacked and the +error is rethrown.

    + +

    This method is not reentrant: you can’t nest transactions.

    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func inTransaction(_ kind: TransactionKind? = nil, _ block: () throws -> TransactionCompletion) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + kind + + +
    +

    The transaction type (default nil). If nil, the transaction +type is configuration.defaultTransactionKind, which itself +defaults to .deferred. See https://www.sqlite.org/lang_transaction.html +for more information.

    +
    +
    + + block + + +
    +

    A block that executes SQL statements and return either +.commit or .rollback.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + inSavepoint(_:) + +
    +
    +
    +
    +
    +
    +

    Executes a block inside a savepoint.

    +
    try dbQueue.inDatabase do {
    +    try db.inSavepoint {
    +        try db.execute(sql: "INSERT ...")
    +        return .commit
    +    }
    +}
    +
    + +

    If the block throws an error, the savepoint is rollbacked and the +error is rethrown.

    + +

    This method is reentrant: you can nest savepoints.

    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func inSavepoint(_ block: () throws -> TransactionCompletion) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that executes SQL statements and return +either .commit or .rollback.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + beginTransaction(_:) + +
    +
    +
    +
    +
    +
    +

    Begins a database transaction.

    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func beginTransaction(_ kind: TransactionKind? = nil) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + kind + + +
    +

    The transaction type (default nil). If nil, the +transaction type is configuration.defaultTransactionKind, which itself +defaults to .deferred. See https://www.sqlite.org/lang_transaction.html +for more information.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + rollback() + +
    +
    +
    +
    +
    +
    +

    Rollbacks a database transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rollback() throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + commit() + +
    +
    +
    +
    +
    +
    +

    Commits a database transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func commit() throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Schema

+

+
+
+
    +
  • +
    + + + + clearSchemaCache() + +
    +
    +
    +
    +
    +
    +

    Clears the database schema cache.

    + +

    You may need to clear the cache manually if the database schema is +modified by another connection.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func clearSchemaCache()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + tableExists(_:) + +
    +
    +
    +
    +
    +
    +

    Returns whether a table exists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func tableExists(_ name: String) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns whether a table is an internal SQLite table.

    + +

    Those are tables whose name begins with “sqlite_”.

    + +

    For more information, see https://www.sqlite.org/fileformat2.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isSQLiteInternalTable(_ tableName: String) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns whether a table is an internal GRDB table.

    + +

    Those are tables whose name begins with “grdb_”.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isGRDBInternalTable(_ tableName: String) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + viewExists(_:) + +
    +
    +
    +
    +
    +
    +

    Returns whether a view exists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func viewExists(_ name: String) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + triggerExists(_:) + +
    +
    +
    +
    +
    +
    +

    Returns whether a trigger exists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func triggerExists(_ name: String) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + primaryKey(_:) + +
    +
    +
    +
    +
    +
    +

    The primary key for table named tableName.

    + +

    All tables have a primary key, even when it is not explicit. When a +table has no explicit primary key, the result is the hidden +“rowid” column.

    +
    +

    Throws

    + A DatabaseError if table does not exist. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primaryKey(_ tableName: String) throws -> PrimaryKeyInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + indexes(on:) + +
    +
    +
    +
    +
    +
    +

    The indexes on table named tableName; returns the empty array if the +table does not exist.

    + +

    Note: SQLite does not define any index for INTEGER PRIMARY KEY columns: +this method does not return any index that represents this primary key.

    + +

    If you want to know if a set of columns uniquely identify a row, prefer +table(_:hasUniqueKey:) instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func indexes(on tableName: String) throws -> [IndexInfo]
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    True if a sequence of columns uniquely identifies a row, that is to say +if the columns are the primary key, or if there is a unique index on them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func table<T: Sequence>(
    +    _ tableName: String,
    +    hasUniqueKey columns: T)
    +    throws -> Bool
    +    where T.Iterator.Element == String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + foreignKeys(on:) + +
    +
    +
    +
    +
    +
    +

    The foreign keys defined on table named tableName.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func foreignKeys(on tableName: String) throws -> [ForeignKeyInfo]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + columns(in:) + +
    +
    +
    +
    +
    +
    +

    The columns in the table named tableName

    +
    +

    Throws

    + A DatabaseError if table does not exist. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func columns(in tableName: String) throws -> [ColumnInfo]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Statements

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a new prepared statement that can be reused.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT COUNT(*) FROM player WHERE score > ?")
    +let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
    +let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
    +
    +
    +

    Throws

    + A DatabaseError whenever SQLite could not parse the sql query. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeSelectStatement(sql: String) throws -> SelectStatement
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    +
    +
    +

    Return Value

    +

    A SelectStatement.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a prepared statement that can be reused.

    +
    let statement = try db.cachedSelectStatement(sql: "SELECT COUNT(*) FROM player WHERE score > ?")
    +let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
    +let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
    +
    + +

    The returned statement may have already been used: it may or may not +contain values for its eventual arguments.

    +
    +

    Throws

    + A DatabaseError whenever SQLite could not parse the sql query. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cachedSelectStatement(sql: String) throws -> SelectStatement
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    +
    +
    +

    Return Value

    +

    An UpdateStatement.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a new prepared statement that can be reused.

    +
    let statement = try db.makeUpdateStatement(sql: "INSERT INTO player (name) VALUES (?)")
    +try statement.execute(arguments: ["Arthur"])
    +try statement.execute(arguments: ["Barbara"])
    +
    +
    +

    Throws

    + A DatabaseError whenever SQLite could not parse the sql query. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeUpdateStatement(sql: String) throws -> UpdateStatement
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    +
    +
    +

    Return Value

    +

    An UpdateStatement.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a prepared statement that can be reused.

    +
    let statement = try db.cachedUpdateStatement(sql: "INSERT INTO player (name) VALUES (?)")
    +try statement.execute(arguments: ["Arthur"])
    +try statement.execute(arguments: ["Barbara"])
    +
    + +

    The returned statement may have already been used: it may or may not +contain values for its eventual arguments.

    +
    +

    Throws

    + A DatabaseError whenever SQLite could not parse the sql query. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cachedUpdateStatement(sql: String) throws -> UpdateStatement
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    +
    +
    +

    Return Value

    +

    An UpdateStatement.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Executes one or several SQL statements, separated by semi-colons.

    +
    try db.execute(
    +    sql: "INSERT INTO player (name) VALUES (:name)",
    +    arguments: ["name": "Arthur"])
    +
    +try db.execute(sql: """
    +    INSERT INTO player (name) VALUES (?);
    +    INSERT INTO player (name) VALUES (?);
    +    INSERT INTO player (name) VALUES (?);
    +    """, arguments: ["Arthur", "Barbara", "O'Brien"])
    +
    + +

    This method may throw a DatabaseError.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func execute(sql: String, arguments: StatementArguments = StatementArguments()) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + execute(literal:) + +
    +
    +
    +
    +
    +
    +

    Executes one or several SQL statements, separated by semi-colons.

    +
    try db.execute(literal: SQLLiteral(
    +    sql: "INSERT INTO player (name) VALUES (:name)",
    +    arguments: ["name": "Arthur"]))
    +
    +try db.execute(literal: SQLLiteral(sql: """
    +    INSERT INTO player (name) VALUES (?);
    +    INSERT INTO player (name) VALUES (?);
    +    INSERT INTO player (name) VALUES (?);
    +    """, arguments: ["Arthur", "Barbara", "O'Brien"]))
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    try db.execute(literal: """
    +    INSERT INTO player (name) VALUES (\("Arthur"));
    +    INSERT INTO player (name) VALUES (\("Barbara"));
    +    INSERT INTO player (name) VALUES (\("O'Brien"));
    +    """)
    +
    + +

    This method may throw a DatabaseError.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func execute(literal sqlLiteral: SQLLiteral) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sqlLiteral + + +
    +

    An SQLLiteral.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + BusyCallback + +
    +
    +
    +
    +
    + +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias BusyCallback = (_ numberOfTries: Int) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + BusyMode + +
    +
    +
    +
    +
    +
    +

    When there are several connections to a database, a connection may try +to access the database while it is locked by another connection.

    + +

    The BusyMode enum describes the behavior of GRDB when such a situation +occurs:

    + +
      +
    • .immediateError: The SQLITE_BUSY error is immediately returned to the +connection that tries to access the locked database.

    • +
    • .timeout: The SQLITE_BUSY error will be returned only if the database +remains locked for more than the specified duration.

    • +
    • .callback: Perform your custom lock handling.

    • +
    + +

    To set the busy mode of a database, use Configuration:

    +
    // Wait 1 second before failing with SQLITE_BUSY
    +let configuration = Configuration(busyMode: .timeout(1))
    +let dbQueue = DatabaseQueue(path: "...", configuration: configuration)
    +
    + +

    Relevant SQLite documentation:

    + + + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum BusyMode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CheckpointMode + +
    +
    +
    +
    +
    +
    +

    The available checkpoint modes.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CheckpointMode : Int32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CollationName + +
    +
    +
    +
    +
    +
    +

    A built-in SQLite collation.

    + +

    See https://www.sqlite.org/datatype3.html#collation

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct CollationName : RawRepresentable, Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ColumnType + +
    +
    +
    +
    +
    +
    +

    An SQL column type.

    +
    try db.create(table: "player") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("title", .text)
    +}
    +
    + +

    See https://www.sqlite.org/datatype3.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ColumnType : RawRepresentable, Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ConflictResolution + +
    +
    +
    +
    +
    +
    +

    An SQLite conflict resolution.

    + +

    See https://www.sqlite.org/lang_conflict.html.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ConflictResolution : String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ForeignKeyAction + +
    +
    +
    +
    +
    +
    +

    A foreign key action.

    + +

    See https://www.sqlite.org/foreignkeys.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ForeignKeyAction : String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + LogErrorFunction + +
    +
    +
    +
    +
    +
    +

    log function that takes an error message.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias LogErrorFunction = (_ resultCode: ResultCode, _ message: String) -> Void
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TransactionCompletion + +
    +
    +
    +
    +
    +
    +

    The end of a transaction: Commit, or Rollback

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TransactionCompletion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TransactionKind + +
    +
    +
    +
    +
    +
    +

    An SQLite transaction kind. See https://www.sqlite.org/lang_transaction.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TransactionKind : String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Observation

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Add a transaction observer, so that it gets notified of +database changes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(
    +    transactionObserver: TransactionObserver,
    +    extent: TransactionObservationExtent = .observerLifetime)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + transactionObserver + + +
    +

    A transaction observer.

    +
    +
    + + extent + + +
    +

    The duration of the observation. The default is +the observer lifetime (observation lasts until observer +is deallocated).

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Remove a transaction observer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(transactionObserver: TransactionObserver)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers a closure to be executed after the next or current +transaction completion.

    +
    try dbQueue.write { db in
    +    db.afterNextTransactionCommit { _ in
    +        print("success")
    +    }
    +    ...
    +} // prints "success"
    +
    + +

    If the transaction is rollbacked, the closure is not executed.

    + +

    If the transaction is committed, the closure is executed in a protected +dispatch queue, serialized will all database updates.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func afterNextTransactionCommit(_ closure: @escaping (Database) -> Void)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The extent of a transaction observation

    + +

    See Database.add(transactionObserver:extent:)

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TransactionObservationExtent
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Deletes the synchronization triggers for a synchronized FTS4 table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropFTS4SynchronizationTriggers(forTable tableName: String) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Schema

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a database table.

    +
    try db.create(table: "place") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("title", .text)
    +    t.column("favorite", .boolean).notNull().default(false)
    +    t.column("longitude", .double).notNull()
    +    t.column("latitude", .double).notNull()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html and +https://www.sqlite.org/withoutrowid.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a database table.

    +
    try db.create(table: "place") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("title", .text)
    +    t.column("favorite", .boolean).notNull().default(false)
    +    t.column("longitude", .double).notNull()
    +    t.column("latitude", .double).notNull()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html and +https://www.sqlite.org/withoutrowid.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public func create(
    +    table name: String,
    +    temporary: Bool = false,
    +    ifNotExists: Bool = false,
    +    withoutRowID: Bool,
    +    body: (TableDefinition) -> Void)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The table name.

    +
    +
    + + temporary + + +
    +

    If true, creates a temporary table.

    +
    +
    + + ifNotExists + + +
    +

    If false (the default), an error is thrown if the +table already exists. Otherwise, the table is created unless it +already exists.

    +
    +
    + + withoutRowID + + +
    +

    If true, uses WITHOUT ROWID optimization.

    +
    +
    + + body + + +
    +

    A closure that defines table columns and constraints.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a database table.

    +
    try db.create(table: "place") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("title", .text)
    +    t.column("favorite", .boolean).notNull().default(false)
    +    t.column("longitude", .double).notNull()
    +    t.column("latitude", .double).notNull()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create(
    +    table name: String,
    +    temporary: Bool = false,
    +    ifNotExists: Bool = false,
    +    body: (TableDefinition) -> Void)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The table name.

    +
    +
    + + temporary + + +
    +

    If true, creates a temporary table.

    +
    +
    + + ifNotExists + + +
    +

    If false (the default), an error is thrown if the +table already exists. Otherwise, the table is created unless it +already exists.

    +
    +
    + + body + + +
    +

    A closure that defines table columns and constraints.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + rename(table:to:) + +
    +
    +
    +
    +
    +
    +

    Renames a database table.

    + +

    See https://www.sqlite.org/lang_altertable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rename(table name: String, to newName: String) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + alter(table:body:) + +
    +
    +
    +
    +
    +
    +

    Modifies a database table.

    +
    try db.alter(table: "player") { t in
    +    t.add(column: "url", .text)
    +}
    +
    + +

    See https://www.sqlite.org/lang_altertable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func alter(table name: String, body: (TableAlteration) -> Void) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    The table name.

    +
    +
    + + body + + +
    +

    A closure that defines table alterations.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + drop(table:) + +
    +
    +
    +
    +
    +
    +

    Deletes a database table.

    + +

    See https://www.sqlite.org/lang_droptable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func drop(table name: String) throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an index.

    +
    try db.create(index: "playerByEmail", on: "player", columns: ["email"])
    +
    + +

    SQLite can also index expressions (https://www.sqlite.org/expridx.html) +and use specific collations. To create such an index, use a raw SQL +query.

    +
    try db.execute(sql: "CREATE INDEX ...")
    +
    + +

    See https://www.sqlite.org/lang_createindex.html

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an index.

    +
    try db.create(index: "playerByEmail", on: "player", columns: ["email"])
    +
    + +

    SQLite can also index expressions (https://www.sqlite.org/expridx.html) +and use specific collations. To create such an index, use a raw SQL +query.

    +
    try db.execute(sql: "CREATE INDEX ...")
    +
    + +

    See https://www.sqlite.org/lang_createindex.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create(
    +    index name: String,
    +    on table: String,
    +    columns: [String],
    +    unique: Bool = false,
    +    ifNotExists: Bool = false)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The index name.

    +
    +
    + + table + + +
    +

    The name of the indexed table.

    +
    +
    + + columns + + +
    +

    The indexed columns.

    +
    +
    + + unique + + +
    +

    If true, creates a unique index.

    +
    +
    + + ifNotExists + + +
    +

    If false, no error is thrown if index already exists.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a partial index.

    +
    try db.create(index: "playerByEmail", on: "player", columns: ["email"], condition: Column("email") != nil)
    +
    + +

    See https://www.sqlite.org/lang_createindex.html, and +https://www.sqlite.org/partialindex.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public func create(
    +    index name: String,
    +    on table: String,
    +    columns: [String],
    +    unique: Bool = false,
    +    ifNotExists: Bool = false,
    +    condition: SQLExpressible)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The index name.

    +
    +
    + + table + + +
    +

    The name of the indexed table.

    +
    +
    + + columns + + +
    +

    The indexed columns.

    +
    +
    + + unique + + +
    +

    If true, creates a unique index.

    +
    +
    + + ifNotExists + + +
    +

    If false, no error is thrown if index already exists.

    +
    +
    + + condition + + +
    +

    The condition that indexed rows must verify.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + drop(index:) + +
    +
    +
    +
    +
    +
    +

    Deletes a database index.

    + +

    See https://www.sqlite.org/lang_dropindex.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func drop(index name: String) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reindex(collation:) + +
    +
    +
    +
    +
    +
    +

    Delete and recreate from scratch all indices that use this collation.

    + +

    This method is useful when the definition of a collation sequence +has changed.

    + +

    See https://www.sqlite.org/lang_reindex.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reindex(collation: Database.CollationName) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reindex(collation:) + +
    +
    +
    +
    +
    +
    +

    Delete and recreate from scratch all indices that use this collation.

    + +

    This method is useful when the definition of a collation sequence +has changed.

    + +

    See https://www.sqlite.org/lang_reindex.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reindex(collation: DatabaseCollation) throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a virtual database table.

    +
    try db.create(virtualTable: "vocabulary", using: "spellfix1")
    +
    + +

    See https://www.sqlite.org/lang_createtable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create(virtualTable name: String, ifNotExists: Bool = false, using module: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The table name.

    +
    +
    + + ifNotExists + + +
    +

    If false (the default), an error is thrown if the +table already exists. Otherwise, the table is created unless it +already exists.

    +
    +
    + + module + + +
    +

    The name of an SQLite virtual table module.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a virtual database table.

    +
    let module = ...
    +try db.create(virtualTable: "book", using: module) { t in
    +    ...
    +}
    +
    + +

    The type of the closure argument t depends on the type of the module +argument: refer to this module’s documentation.

    + +

    Use this method to create full-text tables using the FTS3, FTS4, or +FTS5 modules:

    +
    try db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.column("title")
    +    t.column("author")
    +    t.column("body")
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create<Module: VirtualTableModule>(
    +    virtualTable tableName: String,
    +    ifNotExists: Bool = false,
    +    using module: Module,
    +    _ body: ((Module.TableDefinition) -> Void)? = nil)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The table name.

    +
    +
    + + ifNotExists + + +
    +

    If false (the default), an error is thrown if the +table already exists. Otherwise, the table is created unless it +already exists.

    +
    +
    + + module + + +
    +

    a VirtualTableModule

    +
    +
    + + body + + +
    +

    An optional closure that defines the virtual table.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Encryption

+

+
+
+
    +
  • +
    + + + + usePassphrase(_:) + +
    +
    +
    +
    +
    +
    +

    Sets the passphrase used to crypt and decrypt an SQLCipher database.

    + +

    Call this method from Configuration.prepareDatabase, as in the example below:

    +
    var config = Configuration()
    +config.prepareDatabase = { db in
    +    try db.usePassphrase("secret")
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func usePassphrase(_ passphrase: String) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + changePassphrase(_:) + +
    +
    +
    +
    +
    +
    +

    Changes the passphrase used by an SQLCipher encrypted database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func changePassphrase(_ passphrase: String) throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Deletes the synchronization triggers for a synchronized FTS5 table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropFTS5SynchronizationTriggers(forTable tableName: String) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

FTS5

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +db.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add<Tokenizer>(tokenizer: Tokenizer.Type) where Tokenizer : FTS5CustomTokenizer
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern from a raw pattern string; throws DatabaseError on +invalid syntax.

    + +

    The pattern syntax is documented at https://www.sqlite.org/fts5.html#full_text_query_syntax

    +
    try db.makeFTS5Pattern(rawPattern: "and", forTable: "document") // OK
    +try db.makeFTS5Pattern(rawPattern: "AND", forTable: "document") // malformed MATCH expression: [AND]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeFTS5Pattern(rawPattern: String, forTable table: String) throws -> FTS5Pattern
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + makeTokenizer(_:) + +
    +
    +
    +
    +
    +
    +

    Creates an FTS5 tokenizer, given its descriptor.

    +
    let unicode61 = try db.makeTokenizer(.unicode61())
    +
    + +

    It is a programmer error to use the tokenizer outside of a protected +database queue, or after the database has been closed.

    + +

    Use this method when you implement a custom wrapper tokenizer:

    +
    final class MyTokenizer : FTS5WrapperTokenizer {
    +    var wrappedTokenizer: FTS5Tokenizer
    +
    +    init(db: Database, arguments: [String]) throws {
    +        wrappedTokenizer = try db.makeTokenizer(.unicode61())
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeTokenizer(_ descriptor: FTS5TokenizerDescriptor) throws -> FTS5Tokenizer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Schema

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a database table.

    +
    try db.create(table: "place") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("title", .text)
    +    t.column("favorite", .boolean).notNull().default(false)
    +    t.column("longitude", .double).notNull()
    +    t.column("latitude", .double).notNull()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an index.

    +
    try db.create(index: "playerByEmail", on: "player", columns: ["email"])
    +
    + +

    SQLite can also index expressions (https://www.sqlite.org/expridx.html) +and use specific collations. To create such an index, use a raw SQL +query.

    +
    try db.execute(sql: "CREATE INDEX ...")
    +
    + +

    See https://www.sqlite.org/lang_createindex.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create(
    +    index name: String,
    +    on table: String,
    +    columns: [String],
    +    unique: Bool = false,
    +    ifNotExists: Bool = false,
    +    condition: SQLExpressible? = nil)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The index name.

    +
    +
    + + table + + +
    +

    The name of the indexed table.

    +
    +
    + + columns + + +
    +

    The indexed columns.

    +
    +
    + + unique + + +
    +

    If true, creates a unique index.

    +
    +
    + + ifNotExists + + +
    +

    If false, no error is thrown if index already exists.

    +
    +
    + + condition + + +
    +

    If not nil, creates a partial index +(see https://www.sqlite.org/partialindex.html).

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an index.

    +
    try db.create(index: "playerByEmail", on: "player", columns: ["email"])
    +
    + +

    SQLite can also index expressions (https://www.sqlite.org/expridx.html) +and use specific collations. To create such an index, use a raw SQL +query.

    +
    try db.execute(sql: "CREATE INDEX ...")
    +
    + +

    See https://www.sqlite.org/lang_createindex.html

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Database/BusyMode.html b/docs/4.8/Classes/Database/BusyMode.html new file mode 100644 index 000000000..1f3cb1992 --- /dev/null +++ b/docs/4.8/Classes/Database/BusyMode.html @@ -0,0 +1,1198 @@ + + + + BusyMode Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

BusyMode

+
+
+
public enum BusyMode
+ +
+
+

When there are several connections to a database, a connection may try +to access the database while it is locked by another connection.

+ +

The BusyMode enum describes the behavior of GRDB when such a situation +occurs:

+ +
    +
  • .immediateError: The SQLITE_BUSY error is immediately returned to the +connection that tries to access the locked database.

  • +
  • .timeout: The SQLITE_BUSY error will be returned only if the database +remains locked for more than the specified duration.

  • +
  • .callback: Perform your custom lock handling.

  • +
+ +

To set the busy mode of a database, use Configuration:

+
// Wait 1 second before failing with SQLITE_BUSY
+let configuration = Configuration(busyMode: .timeout(1))
+let dbQueue = DatabaseQueue(path: "...", configuration: configuration)
+
+ +

Relevant SQLite documentation:

+ + + +
+
+
+
    +
  • +
    + + + + immediateError + +
    +
    +
    +
    +
    +
    +

    The SQLITE_BUSY error is immediately returned to the connection that +tries to access the locked database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case immediateError
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + timeout(_:) + +
    +
    +
    +
    +
    +
    +

    The SQLITE_BUSY error will be returned only if the database remains +locked for more than the specified duration (in seconds).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case timeout(TimeInterval)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + callback(_:) + +
    +
    +
    +
    +
    +
    +

    A custom callback that is called when a database is locked. +See https://www.sqlite.org/c3ref/busy_handler.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case callback(BusyCallback)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Database/CheckpointMode.html b/docs/4.8/Classes/Database/CheckpointMode.html new file mode 100644 index 000000000..ccd728307 --- /dev/null +++ b/docs/4.8/Classes/Database/CheckpointMode.html @@ -0,0 +1,1198 @@ + + + + CheckpointMode Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

CheckpointMode

+
+
+
public enum CheckpointMode : Int32
+ +
+
+

The available checkpoint modes.

+ +
+
+
+
    +
  • +
    + + + + passive + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case passive = 0
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + full + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case full = 1
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + restart + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case restart = 2
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + truncate + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case truncate = 3
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Database/CollationName.html b/docs/4.8/Classes/Database/CollationName.html new file mode 100644 index 000000000..a513eae49 --- /dev/null +++ b/docs/4.8/Classes/Database/CollationName.html @@ -0,0 +1,1200 @@ + + + + CollationName Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

CollationName

+
+
+
public struct CollationName : RawRepresentable, Hashable
+ +
+
+

A built-in SQLite collation.

+ +

See https://www.sqlite.org/datatype3.html#collation

+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ rawValue: String)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + binary + +
    +
    +
    +
    +
    +
    +

    The BINARY built-in SQL collation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let binary: Database.CollationName
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + nocase + +
    +
    +
    +
    +
    +
    +

    The NOCASE built-in SQL collation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let nocase: Database.CollationName
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rtrim + +
    +
    +
    +
    +
    +
    +

    The RTRIM built-in SQL collation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let rtrim: Database.CollationName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Database/ColumnType.html b/docs/4.8/Classes/Database/ColumnType.html new file mode 100644 index 000000000..8235b7e85 --- /dev/null +++ b/docs/4.8/Classes/Database/ColumnType.html @@ -0,0 +1,1355 @@ + + + + ColumnType Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ColumnType

+
+
+
public struct ColumnType : RawRepresentable, Hashable
+ +
+
+

An SQL column type.

+
try db.create(table: "player") { t in
+    t.autoIncrementedPrimaryKey("id")
+    t.column("title", .text)
+}
+
+ +

See https://www.sqlite.org/datatype3.html

+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ rawValue: String)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + text + +
    +
    +
    +
    +
    +
    +

    The TEXT SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let text: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + integer + +
    +
    +
    +
    +
    +
    +

    The INTEGER SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let integer: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + double + +
    +
    +
    +
    +
    +
    +

    The DOUBLE SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let double: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + numeric + +
    +
    +
    +
    +
    +
    +

    The NUMERIC SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let numeric: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + boolean + +
    +
    +
    +
    +
    +
    +

    The BOOLEAN SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let boolean: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + blob + +
    +
    +
    +
    +
    +
    +

    The BLOB SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let blob: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + date + +
    +
    +
    +
    +
    +
    +

    The DATE SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let date: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + datetime + +
    +
    +
    +
    +
    +
    +

    The DATETIME SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let datetime: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Database/ConflictResolution.html b/docs/4.8/Classes/Database/ConflictResolution.html new file mode 100644 index 000000000..7fa816b0d --- /dev/null +++ b/docs/4.8/Classes/Database/ConflictResolution.html @@ -0,0 +1,1230 @@ + + + + ConflictResolution Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ConflictResolution

+
+
+
public enum ConflictResolution : String
+ +
+
+

An SQLite conflict resolution.

+ +

See https://www.sqlite.org/lang_conflict.html.

+ +
+
+
+
    +
  • +
    + + + + rollback + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case rollback = "ROLLBACK"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + abort + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case abort = "ABORT"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fail + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case fail = "FAIL"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ignore + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case ignore = "IGNORE"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + replace + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case replace = "REPLACE"
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Database/ForeignKeyAction.html b/docs/4.8/Classes/Database/ForeignKeyAction.html new file mode 100644 index 000000000..ebfddd6cb --- /dev/null +++ b/docs/4.8/Classes/Database/ForeignKeyAction.html @@ -0,0 +1,1200 @@ + + + + ForeignKeyAction Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ForeignKeyAction

+
+
+
public enum ForeignKeyAction : String
+ +
+
+

A foreign key action.

+ +

See https://www.sqlite.org/foreignkeys.html

+ +
+
+
+
    +
  • +
    + + + + cascade + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case cascade = "CASCADE"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + restrict + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case restrict = "RESTRICT"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + setNull + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case setNull = "SET NULL"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + setDefault + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case setDefault = "SET DEFAULT"
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Database/TransactionCompletion.html b/docs/4.8/Classes/Database/TransactionCompletion.html new file mode 100644 index 000000000..dbb2cb84b --- /dev/null +++ b/docs/4.8/Classes/Database/TransactionCompletion.html @@ -0,0 +1,1138 @@ + + + + TransactionCompletion Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TransactionCompletion

+
+
+
public enum TransactionCompletion
+ +
+
+

The end of a transaction: Commit, or Rollback

+ +
+
+
+
    +
  • +
    + + + + commit + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case commit
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rollback + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case rollback
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Database/TransactionKind.html b/docs/4.8/Classes/Database/TransactionKind.html new file mode 100644 index 000000000..20870cc74 --- /dev/null +++ b/docs/4.8/Classes/Database/TransactionKind.html @@ -0,0 +1,1168 @@ + + + + TransactionKind Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TransactionKind

+
+
+
public enum TransactionKind : String
+ +
+
+

An SQLite transaction kind. See https://www.sqlite.org/lang_transaction.html

+ +
+
+
+
    +
  • +
    + + + + deferred + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deferred = "DEFERRED"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + immediate + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case immediate = "IMMEDIATE"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + exclusive + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case exclusive = "EXCLUSIVE"
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Database/TransactionObservationExtent.html b/docs/4.8/Classes/Database/TransactionObservationExtent.html new file mode 100644 index 000000000..ee5d8f811 --- /dev/null +++ b/docs/4.8/Classes/Database/TransactionObservationExtent.html @@ -0,0 +1,1170 @@ + + + + TransactionObservationExtent Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TransactionObservationExtent

+
+
+
public enum TransactionObservationExtent
+ +
+
+

The extent of a transaction observation

+ +

See Database.add(transactionObserver:extent:)

+ +
+
+
+
    +
  • +
    + + + + observerLifetime + +
    +
    +
    +
    +
    +
    +

    Observation lasts until observer is deallocated

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case observerLifetime
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + nextTransaction + +
    +
    +
    +
    +
    +
    +

    Observation lasts until the next transaction

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case nextTransaction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseLifetime + +
    +
    +
    +
    +
    +
    +

    Observation lasts until the database is closed

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case databaseLifetime
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/DatabaseCollation.html b/docs/4.8/Classes/DatabaseCollation.html new file mode 100644 index 000000000..35ce60cc5 --- /dev/null +++ b/docs/4.8/Classes/DatabaseCollation.html @@ -0,0 +1,1404 @@ + + + + DatabaseCollation Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseCollation

+
+
+
public final class DatabaseCollation
+
extension DatabaseCollation: Hashable
+ +
+
+

A Collation is a string comparison function used by SQLite.

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:function:) + +
    +
    +
    +
    +
    +
    +

    Creates a collation.

    +
    let collation = DatabaseCollation("localized_standard") { (string1, string2) in
    +    return (string1 as NSString).localizedStandardCompare(string2)
    +}
    +db.add(collation: collation)
    +try db.execute(sql: "CREATE TABLE file (name TEXT COLLATE localized_standard")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ name: String, function: @escaping (String, String) -> ComparisonResult)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    The function name.

    +
    +
    + + function + + +
    +

    A function that compares two strings.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SQLite Collations

+

+
+
+
    +
  • +
    + + + + unicodeCompare + +
    +
    +
    +
    +
    +
    +

    A collation, or SQL string comparison function, that compares strings +according to the the Swift built-in == and <= operators.

    + +

    This collation is automatically added by GRDB to your database +connections.

    + +

    You can use it when creating database tables:

    +
    let collationName = DatabaseCollation.caseInsensitiveCompare.name
    +dbQueue.execute(sql: """
    +    CREATE TABLE players (
    +      name TEXT COLLATE \(collationName)
    +    )
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let unicodeCompare: DatabaseCollation
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A collation, or SQL string comparison function, that compares strings +according to the the Swift built-in caseInsensitiveCompare(_:) method.

    + +

    This collation is automatically added by GRDB to your database +connections.

    + +

    You can use it when creating database tables:

    +
    let collationName = DatabaseCollation.caseInsensitiveCompare.name
    +dbQueue.execute(sql: """
    +    CREATE TABLE players (
    +      name TEXT COLLATE \(collationName)
    +    )
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let caseInsensitiveCompare: DatabaseCollation
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A collation, or SQL string comparison function, that compares strings +according to the the Swift built-in localizedCaseInsensitiveCompare(_:) method.

    + +

    This collation is automatically added by GRDB to your database +connections.

    + +

    You can use it when creating database tables:

    +
    let collationName = DatabaseCollation.localizedCaseInsensitiveCompare.name
    +dbQueue.execute(sql: """
    +    CREATE TABLE players (
    +      name TEXT COLLATE \(collationName)
    +    )
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let localizedCaseInsensitiveCompare: DatabaseCollation
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + localizedCompare + +
    +
    +
    +
    +
    +
    +

    A collation, or SQL string comparison function, that compares strings +according to the the Swift built-in localizedCompare(_:) method.

    + +

    This collation is automatically added by GRDB to your database +connections.

    + +

    You can use it when creating database tables:

    +
    let collationName = DatabaseCollation.localizedCompare.name
    +dbQueue.execute(sql: """
    +    CREATE TABLE players (
    +      name TEXT COLLATE \(collationName)
    +    )
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let localizedCompare: DatabaseCollation
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A collation, or SQL string comparison function, that compares strings +according to the the Swift built-in localizedStandardCompare(_:) method.

    + +

    This collation is automatically added by GRDB to your database +connections.

    + +

    You can use it when creating database tables:

    +
    let collationName = DatabaseCollation.localizedStandardCompare.name
    +dbQueue.execute(sql: """
    +    CREATE TABLE players (
    +      name TEXT COLLATE \(collationName)
    +    )
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let localizedStandardCompare: DatabaseCollation
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/DatabaseFunction.html b/docs/4.8/Classes/DatabaseFunction.html new file mode 100644 index 000000000..66433ed4e --- /dev/null +++ b/docs/4.8/Classes/DatabaseFunction.html @@ -0,0 +1,1642 @@ + + + + DatabaseFunction Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseFunction

+
+
+
public final class DatabaseFunction : Hashable
+ +
+
+

An SQL function or aggregate.

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an SQL function.

    +
    let fn = DatabaseFunction("succ", argumentCount: 1) { dbValues in
    +    guard let int = Int.fromDatabaseValue(dbValues[0]) else {
    +        return nil
    +    }
    +    return int + 1
    +}
    +db.add(function: fn)
    +try Int.fetchOne(db, sql: "SELECT succ(1)")! // 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    _ name: String,
    +    argumentCount: Int32? = nil,
    +    pure: Bool = false,
    +    function: @escaping ([DatabaseValue]) throws -> DatabaseValueConvertible?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The function name.

    +
    +
    + + argumentCount + + +
    +

    The number of arguments of the function. If +omitted, or nil, the function accepts any number of arguments.

    +
    +
    + + pure + + +
    +

    Whether the function is “pure”, which means that its results +only depends on its inputs. When a function is pure, SQLite has +the opportunity to perform additional optimizations. Default value +is false.

    +
    +
    + + function + + +
    +

    A function that takes an array of DatabaseValue +arguments, and returns an optional DatabaseValueConvertible such +as Int, String, NSDate, etc. The array is guaranteed to have +exactly argumentCount elements, provided argumentCount is +not nil.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an SQL aggregate function.

    +
    struct MySum : DatabaseAggregate {
    +    var sum: Int = 0
    +
    +    mutating func step(_ dbValues: [DatabaseValue]) {
    +        if let int = Int.fromDatabaseValue(dbValues[0]) {
    +            sum += int
    +        }
    +    }
    +
    +    func finalize() -> DatabaseValueConvertible? {
    +        return sum
    +    }
    +}
    +
    +let dbQueue = DatabaseQueue()
    +let fn = DatabaseFunction("mysum", argumentCount: 1, aggregate: MySum.self)
    +dbQueue.add(function: fn)
    +try dbQueue.write { db in
    +    try db.execute(sql: "CREATE TABLE test(i)")
    +    try db.execute(sql: "INSERT INTO test(i) VALUES (1)")
    +    try db.execute(sql: "INSERT INTO test(i) VALUES (2)")
    +    try Int.fetchOne(db, sql: "SELECT mysum(i) FROM test")! // 3
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Aggregate: DatabaseAggregate>(
    +    _ name: String,
    +    argumentCount: Int32? = nil,
    +    pure: Bool = false,
    +    aggregate: Aggregate.Type)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The function name.

    +
    +
    + + argumentCount + + +
    +

    The number of arguments of the aggregate. If +omitted, or nil, the aggregate accepts any number of arguments.

    +
    +
    + + pure + + +
    +

    Whether the aggregate is “pure”, which means that its +results only depends on its inputs. When an aggregate is pure, +SQLite has the opportunity to perform additional optimizations. +Default value is false.

    +
    +
    + + aggregate + + +
    +

    A type that implements the DatabaseAggregate protocol. +For each step of the aggregation, its step method is called with +an array of DatabaseValue arguments. The array is guaranteed to +have exactly argumentCount elements, provided argumentCount is +not nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SQL Functions

+

+
+
+
    +
  • +
    + + + + capitalize + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in capitalized +String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +capitalized:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.capitalized)
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let capitalize: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lowercase + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in lowercased +String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +lowercased:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.lowercased())
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let lowercase: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + uppercase + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in uppercased +String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +uppercased:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.uppercased())
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let uppercase: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + localizedCapitalize + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in +localizedCapitalized String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +localizedCapitalized:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.localizedCapitalized)
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(iOS 9.0, OSX 10.11, watchOS 3.0, *)
    +public static let localizedCapitalize: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + localizedLowercase + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in +localizedLowercased String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +localizedLowercased:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.localizedLowercased)
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(iOS 9.0, OSX 10.11, watchOS 3.0, *)
    +public static let localizedLowercase: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + localizedUppercase + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in +localizedUppercased String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +localizedUppercased:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.localizedUppercased)
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(iOS 9.0, OSX 10.11, watchOS 3.0, *)
    +public static let localizedUppercase: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Custom Functions

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/DatabaseFuture.html b/docs/4.8/Classes/DatabaseFuture.html new file mode 100644 index 000000000..31b4a7e04 --- /dev/null +++ b/docs/4.8/Classes/DatabaseFuture.html @@ -0,0 +1,1127 @@ + + + + DatabaseFuture Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseFuture

+
+
+
public class DatabaseFuture<Value>
+ +
+
+

A future database value, returned by the DatabaseWriter.concurrentRead(_:) +method.

+
let futureCount: Future<Int> = try writer.writeWithoutTransaction { db in
+    try Player(...).insert()
+
+    // Count players concurrently
+    return writer.concurrentRead { db in
+        return try Player.fetchCount()
+    }
+}
+
+let count: Int = try futureCount.wait()
+
+ +
+
+
+
    +
  • +
    + + + + wait() + +
    +
    +
    +
    +
    +
    +

    Blocks the current thread until the value is available, and returns it.

    + +

    It is a programmer error to call this method several times.

    +
    +

    Throws

    + Any error that prevented the value from becoming available. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func wait() throws -> Value
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/DatabasePool.html b/docs/4.8/Classes/DatabasePool.html new file mode 100644 index 000000000..f340a3ace --- /dev/null +++ b/docs/4.8/Classes/DatabasePool.html @@ -0,0 +1,2609 @@ + + + + DatabasePool Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabasePool

+
+
+
public final class DatabasePool : DatabaseWriter
+
extension DatabasePool: DatabaseReader
+ +
+
+

A DatabasePool grants concurrent accesses to an SQLite database.

+ +
+
+
+
+ + +
+ +

Database Information

+

+
+
+
    +
  • +
    + + + + path + +
    +
    +
    +
    +
    +
    +

    The path to the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var path: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var configuration: Configuration { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initializer

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Opens the SQLite database at path path.

    +
    let dbPool = try DatabasePool(path: "/path/to/database.sqlite")
    +
    + +

    Database connections get closed when the database pool gets deallocated.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(path: String, configuration: Configuration = Configuration()) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + path + + +
    +

    The path to the database file.

    +
    +
    + + configuration + + +
    +

    A configuration.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

WAL Checkpoints

+

+
+
+ +
+
+
+ + +
+ +

Memory management

+

+
+
+
    +
  • +
    + + + + releaseMemory() + +
    +
    +
    +
    +
    +
    +

    Free as much memory as possible.

    + +

    This method blocks the current thread until all database accesses +are completed.

    + +

    See also setupMemoryManagement(application:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func releaseMemory()
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Listens to UIApplicationDidEnterBackgroundNotification and +UIApplicationDidReceiveMemoryWarningNotification in order to release +as much memory as possible.

    + +
      +
    • param application: The UIApplication that will start a background +task to let the database pool release its memory when the application +enters background.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setupMemoryManagement(in application: UIApplication)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Interrupting Database Operations

+

+
+
+
    +
  • +
    + + + + interrupt() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func interrupt()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Reading from Database

+

+
+
+
    +
  • +
    + + + + read(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block in a protected dispatch queue, +and returns its result. The block is wrapped in a deferred transaction.

    +
    let players = try dbPool.read { db in
    +    try Player.fetchAll(...)
    +}
    +
    + +

    The block is completely isolated. Eventual concurrent database updates +are not visible inside the block:

    +
    try dbPool.read { db in
    +    // Those two values are guaranteed to be equal, even if the
    +    // `wine` table is modified between the two requests:
    +    let count1 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +    let count2 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +}
    +
    +try dbPool.read { db in
    +    // Now this value may be different:
    +    let count = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +}
    +
    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func read<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + asyncRead(_:) + +
    +
    +
    +
    +
    +
    +

    Asynchronously executes a read-only block in a protected dispatch queue.

    +
    let players = try dbQueue.asyncRead { result in
    +    do {
    +        let db = try result.get()
    +        let count = try Player.fetchCount(db)
    +    } catch {
    +        // Handle error
    +    }
    +}
    +
    + +

    Starting SQLite 3.8.0 (iOS 8.2+, OSX 10.10+, custom SQLite builds and +SQLCipher), attempts to write in the database from this method throw a +DatabaseError of resultCode SQLITE_READONLY.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncRead(_ block: @escaping (Result<Database, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + unsafeRead(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block in a protected dispatch queue, +and returns its result.

    + +

    The block argument is not isolated: eventual concurrent database updates +are visible inside the block:

    +
    try dbPool.unsafeRead { db in
    +    // Those two values may be different because some other thread
    +    // may have inserted or deleted a wine between the two requests:
    +    let count1 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +    let count2 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +}
    +
    + +

    Cursor iteration is safe, though:

    +
    try dbPool.unsafeRead { db in
    +    // No concurrent update can mess with this iteration:
    +    let rows = try Row.fetchCursor(db, sql: "SELECT ...")
    +    while let row = try rows.next() { ... }
    +}
    +
    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeRead<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block in a protected dispatch queue, +and returns its result.

    + +

    The block argument is not isolated: eventual concurrent database updates +are visible inside the block:

    +
    try dbPool.unsafeReentrantRead { db in
    +    // Those two values may be different because some other thread
    +    // may have inserted or deleted a wine between the two requests:
    +    let count1 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +    let count2 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +}
    +
    + +

    Cursor iteration is safe, though:

    +
    try dbPool.unsafeReentrantRead { db in
    +    // No concurrent update can mess with this iteration:
    +    let rows = try Row.fetchCursor(db, sql: "SELECT ...")
    +    while let row = try rows.next() { ... }
    +}
    +
    + +

    This method is reentrant. It is unsafe because it fosters dangerous +concurrency practices.

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeReentrantRead<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + concurrentRead(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func concurrentRead<T>(_ block: @escaping (Database) throws -> T) -> DatabaseFuture<T>
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously executes a read-only block in a protected dispatch queue.

    + +

    This method must be called from a writing dispatch queue, outside of any +transaction. You’ll get a fatal error otherwise.

    + +

    The block argument is guaranteed to see the database in the last +committed state at the moment this method is called. Eventual concurrent +database updates are not visible inside the block.

    + +

    This method returns as soon as the isolation guarantees described above +are established.

    + +

    In the example below, the number of players is fetched concurrently with +the player insertion. Yet the future is guaranteed to return zero:

    +
    try writer.asyncWriteWithoutTransaction { db in
    +    // Delete all players
    +    try Player.deleteAll()
    +
    +    // Count players concurrently
    +    writer.asyncConcurrentRead { result in
    +        do {
    +            let db = try result.get()
    +            // Guaranteed to be zero
    +            let count = try Player.fetchCount(db)
    +        } catch {
    +            // Handle error
    +        }
    +    }
    +
    +    // Insert a player
    +    try Player(...).insert(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncConcurrentRead(_ block: @escaping (Result<Database, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Invalidates open read-only SQLite connections.

    + +

    After this method is called, read-only database access methods will use +new SQLite connections.

    + +

    Eventual concurrent read-only accesses are not invalidated: they will +proceed until completion.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func invalidateReadOnlyConnections()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Writing in Database

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    + +

    Eventual concurrent database updates are postponed until the updates +are completed.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func writeWithoutTransaction<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A barrier write ensures that no database access is executed until all +previous accesses have completed, and the specified updates have been +executed.

    + +

    This method is not reentrant.

    +
    +

    Important

    + Reads executed by concurrent database snapshots are not +considered: they can run concurrently with the barrier updates. + +
    +

    Throws

    + The error thrown by the updates. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func barrierWriteWithoutTransaction<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction, and returns the result.

    + +

    If the updates throws an error, the transaction is rollbacked and the +error is rethrown. If the updates return .rollback, the transaction is +also rollbacked, but no error is thrown.

    + +

    Eventual concurrent database updates are postponed until the transaction +has completed.

    + +

    Eventual concurrent reads are guaranteed to not see any partial updates +of the database until the transaction has completed.

    + +

    This method is not reentrant.

    +
    try dbPool.writeInTransaction { db in
    +    db.execute(...)
    +    return .commit
    +}
    +
    +
    +

    Throws

    + The error thrown by the updates, or by the +wrapping transaction. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func writeInTransaction(
    +    _ kind: Database.TransactionKind? = nil,
    +    _ updates: (Database) throws -> Database.TransactionCompletion)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + kind + + +
    +

    The transaction type (default nil). If nil, the transaction +type is configuration.defaultTransactionKind, which itself +defaults to .deferred. See https://www.sqlite.org/lang_transaction.html +for more information.

    +
    +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    + +

    Eventual concurrent database updates are postponed until the updates +are completed.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +

    This method is reentrant. It should be avoided because it fosters +dangerous concurrency practices.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeReentrantWrite<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously executes database updates in a protected dispatch queue, +outside of any transaction.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncWriteWithoutTransaction(_ updates: @escaping (Database) -> Void)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Functions

+

+
+
+
    +
  • +
    + + + + add(function:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine an SQL function.

    +
    let fn = DatabaseFunction("succ", argumentCount: 1) { dbValues in
    +    guard let int = Int.fromDatabaseValue(dbValues[0]) else {
    +        return nil
    +    }
    +    return int + 1
    +}
    +dbPool.add(function: fn)
    +try dbPool.read { db in
    +    try Int.fetchOne(db, sql: "SELECT succ(1)") // 2
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(function:) + +
    +
    +
    +
    +
    +
    +

    Remove an SQL function.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Collations

+

+
+
+
    +
  • +
    + + + + add(collation:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine a collation.

    +
    let collation = DatabaseCollation("localized_standard") { (string1, string2) in
    +    return (string1 as NSString).localizedStandardCompare(string2)
    +}
    +dbPool.add(collation: collation)
    +try dbPool.write { db in
    +    try db.execute(sql: "CREATE TABLE file (name TEXT COLLATE LOCALIZED_STANDARD")
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(collation:) + +
    +
    +
    +
    +
    +
    +

    Remove a collation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Custom FTS5 Tokenizers

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +dbPool.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Snapshots

+

+
+
+
    +
  • +
    + + + + makeSnapshot() + +
    +
    +
    +
    +
    +
    +

    Creates a database snapshot.

    + +

    The snapshot sees an unchanging database content, as it existed at the +moment it was created.

    + +

    When you want to control the latest committed changes seen by a +snapshot, create it from the pool’s writer protected dispatch queue:

    +
    let snapshot1 = try dbPool.write { db -> DatabaseSnapshot in
    +    try Player.deleteAll()
    +    return try dbPool.makeSnapshot()
    +}
    +// <- Other threads may modify the database here
    +let snapshot2 = try dbPool.makeSnapshot()
    +
    +try snapshot1.read { db in
    +    // Guaranteed to be zero
    +    try Player.fetchCount(db)
    +}
    +
    +try snapshot2.read { db in
    +    // Could be anything
    +    try Player.fetchCount(db)
    +}
    +
    + +

    It is forbidden to create a snapshot from the writer protected dispatch +queue when a transaction is opened, though, because it is likely a +programmer error:

    +
    try dbPool.write { db in
    +    try db.inTransaction {
    +        try Player.deleteAll()
    +        // fatal error: makeSnapshot() must not be called from inside a transaction
    +        let snapshot = try dbPool.makeSnapshot()
    +        return .commit
    +    }
    +}
    +
    + +

    To avoid this fatal error, create the snapshot before or after the +transaction:

    +
    try dbPool.writeWithoutTransaction { db in
    +    // OK
    +    let snapshot = try dbPool.makeSnapshot()
    +
    +    try db.inTransaction {
    +        try Player.deleteAll()
    +        return .commit
    +    }
    +
    +    // OK
    +    let snapshot = try dbPool.makeSnapshot()
    +}
    +
    + +

    You can create as many snapshots as you need, regardless of the maximum +number of reader connections in the pool.

    + +

    For more information, read about “snapshot isolation” at https://sqlite.org/isolation.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeSnapshot() throws -> DatabaseSnapshot
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Memory management

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Listens to UIApplicationDidEnterBackgroundNotification and +UIApplicationDidReceiveMemoryWarningNotification in order to release +as much memory as possible.

    + +
      +
    • param application: The UIApplication that will start a background +task to let the database pool release its memory when the application +enters background.
    • +
    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Encryption

+

+
+
+
    +
  • +
    + + + + change(passphrase:) + +
    +
    +
    +
    +
    +
    +

    Changes the passphrase of an encrypted database

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use Database.changePassphrase(_:﹚ instead")
    +public func change(passphrase: String) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Custom FTS5 Tokenizers

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +dbPool.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add<Tokenizer>(tokenizer: Tokenizer.Type) where Tokenizer : FTS5CustomTokenizer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/DatabaseQueue.html b/docs/4.8/Classes/DatabaseQueue.html new file mode 100644 index 000000000..a51a61f6d --- /dev/null +++ b/docs/4.8/Classes/DatabaseQueue.html @@ -0,0 +1,2167 @@ + + + + DatabaseQueue Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseQueue

+
+
+
public final class DatabaseQueue : DatabaseWriter
+ +
+
+

A DatabaseQueue serializes access to an SQLite database.

+ +
+
+
+
+ + +
+ +

Configuration

+

+
+
+
    +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The database configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var configuration: Configuration { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + path + +
    +
    +
    +
    +
    +
    +

    The path to the database file; it is “:memory:” for in-memory databases.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var path: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initializers

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Opens the SQLite database at path path.

    +
    let dbQueue = try DatabaseQueue(path: "/path/to/database.sqlite")
    +
    + +

    Database connections get closed when the database queue gets deallocated.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(path: String, configuration: Configuration = Configuration()) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + path + + +
    +

    The path to the database file.

    +
    +
    + + configuration + + +
    +

    A configuration.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(configuration:) + +
    +
    +
    +
    +
    +
    +

    Opens an in-memory SQLite database.

    +
    let dbQueue = DatabaseQueue()
    +
    + +

    Database memory is released when the database queue gets deallocated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(configuration: Configuration = Configuration())
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    A configuration.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Memory management

+

+
+
+
    +
  • +
    + + + + releaseMemory() + +
    +
    +
    +
    +
    +
    +

    Free as much memory as possible.

    + +

    This method blocks the current thread until all database accesses are completed.

    + +

    See also setupMemoryManagement(application:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func releaseMemory()
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Listens to UIApplicationDidEnterBackgroundNotification and +UIApplicationDidReceiveMemoryWarningNotification in order to release +as much memory as possible.

    + +
      +
    • param application: The UIApplication that will start a background +task to let the database queue release its memory when the application +enters background.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setupMemoryManagement(in application: UIApplication)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Interrupting Database Operations

+

+
+
+
    +
  • +
    + + + + interrupt() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func interrupt()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Reading from Database

+

+
+
+
    +
  • +
    + + + + read(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block in a protected dispatch queue, +and returns its result.

    +
    let players = try dbQueue.read { db in
    +    try Player.fetchAll(db)
    +}
    +
    + +

    This method is not reentrant.

    + +

    Starting SQLite 3.8.0 (iOS 8.2+, OSX 10.10+, custom SQLite builds and +SQLCipher), attempts to write in the database from this method throw a +DatabaseError of resultCode SQLITE_READONLY.

    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func read<T>(_ block: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + asyncRead(_:) + +
    +
    +
    +
    +
    +
    +

    Asynchronously executes a read-only block in a protected dispatch queue.

    +
    let players = try dbQueue.asyncRead { result in
    +    do {
    +        let db = try result.get()
    +        let count = try Player.fetchCount(db)
    +    } catch {
    +        // Handle error
    +    }
    +}
    +
    + +

    Starting SQLite 3.8.0 (iOS 8.2+, OSX 10.10+, custom SQLite builds and +SQLCipher), attempts to write in the database from this method throw a +DatabaseError of resultCode SQLITE_READONLY.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncRead(_ block: @escaping (Result<Database, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + concurrentRead(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func concurrentRead<T>(_ block: @escaping (Database) throws -> T) -> DatabaseFuture<T>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Writing in Database

+

+
+
+
    +
  • +
    + + + + inTransaction(_:_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction, and returns the result.

    + +

    If the updates throws an error, the transaction is rollbacked and the +error is rethrown. If the updates return .rollback, the transaction is +also rollbacked, but no error is thrown.

    + +

    Eventual concurrent database accesses are postponed until the +transaction has completed.

    + +

    This method is not reentrant.

    +
    try dbQueue.writeInTransaction { db in
    +    db.execute(...)
    +    return .commit
    +}
    +
    +
    +

    Throws

    + The error thrown by the updates, or by the +wrapping transaction. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func inTransaction(
    +    _ kind: Database.TransactionKind? = nil,
    +    _ updates: (Database) throws -> Database.TransactionCompletion)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + kind + + +
    +

    The transaction type (default nil). If nil, the transaction +type is configuration.defaultTransactionKind, which itself +defaults to .deferred. See https://www.sqlite.org/lang_transaction.html +for more information.

    +
    +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    + +

    Eventual concurrent database accesses are postponed until the updates +are completed.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func writeWithoutTransaction<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + inDatabase(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    +
    // INSERT INTO player ...
    +let players = try dbQueue.inDatabase { db in
    +    try Player(...).insert(db)
    +}
    +
    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func inDatabase<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, and +returns the result.

    +
    // INSERT INTO player ...
    +try dbQueue.unsafeReentrantWrite { db in
    +    try Player(...).insert(db)
    +}
    +
    + +

    This method is reentrant. It is unsafe because it fosters dangerous +concurrency practices.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeReentrantWrite<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously executes database updates in a protected dispatch queue, +outside of any transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncWriteWithoutTransaction(_ updates: @escaping (Database) -> Void)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Functions

+

+
+
+
    +
  • +
    + + + + add(function:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine an SQL function.

    +
    let fn = DatabaseFunction("succ", argumentCount: 1) { dbValues in
    +    guard let int = Int.fromDatabaseValue(dbValues[0]) else {
    +        return nil
    +    }
    +    return int + 1
    +}
    +dbQueue.add(function: fn)
    +try dbQueue.read { db in
    +    try Int.fetchOne(db, sql: "SELECT succ(1)") // 2
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(function:) + +
    +
    +
    +
    +
    +
    +

    Remove an SQL function.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Collations

+

+
+
+
    +
  • +
    + + + + add(collation:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine a collation.

    +
    let collation = DatabaseCollation("localized_standard") { (string1, string2) in
    +    return (string1 as NSString).localizedStandardCompare(string2)
    +}
    +dbQueue.add(collation: collation)
    +try dbQueue.write { db in
    +    try db.execute(sql: "CREATE TABLE file (name TEXT COLLATE LOCALIZED_STANDARD")
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(collation:) + +
    +
    +
    +
    +
    +
    +

    Remove a collation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Memory management

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Listens to UIApplicationDidEnterBackgroundNotification and +UIApplicationDidReceiveMemoryWarningNotification in order to release +as much memory as possible.

    + +
      +
    • param application: The UIApplication that will start a background +task to let the database queue release its memory when the application +enters background.
    • +
    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Encryption

+

+
+
+
    +
  • +
    + + + + change(passphrase:) + +
    +
    +
    +
    +
    +
    +

    Changes the passphrase of an encrypted database

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use Database.changePassphrase(_:﹚ instead")
    +public func change(passphrase: String) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Custom FTS5 Tokenizers

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +dbQueue.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add<Tokenizer>(tokenizer: Tokenizer.Type) where Tokenizer : FTS5CustomTokenizer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/DatabaseSnapshot.html b/docs/4.8/Classes/DatabaseSnapshot.html new file mode 100644 index 000000000..3138854ba --- /dev/null +++ b/docs/4.8/Classes/DatabaseSnapshot.html @@ -0,0 +1,1502 @@ + + + + DatabaseSnapshot Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseSnapshot

+
+
+
public class DatabaseSnapshot : DatabaseReader
+ +
+
+

A DatabaseSnapshot sees an unchanging database content, as it existed at the +moment it was created.

+ +

See DatabasePool.makeSnapshot()

+ +

For more information, read about “snapshot isolation” at https://sqlite.org/isolation.html

+ +
+
+
+
    +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The database configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var configuration: Configuration { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Interrupting Database Operations

+

+
+
+
    +
  • +
    + + + + interrupt() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func interrupt()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Reading from Database

+

+
+
+
    +
  • +
    + + + + read(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block that takes a database +connection, and returns its result.

    +
    let players = try snapshot.read { db in
    +    try Player.fetchAll(...)
    +}
    +
    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func read<T>(_ block: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + asyncRead(_:) + +
    +
    +
    +
    +
    +
    +

    Asynchronously executes a read-only block in a protected dispatch queue.

    +
    let players = try snapshot.asyncRead { result in
    +    do {
    +        let db = try result.get()
    +        let count = try Player.fetchCount(db)
    +    } catch {
    +        // Handle error
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncRead(_ block: @escaping (Result<Database, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Functions

+

+
+
+ +
+
+
+ + +
+ +

Collations

+

+
+
+ +
+
+
+ + +
+ +

Value Observation

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/FTS3TableDefinition.html b/docs/4.8/Classes/FTS3TableDefinition.html new file mode 100644 index 000000000..a026aee66 --- /dev/null +++ b/docs/4.8/Classes/FTS3TableDefinition.html @@ -0,0 +1,1174 @@ + + + + FTS3TableDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS3TableDefinition

+
+
+
public final class FTS3TableDefinition
+ +
+
+

The FTS3TableDefinition class lets you define columns of a FTS3 virtual table.

+ +

You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

+
try db.create(virtualTable: "document", using: FTS3()) { t in // t is FTS3TableDefinition
+    t.column("content")
+}
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/FTS4ColumnDefinition.html b/docs/4.8/Classes/FTS4ColumnDefinition.html new file mode 100644 index 000000000..709ab28aa --- /dev/null +++ b/docs/4.8/Classes/FTS4ColumnDefinition.html @@ -0,0 +1,1172 @@ + + + + FTS4ColumnDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS4ColumnDefinition

+
+
+
public final class FTS4ColumnDefinition
+ +
+
+

The FTS4ColumnDefinition class lets you refine a column of an FTS4 +virtual table.

+ +

You get instances of this class when you create an FTS4 table:

+
try db.create(virtualTable: "document", using: FTS4()) { t in
+    t.column("content")      // FTS4ColumnDefinition
+}
+
+ +

See https://www.sqlite.org/fts3.html

+ +
+
+
+
    +
  • +
    + + + + notIndexed() + +
    +
    +
    +
    +
    +
    +

    Excludes the column from the full-text index.

    +
    try db.create(virtualTable: "document", using: FTS4()) { t in
    +    t.column("a")
    +    t.column("b").notIndexed()
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#the_notindexed_option

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +@discardableResult
    +public func notIndexed() -> Self
    + +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + asLanguageId() + +
    +
    +
    +
    +
    +
    +

    Uses the column as the Int32 language id hidden column.

    +
    try db.create(virtualTable: "document", using: FTS4()) { t in
    +    t.column("a")
    +    t.column("lid").asLanguageId()
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#the_languageid_option

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func asLanguageId() -> Self
    + +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/FTS4TableDefinition.html b/docs/4.8/Classes/FTS4TableDefinition.html new file mode 100644 index 000000000..d0c03398f --- /dev/null +++ b/docs/4.8/Classes/FTS4TableDefinition.html @@ -0,0 +1,1387 @@ + + + + FTS4TableDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS4TableDefinition

+
+
+
public final class FTS4TableDefinition
+ +
+
+

The FTS4TableDefinition class lets you define columns of a FTS4 virtual table.

+ +

You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

+
try db.create(virtualTable: "document", using: FTS4()) { t in // t is FTS4TableDefinition
+    t.column("content")
+}
+
+ +

See https://www.sqlite.org/fts3.html

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/FTS5ColumnDefinition.html b/docs/4.8/Classes/FTS5ColumnDefinition.html new file mode 100644 index 000000000..285d3774b --- /dev/null +++ b/docs/4.8/Classes/FTS5ColumnDefinition.html @@ -0,0 +1,1129 @@ + + + + FTS5ColumnDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5ColumnDefinition

+
+
+
public final class FTS5ColumnDefinition
+ +
+
+

The FTS5ColumnDefinition class lets you refine a column of an FTS5 +virtual table.

+ +

You get instances of this class when you create an FTS5 table:

+
try db.create(virtualTable: "document", using: FTS5()) { t in
+    t.column("content")      // FTS5ColumnDefinition
+}
+
+ +

See https://www.sqlite.org/fts5.html

+ +
+
+
+
    +
  • +
    + + + + notIndexed() + +
    +
    +
    +
    +
    +
    +

    Excludes the column from the full-text index.

    +
    try db.create(virtualTable: "document", using: FTS5()) { t in
    +    t.column("a")
    +    t.column("b").notIndexed()
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html#the_unindexed_column_option

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func notIndexed() -> Self
    + +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/FTS5TableDefinition.html b/docs/4.8/Classes/FTS5TableDefinition.html new file mode 100644 index 000000000..9d1e485b0 --- /dev/null +++ b/docs/4.8/Classes/FTS5TableDefinition.html @@ -0,0 +1,1388 @@ + + + + FTS5TableDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5TableDefinition

+
+
+
public final class FTS5TableDefinition
+ +
+
+

The FTS5TableDefinition class lets you define columns of a FTS5 virtual table.

+ +

You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

+
try db.create(virtualTable: "document", using: FTS5()) { t in // t is FTS5TableDefinition
+    t.column("content")
+}
+
+ +

See https://www.sqlite.org/fts5.html

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/FetchedRecordsController.html b/docs/4.8/Classes/FetchedRecordsController.html new file mode 100644 index 000000000..0c6395cda --- /dev/null +++ b/docs/4.8/Classes/FetchedRecordsController.html @@ -0,0 +1,2254 @@ + + + + FetchedRecordsController Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FetchedRecordsController

+
+
+
public final class FetchedRecordsController<Record> where Record : FetchableRecord
+ +
+
+

You use FetchedRecordsController to track changes in the results of an +SQLite request.

+ +

See https://github.com/groue/GRDB.swift#fetchedrecordscontroller for +more information.

+ +
+
+
+
+ + +
+ +

Initialization

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a fetched records controller initialized from a SQL query and +its eventual arguments.

    +
    let controller = FetchedRecordsController<Wine>(
    +    dbQueue,
    +    sql: "SELECT * FROM wine WHERE color = ? ORDER BY name",
    +    arguments: [Color.red],
    +    isSameRecord: { (wine1, wine2) in wine1.id == wine2.id })
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ databaseWriter: DatabaseWriter,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil,
    +    queue: DispatchQueue = .main,
    +    isSameRecord: ((Record, Record) -> Bool)? = nil) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + databaseWriter + + +
    +

    A DatabaseWriter (DatabaseQueue, or DatabasePool)

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    + + queue + + +
    +

    A serial dispatch queue (defaults to the main queue)

    + +

    The fetched records controller tracking callbacks will be +notified of changes in this queue. The controller itself must be +used from this queue.

    +
    +
    + + isSameRecord + + +
    +

    Optional function that compares two records.

    + +

    This function should return true if the two records have the +same identity. For example, they have the same id.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a fetched records controller initialized from a fetch request +from the Query Interface.

    +
    let request = Wine.order(Column("name"))
    +let controller = FetchedRecordsController(
    +    dbQueue,
    +    request: request,
    +    isSameRecord: { (wine1, wine2) in wine1.id == wine2.id })
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init<Request>(
    +    _ databaseWriter: DatabaseWriter,
    +    request: Request,
    +    queue: DispatchQueue = .main,
    +    isSameRecord: ((Record, Record) -> Bool)? = nil) throws
    +    where Request: FetchRequest, Request.RowDecoder == Record
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + databaseWriter + + +
    +

    A DatabaseWriter (DatabaseQueue, or DatabasePool)

    +
    +
    + + request + + +
    +

    A fetch request.

    +
    +
    + + queue + + +
    +

    A serial dispatch queue (defaults to the main queue)

    + +

    The fetched records controller tracking callbacks will be +notified of changes in this queue. The controller itself must be +used from this queue.

    +
    +
    + + isSameRecord + + +
    +

    Optional function that compares two records.

    + +

    This function should return true if the two records have the +same identity. For example, they have the same id.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + performFetch() + +
    +
    +
    +
    +
    +
    +

    Executes the controller’s fetch request.

    + +

    After executing this method, you can access the the fetched objects with +the fetchedRecords property.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func performFetch() throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Configuration

+

+
+
+
    +
  • +
    + + + + databaseWriter + +
    +
    +
    +
    +
    +
    +

    The database writer used to fetch records.

    + +

    The controller registers as a transaction observer in order to respond +to changes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let databaseWriter: DatabaseWriter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + queue + +
    +
    +
    +
    +
    +
    +

    The dispatch queue on which the controller must be used.

    + +

    Unless specified otherwise at initialization time, it is the main queue.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let queue: DispatchQueue
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + setRequest(_:) + +
    +
    +
    +
    +
    +
    +

    Updates the fetch request, and eventually notifies the tracking +callbacks if performFetch() has been called.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setRequest<Request>(_ request: Request)
    +    throws
    +    where Request: FetchRequest, Request.RowDecoder == Record
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Updates the fetch request, and eventually notifies the tracking +callbacks if performFetch() has been called.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setRequest(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers changes notification callbacks.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func trackChanges(
    +    willChange: ((FetchedRecordsController<Record>) -> Void)? = nil,
    +    onChange: ((FetchedRecordsController<Record>, Record, FetchedRecordChange) -> Void)? = nil,
    +    didChange: ((FetchedRecordsController<Record>) -> Void)? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + willChange + + +
    +

    Invoked before records are updated.

    +
    +
    + + onChange + + +
    +

    Invoked for each record that has been added, +removed, moved, or updated.

    +
    +
    + + didChange + + +
    +

    Invoked after records have been updated.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers changes notification callbacks.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func trackChanges<T>(
    +    fetchAlongside: @escaping (Database) throws -> T,
    +    willChange: ((FetchedRecordsController<Record>, _ fetchedAlongside: T) -> Void)? = nil,
    +    onChange: ((FetchedRecordsController<Record>, Record, FetchedRecordChange) -> Void)? = nil,
    +    didChange: ((FetchedRecordsController<Record>, _ fetchedAlongside: T) -> Void)? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + fetchAlongside + + +
    +

    The value returned from this closure is given to +willChange and didChange callbacks, as their +fetchedAlongside argument. The closure is guaranteed to see the +database in the state it has just after eventual changes to the +fetched records have been performed. Use it in order to fetch +values that must be consistent with the fetched records.

    +
    +
    + + willChange + + +
    +

    Invoked before records are updated.

    +
    +
    + + onChange + + +
    +

    Invoked for each record that has been added, +removed, moved, or updated.

    +
    +
    + + didChange + + +
    +

    Invoked after records have been updated.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + trackErrors(_:) + +
    +
    +
    +
    +
    +
    +

    Registers an error callback.

    + +

    Whenever the controller could not look for changes after a transaction +has potentially modified the tracked request, this error handler is +called.

    + +

    The request observation is not stopped, though: future transactions may +successfully be handled, and the notified changes will then be based on +the last successful fetch.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func trackErrors(_ errorHandler: @escaping (FetchedRecordsController<Record>, Error) -> Void)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Call this method when changes performed while the application is +in the background should be processed before the application enters the +suspended state.

    + +

    Whenever the tracked request is changed, the fetched records controller +sets up a background task using +UIApplication.beginBackgroundTask(expirationHandler:) which is ended +after the didChange callback has completed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func allowBackgroundChangesTracking(in application: UIApplication)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Accessing Records

+

+
+
+
    +
  • +
    + + + + fetchedRecords + +
    +
    +
    +
    +
    +
    +

    The fetched records.

    + +

    The value of this property is nil until performFetch() has been called.

    + +

    The records reflect the state of the database after the initial +call to performFetch, and after each database transaction that affects +the results of the fetch request.

    + +

    This property must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var fetchedRecords: [Record] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Configuration

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Call this method when changes performed while the application is +in the background should be processed before the application enters the +suspended state.

    + +

    Whenever the tracked request is changed, the fetched records controller +sets up a background task using +UIApplication.beginBackgroundTask(expirationHandler:) which is ended +after the didChange callback has completed.

    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Accessing Records

+

+
+
+
    +
  • +
    + + + + record(at:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given index path.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func record(at indexPath: IndexPath) -> Record
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + indexPath + + +
    +

    An index path in the fetched records.

    + +

    If indexPath does not describe a valid index path in the fetched +records, a fatal error is raised.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Querying Sections Information

+

+
+
+
    +
  • +
    + + + + sections + +
    +
    +
    +
    +
    +
    +

    The sections for the fetched records.

    + +

    You typically use the sections array when implementing +UITableViewDataSource methods, such as numberOfSectionsInTableView.

    + +

    The sections array is never empty, even when there are no fetched +records. In this case, there is a single empty section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sections: [FetchedRecordsSectionInfo<Record>] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initialization

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a fetched records controller initialized from a SQL query and +its eventual arguments.

    +
    let controller = FetchedRecordsController<Wine>(
    +    dbQueue,
    +    sql: "SELECT * FROM wine WHERE color = ? ORDER BY name",
    +    arguments: [Color.red])
    +
    + +

    The records are compared by primary key (single-column primary key, +compound primary key, or implicit rowid). For a database table which +has an id primary key, this initializer is equivalent to:

    +
    // Assuming the wine table has an `id` primary key:
    +let controller = FetchedRecordsController<Wine>(
    +    dbQueue,
    +    sql: "SELECT * FROM wine WHERE color = ? ORDER BY name",
    +    arguments: [Color.red],
    +    isSameRecord: { (wine1, wine2) in wine1.id == wine2.id })
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ databaseWriter: DatabaseWriter,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil,
    +    queue: DispatchQueue = .main) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + databaseWriter + + +
    +

    A DatabaseWriter (DatabaseQueue, or DatabasePool)

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    + + queue + + +
    +

    A serial dispatch queue (defaults to the main queue)

    + +

    The fetched records controller tracking callbacks will be +notified of changes in this queue. The controller itself must be +used from this queue.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a fetched records controller initialized from a fetch request +from the Query Interface.

    +
    let request = Wine.order(Column("name"))
    +let controller = FetchedRecordsController(
    +    dbQueue,
    +    request: request)
    +
    + +

    The records are compared by primary key (single-column primary key, +compound primary key, or implicit rowid). For a database table which +has an id primary key, this initializer is equivalent to:

    +
    // Assuming the wine table has an `id` primary key:
    +let controller = FetchedRecordsController<Wine>(
    +    dbQueue,
    +    request: request,
    +    isSameRecord: { (wine1, wine2) in wine1.id == wine2.id })
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init<Request>(
    +    _ databaseWriter: DatabaseWriter,
    +    request: Request,
    +    queue: DispatchQueue = .main) throws
    +    where Request: FetchRequest, Request.RowDecoder == Record
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + databaseWriter + + +
    +

    A DatabaseWriter (DatabaseQueue, or DatabasePool)

    +
    +
    + + request + + +
    +

    A fetch request.

    +
    +
    + + queue + + +
    +

    A serial dispatch queue (defaults to the main queue)

    + +

    The fetched records controller tracking callbacks will be +notified of changes in this queue. The controller itself must be +used from this queue.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Record: EncodableRecord

+

+
+
+
    +
  • +
    + + + + indexPath(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the indexPath of a given record.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func indexPath(for record: Record) -> IndexPath?
    + +
    +
    +
    +

    Return Value

    +

    The index path of record in the fetched records, or nil +if record could not be found.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Record.html b/docs/4.8/Classes/Record.html new file mode 100644 index 000000000..ded7e39f4 --- /dev/null +++ b/docs/4.8/Classes/Record.html @@ -0,0 +1,1934 @@ + + + + Record Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Record

+
+
+
open class Record : FetchableRecord, TableRecord, PersistableRecord
+ +
+
+

Record is a class that wraps a table row, or the result of any query. It is +designed to be subclassed.

+ +
+
+
+
+ + +
+ +

Initializers

+

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a Record.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(row:) + +
    +
    +
    +
    +
    +
    +

    Creates a Record from a row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(row: Row)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Core methods

+

+
+
+
    +
  • +
    + + + + databaseTableName + +
    +
    +
    +
    +
    +
    +

    The name of a database table.

    + +

    This table name is required by the insert, update, save, delete, +and exists methods.

    +
    class Player : Record {
    +    override class var databaseTableName: String {
    +        return "player"
    +    }
    +}
    +
    + +

    The implementation of the base class Record raises a fatal error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class var databaseTableName: String { get }
    + +
    +
    +
    +

    Return Value

    +

    The name of a database table.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The policy that handles SQLite conflicts when records are inserted +or updated.

    + +

    This property is optional: its default value uses the ABORT policy +for both insertions and updates, and has GRDB generate regular +INSERT and UPDATE queries.

    + +

    If insertions are resolved with .ignore policy, the +didInsert(with:for:) method is not called upon successful insertion, +even if a row was actually inserted without any conflict.

    + +

    See https://www.sqlite.org/lang_conflict.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class var persistenceConflictPolicy: PersistenceConflictPolicy { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseSelection + +
    +
    +
    +
    +
    +
    +

    The default request selection.

    + +

    Unless this method is overriden, requests select all columns:

    +
    // SELECT * FROM player
    +try Player.fetchAll(db)
    +
    + +

    You can override this property and provide an explicit list +of columns:

    +
    class RestrictedPlayer : Record {
    +    override static var databaseSelection: [SQLSelectable] {
    +        return [Column("id"), Column("name")]
    +    }
    +}
    +
    +// SELECT id, name FROM player
    +try RestrictedPlayer.fetchAll(db)
    +
    + +

    You can also add extra columns such as the rowid column:

    +
    class ExtendedPlayer : Player {
    +    override static var databaseSelection: [SQLSelectable] {
    +        return [AllColumns(), Column.rowID]
    +    }
    +}
    +
    +// SELECT *, rowid FROM player
    +try ExtendedPlayer.fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class var databaseSelection: [SQLSelectable] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + encode(to:) + +
    +
    +
    +
    +
    +
    +

    Defines the values persisted in the database.

    + +

    Store in the container argument all values that should be stored in +the columns of the database table (see Record.databaseTableName()).

    + +

    Primary key columns, if any, must be included.

    +
    class Player : Record {
    +    var id: Int64?
    +    var name: String?
    +
    +    override func encode(to container: inout PersistenceContainer) {
    +        container["id"] = id
    +        container["name"] = name
    +    }
    +}
    +
    + +

    The implementation of the base class Record does not store any value in +the container.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func encode(to container: inout PersistenceContainer)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + didInsert(with:for:) + +
    +
    +
    +
    +
    +
    +

    Notifies the record that it was succesfully inserted.

    + +

    Do not call this method directly: it is called for you, in a protected +dispatch queue, with the inserted RowID and the eventual +INTEGER PRIMARY KEY column name.

    + +

    The implementation of the base Record class does nothing.

    +
    class Player : Record {
    +    var id: Int64?
    +    var name: String?
    +
    +    func didInsert(with rowID: Int64, for column: String?) {
    +        id = rowID
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func didInsert(with rowID: Int64, for column: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + rowID + + +
    +

    The inserted rowID.

    +
    +
    + + column + + +
    +

    The name of the eventual INTEGER PRIMARY KEY column.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Copy

+

+
+
+
    +
  • +
    + + + + copy() + +
    +
    +
    +
    +
    +
    +

    Returns a copy of self, initialized from all values encoded in the +encode(to:) method.

    + +

    The eventual primary key is copied, as well as the +hasDatabaseChanges flag.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func copy() -> Self
    + +
    +
    +
    +

    Return Value

    +

    A copy of self.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Compare with Previous Versions

+

+
+
+
    +
  • +
    + + + + hasDatabaseChanges + +
    +
    +
    +
    +
    +
    +

    A boolean that indicates whether the record has changes that have not +been saved.

    + +

    This flag is purely informative, and does not prevent insert(), +update(), and save() from performing their database queries.

    + +

    A record is edited if has been changed since last database +synchronization (fetch, update, insert). Comparison +is performed between values (values stored in the encode(to:) +method, and values loaded from the database). Property setters do not +trigger this flag.

    + +

    You can rely on the Record base class to compute this flag for you, or +you may set it to true or false when you know better. Setting it to +false does not prevent it from turning true on subsequent modifications +of the record.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var hasDatabaseChanges: Bool { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseChanges + +
    +
    +
    +
    +
    +
    +

    A dictionary of changes that have not been saved.

    + +

    Its keys are column names, and values the old values that have been +changed since last fetching or saving of the record.

    + +

    Unless the record has actually been fetched or saved, the old values +are nil.

    + +

    See hasDatabaseChanges for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseChanges: [String : DatabaseValue?] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

CRUD

+

+
+
+
    +
  • +
    + + + + insert(_:) + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT statement.

    + +

    On success, this method sets the hasDatabaseChanges flag to false.

    + +

    This method is guaranteed to have inserted a row in the database if it +returns without error.

    + +

    Records whose primary key is declared as “INTEGER PRIMARY KEY” have +their id automatically set after successful insertion, if it was nil +before the insertion.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func insert(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + update(_:columns:) + +
    +
    +
    +
    +
    +
    +

    Executes an UPDATE statement.

    + +

    On success, this method sets the hasDatabaseChanges flag to false.

    + +

    This method is guaranteed to have updated a row in the database if it +returns without error.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database and record could not be updated. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func update(_ db: Database, columns: Set<String>) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + columns + + +
    +

    The columns to update.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + updateChanges(_:) + +
    +
    +
    +
    +
    +
    +

    If the record has been changed, executes an UPDATE statement so that +those changes and only those changes are saved in the database.

    + +

    On success, this method sets the hasDatabaseChanges flag to false.

    + +

    This method is guaranteed to have saved the eventual changes in the +database if it returns without error.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database and record could not be updated. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public final func updateChanges(_ db: Database) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + columns + + +
    +

    The columns to update.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the record had changes.

    +
    + +
    +
    +
  • +
  • +
    + + + + save(_:) + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT or an UPDATE statement so that self is saved in +the database.

    + +

    If the record has a non-nil primary key and a matching row in the +database, this method performs an update.

    + +

    Otherwise, performs an insert.

    + +

    On success, this method sets the hasDatabaseChanges flag to false.

    + +

    This method is guaranteed to have inserted or updated a row in the +database if it returns without error.

    + +

    You can’t override this method. Instead, override insert(_:) +or update(_:columns:).

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs, or errors +thrown by update(). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final func save(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Executes a DELETE statement.

    + +

    On success, this method sets the hasDatabaseChanges flag to true.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +open func delete(_ db: Database) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether a database row was deleted.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Row.html b/docs/4.8/Classes/Row.html new file mode 100644 index 000000000..17fc62319 --- /dev/null +++ b/docs/4.8/Classes/Row.html @@ -0,0 +1,3798 @@ + + + + Row Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Row

+
+
+
public final class Row: Equatable, Hashable, RandomAccessCollection,
+    ExpressibleByDictionaryLiteral, CustomStringConvertible,
+    CustomDebugStringConvertible
+ +
+
+

A database row.

+ +
+
+
+
    +
  • +
    + + + + count + +
    +
    +
    +
    +
    +
    +

    The number of columns in the row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let count: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + prefetchedRows + +
    +
    +
    +
    +
    +
    +

    A view on the prefetched associated rows.

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row)
    +// Prints [id:1 name:"Herman Melville"]
    +
    +let bookRows = row.prefetchedRows["books"]
    +print(bookRows[0])
    +// Prints [id:42 title:"Moby-Dick"]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var prefetchedRows: Row.PrefetchedRowsView
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Building rows

+

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates an empty row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a row from a dictionary of values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(_ dictionary: [String : DatabaseValueConvertible?])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a row from [AnyHashable: Any].

    + +

    The result is nil unless all dictionary keys are strings, and values +adopt DatabaseValueConvertible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init?(_ dictionary: [AnyHashable : Any])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + copy() + +
    +
    +
    +
    +
    +
    +

    Returns an immutable copy of the row.

    + +

    For performance reasons, rows fetched from a cursor are reused during +the iteration of a query: make sure to make a copy of it whenever you +want to keep a specific one: row.copy().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func copy() -> Row
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Columns

+

+
+
+
    +
  • +
    + + + + columnNames + +
    +
    +
    +
    +
    +
    +

    The names of columns in the row.

    + +

    Columns appear in the same order as they occur as the .0 member +of column-value pairs in self.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var columnNames: LazyMapCollection<Row, String> { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasColumn(_:) + +
    +
    +
    +
    +
    +
    +

    Returns true if and only if the row has that column.

    + +

    This method is case-insensitive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasColumn(_ columnName: String) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Extracting Values

+

+
+
+
    +
  • +
    + + + + containsNonNullValue + +
    +
    +
    +
    +
    +
    +

    Returns true if and only if one column contains a non-null value, or if +the row was fetched with a row adapter that defines a scoped row that +contains a non-null value.

    + +

    For example:

    +
    let row = try Row.fetchOne(db, sql: "SELECT 'foo', 1")!
    +row.containsNonNullValue // true
    +
    +let row = try Row.fetchOne(db, sql: "SELECT NULL, NULL")!
    +row.containsNonNullValue // false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var containsNonNullValue: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasNull(atIndex:) + +
    +
    +
    +
    +
    +
    +

    Returns true if the row contains null at given index.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    This method is equivalent to row[index] == nil, but may be preferred +in performance-critical code because it can avoid decoding database +values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasNull(atIndex index: Int) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns Int64, Double, String, Data or nil, depending on the value +stored at the given index.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(index: Int) -> DatabaseValueConvertible? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given index, converted to the requested type.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    If the SQLite value is NULL, the result is nil. Otherwise the SQLite +value is converted to the requested type Value. Should this conversion +fail, a fatal error is raised.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(index: Int) -> Value? where Value : DatabaseValueConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given index, converted to the requested type.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    If the SQLite value is NULL, the result is nil. Otherwise the SQLite +value is converted to the requested type Value. Should this conversion +fail, a fatal error is raised.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(index: Int) -> Value? where Value : DatabaseValueConvertible, Value : StatementColumnConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given index, converted to the requested type.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(index: Int) -> Value where Value : DatabaseValueConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given index, converted to the requested type.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(index: Int) -> Value where Value : DatabaseValueConvertible, Value : StatementColumnConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns Int64, Double, String, Data or nil, depending on the value +stored at the given column.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    The result is nil if the row does not contain the column.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(columnName: String) -> DatabaseValueConvertible? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. Otherwise the SQLite value is converted to the requested type +Value. Should this conversion fail, a fatal error is raised.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(columnName: String) -> Value? where Value : DatabaseValueConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. Otherwise the SQLite value is converted to the requested type +Value. Should this conversion fail, a fatal error is raised.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(columnName: String) -> Value? where Value : DatabaseValueConvertible, Value : StatementColumnConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the row does not contain the column, a fatal error is raised.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(columnName: String) -> Value where Value : DatabaseValueConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the row does not contain the column, a fatal error is raised.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(columnName: String) -> Value where Value : DatabaseValueConvertible, Value : StatementColumnConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns Int64, Double, String, NSData or nil, depending on the value +stored at the given column.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    The result is nil if the row does not contain the column.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Column>(column: Column) -> DatabaseValueConvertible? where Column : ColumnExpression { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. Otherwise the SQLite value is converted to the requested type +Value. Should this conversion fail, a fatal error is raised.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value, Column>(column: Column) -> Value? where Value : DatabaseValueConvertible, Column : ColumnExpression { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. Otherwise the SQLite value is converted to the requested type +Value. Should this conversion fail, a fatal error is raised.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value, Column>(_ column: Column)
    +    -> Value?
    +    where
    +    Value: DatabaseValueConvertible & StatementColumnConvertible,
    +    Column: ColumnExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the row does not contain the column, a fatal error is raised.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value, Column>(column: Column) -> Value where Value : DatabaseValueConvertible, Column : ColumnExpression { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the row does not contain the column, a fatal error is raised.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value, Column>(_ column: Column)
    +    -> Value
    +    where
    +    Value: DatabaseValueConvertible & StatementColumnConvertible,
    +    Column: ColumnExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dataNoCopy(atIndex:) + +
    +
    +
    +
    +
    +
    +

    Returns the optional Data at given index.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    If the SQLite value is NULL, the result is nil. If the SQLite value can +not be converted to Data, a fatal error is raised.

    + +

    The returned data does not owns its bytes: it must not be used longer +than the row’s lifetime.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dataNoCopy(atIndex index: Int) -> Data?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dataNoCopy(named:) + +
    +
    +
    +
    +
    +
    +

    Returns the optional Data at given column.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. If the SQLite value can not be converted to Data, a fatal error +is raised.

    + +

    The returned data does not owns its bytes: it must not be used longer +than the row’s lifetime.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dataNoCopy(named columnName: String) -> Data?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dataNoCopy(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the optional NSData at given column.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. If the SQLite value can not be converted to NSData, a fatal error +is raised.

    + +

    The returned data does not owns its bytes: it must not be used longer +than the row’s lifetime.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dataNoCopy<Column>(_ column: Column) -> Data? where Column : ColumnExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Extracting DatabaseValue

+

+
+
+
    +
  • +
    + + + + databaseValues + +
    +
    +
    +
    +
    +
    +

    The database values in the row.

    + +

    Values appear in the same order as they occur as the .1 member +of column-value pairs in self.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValues: LazyMapCollection<Row, DatabaseValue> { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Extracting Records

+

+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the record associated with the given scope.

    + +

    For example:

    +
    let request = Book.including(required: Book.author)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Book(row: row).title)
    +// Prints "Moby-Dick"
    +
    +let author: Author = row["author"]
    +print(author.name)
    +// Prints "Herman Melville"
    +
    + +

    Associated records stored in nested associations are available, too:

    +
    let request = Book.including(required: Book.author.including(required: Author.country))
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Book(row: row).title)
    +// Prints "Moby-Dick"
    +
    +let country: Country = row["country"]
    +print(country.name)
    +// Prints "United States"
    +
    + +

    A fatal error is raised if the scope is not available, or contains only +null values.

    + +

    See https://github.com/groue/GRDB.swift/blob/master/README.md#joined-queries-support +for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript<Record>(scope: String) -> Record where Record : FetchableRecord { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the eventual record associated with the given scope.

    + +

    For example:

    +
    let request = Book.including(optional: Book.author)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Book(row: row).title)
    +// Prints "Moby-Dick"
    +
    +let author: Author? = row["author"]
    +print(author.name)
    +// Prints "Herman Melville"
    +
    + +

    Associated records stored in nested associations are available, too:

    +
    let request = Book.including(optional: Book.author.including(optional: Author.country))
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Book(row: row).title)
    +// Prints "Moby-Dick"
    +
    +let country: Country? = row["country"]
    +print(country.name)
    +// Prints "United States"
    +
    + +

    Nil is returned if the scope is not available, or contains only +null values.

    + +

    See https://github.com/groue/GRDB.swift/blob/master/README.md#joined-queries-support +for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript<Record>(scope: String) -> Record? where Record : FetchableRecord { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the records encoded in the given prefetched rows.

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Author(row: row).name)
    +// Prints "Herman Melville"
    +
    +let books: [Book] = row["books"]
    +print(books[0].title)
    +// Prints "Moby-Dick"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript<Collection>(_ key: String)
    +    -> Collection
    +    where
    +    Collection: RangeReplaceableCollection,
    +    Collection.Element: FetchableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the set of records encoded in the given prefetched rows.

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Author(row: row).name)
    +// Prints "Herman Melville"
    +
    +let books: Set<Book> = row["books"]
    +print(books.first!.title)
    +// Prints "Moby-Dick"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript<Record>(key: String) -> Set<Record> where Record : FetchableRecord, Record : Hashable { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Scopes

+

+
+
+
    +
  • +
    + + + + scopes + +
    +
    +
    +
    +
    +
    +

    Returns a view on the scopes defined by row adapters.

    + +

    For example:

    +
    // Define a tree of nested scopes
    +let adapter = ScopeAdapter([
    +    "foo": RangeRowAdapter(0..<1),
    +    "bar": RangeRowAdapter(1..<2).addingScopes([
    +        "baz" : RangeRowAdapter(2..<3)])])
    +
    +// Fetch
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
    +
    +row.scopes.count  // 2
    +row.scopes.names  // ["foo", "bar"]
    +
    +row.scopes["foo"] // [foo:1]
    +row.scopes["bar"] // [bar:2]
    +row.scopes["baz"] // nil
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var scopes: ScopesView { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + scopesTree + +
    +
    +
    +
    +
    +
    +

    Returns a view on the scopes tree defined by row adapters.

    + +

    For example:

    +
    // Define a tree of nested scopes
    +let adapter = ScopeAdapter([
    +    "foo": RangeRowAdapter(0..<1),
    +    "bar": RangeRowAdapter(1..<2).addingScopes([
    +        "baz" : RangeRowAdapter(2..<3)])])
    +
    +// Fetch
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
    +
    +row.scopesTree.names  // ["foo", "bar", "baz"]
    +
    +row.scopesTree["foo"] // [foo:1]
    +row.scopesTree["bar"] // [bar:2]
    +row.scopesTree["baz"] // [baz:3]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var scopesTree: ScopesTreeView { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unscoped + +
    +
    +
    +
    +
    +
    +

    Returns a copy of the row, without any scopes.

    + +

    This property can turn out useful when you want to test the content of +adapted rows, such as rows fetched from joined requests.

    +
    let row = ...
    +// Failure because row equality tests for row scopes:
    +XCTAssertEqual(row, ["id": 1, "name": "foo"])
    +// Success:
    +XCTAssertEqual(row.unscoped, ["id": 1, "name": "foo"])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var unscoped: Row { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unadapted + +
    +
    +
    +
    +
    +
    +

    Return the raw row fetched from the database.

    + +

    This property can turn out useful when you debug the consumption of +adapted rows, such as rows fetched from joined requests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var unadapted: Row { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over rows fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT ...")
    +let rows = try Row.fetchCursor(statement) // RowCursor
    +while let row = try rows.next() { // Row
    +    let id: Int64 = row[0]
    +    let name: String = row[1]
    +}
    +
    + +

    Fetched rows are reused during the cursor iteration: don’t turn a row +cursor into an array with Array(rows) or rows.filter { ... } since +you would not get the distinct rows you expect. Use Row.fetchAll(...) +instead.

    + +

    For the same reason, make sure you make a copy whenever you extract a +row for later use: row.copy().

    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> RowCursor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched rows.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of rows fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT ...")
    +let rows = try Row.fetchAll(statement)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Row]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of rows.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a single row fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT ...")
    +let row = try Row.fetchOne(statement)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> Row?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional row.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over rows fetched from an SQL query.

    +
    let rows = try Row.fetchCursor(db, sql: "SELECT id, name FROM player") // RowCursor
    +while let row = try rows.next() { // Row
    +    let id: Int64 = row[0]
    +    let name: String = row[1]
    +}
    +
    + +

    Fetched rows are reused during the cursor iteration: don’t turn a row +cursor into an array with Array(rows) or rows.filter { ... } since +you would not get the distinct rows you expect. Use Row.fetchAll(...) +instead.

    + +

    For the same reason, make sure you make a copy whenever you extract a +row for later use: row.copy().

    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> RowCursor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched rows.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of rows fetched from an SQL query.

    +
    let rows = try Row.fetchAll(db, sql: "SELECT id, name FROM player") // [Row]
    +for row in rows {
    +    let id: Int64 = row[0]
    +    let name: String = row[1]
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Row]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of rows.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a single row fetched from an SQL query.

    +
    let row = try Row.fetchOne(db, sql: "SELECT id, name FROM player") // Row?
    +if let row = row {
    +    let id: Int64 = row[0]
    +    let name: String = row[1]
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> Row?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional row.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over rows fetched from a fetch request.

    +
    let request = Player.all()
    +let rows = try Row.fetchCursor(db, request) // RowCursor
    +while let row = try rows.next() { // Row
    +    let id: Int64 = row["id"]
    +    let name: String = row["name"]
    +}
    +
    + +

    Fetched rows are reused during the cursor iteration: don’t turn a row +cursor into an array with Array(rows) or rows.filter { ... } since +you would not get the distinct rows you expect. Use Row.fetchAll(...) +instead.

    + +

    For the same reason, make sure you make a copy whenever you extract a +row for later use: row.copy().

    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R>(_ db: Database, _ request: R) throws -> RowCursor where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched rows.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an array of rows fetched from a fetch request.

    +
    let request = Player.all()
    +let rows = try Row.fetchAll(db, request)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Row] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of rows.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns a single row fetched from a fetch request.

    +
    let request = Player.filter(key: 1)
    +let row = try Row.fetchOne(db, request)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<R>(_ db: Database, _ request: R) throws -> Row? where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional row.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

RowCursor

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a row initialized with elements. Column order is preserved, and +duplicated columns names are allowed.

    +
    let row: Row = ["foo": 1, "foo": "bar", "baz": nil]
    +print(row)
    +// Prints [foo:1 foo:"bar" baz:NULL]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(dictionaryLiteral elements: (String, DatabaseValueConvertible?)...)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Row as a Collection of (ColumnName, DatabaseValue) Pairs

+

+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses the (ColumnName, DatabaseValue) pair at given index.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(position: RowIndex) -> (String, DatabaseValue) { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Row.ScopesView

+

+
+
+
    +
  • +
    + + + + ScopesView + +
    +
    +
    +
    +
    +
    +

    A view of the scopes defined by row adapters. It is a collection of +tuples made of a scope name and a scoped row, which behaves like a +dictionary.

    + +

    For example:

    +
    // Define a tree of nested scopes
    +let adapter = ScopeAdapter([
    +    "foo": RangeRowAdapter(0..<1),
    +    "bar": RangeRowAdapter(1..<2).addingScopes([
    +        "baz" : RangeRowAdapter(2..<3)])])
    +
    +// Fetch
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
    +
    +row.scopes.count  // 2
    +row.scopes.names  // ["foo", "bar"]
    +
    +row.scopes["foo"] // [foo:1]
    +row.scopes["bar"] // [bar:2]
    +row.scopes["baz"] // nil
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ScopesView : Collection
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Row.ScopesTreeView

+

+
+
+
    +
  • +
    + + + + ScopesTreeView + +
    +
    +
    +
    +
    +
    +

    A view on the scopes tree defined by row adapters.

    + +

    For example:

    +
    // Define a tree of nested scopes
    +let adapter = ScopeAdapter([
    +    "foo": RangeRowAdapter(0..<1),
    +    "bar": RangeRowAdapter(1..<2).addingScopes([
    +        "baz" : RangeRowAdapter(2..<3)])])
    +
    +// Fetch
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
    +
    +row.scopesTree.names  // ["foo", "bar", "baz"]
    +
    +row.scopesTree["foo"] // [foo:1]
    +row.scopesTree["bar"] // [bar:2]
    +row.scopesTree["baz"] // [baz:3]
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ScopesTreeView
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Row.PrefetchedRowsView

+

+
+
+
    +
  • +
    + + + + PrefetchedRowsView + +
    +
    +
    +
    +
    +
    +

    A view on the prefetched associated rows.

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row)
    +// Prints [id:1 name:"Herman Melville"]
    +
    +let bookRows = row.prefetchedRows["books"]
    +print(bookRows[0])
    +// Prints [id:42 title:"Moby-Dick"]
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct PrefetchedRowsView : Equatable
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Row/PrefetchedRowsView.html b/docs/4.8/Classes/Row/PrefetchedRowsView.html new file mode 100644 index 000000000..72e260e52 --- /dev/null +++ b/docs/4.8/Classes/Row/PrefetchedRowsView.html @@ -0,0 +1,1205 @@ + + + + PrefetchedRowsView Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PrefetchedRowsView

+
+
+
public struct PrefetchedRowsView : Equatable
+ +
+
+

A view on the prefetched associated rows.

+ +

For example:

+
let request = Author.including(all: Author.books)
+let row = try Row.fetchOne(db, request)!
+
+print(row)
+// Prints [id:1 name:"Herman Melville"]
+
+let bookRows = row.prefetchedRows["books"]
+print(bookRows[0])
+// Prints [id:42 title:"Moby-Dick"]
+
+ +
+
+
+
    +
  • +
    + + + + isEmpty + +
    +
    +
    +
    +
    +
    +

    True if there is no prefetched associated rows.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isEmpty: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + keys + +
    +
    +
    +
    +
    +
    +

    The keys for available prefetched rows

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row.prefetchedRows.keys)
    +// Prints ["books"]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var keys: Set<String> { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the prefetched rows associated with the given key.

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row)
    +// Prints [id:1 name:"Herman Melville"]
    +
    +let bookRows = row.prefetchedRows["books"]
    +print(bookRows[0])
    +// Prints [id:42 title:"Moby-Dick"]
    +
    + +

    Prefetched rows stored in nested “to-one” associations are +available, too.

    + +

    Nil is returned if the key is not available.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(key: String) -> [Row]? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Row/ScopesTreeView.html b/docs/4.8/Classes/Row/ScopesTreeView.html new file mode 100644 index 000000000..32434cd6c --- /dev/null +++ b/docs/4.8/Classes/Row/ScopesTreeView.html @@ -0,0 +1,1182 @@ + + + + ScopesTreeView Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ScopesTreeView

+
+
+
public struct ScopesTreeView
+ +
+
+

A view on the scopes tree defined by row adapters.

+ +

For example:

+
// Define a tree of nested scopes
+let adapter = ScopeAdapter([
+    "foo": RangeRowAdapter(0..<1),
+    "bar": RangeRowAdapter(1..<2).addingScopes([
+        "baz" : RangeRowAdapter(2..<3)])])
+
+// Fetch
+let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
+let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
+
+row.scopesTree.names  // ["foo", "bar", "baz"]
+
+row.scopesTree["foo"] // [foo:1]
+row.scopesTree["bar"] // [bar:2]
+row.scopesTree["baz"] // [baz:3]
+
+ +
+
+
+
    +
  • +
    + + + + names + +
    +
    +
    +
    +
    +
    +

    The scopes defined on this row, recursively.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var names: Set<String> { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the row associated with the given scope.

    + +

    For example:

    +
    let request = Book.including(required: Book.author)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row)
    +// Prints [id:42 title:"Moby-Dick"]
    +
    +let authorRow = row.scopesTree["author"]
    +print(authorRow)
    +// Prints [id:1 name:"Herman Melville"]
    +
    + +

    Associated rows stored in nested associations are available, too:

    +
    let request = Book.including(required: Book.author.including(required: Author.country))
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row)
    +// Prints [id:42 title:"Moby-Dick"]
    +
    +let countryRow = row.scopesTree["country"]
    +print(countryRow)
    +// Prints [code:"US" name:"United States"]
    +
    + +

    Nil is returned if the scope is not available.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(name: String) -> Row? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Row/ScopesView.html b/docs/4.8/Classes/Row/ScopesView.html new file mode 100644 index 000000000..fc0c84b34 --- /dev/null +++ b/docs/4.8/Classes/Row/ScopesView.html @@ -0,0 +1,1189 @@ + + + + ScopesView Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ScopesView

+
+
+
public struct ScopesView : Collection
+ +
+
+

A view of the scopes defined by row adapters. It is a collection of +tuples made of a scope name and a scoped row, which behaves like a +dictionary.

+ +

For example:

+
// Define a tree of nested scopes
+let adapter = ScopeAdapter([
+    "foo": RangeRowAdapter(0..<1),
+    "bar": RangeRowAdapter(1..<2).addingScopes([
+        "baz" : RangeRowAdapter(2..<3)])])
+
+// Fetch
+let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
+let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
+
+row.scopes.count  // 2
+row.scopes.names  // ["foo", "bar"]
+
+row.scopes["foo"] // [foo:1]
+row.scopes["bar"] // [bar:2]
+row.scopes["baz"] // nil
+
+ +
+
+
+
    +
  • +
    + + + + Index + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Index = Dictionary<String, LayoutedRowAdapter>.Index
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + names + +
    +
    +
    +
    +
    +
    +

    The scopes defined on this row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var names: Dictionary<String, LayoutedRowAdapter>.Keys { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the row associated with the given scope, or nil if the +scope is not defined.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(name: String) -> Row? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/RowCursor.html b/docs/4.8/Classes/RowCursor.html new file mode 100644 index 000000000..7ebb67f61 --- /dev/null +++ b/docs/4.8/Classes/RowCursor.html @@ -0,0 +1,1112 @@ + + + + RowCursor Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

RowCursor

+
+
+
public final class RowCursor : Cursor
+ +
+
+

A cursor of database rows. For example:

+
try dbQueue.read { db in
+    let rows: RowCursor = try Row.fetchCursor(db, sql: "SELECT * FROM player")
+}
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/SelectStatement.html b/docs/4.8/Classes/SelectStatement.html new file mode 100644 index 000000000..0f7753326 --- /dev/null +++ b/docs/4.8/Classes/SelectStatement.html @@ -0,0 +1,1208 @@ + + + + SelectStatement Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SelectStatement

+
+
+
public final class SelectStatement : Statement
+
extension SelectStatement: RowLayout
+ +
+
+

A subclass of Statement that fetches database rows.

+ +

You create SelectStatement with the Database.makeSelectStatement() method:

+
try dbQueue.read { db in
+    let statement = try db.makeSelectStatement(sql: "SELECT COUNT(*) FROM player WHERE score > ?")
+    let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
+    let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
+}
+
+ +
+
+
+
    +
  • +
    + + + + databaseRegion + +
    +
    +
    +
    +
    +
    +

    The database region that the statement looks into.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var databaseRegion: DatabaseRegion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + columnCount + +
    +
    +
    +
    +
    +
    +

    The number of columns in the resulting rows.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var columnCount: Int { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + columnNames + +
    +
    +
    +
    +
    +
    +

    The column names, ordered from left to right.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public lazy var columnNames: [String] { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + index(ofColumn:) + +
    +
    +
    +
    +
    +
    +

    Returns the index of the leftmost column named name, in a +case-insensitive way.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func index(ofColumn name: String) -> Int?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/Statement.html b/docs/4.8/Classes/Statement.html new file mode 100644 index 000000000..201a36f69 --- /dev/null +++ b/docs/4.8/Classes/Statement.html @@ -0,0 +1,1245 @@ + + + + Statement Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Statement

+
+
+
public class Statement
+ +
+
+

A statement represents an SQL query.

+ +

It is the base class of UpdateStatement that executes update statements, +and SelectStatement that fetches rows.

+ +
+
+
+
    +
  • +
    + + + + sqliteStatement + +
    +
    +
    +
    +
    +
    +

    The raw SQLite statement, suitable for the SQLite C API.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let sqliteStatement: SQLiteStatement
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + sql + +
    +
    +
    +
    +
    +
    +

    The SQL query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sql: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Arguments

+

+
+
+
    +
  • +
    + + + + arguments + +
    +
    +
    +
    +
    +
    +

    The statement arguments.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var arguments: StatementArguments { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(arguments:) + +
    +
    +
    +
    +
    +
    +

    Throws a DatabaseError of code SQLITE_ERROR if arguments don’t fill all +statement arguments.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func validate(arguments: StatementArguments) throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Set arguments without any validation. Trades safety for performance.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeSetArguments(_ arguments: StatementArguments)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/TableAlias.html b/docs/4.8/Classes/TableAlias.html new file mode 100644 index 000000000..078395d37 --- /dev/null +++ b/docs/4.8/Classes/TableAlias.html @@ -0,0 +1,1172 @@ + + + + TableAlias Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableAlias

+
+
+
public class TableAlias : Hashable
+ +
+
+

Experimental

+ +

A TableAlias identifies a table in a request.

+ +
+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String? = nil)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a qualified value that is able to resolve ambiguities in +joined queries.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(selectable: SQLSelectable) -> SQLSelectable { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a qualified expression that is able to resolve ambiguities in +joined queries.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(expression: SQLExpression) -> SQLExpression { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/TableAlteration.html b/docs/4.8/Classes/TableAlteration.html new file mode 100644 index 000000000..85b59ceff --- /dev/null +++ b/docs/4.8/Classes/TableAlteration.html @@ -0,0 +1,1160 @@ + + + + TableAlteration Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableAlteration

+
+
+
public final class TableAlteration
+ +
+
+

The TableAlteration class lets you alter database tables.

+ +

You don’t create instances of this class. Instead, you use the Database +alter(table:) method:

+
try db.alter(table: "player") { t in // t is TableAlteration
+    t.add(column: ...)
+}
+
+ +

See https://www.sqlite.org/lang_altertable.html

+ +
+
+
+
    +
  • +
    + + + + add(column:_:) + +
    +
    +
    +
    +
    +
    +

    Appends a column to the table.

    +
    try db.alter(table: "player") { t in
    +    t.add(column: "url", .text)
    +}
    +
    + +

    See https://www.sqlite.org/lang_altertable.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func add(column name: String, _ type: Database.ColumnType? = nil) -> ColumnDefinition
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    the column name.

    +
    +
    + + type + + +
    +

    the column type.

    +
    +
    +
    +
    +

    Return Value

    +

    An ColumnDefinition that allows you to refine the +column definition.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/TableDefinition.html b/docs/4.8/Classes/TableDefinition.html new file mode 100644 index 000000000..e6c1b2140 --- /dev/null +++ b/docs/4.8/Classes/TableDefinition.html @@ -0,0 +1,1624 @@ + + + + TableDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableDefinition

+
+
+
public final class TableDefinition
+ +
+
+

The TableDefinition class lets you define table columns and constraints.

+ +

You don’t create instances of this class. Instead, you use the Database +create(table:) method:

+
try db.create(table: "player") { t in // t is TableDefinition
+    t.column(...)
+}
+
+ +

See https://www.sqlite.org/lang_createtable.html

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Defines the auto-incremented primary key.

    +
    try db.create(table: "player") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +}
    +
    + +

    The auto-incremented primary key is an integer primary key that +automatically generates unused values when you do not explicitly +provide one, and prevents the reuse of ids over the lifetime of +the database.

    + +

    It is the preferred way to define a numeric primary key.

    + +

    The fact that an auto-incremented primary key prevents the reuse of +ids is an excellent guard against data races that could happen when your +application processes ids in an asynchronous way. The auto-incremented +primary key provides the guarantee that a given id can’t reference a row +that is different from the one it used to be at the beginning of the +asynchronous process, even if this row gets deleted and a new one is +inserted in between.

    + +

    See https://www.sqlite.org/lang_createtable.html#primkeyconst and +https://www.sqlite.org/lang_createtable.html#rowid

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func autoIncrementedPrimaryKey(
    +    _ name: String,
    +    onConflict conflictResolution: Database.ConflictResolution? = nil)
    +    -> ColumnDefinition
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + column(_:_:) + +
    +
    +
    +
    +
    +
    +

    Appends a table column.

    +
    try db.create(table: "player") { t in
    +    t.column("name", .text)
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#tablecoldef

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func column(_ name: String, _ type: Database.ColumnType? = nil) -> ColumnDefinition
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    the column name.

    +
    +
    + + type + + +
    +

    the eventual column type.

    +
    +
    +
    +
    +

    Return Value

    +

    An ColumnDefinition that allows you to refine the +column definition.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Defines the table primary key.

    +
    try db.create(table: "citizenship") { t in
    +    t.column("citizenID", .integer)
    +    t.column("countryCode", .text)
    +    t.primaryKey(["citizenID", "countryCode"])
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#primkeyconst and +https://www.sqlite.org/lang_createtable.html#rowid

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primaryKey(_ columns: [String], onConflict conflictResolution: Database.ConflictResolution? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + columns + + +
    +

    The primary key columns.

    +
    +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a unique key.

    +
    try db.create(table: "place") { t in
    +    t.column("latitude", .double)
    +    t.column("longitude", .double)
    +    t.uniqueKey(["latitude", "longitude"])
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#uniqueconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func uniqueKey(_ columns: [String], onConflict conflictResolution: Database.ConflictResolution? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + columns + + +
    +

    The unique key columns.

    +
    +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a foreign key.

    +
    try db.create(table: "passport") { t in
    +    t.column("issueDate", .date)
    +    t.column("citizenID", .integer)
    +    t.column("countryCode", .text)
    +    t.foreignKey(["citizenID", "countryCode"], references: "citizenship", onDelete: .cascade)
    +}
    +
    + +

    See https://www.sqlite.org/foreignkeys.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func foreignKey(
    +    _ columns: [String],
    +    references table: String,
    +    columns destinationColumns: [String]? = nil,
    +    onDelete deleteAction: Database.ForeignKeyAction? = nil,
    +    onUpdate updateAction: Database.ForeignKeyAction? = nil,
    +    deferred: Bool = false)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + columns + + +
    +

    The foreign key columns.

    +
    +
    + + table + + +
    +

    The referenced table.

    +
    +
    + + destinationColumns + + +
    +

    The columns in the referenced table. If not +specified, the columns of the primary key of the referenced table +are used.

    +
    +
    + + deleteAction + + +
    +

    Optional action when the referenced row is deleted.

    +
    +
    + + updateAction + + +
    +

    Optional action when the referenced row is updated.

    +
    +
    + + deferred + + +
    +

    If true, defines a deferred foreign key constraint. +See https://www.sqlite.org/foreignkeys.html#fk_deferred.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + check(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a CHECK constraint.

    +
    try db.create(table: "player") { t in
    +    t.column("personalPhone", .text)
    +    t.column("workPhone", .text)
    +    let personalPhone = Column("personalPhone")
    +    let workPhone = Column("workPhone")
    +    t.check(personalPhone != nil || workPhone != nil)
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#ckconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func check(_ condition: SQLExpressible)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + condition + + +
    +

    The checked condition

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + check(sql:) + +
    +
    +
    +
    +
    +
    +

    Adds a CHECK constraint.

    +
    try db.create(table: "player") { t in
    +    t.column("personalPhone", .text)
    +    t.column("workPhone", .text)
    +    t.check(sql: "personalPhone IS NOT NULL OR workPhone IS NOT NULL")
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#ckconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func check(sql: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL snippet

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Classes/UpdateStatement.html b/docs/4.8/Classes/UpdateStatement.html new file mode 100644 index 000000000..6efd3739a --- /dev/null +++ b/docs/4.8/Classes/UpdateStatement.html @@ -0,0 +1,1141 @@ + + + + UpdateStatement Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UpdateStatement

+
+
+
public final class UpdateStatement : Statement
+ +
+
+

A subclass of Statement that executes SQL queries.

+ +

You create UpdateStatement with the Database.makeUpdateStatement() method:

+
try dbQueue.inTransaction { db in
+    let statement = try db.makeUpdateStatement(sql: "INSERT INTO player (name) VALUES (?)")
+    try statement.execute(arguments: ["Arthur"])
+    try statement.execute(arguments: ["Barbara"])
+    return .commit
+}
+
+ +
+
+
+
    +
  • +
    + + + + execute(arguments:) + +
    +
    +
    +
    +
    +
    +

    Executes the SQL query.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func execute(arguments: StatementArguments? = nil) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums.html b/docs/4.8/Enums.html new file mode 100644 index 000000000..4de2ac4f9 --- /dev/null +++ b/docs/4.8/Enums.html @@ -0,0 +1,1474 @@ + + + + Enumerations Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Enumerations

+

The following enumerations are available globally.

+ +
+
+
+
+ + +
+ +

Database events

+

+
+
+
    +
  • +
    + + + + DatabaseEventKind + +
    +
    +
    +
    +
    +
    +

    A kind of database event. See the TransactionObserver protocol for +more information.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DatabaseEventKind
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Logical Operators (AND, OR, NOT)

+

+
+
+ +
+
+
+ + +
+ +

DatabaseDateEncodingStrategy

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    DatabaseDateEncodingStrategy specifies how EncodableRecord types that also +adopt the standard Encodable protocol encode their date properties.

    + +

    For example:

    +
    struct Player: EncodableRecord, Encodable {
    +    static let databaseDateEncodingStrategy: DatabaseDateEncodingStrategy = .timeIntervalSince1970
    +
    +    var name: String
    +    var registrationDate: Date // encoded as an epoch timestamp
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DatabaseDateEncodingStrategy
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseUUIDEncodingStrategy

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    DatabaseUUIDEncodingStrategy specifies how EncodableRecord types that also +adopt the standard Encodable protocol encode their UUID properties.

    + +

    For example:

    +
    struct Player: EncodableProtocol, Encodable {
    +    static let databaseUUIDEncodingStrategy: DatabaseUUIDEncodingStrategy = .string
    +
    +    // encoded in a string like "E621E1F8-C36C-495A-93FC-0C247A3E6E5F"
    +    var uuid: UUID
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DatabaseUUIDEncodingStrategy
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseDateDecodingStrategy

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    DatabaseDateDecodingStrategy specifies how FetchableRecord types that also +adopt the standard Decodable protocol decode their date properties.

    + +

    For example:

    +
    struct Player: FetchableRecord, Decodable {
    +    static let databaseDateDecodingStrategy: DatabaseDateDecodingStrategy = .timeIntervalSince1970
    +
    +    var name: String
    +    var registrationDate: Date // decoded from epoch timestamp
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DatabaseDateDecodingStrategy
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

UITableView Support

+

+
+
+
    +
  • +
    + + + + FetchedRecordChange + +
    +
    +
    +
    +
    +
    +

    A record change, given by a FetchedRecordsController to its change callback.

    + +

    The move and update events hold a changes dictionary, whose keys are +column names, and values the old values that have been changed.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum FetchedRecordChange
    +
    extension FetchedRecordChange: CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + PersistenceError + +
    +
    +
    +
    +
    +
    +

    An error thrown by a type that adopts PersistableRecord.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum PersistenceError : Error, CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ValueScheduling

+

+
+
+
    +
  • +
    + + + + ValueScheduling + +
    +
    +
    +
    +
    +
    +

    ValueScheduling controls how ValueObservation schedules the notifications +of fresh values to your application.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ValueScheduling
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ValueReducers + +
    +
    +
    +
    +
    +
    +

    A namespace for types related to the ValueReducer protocol.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ValueReducers
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/DatabaseDateDecodingStrategy.html b/docs/4.8/Enums/DatabaseDateDecodingStrategy.html new file mode 100644 index 000000000..e8165c238 --- /dev/null +++ b/docs/4.8/Enums/DatabaseDateDecodingStrategy.html @@ -0,0 +1,1321 @@ + + + + DatabaseDateDecodingStrategy Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseDateDecodingStrategy

+
+
+
public enum DatabaseDateDecodingStrategy
+ +
+
+

DatabaseDateDecodingStrategy specifies how FetchableRecord types that also +adopt the standard Decodable protocol decode their date properties.

+ +

For example:

+
struct Player: FetchableRecord, Decodable {
+    static let databaseDateDecodingStrategy: DatabaseDateDecodingStrategy = .timeIntervalSince1970
+
+    var name: String
+    var registrationDate: Date // decoded from epoch timestamp
+}
+
+ +
+
+
+
    +
  • +
    + + + + deferredToDate + +
    +
    +
    +
    +
    +
    +

    The strategy that uses formatting from the Date structure.

    + +

    It decodes numeric values as a number of seconds since Epoch +(midnight UTC on January 1st, 1970).

    + +

    It decodes strings in the following formats, assuming UTC time zone. +Missing components are assumed to be zero:

    + +
      +
    • YYYY-MM-DD
    • +
    • YYYY-MM-DD HH:MM
    • +
    • YYYY-MM-DD HH:MM:SS
    • +
    • YYYY-MM-DD HH:MM:SS.SSS
    • +
    • YYYY-MM-DDTHH:MM
    • +
    • YYYY-MM-DDTHH:MM:SS
    • +
    • YYYY-MM-DDTHH:MM:SS.SSS
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deferredToDate
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Decodes numeric values as a number of seconds between the date and +midnight UTC on 1 January 2001

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case timeIntervalSinceReferenceDate
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + timeIntervalSince1970 + +
    +
    +
    +
    +
    +
    +

    Decodes numeric values as a number of seconds between the date and +midnight UTC on 1 January 1970

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case timeIntervalSince1970
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + millisecondsSince1970 + +
    +
    +
    +
    +
    +
    +

    Decodes numeric values as a number of milliseconds between the date and +midnight UTC on 1 January 1970

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case millisecondsSince1970
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + iso8601 + +
    +
    +
    +
    +
    +
    +

    Decodes dates according to the ISO 8601 standards

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case iso8601
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + formatted(_:) + +
    +
    +
    +
    +
    +
    +

    Decodes a String, according to the provided formatter

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case formatted(DateFormatter)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + custom(_:) + +
    +
    +
    +
    +
    +
    +

    Decodes according to the user-provided function.

    + +

    If the database value does not contain a suitable value, the function +must return nil (GRDB will interpret this nil result as a conversion +error, and react accordingly).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case custom((DatabaseValue) -> Date?)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/DatabaseDateEncodingStrategy.html b/docs/4.8/Enums/DatabaseDateEncodingStrategy.html new file mode 100644 index 000000000..59b9311c1 --- /dev/null +++ b/docs/4.8/Enums/DatabaseDateEncodingStrategy.html @@ -0,0 +1,1335 @@ + + + + DatabaseDateEncodingStrategy Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseDateEncodingStrategy

+
+
+
public enum DatabaseDateEncodingStrategy
+ +
+
+

DatabaseDateEncodingStrategy specifies how EncodableRecord types that also +adopt the standard Encodable protocol encode their date properties.

+ +

For example:

+
struct Player: EncodableRecord, Encodable {
+    static let databaseDateEncodingStrategy: DatabaseDateEncodingStrategy = .timeIntervalSince1970
+
+    var name: String
+    var registrationDate: Date // encoded as an epoch timestamp
+}
+
+ +
+
+
+
    +
  • +
    + + + + deferredToDate + +
    +
    +
    +
    +
    +
    +

    The strategy that uses formatting from the Date structure.

    + +

    It encodes dates using the format “YYYY-MM-DD HH:MM:SS.SSS” in the +UTC time zone.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deferredToDate
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Encodes a Double: the number of seconds between the date and +midnight UTC on 1 January 2001

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case timeIntervalSinceReferenceDate
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + timeIntervalSince1970 + +
    +
    +
    +
    +
    +
    +

    Encodes a Double: the number of seconds between the date and +midnight UTC on 1 January 1970

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case timeIntervalSince1970
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + secondsSince1970 + +
    +
    +
    +
    +
    +
    +

    Encodes an Int64: the number of seconds between the date and +midnight UTC on 1 January 1970

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case secondsSince1970
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + millisecondsSince1970 + +
    +
    +
    +
    +
    +
    +

    Encodes an Int64: the number of milliseconds between the date and +midnight UTC on 1 January 1970

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case millisecondsSince1970
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + iso8601 + +
    +
    +
    +
    +
    +
    +

    Encodes dates according to the ISO 8601 and RFC 3339 standards

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case iso8601
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + formatted(_:) + +
    +
    +
    +
    +
    +
    +

    Encodes a String, according to the provided formatter

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case formatted(DateFormatter)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + custom(_:) + +
    +
    +
    +
    +
    +
    +

    Encodes the result of the user-provided function

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case custom((Date) -> DatabaseValueConvertible?)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/DatabaseEventKind.html b/docs/4.8/Enums/DatabaseEventKind.html new file mode 100644 index 000000000..411b45f74 --- /dev/null +++ b/docs/4.8/Enums/DatabaseEventKind.html @@ -0,0 +1,1212 @@ + + + + DatabaseEventKind Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseEventKind

+
+
+
public enum DatabaseEventKind
+ +
+
+

A kind of database event. See the TransactionObserver protocol for +more information.

+ +
+
+
+
    +
  • +
    + + + + insert(tableName:) + +
    +
    +
    +
    +
    +
    +

    The insertion of a row in a database table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case insert(tableName: String)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + delete(tableName:) + +
    +
    +
    +
    +
    +
    +

    The deletion of a row in a database table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case delete(tableName: String)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The update of a set of columns in a database table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case update(tableName: String, columnNames: Set<String>)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database events

+

+
+
+
    +
  • +
    + + + + tableName + +
    +
    +
    +
    +
    +
    +

    The impacted database table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var tableName: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/DatabaseUUIDEncodingStrategy.html b/docs/4.8/Enums/DatabaseUUIDEncodingStrategy.html new file mode 100644 index 000000000..9d9cfb202 --- /dev/null +++ b/docs/4.8/Enums/DatabaseUUIDEncodingStrategy.html @@ -0,0 +1,1150 @@ + + + + DatabaseUUIDEncodingStrategy Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseUUIDEncodingStrategy

+
+
+
public enum DatabaseUUIDEncodingStrategy
+ +
+
+

DatabaseUUIDEncodingStrategy specifies how EncodableRecord types that also +adopt the standard Encodable protocol encode their UUID properties.

+ +

For example:

+
struct Player: EncodableProtocol, Encodable {
+    static let databaseUUIDEncodingStrategy: DatabaseUUIDEncodingStrategy = .string
+
+    // encoded in a string like "E621E1F8-C36C-495A-93FC-0C247A3E6E5F"
+    var uuid: UUID
+}
+
+ +
+
+
+
    +
  • +
    + + + + deferredToUUID + +
    +
    +
    +
    +
    +
    +

    The strategy that uses formatting from the UUID type.

    + +

    It encodes UUIDs as 16-bytes data blobs.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deferredToUUID
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + string + +
    +
    +
    +
    +
    +
    +

    Encodes UUIDs as strings such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case string
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/FetchedRecordChange.html b/docs/4.8/Enums/FetchedRecordChange.html new file mode 100644 index 000000000..6fdcb0ea7 --- /dev/null +++ b/docs/4.8/Enums/FetchedRecordChange.html @@ -0,0 +1,1248 @@ + + + + FetchedRecordChange Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FetchedRecordChange

+
+
+
public enum FetchedRecordChange
+
extension FetchedRecordChange: CustomStringConvertible
+ +
+
+

A record change, given by a FetchedRecordsController to its change callback.

+ +

The move and update events hold a changes dictionary, whose keys are +column names, and values the old values that have been changed.

+ +
+
+
+
    +
  • +
    + + + + insertion(indexPath:) + +
    +
    +
    +
    +
    +
    +

    An insertion event, at given indexPath.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case insertion(indexPath: IndexPath)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + deletion(indexPath:) + +
    +
    +
    +
    +
    +
    +

    A deletion event, at given indexPath.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deletion(indexPath: IndexPath)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A move event, from indexPath to newIndexPath. The changes are a +dictionary whose keys are column names, and values the old values that +have been changed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case move(indexPath: IndexPath, newIndexPath: IndexPath, changes: [String : DatabaseValue])
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An update event, at given indexPath. The changes are a dictionary +whose keys are column names, and values the old values that have +been changed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case update(indexPath: IndexPath, changes: [String : DatabaseValue])
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

UITableView Support

+

+
+
+
    +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/PersistenceError.html b/docs/4.8/Enums/PersistenceError.html new file mode 100644 index 000000000..fa8dd1703 --- /dev/null +++ b/docs/4.8/Enums/PersistenceError.html @@ -0,0 +1,1114 @@ + + + + PersistenceError Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PersistenceError

+
+
+
public enum PersistenceError : Error, CustomStringConvertible
+ +
+
+

An error thrown by a type that adopts PersistableRecord.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Thrown by MutablePersistableRecord.update() when no matching row could be +found in the database.

    + +
      +
    • databaseTableName: the table of the unfound record
    • +
    • key: the key of the unfound record (column and values)
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case recordNotFound(databaseTableName: String, key: [String : DatabaseValue])
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/SQLLogicalBinaryOperator.html b/docs/4.8/Enums/SQLLogicalBinaryOperator.html new file mode 100644 index 000000000..693ed1f00 --- /dev/null +++ b/docs/4.8/Enums/SQLLogicalBinaryOperator.html @@ -0,0 +1,1138 @@ + + + + SQLLogicalBinaryOperator Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SQLLogicalBinaryOperator

+
+
+
public enum SQLLogicalBinaryOperator
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + and + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case and
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + or + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case or
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/ValueReducers.html b/docs/4.8/Enums/ValueReducers.html new file mode 100644 index 000000000..910e134af --- /dev/null +++ b/docs/4.8/Enums/ValueReducers.html @@ -0,0 +1,1417 @@ + + + + ValueReducers Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ValueReducers

+
+
+
public enum ValueReducers
+ +
+
+

A namespace for types related to the ValueReducer protocol.

+ +
+
+
+
+ + +
+ +

Combine 2 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 3 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 4 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 5 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 6 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 7 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 8 Reducers

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/ValueReducers/Combine2.html b/docs/4.8/Enums/ValueReducers/Combine2.html new file mode 100644 index 000000000..063c7eeec --- /dev/null +++ b/docs/4.8/Enums/ValueReducers/Combine2.html @@ -0,0 +1,1196 @@ + + + + Combine2 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine2

+
+
+
public struct Combine2<
+    R1: ValueReducer,
+    R2: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/ValueReducers/Combine3.html b/docs/4.8/Enums/ValueReducers/Combine3.html new file mode 100644 index 000000000..4f4395b91 --- /dev/null +++ b/docs/4.8/Enums/ValueReducers/Combine3.html @@ -0,0 +1,1197 @@ + + + + Combine3 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine3

+
+
+
public struct Combine3<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/ValueReducers/Combine4.html b/docs/4.8/Enums/ValueReducers/Combine4.html new file mode 100644 index 000000000..fda1e97eb --- /dev/null +++ b/docs/4.8/Enums/ValueReducers/Combine4.html @@ -0,0 +1,1198 @@ + + + + Combine4 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine4

+
+
+
public struct Combine4<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer,
+    R4: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched, R4.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value, R4.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/ValueReducers/Combine5.html b/docs/4.8/Enums/ValueReducers/Combine5.html new file mode 100644 index 000000000..3db3d5f91 --- /dev/null +++ b/docs/4.8/Enums/ValueReducers/Combine5.html @@ -0,0 +1,1199 @@ + + + + Combine5 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine5

+
+
+
public struct Combine5<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer,
+    R4: ValueReducer,
+    R5: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched, R4.Fetched, R5.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value, R4.Value, R5.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/ValueReducers/Combine6.html b/docs/4.8/Enums/ValueReducers/Combine6.html new file mode 100644 index 000000000..5636df021 --- /dev/null +++ b/docs/4.8/Enums/ValueReducers/Combine6.html @@ -0,0 +1,1200 @@ + + + + Combine6 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine6

+
+
+
public struct Combine6<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer,
+    R4: ValueReducer,
+    R5: ValueReducer,
+    R6: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched, R4.Fetched, R5.Fetched, R6.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value, R4.Value, R5.Value, R6.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/ValueReducers/Combine7.html b/docs/4.8/Enums/ValueReducers/Combine7.html new file mode 100644 index 000000000..43db3c588 --- /dev/null +++ b/docs/4.8/Enums/ValueReducers/Combine7.html @@ -0,0 +1,1201 @@ + + + + Combine7 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine7

+
+
+
public struct Combine7<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer,
+    R4: ValueReducer,
+    R5: ValueReducer,
+    R6: ValueReducer,
+    R7: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched, R4.Fetched, R5.Fetched, R6.Fetched, R7.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value, R4.Value, R5.Value, R6.Value, R7.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/ValueReducers/Combine8.html b/docs/4.8/Enums/ValueReducers/Combine8.html new file mode 100644 index 000000000..db852b8cf --- /dev/null +++ b/docs/4.8/Enums/ValueReducers/Combine8.html @@ -0,0 +1,1202 @@ + + + + Combine8 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine8

+
+
+
public struct Combine8<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer,
+    R4: ValueReducer,
+    R5: ValueReducer,
+    R6: ValueReducer,
+    R7: ValueReducer,
+    R8: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched, R4.Fetched, R5.Fetched, R6.Fetched, R7.Fetched, R8.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value, R4.Value, R5.Value, R6.Value, R7.Value, R8.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Enums/ValueScheduling.html b/docs/4.8/Enums/ValueScheduling.html new file mode 100644 index 000000000..44f864ad7 --- /dev/null +++ b/docs/4.8/Enums/ValueScheduling.html @@ -0,0 +1,1215 @@ + + + + ValueScheduling Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ValueScheduling

+
+
+
public enum ValueScheduling
+ +
+
+

ValueScheduling controls how ValueObservation schedules the notifications +of fresh values to your application.

+ +
+
+
+
    +
  • +
    + + + + mainQueue + +
    +
    +
    +
    +
    +
    +

    All values are notified on the main queue.

    + +

    If the observation starts on the main queue, an initial value is +notified right upon subscription, synchronously:

    +
    // On main queue
    +let observation = Player.observationForAll()
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("fresh players: \(players)")
    +}
    +// <- here "fresh players" is already printed.
    +
    + +

    If the observation does not start on the main queue, an initial value +is also notified on the main queue, but asynchronously:

    +
    // Not on the main queue: "fresh players" is eventually printed
    +// on the main queue.
    +let observation = Player.observationForAll()
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("fresh players: \(players)")
    +}
    +
    + +

    When the database changes, fresh values are asynchronously notified on +the main queue:

    +
    // Eventually prints "fresh players" on the main queue
    +try dbQueue.write { db in
    +    try Player(...).insert(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case mainQueue
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    All values are asychronously notified on the specified queue.

    + +

    An initial value is fetched and notified if startImmediately +is true.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case async(onQueue: DispatchQueue, startImmediately: Bool)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Values are not all notified on the same dispatch queue.

    + +

    If startImmediately is true, an initial value is notified right upon +subscription, synchronously, on the dispatch queue which starts +the observation.

    +
    // On any queue
    +var observation = Player.observationForAll()
    +observation.scheduling = .unsafe(startImmediately: true)
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("fresh players: \(players)")
    +}
    +// <- here "fresh players" is already printed.
    +
    + +

    When the database changes, other values are notified on +unspecified queues.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unsafe(startImmediately: Bool)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions.html b/docs/4.8/Extensions.html new file mode 100644 index 000000000..8f367676d --- /dev/null +++ b/docs/4.8/Extensions.html @@ -0,0 +1,2204 @@ + + + + Extensions Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+
+
+ + +
+ +

Array, Sequence, Set extensions

+

+
+
+
    +
  • +
    + + + + Array + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Array
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Sequence + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Sequence
    +
    extension Sequence where Element == SQLLiteral
    +
    extension Sequence where Self.Iterator.Element: SQLExpressible
    +
    extension Sequence where Element == SQLExpression
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Set + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Set
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Database + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseValueConvertible

+

+
+
+
    +
  • +
    + + + + Optional + +
    +
    +
    +
    +
    +
    +

    Swift’s Optional comes with built-in methods that allow to fetch cursors +and arrays of optional DatabaseValueConvertible:

    +
    try Optional<String>.fetchCursor(db, sql: "SELECT name FROM ...", arguments:...) // Cursor of String?
    +try Optional<String>.fetchAll(db, sql: "SELECT name FROM ...", arguments:...)    // [String?]
    +
    +let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +try Optional<String>.fetchCursor(statement, arguments:...) // Cursor of String?
    +try Optional<String>.fetchAll(statement, arguments:...)    // [String?]
    +
    + +

    DatabaseValueConvertible is adopted by Bool, Int, String, etc.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Optional where Wrapped: DatabaseValueConvertible
    +
    extension Optional where Wrapped: DatabaseValueConvertible & StatementColumnConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Collection + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Collection where Element == SQLLiteral
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + CGFloat + +
    +
    +
    +
    +
    +
    +

    CGFloat adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension CGFloat: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Data + +
    +
    +
    +
    +
    +
    +

    Data is convertible to and from DatabaseValue.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Data: DatabaseValueConvertible, StatementColumnConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSDate + +
    +
    +
    +
    +
    +
    +

    NSDate is stored in the database using the format +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSDate: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Date + +
    +
    +
    +
    +
    +
    +

    Date is stored in the database using the format +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Date: DatabaseValueConvertible
    +
    extension Date: StatementColumnConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSData + +
    +
    +
    +
    +
    +
    +

    NSData is convertible to and from DatabaseValue.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSData: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSNull + +
    +
    +
    +
    +
    +
    +

    NSNull adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSNull: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSNumber + +
    +
    +
    +
    +
    +
    +

    NSNumber adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSNumber: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSString + +
    +
    +
    +
    +
    +
    +

    NSString adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSString: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSURL + +
    +
    +
    +
    +
    +
    +

    NSURL stores its absoluteString in the database.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSURL: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + URL + +
    +
    +
    +
    +
    +
    +

    URL stores its absoluteString in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension URL: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSUUID + +
    +
    +
    +
    +
    +
    +

    NSUUID adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSUUID: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + UUID + +
    +
    +
    +
    +
    +
    +

    UUID adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension UUID: DatabaseValueConvertible
    +
    extension UUID: StatementColumnConvertible
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Value Types

+

+
+
+ +
+
+
+ + +
+ +

Inclusion Operators (BETWEEN, IN)

+

+
+
+
    +
  • +
    + + + + Range + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Range where Bound: SQLExpressible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ClosedRange + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension ClosedRange where Bound: SQLExpressible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + CountableRange + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension CountableRange where Bound: SQLExpressible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + CountableClosedRange + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension CountableClosedRange where Bound: SQLExpressible
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Array.html b/docs/4.8/Extensions/Array.html new file mode 100644 index 000000000..0a377addf --- /dev/null +++ b/docs/4.8/Extensions/Array.html @@ -0,0 +1,1111 @@ + + + + Array Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Array

+
+
+
extension Array
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates an array containing the elements of a cursor.

    +
    let cursor = try String.fetchCursor(db, sql: "SELECT 'foo' UNION ALL SELECT 'bar'")
    +let strings = try Array(cursor) // ["foo", "bar"]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init<C>(_ cursor: C) throws where Element == C.Element, C : Cursor
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Bool.html b/docs/4.8/Extensions/Bool.html new file mode 100644 index 000000000..8f1f2a902 --- /dev/null +++ b/docs/4.8/Extensions/Bool.html @@ -0,0 +1,1200 @@ + + + + Bool Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Bool

+ +

Bool adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a Bool initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Bool?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/CGFloat.html b/docs/4.8/Extensions/CGFloat.html new file mode 100644 index 000000000..4d6568379 --- /dev/null +++ b/docs/4.8/Extensions/CGFloat.html @@ -0,0 +1,1138 @@ + + + + CGFloat Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

CGFloat

+
+
+
extension CGFloat: DatabaseValueConvertible
+ +
+
+

CGFloat adopts DatabaseValueConvertible

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a CGFloat initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> CGFloat?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/ClosedRange.html b/docs/4.8/Extensions/ClosedRange.html new file mode 100644 index 000000000..0fbcf24e1 --- /dev/null +++ b/docs/4.8/Extensions/ClosedRange.html @@ -0,0 +1,1152 @@ + + + + ClosedRange Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ClosedRange

+
+
+
extension ClosedRange where Bound: SQLExpressible
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Bound: SQLExpressible

+

+
+
+
    +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // email BETWEEN 'A' AND 'B'
    +("A"..."B").contains(Column("email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // email BETWEEN 'A' AND 'B' COLLATE NOCASE
    +("A"..."B").contains(Column("email").collating(.nocase))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Collection.html b/docs/4.8/Extensions/Collection.html new file mode 100644 index 000000000..8ec20c5df --- /dev/null +++ b/docs/4.8/Extensions/Collection.html @@ -0,0 +1,1124 @@ + + + + Collection Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Collection

+
+
+
extension Collection where Element == SQLLiteral
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Element == SQLLiteral

+

+
+
+
    +
  • +
    + + + + joined(separator:) + +
    +
    +
    +
    +
    +
    +

    Returns the concatenated SQLLiteral of this collection of literals, +inserting the given separator between each element.

    +
    let components: [SQLLiteral] = [
    +    "UPDATE player",
    +    "SET name = \(name)",
    +    "WHERE id = \(id)"
    +]
    +let query = components.joined(separator: " ")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined(separator: String = "") -> SQLLiteral
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Column.html b/docs/4.8/Extensions/Column.html new file mode 100644 index 000000000..be68d790d --- /dev/null +++ b/docs/4.8/Extensions/Column.html @@ -0,0 +1,1090 @@ + + + + Column Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Column

+ +
+
+
+
    +
  • +
    + + + + rank + +
    +
    +
    +
    +
    +
    +

    The FTS5 rank column

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/CountableClosedRange.html b/docs/4.8/Extensions/CountableClosedRange.html new file mode 100644 index 000000000..2d44fd6f8 --- /dev/null +++ b/docs/4.8/Extensions/CountableClosedRange.html @@ -0,0 +1,1119 @@ + + + + CountableClosedRange Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

CountableClosedRange

+
+
+
extension CountableClosedRange where Bound: SQLExpressible
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Bound: SQLExpressible

+

+
+
+
    +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // id BETWEEN 1 AND 10
    +(1...10).contains(Column("id"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/CountableRange.html b/docs/4.8/Extensions/CountableRange.html new file mode 100644 index 000000000..a3625ef8d --- /dev/null +++ b/docs/4.8/Extensions/CountableRange.html @@ -0,0 +1,1119 @@ + + + + CountableRange Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

CountableRange

+
+
+
extension CountableRange where Bound: SQLExpressible
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Bound: SQLExpressible

+

+
+
+
    +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // id BETWEEN 1 AND 9
    +(1..<10).contains(Column("id"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Data.html b/docs/4.8/Extensions/Data.html new file mode 100644 index 000000000..b972e87a2 --- /dev/null +++ b/docs/4.8/Extensions/Data.html @@ -0,0 +1,1169 @@ + + + + Data Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Data

+ +

Data is convertible to and from DatabaseValue.

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Database.html b/docs/4.8/Extensions/Database.html new file mode 100644 index 000000000..04c56bc54 --- /dev/null +++ b/docs/4.8/Extensions/Database.html @@ -0,0 +1,1238 @@ + + + + Database Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Database

+ +
+
+
+
+ + +
+ +

Encryption

+

+
+
+
    +
  • +
    + + + + usePassphrase(_:) + +
    +
    +
    +
    +
    +
    +

    Sets the passphrase used to crypt and decrypt an SQLCipher database.

    + +

    Call this method from Configuration.prepareDatabase, as in the example below:

    +
    var config = Configuration()
    +config.prepareDatabase = { db in
    +    try db.usePassphrase("secret")
    +}
    +
    + +
    +
    +
    +
  • +
  • +
    + + + + changePassphrase(_:) + +
    +
    +
    +
    +
    +
    +

    Changes the passphrase used by an SQLCipher encrypted database.

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Deletes the synchronization triggers for a synchronized FTS5 table

    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

FTS5

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +db.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern from a raw pattern string; throws DatabaseError on +invalid syntax.

    + +

    The pattern syntax is documented at https://www.sqlite.org/fts5.html#full_text_query_syntax

    +
    try db.makeFTS5Pattern(rawPattern: "and", forTable: "document") // OK
    +try db.makeFTS5Pattern(rawPattern: "AND", forTable: "document") // malformed MATCH expression: [AND]
    +
    + +
    +
    +
    +
  • +
  • +
    + + + + makeTokenizer(_:) + +
    +
    +
    +
    +
    +
    +

    Creates an FTS5 tokenizer, given its descriptor.

    +
    let unicode61 = try db.makeTokenizer(.unicode61())
    +
    + +

    It is a programmer error to use the tokenizer outside of a protected +database queue, or after the database has been closed.

    + +

    Use this method when you implement a custom wrapper tokenizer:

    +
    final class MyTokenizer : FTS5WrapperTokenizer {
    +    var wrappedTokenizer: FTS5Tokenizer
    +
    +    init(db: Database, arguments: [String]) throws {
    +        wrappedTokenizer = try db.makeTokenizer(.unicode61())
    +    }
    +}
    +
    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/DatabaseQueue.html b/docs/4.8/Extensions/DatabaseQueue.html new file mode 100644 index 000000000..38002674e --- /dev/null +++ b/docs/4.8/Extensions/DatabaseQueue.html @@ -0,0 +1,1102 @@ + + + + DatabaseQueue Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseQueue

+ +
+
+
+
+ + +
+ +

Custom FTS5 Tokenizers

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +dbQueue.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Date.html b/docs/4.8/Extensions/Date.html new file mode 100644 index 000000000..d6552fcdf --- /dev/null +++ b/docs/4.8/Extensions/Date.html @@ -0,0 +1,1242 @@ + + + + Date Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Date

+
+
+
extension Date: DatabaseValueConvertible
+
extension Date: StatementColumnConvertible
+ +
+
+

Date is stored in the database using the format +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a database value that contains the date encoded as +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a date initialized from dbValue, if possible.

    + +

    If database value contains a number, that number is interpreted as a +timeinterval since 00:00:00 UTC on 1 January 1970.

    + +

    If database value contains a string, that string is interpreted as a +SQLite date in the UTC time +zone. Nil is returned if the date string does not contain at least the +year, month and day components. Other components (minutes, etc.) +are set to zero if missing.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(julianDay:) + +
    +
    +
    +
    +
    +
    +

    Creates a date from a Julian Day.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(julianDay: Double)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Double.html b/docs/4.8/Extensions/Double.html new file mode 100644 index 000000000..b920a2c29 --- /dev/null +++ b/docs/4.8/Extensions/Double.html @@ -0,0 +1,1200 @@ + + + + Double Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Double

+ +

Double adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a Double initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Double?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Float.html b/docs/4.8/Extensions/Float.html new file mode 100644 index 000000000..ce1ad512d --- /dev/null +++ b/docs/4.8/Extensions/Float.html @@ -0,0 +1,1200 @@ + + + + Float Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Float

+ +

Float adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a Float initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Float?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Int.html b/docs/4.8/Extensions/Int.html new file mode 100644 index 000000000..c612a1f48 --- /dev/null +++ b/docs/4.8/Extensions/Int.html @@ -0,0 +1,1200 @@ + + + + Int Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Int

+ +

Int adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Int?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Int16.html b/docs/4.8/Extensions/Int16.html new file mode 100644 index 000000000..2a239e630 --- /dev/null +++ b/docs/4.8/Extensions/Int16.html @@ -0,0 +1,1200 @@ + + + + Int16 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Int16

+ +

Int16 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int16 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Int16?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Int32.html b/docs/4.8/Extensions/Int32.html new file mode 100644 index 000000000..f76cfa4c6 --- /dev/null +++ b/docs/4.8/Extensions/Int32.html @@ -0,0 +1,1200 @@ + + + + Int32 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Int32

+ +

Int32 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int32 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Int32?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Int64.html b/docs/4.8/Extensions/Int64.html new file mode 100644 index 000000000..b7e379c30 --- /dev/null +++ b/docs/4.8/Extensions/Int64.html @@ -0,0 +1,1200 @@ + + + + Int64 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Int64

+ +

Int64 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int64 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Int64?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Int8.html b/docs/4.8/Extensions/Int8.html new file mode 100644 index 000000000..5f70ae82a --- /dev/null +++ b/docs/4.8/Extensions/Int8.html @@ -0,0 +1,1200 @@ + + + + Int8 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Int8

+ +

Int8 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int8 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Int8?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/NSData.html b/docs/4.8/Extensions/NSData.html new file mode 100644 index 000000000..5880f84c8 --- /dev/null +++ b/docs/4.8/Extensions/NSData.html @@ -0,0 +1,1139 @@ + + + + NSData Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSData

+
+
+
extension NSData: DatabaseValueConvertible
+ +
+
+

NSData is convertible to and from DatabaseValue.

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an NSData initialized from dbValue, if it contains +a Blob.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/NSDate.html b/docs/4.8/Extensions/NSDate.html new file mode 100644 index 000000000..c71fe86b8 --- /dev/null +++ b/docs/4.8/Extensions/NSDate.html @@ -0,0 +1,1149 @@ + + + + NSDate Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSDate

+
+
+
extension NSDate: DatabaseValueConvertible
+ +
+
+

NSDate is stored in the database using the format +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a database value that contains the date encoded as +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a date initialized from dbValue, if possible.

    + +

    If database value contains a number, that number is interpreted as a +timeinterval since 00:00:00 UTC on 1 January 1970.

    + +

    If database value contains a string, that string is interpreted as a +SQLite date in the UTC time +zone. Nil is returned if the date string does not contain at least the +year, month and day components. Other components (minutes, etc.) +are set to zero if missing.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/NSNull.html b/docs/4.8/Extensions/NSNull.html new file mode 100644 index 000000000..f14081b66 --- /dev/null +++ b/docs/4.8/Extensions/NSNull.html @@ -0,0 +1,1138 @@ + + + + NSNull Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSNull

+
+
+
extension NSNull: DatabaseValueConvertible
+ +
+
+

NSNull adopts DatabaseValueConvertible

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns DatabaseValue.null.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/NSNumber.html b/docs/4.8/Extensions/NSNumber.html new file mode 100644 index 000000000..b9ae19c9f --- /dev/null +++ b/docs/4.8/Extensions/NSNumber.html @@ -0,0 +1,1138 @@ + + + + NSNumber Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSNumber

+
+
+
extension NSNumber: DatabaseValueConvertible
+ +
+
+

NSNumber adopts DatabaseValueConvertible

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an NSNumber initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/NSString.html b/docs/4.8/Extensions/NSString.html new file mode 100644 index 000000000..b157882c2 --- /dev/null +++ b/docs/4.8/Extensions/NSString.html @@ -0,0 +1,1138 @@ + + + + NSString Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSString

+
+
+
extension NSString: DatabaseValueConvertible
+ +
+
+

NSString adopts DatabaseValueConvertible

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an NSString initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/NSURL.html b/docs/4.8/Extensions/NSURL.html new file mode 100644 index 000000000..f44194b5e --- /dev/null +++ b/docs/4.8/Extensions/NSURL.html @@ -0,0 +1,1139 @@ + + + + NSURL Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSURL

+
+
+
extension NSURL: DatabaseValueConvertible
+ +
+
+

NSURL stores its absoluteString in the database.

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database. +(the URL’s absoluteString).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an NSURL initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/NSUUID.html b/docs/4.8/Extensions/NSUUID.html new file mode 100644 index 000000000..4c26e89cd --- /dev/null +++ b/docs/4.8/Extensions/NSUUID.html @@ -0,0 +1,1136 @@ + + + + NSUUID Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSUUID

+
+
+
extension NSUUID: DatabaseValueConvertible
+ +
+
+

NSUUID adopts DatabaseValueConvertible

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Optional.html b/docs/4.8/Extensions/Optional.html new file mode 100644 index 000000000..b6d8afa71 --- /dev/null +++ b/docs/4.8/Extensions/Optional.html @@ -0,0 +1,2265 @@ + + + + Optional Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Optional

+
+
+
extension Optional where Wrapped: DatabaseValueConvertible
+
extension Optional where Wrapped: DatabaseValueConvertible & StatementColumnConvertible
+ +
+
+

Swift’s Optional comes with built-in methods that allow to fetch cursors +and arrays of optional DatabaseValueConvertible:

+
try Optional<String>.fetchCursor(db, sql: "SELECT name FROM ...", arguments:...) // Cursor of String?
+try Optional<String>.fetchAll(db, sql: "SELECT name FROM ...", arguments:...)    // [String?]
+
+let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
+try Optional<String>.fetchCursor(statement, arguments:...) // Cursor of String?
+try Optional<String>.fetchAll(statement, arguments:...)    // [String?]
+
+ +

DatabaseValueConvertible is adopted by Bool, Int, String, etc.

+ +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try Optional<String>.fetchCursor(statement) // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> NullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try Optional<String>.fetchAll(statement)  // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from an SQL query.

    +
    let names = try Optional<String>.fetchCursor(db, sql: "SELECT name FROM ...") // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> NullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from an SQL query.

    +
    let names = try String.fetchAll(db, sql: "SELECT name FROM ...") // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try Optional<String>.fetchCursor(db, request) // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R: FetchRequest>(_ db: Database, _ request: R)
    +    throws -> NullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try Optional<String>.fetchAll(db, request) // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Wrapped?] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try Optional<String>.fetchCursor(statement) // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> FastNullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try Optional<String>.fetchAll(statement)  // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from an SQL query.

    +
    let names = try Optional<String>.fetchCursor(db, sql: "SELECT name FROM ...") // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> FastNullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from an SQL query.

    +
    let names = try String.fetchAll(db, sql: "SELECT name FROM ...") // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try Optional<String>.fetchCursor(db, request) // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R: FetchRequest>(_ db: Database, _ request: R)
    +    throws -> FastNullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try Optional<String>.fetchAll(db, request) // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Wrapped?] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Range.html b/docs/4.8/Extensions/Range.html new file mode 100644 index 000000000..0a5089de5 --- /dev/null +++ b/docs/4.8/Extensions/Range.html @@ -0,0 +1,1152 @@ + + + + Range Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Range

+
+
+
extension Range where Bound: SQLExpressible
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Bound: SQLExpressible

+

+
+
+
    +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // email >= 'A' AND email < 'B'
    +("A"..<"B").contains(Column("email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // email >= 'A' COLLATE NOCASE AND email < 'B' COLLATE NOCASE
    +("A"..<"B").contains(Column("email").collating(.nocase))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Sequence.html b/docs/4.8/Extensions/Sequence.html new file mode 100644 index 000000000..b97bec847 --- /dev/null +++ b/docs/4.8/Extensions/Sequence.html @@ -0,0 +1,1310 @@ + + + + Sequence Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Sequence

+
+
+
extension Sequence
+
extension Sequence where Element == SQLLiteral
+
extension Sequence where Self.Iterator.Element: SQLExpressible
+
extension Sequence where Element == SQLExpression
+ +
+
+ +
+
+
+
    +
  • +
    + + + + flatMap(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over the concatenated results of mapping transform +over self.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func flatMap<SegmentOfResult: Cursor>(
    +    _ transform: @escaping (Iterator.Element) throws -> SegmentOfResult)
    +    -> FlattenCursor<MapCursor<AnyCursor<Iterator.Element>, SegmentOfResult>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element == SQLLiteral

+

+
+
+
    +
  • +
    + + + + joined(separator:) + +
    +
    +
    +
    +
    +
    +

    Returns the concatenated SQLLiteral of this sequence of literals, +inserting the given separator between each element.

    +
    let components: [SQLLiteral] = [
    +    "UPDATE player",
    +    "SET name = \(name)",
    +    "WHERE id = \(id)"
    +]
    +let query = components.joined(separator: " ")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined(separator: String = "") -> SQLLiteral
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Self.Iterator.Element: SQLExpressible

+

+
+
+
    +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in +a sequence.

    +
    // id IN (1,2,3)
    +[1, 2, 3].contains(Column("id"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in +a sequence.

    +
    // name IN ('A', 'B') COLLATE NOCASE
    +["A", "B"].contains(Column("name").collating(.nocase))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element == SQLExpression

+

+
+
+
    +
  • +
    + + + + joined(operator:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression by joining all elements with an SQL +logical operator.

    + +

    For example:

    +
    // SELECT * FROM player
    +// WHERE (registered
    +//        AND (score >= 1000)
    +//        AND (name IS NOT NULL))
    +let conditions = [
    +    Column("registered"),
    +    Column("score") >= 1000,
    +    Column("name") != nil]
    +Player.filter(conditions.joined(operator: .and))
    +
    + +

    When the sequence is empty, joined(operator: .and) returns true, +and joined(operator: .or) returns false:

    +
    // SELECT * FROM player WHERE 1
    +Player.filter([].joined(operator: .and))
    +
    +// SELECT * FROM player WHERE 0
    +Player.filter([].joined(operator: .or))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined(operator: SQLLogicalBinaryOperator) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/Set.html b/docs/4.8/Extensions/Set.html new file mode 100644 index 000000000..9141230d7 --- /dev/null +++ b/docs/4.8/Extensions/Set.html @@ -0,0 +1,1110 @@ + + + + Set Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Set

+
+
+
extension Set
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a set containing the elements of a cursor.

    +
    let cursor = try String.fetchCursor(db, sql: "SELECT 'foo' UNION ALL SELECT 'foo'")
    +let strings = try Set(cursor) // ["foo"]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<C>(_ cursor: C) throws where Element == C.Element, C : Cursor
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/String.html b/docs/4.8/Extensions/String.html new file mode 100644 index 000000000..45d54300e --- /dev/null +++ b/docs/4.8/Extensions/String.html @@ -0,0 +1,1247 @@ + + + + String Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

String

+ +

String adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a String initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> String?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Public

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns the receiver, quoted for safe insertion as an identifier in an +SQL query.

    +
    db.execute(sql: "SELECT * FROM \(tableName.quotedDatabaseIdentifier)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public var quotedDatabaseIdentifier: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/TableRecord.html b/docs/4.8/Extensions/TableRecord.html new file mode 100644 index 000000000..beb848578 --- /dev/null +++ b/docs/4.8/Extensions/TableRecord.html @@ -0,0 +1,1105 @@ + + + + TableRecord Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableRecord

+ +
+
+
+
+ + +
+ +

Full Text Search

+

+
+
+
    +
  • +
    + + + + matching(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a QueryInterfaceRequest with a matching predicate.

    +
    // SELECT * FROM book WHERE book MATCH '...'
    +var request = Book.matching(pattern)
    +
    + +

    If the search pattern is nil, the request does not match any +database row.

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/TableRequest.html b/docs/4.8/Extensions/TableRequest.html new file mode 100644 index 000000000..78226987b --- /dev/null +++ b/docs/4.8/Extensions/TableRequest.html @@ -0,0 +1,1111 @@ + + + + TableRequest Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableRequest

+ +
+
+
+
+ + +
+ +

Full Text Search

+

+
+
+
    +
  • +
    + + + + matching(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request with a full-text predicate added to the eventual +set of already applied predicates.

    +
    // SELECT * FROM book WHERE book MATCH '...'
    +var request = Book.all()
    +request = request.matching(pattern)
    +
    + +

    If the search pattern is nil, the request does not match any +database row.

    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/UInt.html b/docs/4.8/Extensions/UInt.html new file mode 100644 index 000000000..769876360 --- /dev/null +++ b/docs/4.8/Extensions/UInt.html @@ -0,0 +1,1200 @@ + + + + UInt Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UInt

+ +

UInt adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> UInt?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/UInt16.html b/docs/4.8/Extensions/UInt16.html new file mode 100644 index 000000000..de713f873 --- /dev/null +++ b/docs/4.8/Extensions/UInt16.html @@ -0,0 +1,1200 @@ + + + + UInt16 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UInt16

+ +

UInt16 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an UInt16 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> UInt16?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/UInt32.html b/docs/4.8/Extensions/UInt32.html new file mode 100644 index 000000000..baefda08f --- /dev/null +++ b/docs/4.8/Extensions/UInt32.html @@ -0,0 +1,1200 @@ + + + + UInt32 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UInt32

+ +

UInt32 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an UInt32 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> UInt32?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/UInt64.html b/docs/4.8/Extensions/UInt64.html new file mode 100644 index 000000000..2e26aef18 --- /dev/null +++ b/docs/4.8/Extensions/UInt64.html @@ -0,0 +1,1200 @@ + + + + UInt64 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UInt64

+ +

UInt64 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an UInt64 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> UInt64?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/UInt8.html b/docs/4.8/Extensions/UInt8.html new file mode 100644 index 000000000..ade0f042a --- /dev/null +++ b/docs/4.8/Extensions/UInt8.html @@ -0,0 +1,1200 @@ + + + + UInt8 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UInt8

+ +

UInt8 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an UInt8 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> UInt8?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Extensions/UUID.html b/docs/4.8/Extensions/UUID.html new file mode 100644 index 000000000..41e65d74b --- /dev/null +++ b/docs/4.8/Extensions/UUID.html @@ -0,0 +1,1167 @@ + + + + UUID Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UUID

+
+
+
extension UUID: DatabaseValueConvertible
+
extension UUID: StatementColumnConvertible
+ +
+
+

UUID adopts DatabaseValueConvertible

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Functions.html b/docs/4.8/Functions.html new file mode 100644 index 000000000..28d55e48e --- /dev/null +++ b/docs/4.8/Functions.html @@ -0,0 +1,5722 @@ + + + + Functions Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Functions

+

The following functions are available globally.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns an array of row adapters that split a row according to the input +number of columns.

    + +

    For example:

    +
    let sql = "SELECT 1, 2,3,4, 5,6, 7,8"
    +//               <.><. . .><. .><. .>
    +let adapters = splittingRowAdapters([1, 3, 2])
    +let adapter = ScopeAdapter([
    +    "a": adapters[0],
    +    "b": adapters[1],
    +    "c": adapters[2],
    +    "d": adapters[3]])
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)
    +row.scopes["a"] // [1]
    +row.scopes["b"] // [2, 3, 4]
    +row.scopes["c"] // [5, 6]
    +row.scopes["d"] // [7, 8]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func splittingRowAdapters(columnCounts: [Int]) -> [RowAdapter]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Logical Operators (AND, OR, NOT)

+

+
+
+ +
+
+
+ + +
+ +

Egality and Identity Operators (=, <>, IS, IS NOT)

+

+
+
+
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the = SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count == Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the = SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count == 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the = SQL operator.

    + +

    For example:

    + +

    Author.having(3 == Author.books.count)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that checks the boolean value of an aggregate.

    + +

    For example:

    +
    Author.having(Author.books.isEmpty == false)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <RowDecoder>(lhs: AssociationAggregate<RowDecoder>, rhs: Bool) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that checks the boolean value of an aggregate.

    + +

    For example:

    +
    Author.having(false == Author.books.isEmpty)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <RowDecoder>(lhs: Bool, rhs: AssociationAggregate<RowDecoder>) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the <> SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count != Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the <> SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count != 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the <> SQL operator.

    + +

    For example:

    +
    Author.having(3 != Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that checks the boolean value of an aggregate.

    + +

    For example:

    +
    Author.having(Author.books.isEmpty != true)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <RowDecoder>(lhs: AssociationAggregate<RowDecoder>, rhs: Bool) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that checks the boolean value of an aggregate.

    + +

    For example:

    +
    Author.having(true != Author.books.isEmpty)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <RowDecoder>(lhs: Bool, rhs: AssociationAggregate<RowDecoder>) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the IS SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count === Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the IS SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count === 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the IS SQL operator.

    + +

    For example:

    +
    Author.having(3 === Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the IS NOT SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count !== Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the IS NOT SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count !== 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the IS NOT SQL operator.

    + +

    For example:

    +
    Author.having(3 !== Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Comparison Operators (<, >, <=, >=)

+

+
+
+
    +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the <= SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count <= Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the <= SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count <= 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the <= SQL operator.

    + +

    For example:

    +
    Author.having(3 <= Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the < SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count < Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the < SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count < 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the < SQL operator.

    + +

    For example:

    +
    Author.having(3 < Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the > SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count > Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the > SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count > 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the > SQL operator.

    + +

    For example:

    +
    Author.having(3 > Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the >= SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count >= Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the >= SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count >= 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the >= SQL operator.

    + +

    For example:

    +
    Author.having(3 >= Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Arithmetic Operators (+, -, *, /)

+

+
+
+
    +
  • +
    + + + + -(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an arithmetically negated aggregate.

    + +

    For example:

    +
    Author.annotated(with: -Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public prefix func - <RowDecoder>(aggregate: AssociationAggregate<RowDecoder>) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that sums two aggregates with the + SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count + Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that sums an aggregate with the + SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count + 1)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that sums an aggregate with the + SQL operator.

    + +

    For example:

    +
    Author.annotated(with: 1 + Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts two aggregates with the - SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count - Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the - SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count - 1)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the - SQL operator.

    + +

    For example:

    +
    Author.annotated(with: 1 - Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that multiplies two aggregates with the * SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count * Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the * SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count * 2)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the * SQL operator.

    + +

    For example:

    +
    Author.annotated(with: 2 * Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that multiplies two aggregates with the / SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count / Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the / SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count / 2)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the / SQL operator.

    + +

    For example:

    +
    Author.annotated(with: 2 / Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

IFNULL(…)

+

+
+
+
    +
  • +
    + + + + ??(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that evaluates the IFNULL SQL function.

    +
    Team.annotated(with: Team.players.min(Column("score")) ?? 0)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ?? <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ColumnAssignment

+

+
+
+
    +
  • +
    + + + + <-(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates an assignment to a value.

    +
    Column("valid") <- true
    +Column("score") <- 0
    +Column("score") <- Column("score") + Column("bonus")
    +
    +try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    try Player.updateAll(db, Column("score") <- 0)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <- (column: ColumnExpression, value: SQLExpressible) -> ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates an assignment that adds a value

    +
    Column("score") += 1
    +Column("score") += Column("bonus")
    +
    +try dbQueue.write { db in
    +    // UPDATE player SET score = score + 1
    +    try Player.updateAll(db, Column("score") += 1)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func += (column: ColumnExpression, value: SQLExpressible) -> ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates an assignment that subtracts a value

    +
    Column("score") -= 1
    +Column("score") -= Column("bonus")
    +
    +try dbQueue.write { db in
    +    // UPDATE player SET score = score - 1
    +    try Player.updateAll(db, Column("score") -= 1)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func -= (column: ColumnExpression, value: SQLExpressible) -> ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates an assignment that multiplies by a value

    +
    Column("score") *= 2
    +Column("score") *= Column("factor")
    +
    +try dbQueue.write { db in
    +    // UPDATE player SET score = score * 2
    +    try Player.updateAll(db, Column("score") *= 2)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func *= (column: ColumnExpression, value: SQLExpressible) -> ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates an assignment that divides by a value

    +
    Column("score") /= 2
    +Column("score") /= Column("factor")
    +
    +try dbQueue.write { db in
    +    // UPDATE player SET score = score / 2
    +    try Player.updateAll(db, Column("score") /= 2)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func /= (column: ColumnExpression, value: SQLExpressible) -> ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ABS(…)

+

+
+
+
    +
  • +
    + + + + abs(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the ABS SQL function.

    +
    // ABS(amount)
    +abs(Column("amount"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func abs(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

AVG(…)

+

+
+
+
    +
  • +
    + + + + average(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the AVG SQL function.

    +
    // AVG(length)
    +average(Column("length"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func average(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

COUNT(…)

+

+
+
+
    +
  • +
    + + + + count(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the COUNT SQL function.

    +
    // COUNT(email)
    +count(Column("email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func count(_ counted: SQLSelectable) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

COUNT(DISTINCT …)

+

+
+
+
    +
  • +
    + + + + count(distinct:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the COUNT(DISTINCT) SQL function.

    +
    // COUNT(DISTINCT email)
    +count(distinct: Column("email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func count(distinct value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

IFNULL(…)

+

+
+
+
    +
  • +
    + + + + ??(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the IFNULL SQL function.

    +
    // IFNULL(name, 'Anonymous')
    +Column("name") ?? "Anonymous"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ?? (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

LENGTH(…)

+

+
+
+
    +
  • +
    + + + + length(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the LENGTH SQL function.

    +
    // LENGTH(name)
    +length(Column("name"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func length(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

MAX(…)

+

+
+
+
    +
  • +
    + + + + max(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the MAX SQL function.

    +
    // MAX(score)
    +max(Column("score"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func max(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

MIN(…)

+

+
+
+
    +
  • +
    + + + + min(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the MIN SQL function.

    +
    // MIN(score)
    +min(Column("score"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func min(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SUM(…)

+

+
+
+
    +
  • +
    + + + + sum(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the SUM SQL function.

    +
    // SUM(amount)
    +sum(Column("amount"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sum(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Egality and Identity Operators (=, <>, IS, IS NOT)

+

+
+
+
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the = SQL operator.

    +
    // name = 'Arthur'
    +Column("name") == "Arthur"
    +
    + +

    When the right operand is nil, IS NULL is used instead.

    +
    // name IS NULL
    +Column("name") == nil
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLSpecificExpressible, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the = SQL operator.

    +
    // name = 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) == "Arthur"
    +
    + +

    When the right operand is nil, IS NULL is used instead.

    +
    // name IS NULL
    +Column("name").collating(.nocase) == nil
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLCollatedExpression, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the boolean value of an expression.

    + +

    The comparison is done with the built-in boolean evaluation of SQLite:

    +
    // validated
    +Column("validated") == true
    +
    +// NOT validated
    +Column("validated") == false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLSpecificExpressible, rhs: Bool) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the = SQL operator.

    +
    // 'Arthur' = name
    +"Arthur" == Column("name")
    +
    + +

    When the left operand is nil, IS NULL is used instead.

    +
    // name IS NULL
    +nil == Column("name")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLExpressible?, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the = SQL operator.

    +
    // 'Arthur' = name COLLATE NOCASE
    +"Arthur" == Column("name").collating(.nocase)
    +
    + +

    When the left operand is nil, IS NULL is used instead.

    +
    // name IS NULL
    +nil == Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLExpressible?, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the boolean value of an expression.

    + +

    The comparison is done with the built-in boolean evaluation of SQLite:

    +
    // validated
    +true == Column("validated")
    +
    +// NOT validated
    +false == Column("validated")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: Bool, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the = SQL operator.

    +
    // email = login
    +Column("email") == Column("login")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <> SQL operator.

    +
    // name <> 'Arthur'
    +Column("name") != "Arthur"
    +
    + +

    When the right operand is nil, IS NOT NULL is used instead.

    +
    // name IS NOT NULL
    +Column("name") != nil
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLSpecificExpressible, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <> SQL operator.

    +
    // name <> 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) != "Arthur"
    +
    + +

    When the right operand is nil, IS NOT NULL is used instead.

    +
    // name IS NOT NULL
    +Column("name").collating(.nocase) != nil
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLCollatedExpression, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the boolean value of an expression.

    + +

    The comparison is done with the built-in boolean evaluation of SQLite:

    +
    // NOT validated
    +Column("validated") != true
    +
    +// validated
    +Column("validated") != false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLSpecificExpressible, rhs: Bool) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <> SQL operator.

    +
    // 'Arthur' <> name
    +"Arthur" != Column("name")
    +
    + +

    When the left operand is nil, IS NOT NULL is used instead.

    +
    // name IS NOT NULL
    +nil != Column("name")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLExpressible?, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <> SQL operator.

    +
    // 'Arthur' <> name COLLATE NOCASE
    +"Arthur" != Column("name").collating(.nocase)
    +
    + +

    When the left operand is nil, IS NOT NULL is used instead.

    +
    // name IS NOT NULL
    +nil != Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLExpressible?, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the boolean value of an expression.

    + +

    The comparison is done with the built-in boolean evaluation of SQLite:

    +
    // NOT validated
    +true != Column("validated")
    +
    +// validated
    +false != Column("validated")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: Bool, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <> SQL operator.

    +
    // email <> login
    +Column("email") != Column("login")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS SQL operator.

    +
    // name IS 'Arthur'
    +Column("name") === "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === (lhs: SQLSpecificExpressible, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS SQL operator.

    +
    // name IS 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) === "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === (lhs: SQLCollatedExpression, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS SQL operator.

    +
    // name IS 'Arthur'
    +"Arthur" === Column("name")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === (lhs: SQLExpressible?, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS SQL operator.

    +
    // name IS 'Arthur' COLLATE NOCASE
    +"Arthur" === Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === (lhs: SQLExpressible?, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS SQL operator.

    +
    // email IS login
    +Column("email") === Column("login")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS NOT SQL operator.

    +
    // name IS NOT 'Arthur'
    +Column("name") !== "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== (lhs: SQLSpecificExpressible, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS NOT SQL operator.

    +
    // name IS NOT 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) !== "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== (lhs: SQLCollatedExpression, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS NOT SQL operator.

    +
    // name IS NOT 'Arthur'
    +"Arthur" !== Column("name")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== (lhs: SQLExpressible?, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS NOT SQL operator.

    +
    // name IS NOT 'Arthur' COLLATE NOCASE
    +"Arthur" !== Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== (lhs: SQLExpressible?, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS NOT SQL operator.

    +
    // email IS NOT login
    +Column("email") !== Column("login")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Comparison Operators (<, >, <=, >=)

+

+
+
+
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the < SQL operator.

    +
    // score < 18
    +Column("score") < 18
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the < SQL operator.

    +
    // name < 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) < "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < (lhs: SQLCollatedExpression, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the < SQL operator.

    +
    // 18 < score
    +18 < Column("score")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the < SQL operator.

    +
    // 'Arthur' < name COLLATE NOCASE
    +"Arthur" < Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < (lhs: SQLExpressible, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the < SQL operator.

    +
    // width < height
    +Column("width") < Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <= SQL operator.

    +
    // score <= 18
    +Column("score") <= 18
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <= SQL operator.

    +
    // name <= 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) <= "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= (lhs: SQLCollatedExpression, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <= SQL operator.

    +
    // 18 <= score
    +18 <= Column("score")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <= SQL operator.

    +
    // 'Arthur' <= name COLLATE NOCASE
    +"Arthur" <= Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= (lhs: SQLExpressible, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <= SQL operator.

    +
    // width <= height
    +Column("width") <= Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the > SQL operator.

    +
    // score > 18
    +Column("score") > 18
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the > SQL operator.

    +
    // name > 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) > "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > (lhs: SQLCollatedExpression, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the > SQL operator.

    +
    // 18 > score
    +18 > Column("score")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the > SQL operator.

    +
    // 'Arthur' > name COLLATE NOCASE
    +"Arthur" > Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > (lhs: SQLExpressible, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the > SQL operator.

    +
    // width > height
    +Column("width") > Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the >= SQL operator.

    +
    // score >= 18
    +Column("score") >= 18
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the >= SQL operator.

    +
    // name >= 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) >= "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= (lhs: SQLCollatedExpression, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the >= SQL operator.

    +
    // 18 >= score
    +18 >= Column("score")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the >= SQL operator.

    +
    // 'Arthur' >= name COLLATE NOCASE
    +"Arthur" >= Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= (lhs: SQLExpressible, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the >= SQL operator.

    +
    // width >= height
    +Column("width") >= Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Arithmetic Operators (+, -, *, /)

+

+
+
+
    +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic multiplication.

    +
    // width * 2
    +Column("width") * 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic multiplication.

    +
    // 2 * width
    +2 * Column("width")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic multiplication.

    +
    // width * height
    +Column("width") * Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic division.

    +
    // width / 2
    +Column("width") / 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic division.

    +
    // 2 / width
    +2 / Column("width")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic division.

    +
    // width / height
    +Column("width") / Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic addition.

    +
    // width + 2
    +Column("width") + 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic addition.

    +
    // 2 + width
    +2 + Column("width")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic addition.

    +
    // width + height
    +Column("width") + Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:) + +
    +
    +
    +
    +
    +
    +

    A negated SQL arithmetic expression.

    +
    // -width
    +-Column("width")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public prefix func - (value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic substraction.

    +
    // width - 2
    +Column("width") - 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic substraction.

    +
    // 2 - width
    +2 - Column("width")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic substraction.

    +
    // width - height
    +Column("width") - Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Logical Operators (AND, OR, NOT)

+

+
+
+
    +
  • +
    + + + + &&(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the AND SQL operator.

    +
    // favorite AND 0
    +Column("favorite") && false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func && (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + &&(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the AND SQL operator.

    +
    // 0 AND favorite
    +false && Column("favorite")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func && (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + &&(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the AND SQL operator.

    +
    // email IS NOT NULL AND favorite
    +Column("email") != nil && Column("favorite")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func && (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the OR SQL operator.

    +
    // favorite OR 1
    +Column("favorite") || true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func || (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the OR SQL operator.

    +
    // 0 OR favorite
    +true || Column("favorite")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func || (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the OR SQL operator.

    +
    // email IS NULL OR hidden
    +Column("email") == nil || Column("hidden")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func || (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !(_:) + +
    +
    +
    +
    +
    +
    +

    A negated logical SQL expression with the NOT SQL operator.

    +
    // NOT hidden
    +!Column("hidden")
    +
    + +

    Some expressions may be negated with specific SQL operators:

    +
    // id NOT BETWEEN 1 AND 10
    +!((1...10).contains(Column("id")))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public prefix func ! (value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Public

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Return as many question marks separated with commas as the count argument.

    +
    databaseQuestionMarks(count: 3) // "?,?,?"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func databaseQuestionMarks(count: Int) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols.html b/docs/4.8/Protocols.html new file mode 100644 index 000000000..20785fa6c --- /dev/null +++ b/docs/4.8/Protocols.html @@ -0,0 +1,2242 @@ + + + + Protocols Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+
+
+ + +
+ +

Cursor

+

+
+
+
    +
  • +
    + + + + Cursor + +
    +
    +
    +
    +
    +
    +

    A type that supplies the values of some external resource, one at a time.

    +

    Overview

    + +

    The most common way to iterate over the elements of a cursor is to use a +while loop:

    +
    let cursor = ...
    +while let element = try cursor.next() {
    +    ...
    +}
    +
    +

    Relationship with standard Sequence and IteratorProtocol

    + +

    Cursors share traits with lazy sequences and iterators from the Swift +standard library. Differences are:

    + +
      +
    • Cursor types are classes, and have a lifetime.
    • +
    • Cursor iteration may throw errors.
    • +
    • A cursor can not be repeated.
    • +
    + +

    The protocol comes with default implementations for many operations similar +to those defined by Swift’s Sequence protocol: contains, dropFirst, +dropLast, drop(while:), enumerated, filter, first, flatMap, +forEach, joined, joined(separator:), max, max(by:), min, +min(by:), map, prefix, prefix(while:), reduce, reduce(into:), +suffix.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Cursor : AnyObject
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseAggregate + +
    +
    +
    +
    +
    +
    +

    The protocol for custom SQLite aggregates.

    + +

    For example:

    +
    struct MySum : DatabaseAggregate {
    +    var sum: Int = 0
    +
    +    mutating func step(_ dbValues: [DatabaseValue]) {
    +        if let int = Int.fromDatabaseValue(dbValues[0]) {
    +            sum += int
    +        }
    +    }
    +
    +    func finalize() -> DatabaseValueConvertible? {
    +        return sum
    +    }
    +}
    +
    +let dbQueue = DatabaseQueue()
    +let fn = DatabaseFunction("mysum", argumentCount: 1, aggregate: MySum.self)
    +dbQueue.add(function: fn)
    +try dbQueue.write { db in
    +    try db.execute(sql: "CREATE TABLE test(i)")
    +    try db.execute(sql: "INSERT INTO test(i) VALUES (1)")
    +    try db.execute(sql: "INSERT INTO test(i) VALUES (2)")
    +    try Int.fetchOne(db, sql: "SELECT mysum(i) FROM test")! // 3
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DatabaseAggregate
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseReader + +
    +
    +
    +
    +
    +
    +

    The protocol for all types that can fetch values from a database.

    + +

    It is adopted by DatabaseQueue and DatabasePool.

    + +

    The protocol comes with isolation guarantees that describe the behavior of +adopting types in a multithreaded application.

    + +

    Types that adopt the protocol can provide in practice stronger guarantees. +For example, DatabaseQueue provides a stronger isolation level +than DatabasePool.

    + +

    Warning: Isolation guarantees stand as long as there is no external +connection to the database. Should you have to cope with external +connections, protect yourself with transactions, and be ready to setup a +busy handler.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DatabaseReader : AnyObject
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseRegionConvertible

+

+
+
+ +
+
+
+ + +
+ +

DatabaseValueConvertible

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Types that adopt DatabaseValueConvertible can be initialized from +database values.

    + +

    The protocol comes with built-in methods that allow to fetch cursors, +arrays, or single values:

    +
    try String.fetchCursor(db, sql: "SELECT name FROM ...", arguments:...) // Cursor of String
    +try String.fetchAll(db, sql: "SELECT name FROM ...", arguments:...)    // [String]
    +try String.fetchOne(db, sql: "SELECT name FROM ...", arguments:...)    // String?
    +
    +let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +try String.fetchCursor(statement, arguments:...) // Cursor of String
    +try String.fetchAll(statement, arguments:...)    // [String]
    +try String.fetchOne(statement, arguments:...)    // String?
    +
    + +

    DatabaseValueConvertible is adopted by Bool, Int, String, etc.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DatabaseValueConvertible : SQLExpressible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

FetchRequest

+

+
+
+
    +
  • +
    + + + + FetchRequest + +
    +
    +
    +
    +
    +
    +

    The protocol for all requests that fetch database rows, and tell how those +rows should be interpreted.

    +
    struct Player: FetchableRecord { ... }
    +let request: ... // Some FetchRequest that fetches Player
    +try request.fetchCursor(db) // Cursor of Player
    +try request.fetchAll(db)    // [Player]
    +try request.fetchOne(db)    // Player?
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FetchRequest : DatabaseRegionConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseWriter + +
    +
    +
    +
    +
    +
    +

    The protocol for all types that can update a database.

    + +

    It is adopted by DatabaseQueue and DatabasePool.

    + +

    The protocol comes with isolation guarantees that describe the behavior of +adopting types in a multithreaded application.

    + +

    Types that adopt the protocol can in practice provide stronger guarantees. +For example, DatabaseQueue provides a stronger isolation level +than DatabasePool.

    + +

    Warning: Isolation guarantees stand as long as there is no external +connection to the database. Should you have to cope with external +connections, protect yourself with transactions, and be ready to setup a +busy handler.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DatabaseWriter : DatabaseReader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RowAdapter + +
    +
    +
    +
    +
    +
    +

    RowAdapter is a protocol that helps two incompatible row interfaces working +together.

    + +

    GRDB ships with four concrete types that adopt the RowAdapter protocol:

    + +
      +
    • ColumnMapping: renames row columns
    • +
    • SuffixRowAdapter: hides the first columns of a row
    • +
    • RangeRowAdapter: only exposes a range of columns
    • +
    • ScopeAdapter: groups several adapters together to define named scopes
    • +
    + +

    To use a row adapter, provide it to any method that fetches:

    +
    let adapter = SuffixRowAdapter(fromIndex: 2)
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +
    +// [baz:3]
    +try Row.fetchOne(db, sql: sql, adapter: adapter)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The StatementColumnConvertible protocol grants access to the low-level C +interface that extracts values from query results: +https://www.sqlite.org/c3ref/column_blob.html. It can bring performance +improvements.

    + +

    To use it, have a value type adopt both StatementColumnConvertible and +DatabaseValueConvertible. GRDB will then automatically apply the +optimization whenever direct access to SQLite is possible:

    +
    let rows = Row.fetchCursor(db, sql: "SELECT ...")
    +while let row = try rows.next() {
    +    let int: Int = row[0]                 // there
    +}
    +let ints = Int.fetchAll(db, sql: "SELECT ...") // there
    +struct Player {
    +    init(row: Row) {
    +        name = row["name"]                // there
    +        score = row["score"]              // there
    +    }
    +}
    +
    + +

    StatementColumnConvertible is already adopted by all Swift integer types, +Float, Double, String, and Bool.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol StatementColumnConvertible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

TransactionObserver

+

+
+
+
    +
  • +
    + + + + TransactionObserver + +
    +
    +
    +
    +
    +
    +

    A transaction observer is notified of all changes and transactions committed +or rollbacked on a database.

    + +

    Adopting types must be a class.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol TransactionObserver : AnyObject
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5CustomTokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for custom FTS5 tokenizers.

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS5Tokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for FTS5 tokenizers

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS5WrapperTokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for custom FTS5 tokenizers that wrap another tokenizer.

    + +

    Types that adopt FTS5WrapperTokenizer don’t have to implement the +low-level FTS5Tokenizer.tokenize(context:flags:pText:nText:tokenCallback:).

    + +

    Instead, they process regular Swift strings.

    + +

    Here is the implementation for a trivial tokenizer that wraps the +built-in ascii tokenizer without any custom processing:

    +
    class TrivialAsciiTokenizer : FTS5WrapperTokenizer {
    +    static let name = "trivial"
    +    let wrappedTokenizer: FTS5Tokenizer
    +
    +    init(db: Database, arguments: [String]) throws {
    +        wrappedTokenizer = try db.makeTokenizer(.ascii())
    +    }
    +
    +    func accept(
    +        token: String,
    +        flags: FTS5TokenFlags,
    +        for tokenization: FTS5Tokenization,
    +        tokenCallback: FTS5WrapperTokenCallback)
    +        throws
    +    {
    +        try tokenCallback(token, flags)
    +    }
    +}
    +
    + + See more +
    +
    +
    +
  • +
  • +
    + + + + TableRecord + +
    +
    +
    +
    +
    +
    +

    Types that adopt TableRecord declare a particular relationship with +a database table.

    + +

    Types that adopt both TableRecord and FetchableRecord are granted with +built-in methods that allow to fetch instances identified by key:

    +
    try Player.fetchOne(db, key: 123)  // Player?
    +try Citizenship.fetchOne(db, key: ["citizenId": 12, "countryId": 45]) // Citizenship?
    +
    + +

    TableRecord is adopted by Record.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol TableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ColumnExpression + +
    +
    +
    +
    +
    +
    +

    Adopt the ColumnExpression protocol when you define a column type.

    + +

    You can, for example, define a String-based column enum:

    +
    enum Columns: String, ColumnExpression {
    +    case id, name, score
    +}
    +let arthur = try Player.filter(Columns.name == "Arthur").fetchOne(db)
    +
    + +

    You can also define a genuine column type:

    +
    struct MyColumn: ColumnExpression {
    +    var name: String
    +    var sqlType: String
    +}
    +let nameColumn = MyColumn(name: "name", sqlType: "VARCHAR")
    +let arthur = try Player.filter(nameColumn == "Arthur").fetchOne(db)
    +
    + +

    See https://github.com/groue/GRDB.swift#the-query-interface

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ColumnExpression : SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Association + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    The base protocol for all associations that define a connection between two +record types.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Association : DerivableRequest
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

AssociationToOne

+

+
+
+ +
+
+
+ + +
+ +

AssociationToMany

+

+
+
+
    +
  • +
    + + + + AssociationToMany + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    The base protocol for all associations that define a one-to-many connection.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol AssociationToMany : Association
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + VirtualTableModule + +
    +
    +
    +
    +
    +
    +

    The protocol for SQLite virtual table modules. It lets you define a DSL for +the Database.create(virtualTable:using:) method:

    +
    let module = ...
    +try db.create(virtualTable: "item", using: module) { t in
    +    ...
    +}
    +
    + +

    GRDB ships with three concrete classes that implement this protocol: FTS3, +FTS4 and FTS5.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol VirtualTableModule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + EncodableRecord + +
    +
    +
    +
    +
    +
    +

    Types that adopt EncodableRecord can be encoded into the database.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol EncodableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FetchableRecord + +
    +
    +
    +
    +
    +
    +

    Types that adopt FetchableRecord can be initialized from a database Row.

    +
    let row = try Row.fetchOne(db, sql: "SELECT ...")!
    +let player = Player(row)
    +
    + +

    The protocol comes with built-in methods that allow to fetch cursors, +arrays, or single records:

    +
    try Player.fetchCursor(db, sql: "SELECT ...", arguments:...) // Cursor of Player
    +try Player.fetchAll(db, sql: "SELECT ...", arguments:...)    // [Player]
    +try Player.fetchOne(db, sql: "SELECT ...", arguments:...)    // Player?
    +
    +let statement = try db.makeSelectStatement(sql: "SELECT ...")
    +try Player.fetchCursor(statement, arguments:...) // Cursor of Player
    +try Player.fetchAll(statement, arguments:...)    // [Player]
    +try Player.fetchOne(statement, arguments:...)    // Player?
    +
    + +

    FetchableRecord is adopted by Record.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FetchableRecord
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Types that adopt MutablePersistableRecord can be inserted, updated, and deleted.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol MutablePersistableRecord : EncodableRecord, TableRecord
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

PersistableRecord

+

+
+
+
    +
  • +
    + + + + PersistableRecord + +
    +
    +
    +
    +
    +
    +

    Types that adopt PersistableRecord can be inserted, updated, and deleted.

    + +

    This protocol is intented for types that don’t have an INTEGER PRIMARY KEY.

    + +

    Unlike MutablePersistableRecord, the insert() and save() methods are not +mutating methods.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol PersistableRecord : MutablePersistableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ValueReducer + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    The ValueReducer protocol supports ValueObservation.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ValueReducer
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5CustomTokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for custom FTS5 tokenizers.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FTS5CustomTokenizer : FTS5Tokenizer
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5Tokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for FTS5 tokenizers

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FTS5Tokenizer : AnyObject
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5WrapperTokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for custom FTS5 tokenizers that wrap another tokenizer.

    + +

    Types that adopt FTS5WrapperTokenizer don’t have to implement the +low-level FTS5Tokenizer.tokenize(context:flags:pText:nText:tokenCallback:).

    + +

    Instead, they process regular Swift strings.

    + +

    Here is the implementation for a trivial tokenizer that wraps the +built-in ascii tokenizer without any custom processing:

    +
    class TrivialAsciiTokenizer : FTS5WrapperTokenizer {
    +    static let name = "trivial"
    +    let wrappedTokenizer: FTS5Tokenizer
    +
    +    init(db: Database, arguments: [String]) throws {
    +        wrappedTokenizer = try db.makeTokenizer(.ascii())
    +    }
    +
    +    func accept(
    +        token: String,
    +        flags: FTS5TokenFlags,
    +        for tokenization: FTS5Tokenization,
    +        tokenCallback: FTS5WrapperTokenCallback)
    +        throws
    +    {
    +        try tokenCallback(token, flags)
    +    }
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FTS5WrapperTokenizer : FTS5CustomTokenizer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/Association.html b/docs/4.8/Protocols/Association.html new file mode 100644 index 000000000..7ba986bdc --- /dev/null +++ b/docs/4.8/Protocols/Association.html @@ -0,0 +1,1543 @@ + + + + Association Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Association

+
+
+
public protocol Association : DerivableRequest
+ +
+
+

Experimental

+ +

The base protocol for all associations that define a connection between two +record types.

+ +
+
+
+
    +
  • +
    + + + + OriginRowDecoder + +
    +
    +
    +
    +
    +
    +

    The record type at the origin of the association.

    + +

    In the belongsTo association below, it is Book:

    +
    struct Book: TableRecord {
    +    // BelongsToAssociation<Book, Author>
    +    static let author = belongsTo(Author.self)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype OriginRowDecoder : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + forKey(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Creates an association with the given key.

    + +

    This new key impacts how rows fetched from the resulting association +should be consumed:

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// Consume rows:
    +let request = Player.including(required: Player.team.forKey("custom"))
    +for row in Row.fetchAll(db, request) {
    +    let team: Team = row["custom"]
    +}
    +
    + +
    +

    Default Implementation

    +
    +

    Creates an association with the given key.

    + +

    This new key helps Decodable records decode rows fetched from the +resulting association:

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +struct PlayerInfo: FetchableRecord, Decodable {
    +    let player: Player
    +    let team: Team
    +
    +    static func all() -> QueryInterfaceRequest<PlayerInfo> {
    +        return Player
    +            .including(required: Player.team.forKey(CodingKeys.team))
    +            .asRequest(of: PlayerInfo.self)
    +    }
    +}
    +
    +let playerInfos = PlayerInfo.all().fetchAll(db)
    +print(playerInfos.first?.team)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func forKey(_ key: String) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association which selects selection.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.color
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let association = Player.team.select([Column("color")])
    +var request = Player.including(required: association)
    +
    + +

    Any previous selection is replaced:

    +
    // SELECT player.*, team.color
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let association = Player.team
    +    .select([Column("id")])
    +    .select([Column("color")])
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select(_ selection: [SQLSelectable]) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association which appends selection.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.color, team.name
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let association = Player.team
    +    .select([Column("color")])
    +    .annotated(with: [Column("name")])
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func annotated(with selection: [SQLSelectable]) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association with the provided predicate promise added to +the eventual set of already applied predicates.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId AND 1
    +let association = Player.team.filter { db in true }
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func filter(_ predicate: @escaping (Database) throws -> SQLExpressible) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association with the provided orderings promise.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +// ORDER BY team.name
    +let association = Player.team.order { _ in [Column("name")] }
    +var request = Player.including(required: association)
    +
    + +

    Any previous ordering is replaced:

    +
    // SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +// ORDER BY team.name
    +let association = Player.team
    +    .order{ _ in [Column("color")] }
    +    .reversed()
    +    .order{ _ in [Column("name")] }
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func order(_ orderings: @escaping (Database) throws -> [SQLOrderingTerm]) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reversed() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association that reverses applied orderings.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +// ORDER BY team.name DESC
    +let association = Player.team.order(Column("name")).reversed()
    +var request = Player.including(required: association)
    +
    + +

    If no ordering was applied, the returned association is identical.

    +
    // SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let association = Player.team.reversed()
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reversed() -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unordered() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association without any ordering.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let association = Player.team.order(Column("name")).unordered()
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unordered() -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + aliased(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association that allows you to define expressions that target +a specific database table.

    + +

    In the example below, the “team.color = ‘red’” condition in the where +clause could be not achieved without table aliases.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// JOIN team ON ...
    +// WHERE team.color = 'red'
    +let teamAlias = TableAlias()
    +let request = Player
    +    .including(required: Player.team.aliased(teamAlias))
    +    .filter(teamAlias[Column("color")] == "red")
    +
    + +

    When you give a name to a table alias, you can reliably inject sql +snippets in your requests:

    +
    // SELECT player.*, custom.*
    +// JOIN team custom ON ...
    +// WHERE custom.color = 'red'
    +let teamAlias = TableAlias(name: "custom")
    +let request = Player
    +    .including(required: Player.team.aliased(teamAlias))
    +    .filter(sql: "custom.color = ?", arguments: ["red"])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func aliased(_ alias: TableAlias) -> Self
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/AssociationToMany.html b/docs/4.8/Protocols/AssociationToMany.html new file mode 100644 index 000000000..b54855604 --- /dev/null +++ b/docs/4.8/Protocols/AssociationToMany.html @@ -0,0 +1,1411 @@ + + + + AssociationToMany Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AssociationToMany

+
+
+
public protocol AssociationToMany : Association
+ +
+
+

Experimental

+ +

The base protocol for all associations that define a one-to-many connection.

+ +
+
+
+
+ + +
+ +

AssociationToMany

+

+
+
+
    +
  • +
    + + + + forKey(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func forKey(_ key: String) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + count + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The number of associated records.

    + +

    It has a default name, which is “[key]Count”, where key is the key of +the association. For example:

    + +

    For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var playerCount: Int
    +}
    +let request = Team.annotated(with: Team.players.count())
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.count() > 10).fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var count: AssociationAggregate<OriginRowDecoder> { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isEmpty + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate that is true if there exists no associated records.

    + +

    It has a default name, which is “hasNo[Key]”, where key is the key of +the association. For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var hasNoPlayer: Bool
    +}
    +let request = Team.annotated(with: Team.players.isEmpty())
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.isEmpty()).fetchAll(db)
    +let teams: [Team] = try Team.having(!Team.players.isEmpty())
    +let teams: [Team] = try Team.having(Team.players.isEmpty() == false)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isEmpty: AssociationAggregate<OriginRowDecoder> { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + average(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate which evaluate to the average value of the given +expression in associated records.

    + +

    When the averaged expression is a column, the aggregate has a default +name which is “average[Key][Column]”, where key is the key of the +association. For example:

    + +

    For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var averagePlayerScore: Double
    +}
    +let request = Team.annotated(with: Team.players.average(Column("score")))
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.average(Column("score")) > 100).fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func average(_ expression: SQLExpressible) -> AssociationAggregate<OriginRowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + max(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate which evaluate to the maximum value of the given +expression in associated records.

    + +

    When the maximized expression is a column, the aggregate has a default +name which is “maximum[Key][Column]”, where key is the key of the +association. For example:

    + +

    For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var maxPlayerScore: Double
    +}
    +let request = Team.annotated(with: Team.players.max(Column("score")))
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.max(Column("score")) < 100).fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func max(_ expression: SQLExpressible) -> AssociationAggregate<OriginRowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + min(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate which evaluate to the minimum value of the given +expression in associated records.

    + +

    When the minimized expression is a column, the aggregate has a default +name which is “minimum[Key][Column]”, where key is the key of the +association. For example:

    + +

    For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var minPlayerScore: Double
    +}
    +let request = Team.annotated(with: Team.players.min(Column("score")))
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.min(Column("score")) > 100).fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func min(_ expression: SQLExpressible) -> AssociationAggregate<OriginRowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + sum(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate which evaluate to the sum of the given expression +in associated records.

    + +

    When the summed expression is a column, the aggregate has a default +name which is “[key][Column]Sum”, where key is the key of the +association. For example:

    + +

    For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var playerScoreSum: Double
    +}
    +let request = Team.annotated(with: Team.players.sum(Column("score")))
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.sum(Column("score")) > 100).fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sum(_ expression: SQLExpressible) -> AssociationAggregate<OriginRowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/AssociationToOne.html b/docs/4.8/Protocols/AssociationToOne.html new file mode 100644 index 000000000..2a31bc2e9 --- /dev/null +++ b/docs/4.8/Protocols/AssociationToOne.html @@ -0,0 +1,1121 @@ + + + + AssociationToOne Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AssociationToOne

+
+
+
public protocol AssociationToOne : Association
+ +
+
+

Experimental

+ +

The base protocol for all associations that define a one-to-one connection.

+ +
+
+
+
+ + +
+ +

AssociationToOne

+

+
+
+
    +
  • +
    + + + + forKey(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func forKey(_ key: String) -> Self
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/ColumnExpression.html b/docs/4.8/Protocols/ColumnExpression.html new file mode 100644 index 000000000..526b9dc90 --- /dev/null +++ b/docs/4.8/Protocols/ColumnExpression.html @@ -0,0 +1,1167 @@ + + + + ColumnExpression Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ColumnExpression

+
+
+
public protocol ColumnExpression : SQLExpression
+ +
+
+

Adopt the ColumnExpression protocol when you define a column type.

+ +

You can, for example, define a String-based column enum:

+
enum Columns: String, ColumnExpression {
+    case id, name, score
+}
+let arthur = try Player.filter(Columns.name == "Arthur").fetchOne(db)
+
+ +

You can also define a genuine column type:

+
struct MyColumn: ColumnExpression {
+    var name: String
+    var sqlType: String
+}
+let nameColumn = MyColumn(name: "name", sqlType: "VARCHAR")
+let arthur = try Player.filter(nameColumn == "Arthur").fetchOne(db)
+
+ +

See https://github.com/groue/GRDB.swift#the-query-interface

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The unqualified name of a database column.

    + +

    “score” is a valid unqualified name. “player.score” is not.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var name: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + match(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A matching SQL expression with the MATCH SQL operator.

    +
    // content MATCH '...'
    +Column("content").match(pattern)
    +
    + +

    If the search pattern is nil, SQLite will evaluate the expression +to false.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func match(_ pattern: FTS3Pattern?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/Cursor.html b/docs/4.8/Protocols/Cursor.html new file mode 100644 index 000000000..aad14b0cc --- /dev/null +++ b/docs/4.8/Protocols/Cursor.html @@ -0,0 +1,2536 @@ + + + + Cursor Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Cursor

+
+
+
public protocol Cursor : AnyObject
+ +
+
+

A type that supplies the values of some external resource, one at a time.

+

Overview

+ +

The most common way to iterate over the elements of a cursor is to use a +while loop:

+
let cursor = ...
+while let element = try cursor.next() {
+    ...
+}
+
+

Relationship with standard Sequence and IteratorProtocol

+ +

Cursors share traits with lazy sequences and iterators from the Swift +standard library. Differences are:

+ +
    +
  • Cursor types are classes, and have a lifetime.
  • +
  • Cursor iteration may throw errors.
  • +
  • A cursor can not be repeated.
  • +
+ +

The protocol comes with default implementations for many operations similar +to those defined by Swift’s Sequence protocol: contains, dropFirst, +dropLast, drop(while:), enumerated, filter, first, flatMap, +forEach, joined, joined(separator:), max, max(by:), min, +min(by:), map, prefix, prefix(while:), reduce, reduce(into:), +suffix.

+ +
+
+
+
    +
  • +
    + + + + Element + +
    +
    +
    +
    +
    +
    +

    The type of element traversed by the cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Element
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + next() + +
    +
    +
    +
    +
    +
    +

    Advances to the next element and returns it, or nil if no next element +exists. Once nil has been returned, all subsequent calls return nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func next() throws -> Element?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Cursor

+

+
+
+
    +
  • +
    + + + + isEmpty() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a Boolean value indicating whether the cursor contains +an element.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isEmpty() throws -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contains(where:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a Boolean value indicating whether the cursor contains an +element that satisfies the given predicate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(where predicate: (Element) throws -> Bool) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + predicate + + +
    +

    A closure that takes an element of the cursor as +its argument and returns a Boolean value that indicates whether the +passed element represents a match.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the cursor contains an element that satisfies +predicate; otherwise, false.

    +
    + +
    +
    +
  • +
  • +
    + + + + enumerated() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor of pairs (n, x), where n represents a consecutive +integer starting at zero, and x represents an element of the cursor.

    +
    let cursor = try String.fetchCursor(db, sql: "SELECT 'foo' UNION ALL SELECT 'bar'")
    +let c = cursor.enumerated()
    +while let (n, x) = c.next() {
    +    print("\(n): \(x)")
    +}
    +// Prints: "0: foo"
    +// Prints: "1: bar"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func enumerated() -> EnumeratedCursor<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the elements of the cursor that satisfy the given predicate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func filter(_ isIncluded: @escaping (Element) throws -> Bool) -> FilterCursor<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + first(where:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the first element of the cursor that satisfies the given +predicate or nil if no such element is found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func first(where predicate: (Element) throws -> Bool) throws -> Element?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compactMap(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over the concatenated non-nil results of mapping +transform over this cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func compactMap<ElementOfResult>(_ transform: @escaping (Element) throws -> ElementOfResult?)
    +    -> MapCursor<FilterCursor<MapCursor<Self, ElementOfResult?>>, ElementOfResult>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + drop(while:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor that skips any initial elements that satisfy +predicate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func drop(while predicate: @escaping (Element) throws -> Bool) -> DropWhileCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + predicate + + +
    +

    A closure that takes an element of the cursir as +its argument and returns true if the element should be skipped or +false otherwise. Once predicate returns false it will not be +called again.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + dropFirst(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor containing all but the given number of initial +elements.

    + +

    If the number of elements to drop exceeds the number of elements in +the cursor, the result is an empty cursor.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.dropFirst(2))
    +// Prints "[3, 4, 5]"
    +try print(numbers.dropFirst(10))
    +// Prints "[]"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropFirst(_ n: Int) -> DropFirstCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + n + + +
    +

    The number of elements to drop from the beginning of +the cursor. n must be greater than or equal to zero.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor starting after the specified number of +elements.

    +
    + +
    +
    +
  • +
  • +
    + + + + dropFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor containing all but the first element of the cursor.

    + +

    The following example drops the first element from a cursor of integers.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.dropFirst())
    +// Prints "[2, 3, 4, 5]"
    +
    + +

    If the cursor has no elements, the result is an empty cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropFirst() -> DropFirstCursor<Self>
    + +
    +
    +
    +

    Return Value

    +

    A cursor starting after the first element of the cursor.

    +
    + +
    +
    +
  • +
  • +
    + + + + dropLast(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array containing all but the given number of final +elements.

    + +

    The cursor must be finite. If the number of elements to drop exceeds +the number of elements in the cursor, the result is an empty array.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.dropLast(2))
    +// Prints "[1, 2, 3]"
    +try print(numbers.dropLast(10))
    +// Prints "[]"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropLast(_ n: Int) throws -> [Element]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + n + + +
    +

    The number of elements to drop off the end of the +cursor. n must be greater than or equal to zero.

    +
    +
    +
    +
    +

    Return Value

    +

    An array leaving off the specified number of elements.

    +
    + +
    +
    +
  • +
  • +
    + + + + dropLast() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array containing all but the last element of the cursor.

    + +

    The following example drops the last element from a cursor of integers.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.dropLast())
    +// Prints "[1, 2, 3, 4]"
    +
    + +

    If the cursor has no elements, the result is an empty cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropLast() throws -> [Element]
    + +
    +
    +
    +

    Return Value

    +

    An array leaving off the last element of the cursor.

    +
    + +
    +
    +
  • +
  • +
    + + + + flatMap(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over the concatenated results of mapping transform +over self.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func flatMap<SegmentOfResult>(_ transform: @escaping (Element) throws -> SegmentOfResult)
    +    -> FlattenCursor<MapCursor<Self, AnyCursor<SegmentOfResult.Element>>>
    +    where SegmentOfResult: Sequence
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + flatMap(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over the concatenated results of mapping transform +over self.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func flatMap<SegmentOfResult>(_ transform: @escaping (Element) throws -> SegmentOfResult)
    +    -> FlattenCursor<MapCursor<Self, SegmentOfResult>>
    +    where SegmentOfResult: Cursor
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + forEach(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Calls the given closure on each element in the cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func forEach(_ body: (Element) throws -> Void) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + map(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over the results of the transform function applied to +this cursor’s elements.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func map<T>(_ transform: @escaping (Element) throws -> T) -> MapCursor<Self, T>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + max(by:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the maximum element in the cursor, using the given predicate as +the comparison between elements.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func max(by areInIncreasingOrder: (Element, Element) throws -> Bool) throws -> Element?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + areInIncreasingOrder + + +
    +

    A predicate that returns true +if its first argument should be ordered before its second +argument; otherwise, false.

    +
    +
    +
    +
    +

    Return Value

    +

    The cursor’s maximum element, according to +areInIncreasingOrder. If the cursor has no elements, returns nil.

    +
    + +
    +
    +
  • +
  • +
    + + + + min(by:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the minimum element in the cursor, using the given predicate as +the comparison between elements.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func min(by areInIncreasingOrder: (Element, Element) throws -> Bool) throws -> Element?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + areInIncreasingOrder + + +
    +

    A predicate that returns true +if its first argument should be ordered before its second +argument; otherwise, false.

    +
    +
    +
    +
    +

    Return Value

    +

    The cursor’s minimum element, according to +areInIncreasingOrder. If the cursor has no elements, returns nil.

    +
    + +
    +
    +
  • +
  • +
    + + + + prefix(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor, up to the specified maximum length, containing the +initial elements of the cursor.

    + +

    If the maximum length exceeds the number of elements in the cursor, +the result contains all the elements in the cursor.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.prefix(2))
    +// Prints "[1, 2]"
    +try print(numbers.prefix(10))
    +// Prints "[1, 2, 3, 4, 5]"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func prefix(_ maxLength: Int) -> PrefixCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + maxLength + + +
    +

    The maximum number of elements to return. The +value of maxLength must be greater than or equal to zero.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor starting at the beginning of this cursor +with at most maxLength elements.

    +
    + +
    +
    +
  • +
  • +
    + + + + prefix(while:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor of the initial consecutive elements that satisfy +predicate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func prefix(while predicate: @escaping (Element) throws -> Bool) -> PrefixWhileCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + predicate + + +
    +

    A closure that takes an element of the cursor as +its argument and returns true if the element should be included or +false otherwise. Once predicate returns false it will not be +called again.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + reduce(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the result of calling the given combining closure with each +element of this cursor and an accumulating value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reduce<Result>(
    +    _ initialResult: Result,
    +    _ nextPartialResult: (Result, Element) throws -> Result)
    +    throws -> Result
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reduce(into:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the result of calling the given combining closure with each +element of this cursor and an accumulating value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reduce<Result>(
    +    into initialResult: Result,
    +    _ updateAccumulatingResult: (inout Result, Element) throws -> Void)
    +    throws -> Result
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + suffix(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array, up to the given maximum length, containing the +final elements of the cursor.

    + +

    The cursor must be finite. If the maximum length exceeds the number of +elements in the cursor, the result contains all the elements in the +cursor.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.suffix(2))
    +// Prints "[4, 5]"
    +try print(numbers.suffix(10))
    +// Prints "[1, 2, 3, 4, 5]"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func suffix(_ maxLength: Int) throws -> [Element]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + maxLength + + +
    +

    The maximum number of elements to return. The +value of maxLength must be greater than or equal to zero.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element: Equatable

+

+
+
+
    +
  • +
    + + + + contains(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a Boolean value indicating whether the cursor contains the +given element.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: Element) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element: Comparable

+

+
+
+
    +
  • +
    + + + + max() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the maximum element in the cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func max() throws -> Element?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + areInIncreasingOrder + + +
    +

    A predicate that returns true +if its first argument should be ordered before its second +argument; otherwise, false.

    +
    +
    +
    +
    +

    Return Value

    +

    The cursor’s maximum element, according to +areInIncreasingOrder. If the cursor has no elements, returns +nil.

    +
    + +
    +
    +
  • +
  • +
    + + + + min() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the minimum element in the cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func min() throws -> Element?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + areInIncreasingOrder + + +
    +

    A predicate that returns true +if its first argument should be ordered before its second +argument; otherwise, false.

    +
    +
    +
    +
    +

    Return Value

    +

    The cursor’s minimum element, according to +areInIncreasingOrder. If the cursor has no elements, returns +nil.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element: Cursor

+

+
+
+
    +
  • +
    + + + + joined() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the elements of this cursor of cursors, concatenated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined() -> FlattenCursor<Self>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element: Sequence

+

+
+
+
    +
  • +
    + + + + joined() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the elements of this cursor of sequences, concatenated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined() -> FlattenCursor<MapCursor<Self, AnyCursor<Element.Element>>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element: StringProtocol

+

+
+
+
    +
  • +
    + + + + joined(separator:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the elements of this cursor of sequences, concatenated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined(separator: String = "") throws -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/DatabaseAggregate.html b/docs/4.8/Protocols/DatabaseAggregate.html new file mode 100644 index 000000000..67e8551a0 --- /dev/null +++ b/docs/4.8/Protocols/DatabaseAggregate.html @@ -0,0 +1,1205 @@ + + + + DatabaseAggregate Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseAggregate

+
+
+
public protocol DatabaseAggregate
+ +
+
+

The protocol for custom SQLite aggregates.

+ +

For example:

+
struct MySum : DatabaseAggregate {
+    var sum: Int = 0
+
+    mutating func step(_ dbValues: [DatabaseValue]) {
+        if let int = Int.fromDatabaseValue(dbValues[0]) {
+            sum += int
+        }
+    }
+
+    func finalize() -> DatabaseValueConvertible? {
+        return sum
+    }
+}
+
+let dbQueue = DatabaseQueue()
+let fn = DatabaseFunction("mysum", argumentCount: 1, aggregate: MySum.self)
+dbQueue.add(function: fn)
+try dbQueue.write { db in
+    try db.execute(sql: "CREATE TABLE test(i)")
+    try db.execute(sql: "INSERT INTO test(i) VALUES (1)")
+    try db.execute(sql: "INSERT INTO test(i) VALUES (2)")
+    try Int.fetchOne(db, sql: "SELECT mysum(i) FROM test")! // 3
+}
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + step(_:) + +
    +
    +
    +
    +
    +
    +

    This method is called at each step of the aggregation.

    + +

    The dbValues argument contains as many values as given to the SQL +aggregate function.

    + +

    – One value + SELECT maxLength(name) FROM player

    + +

    – Two values + SELECT maxFullNameLength(firstName, lastName) FROM player

    + +

    This method is never called after the finalize() method has been called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func step(_ dbValues: [DatabaseValue]) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + finalize() + +
    +
    +
    +
    +
    +
    +

    Returns the final result

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func finalize() throws -> DatabaseValueConvertible?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/DatabaseReader.html b/docs/4.8/Protocols/DatabaseReader.html new file mode 100644 index 000000000..5457e2a3b --- /dev/null +++ b/docs/4.8/Protocols/DatabaseReader.html @@ -0,0 +1,1879 @@ + + + + DatabaseReader Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseReader

+
+
+
public protocol DatabaseReader : AnyObject
+ +
+
+

The protocol for all types that can fetch values from a database.

+ +

It is adopted by DatabaseQueue and DatabasePool.

+ +

The protocol comes with isolation guarantees that describe the behavior of +adopting types in a multithreaded application.

+ +

Types that adopt the protocol can provide in practice stronger guarantees. +For example, DatabaseQueue provides a stronger isolation level +than DatabasePool.

+ +

Warning: Isolation guarantees stand as long as there is no external +connection to the database. Should you have to cope with external +connections, protect yourself with transactions, and be ready to setup a +busy handler.

+ +
+
+
+
    +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The database configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var configuration: Configuration { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Interrupting Database Operations

+

+
+
+
    +
  • +
    + + + + interrupt() + +
    +
    +
    +
    +
    +
    +

    This method causes any pending database operation to abort and return at +its earliest opportunity.

    + +

    It can be called from any thread.

    + +

    A call to interrupt() that occurs when there are no running SQL +statements is a no-op and has no effect on SQL statements that are +started after interrupt() returns.

    + +

    A database operation that is interrupted will throw a DatabaseError with +code SQLITE_INTERRUPT. If the interrupted SQL operation is an INSERT, +UPDATE, or DELETE that is inside an explicit transaction, then the +entire transaction will be rolled back automatically. If the rolled back +transaction was started by a transaction-wrapping method such as +DatabaseWriter.write or Database.inTransaction, then all database +accesses will throw a DatabaseError with code SQLITE_ABORT until the +wrapping method returns.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    // interrupted:
    +    try Player(...).insert(db)     // throws SQLITE_INTERRUPT
    +    // not executed:
    +    try Player(...).insert(db)
    +}                                  // throws SQLITE_INTERRUPT
    +
    +try dbQueue.write { db in
    +    do {
    +        // interrupted:
    +        try Player(...).insert(db) // throws SQLITE_INTERRUPT
    +    } catch { }
    +    try Player(...).insert(db)     // throws SQLITE_ABORT
    +}                                  // throws SQLITE_ABORT
    +
    +try dbQueue.write { db in
    +    do {
    +        // interrupted:
    +        try Player(...).insert(db) // throws SQLITE_INTERRUPT
    +    } catch { }
    +}                                  // throws SQLITE_ABORT
    +
    + +

    When an application creates transaction without a transaction-wrapping +method, no SQLITE_ABORT error warns of aborted transactions:

    +
    try dbQueue.inDatabase { db in // or dbPool.writeWithoutTransaction
    +    try db.beginTransaction()
    +    do {
    +        // interrupted:
    +        try Player(...).insert(db) // throws SQLITE_INTERRUPT
    +    } catch { }
    +    try Player(...).insert(db)     // success
    +    try db.commit()                // throws SQLITE_ERROR "cannot commit - no transaction is active"
    +}
    +
    + +

    Both SQLITE_ABORT and SQLITE_INTERRUPT errors can be checked with the +DatabaseError.isInterruptionError property.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func interrupt()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Read From Database

+

+
+
+
    +
  • +
    + + + + read(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block that takes a database +connection, and returns its result.

    + +

    Guarantee 1: the block argument is isolated. Eventual concurrent +database updates are not visible inside the block:

    +
    try reader.read { db in
    +    // Those two values are guaranteed to be equal, even if the
    +    // `player` table is modified between the two requests:
    +    let count1 = try Player.fetchCount(db)
    +    let count2 = try Player.fetchCount(db)
    +}
    +
    +try reader.read { db in
    +    // Now this value may be different:
    +    let count = try Player.fetchCount(db)
    +}
    +
    + +

    Guarantee 2: Starting iOS 8.2, OSX 10.10, and with custom SQLite builds +and SQLCipher, attempts to write in the database throw a DatabaseError +whose resultCode is SQLITE_READONLY.

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func read<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + asyncRead(_:) + +
    +
    +
    +
    +
    +
    +

    Asynchronously executes a read-only block that takes a +database connection.

    + +

    Guarantee 1: the block argument is isolated. Eventual concurrent +database updates are not visible inside the block:

    +
    try reader.asyncRead { result in
    +    do (
    +        let db = try result.get()
    +        // Those two values are guaranteed to be equal, even if the
    +        // `player` table is modified between the two requests:
    +        let count1 = try Player.fetchCount(db)
    +        let count2 = try Player.fetchCount(db)
    +    } catch {
    +        // handle error
    +    }
    +}
    +
    + +

    Guarantee 2: Starting iOS 8.2, OSX 10.10, and with custom SQLite builds +and SQLCipher, attempts to write in the database throw a DatabaseError +whose resultCode is SQLITE_READONLY.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func asyncRead(_ block: @escaping (Result<Database, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + unsafeRead(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block that takes a database +connection, and returns its result.

    + +

    The two guarantees of the safe read method are lifted:

    + +

    The block argument is not isolated: eventual concurrent database updates +are visible inside the block:

    +
    try reader.unsafeRead { db in
    +    // Those two values may be different because some other thread
    +    // may have inserted or deleted a player between the two requests:
    +    let count1 = try Player.fetchCount(db)
    +    let count2 = try Player.fetchCount(db)
    +}
    +
    + +

    Cursor iterations are isolated, though:

    +
    try reader.unsafeRead { db in
    +    // No concurrent update can mess with this iteration:
    +    let rows = try Row.fetchCursor(db, sql: "SELECT ...")
    +    while let row = try rows.next() { ... }
    +}
    +
    + +

    The block argument is not prevented from writing (DatabaseQueue, in +particular, will accept database modifications in unsafeRead).

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unsafeRead<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes a block that takes a database connection, and +returns its result.

    + +

    The two guarantees of the safe read method are lifted:

    + +

    The block argument is not isolated: eventual concurrent database updates +are visible inside the block:

    +
    try reader.unsafeReentrantRead { db in
    +    // Those two values may be different because some other thread
    +    // may have inserted or deleted a player between the two requests:
    +    let count1 = try Player.fetchCount(db)
    +    let count2 = try Player.fetchCount(db)
    +}
    +
    + +

    Cursor iterations are isolated, though:

    +
    try reader.unsafeReentrantRead { db in
    +    // No concurrent update can mess with this iteration:
    +    let rows = try Row.fetchCursor(db, sql: "SELECT ...")
    +    while let row = try rows.next() { ... }
    +}
    +
    + +

    The block argument is not prevented from writing (DatabaseQueue, in +particular, will accept database modifications in unsafeReentrantRead).

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +

    This method is reentrant. It should be avoided because it fosters +dangerous concurrency practices.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unsafeReentrantRead<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Functions

+

+
+
+
    +
  • +
    + + + + add(function:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine an SQL function.

    +
    let fn = DatabaseFunction("succ", argumentCount: 1) { dbValues in
    +    guard let int = Int.fromDatabaseValue(dbValues[0]) else {
    +        return nil
    +    }
    +    return int + 1
    +}
    +reader.add(function: fn)
    +try reader.read { db in
    +    try Int.fetchOne(db, sql: "SELECT succ(1)")! // 2
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func add(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(function:) + +
    +
    +
    +
    +
    +
    +

    Remove an SQL function.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func remove(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Collations

+

+
+
+
    +
  • +
    + + + + add(collation:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine a collation.

    +
    let collation = DatabaseCollation("localized_standard") { (string1, string2) in
    +    return (string1 as NSString).localizedStandardCompare(string2)
    +}
    +reader.add(collation: collation)
    +try reader.execute(sql: "SELECT * FROM file ORDER BY name COLLATE localized_standard")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func add(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(collation:) + +
    +
    +
    +
    +
    +
    +

    Remove a collation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func remove(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Value Observation

+

+
+
+ +
+
+
+ + +
+ +

Backup

+

+
+
+
    +
  • +
    + + + + backup(to:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Copies the database contents into another database.

    + +

    The backup method blocks the current thread until the destination +database contains the same contents as the source database.

    + +

    When the source is a DatabasePool, concurrent writes can happen during +the backup. Those writes may, or may not, be reflected in the backup, +but they won’t trigger any error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func backup(to writer: DatabaseWriter) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/DatabaseRegionConvertible.html b/docs/4.8/Protocols/DatabaseRegionConvertible.html new file mode 100644 index 000000000..de2cf5134 --- /dev/null +++ b/docs/4.8/Protocols/DatabaseRegionConvertible.html @@ -0,0 +1,1127 @@ + + + + DatabaseRegionConvertible Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseRegionConvertible

+
+
+
public protocol DatabaseRegionConvertible
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + databaseRegion(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a database region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func databaseRegion(_ db: Database) throws -> DatabaseRegion
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/DatabaseValueConvertible.html b/docs/4.8/Protocols/DatabaseValueConvertible.html new file mode 100644 index 000000000..f3c5f01fc --- /dev/null +++ b/docs/4.8/Protocols/DatabaseValueConvertible.html @@ -0,0 +1,3095 @@ + + + + DatabaseValueConvertible Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseValueConvertible

+
+
+
public protocol DatabaseValueConvertible : SQLExpressible
+ +
+
+

Types that adopt DatabaseValueConvertible can be initialized from +database values.

+ +

The protocol comes with built-in methods that allow to fetch cursors, +arrays, or single values:

+
try String.fetchCursor(db, sql: "SELECT name FROM ...", arguments:...) // Cursor of String
+try String.fetchAll(db, sql: "SELECT name FROM ...", arguments:...)    // [String]
+try String.fetchOne(db, sql: "SELECT name FROM ...", arguments:...)    // String?
+
+let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
+try String.fetchCursor(statement, arguments:...) // Cursor of String
+try String.fetchAll(statement, arguments:...)    // [String]
+try String.fetchOne(statement, arguments:...)    // String?
+
+ +

DatabaseValueConvertible is adopted by Bool, Int, String, etc.

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a value initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try String.fetchCursor(statement) // Cursor of String
    +while let name = try names.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> DatabaseValueCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try String.fetchAll(statement)  // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from a prepared statement.

    + +

    The result is nil if the query returns no row, or if no value can be +extracted from the first row.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let name = try String.fetchOne(statement)   // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from an SQL query.

    +
    let names = try String.fetchCursor(db, sql: "SELECT name FROM ...") // Cursor of String
    +while let name = try name.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> DatabaseValueCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from an SQL query.

    +
    let names = try String.fetchAll(db, sql: "SELECT name FROM ...") // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from an SQL query.

    + +

    The result is nil if the query returns no row, or if no value can be +extracted from the first row.

    +
    let name = try String.fetchOne(db, sql: "SELECT name FROM ...") // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try String.fetchCursor(db, request) // Cursor of String
    +while let name = try name.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R>(_ db: Database, _ request: R) throws -> DatabaseValueCursor<Self> where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try String.fetchAll(db, request) // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Self] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from a fetch request.

    + +

    The result is nil if the query returns no row, or if no value can be +extracted from the first row.

    +
    let request = Player.filter(key: 1).select(Column("name"))
    +let name = try String.fetchOne(db, request) // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<R>(_ db: Database, _ request: R) throws -> Self? where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try String.fetchCursor(statement) // Cursor of String
    +while let name = try names.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> FastDatabaseValueCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try String.fetchAll(statement)  // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let name = try String.fetchOne(statement)   // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from an SQL query.

    +
    let names = try String.fetchCursor(db, sql: "SELECT name FROM ...") // Cursor of String
    +while let name = try names.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> FastDatabaseValueCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from an SQL query.

    +
    let names = try String.fetchAll(db, sql: "SELECT name FROM ...") // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from an SQL query.

    +
    let name = try String.fetchOne(db, sql: "SELECT name FROM ...") // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try String.fetchCursor(db, request) // Cursor of String
    +while let name = try names.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R: FetchRequest>(_ db: Database, _ request: R)
    +    throws -> FastDatabaseValueCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try String.fetchAll(db, request) // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Self] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from a fetch request.

    +
    let request = Player.filter(key: 1).select(Column("name"))
    +let name = try String.fetchOne(db, request) // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<R>(_ db: Database, _ request: R) throws -> Self? where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Self: ReferenceConvertible, Self.ReferenceType: DatabaseValueConvertible

+

+
+
+
    +
  • +
    + + + + databaseValue + + + Default implementation + +
    +
    +
    +
    +
    +
    + +
    +

    Default Implementation

    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    + +
    +

    Default Implementation

    +
    +

    Returns a value initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Self?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Self: RawRepresentable, Self.RawValue: DatabaseValueConvertible

+

+
+
+
    +
  • +
    + + + + databaseValue + + + Default implementation + +
    +
    +
    +
    +
    +
    + +
    +

    Default Implementation

    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    + +
    +

    Default Implementation

    +
    +

    Returns a value initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Self?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/DatabaseWriter.html b/docs/4.8/Protocols/DatabaseWriter.html new file mode 100644 index 000000000..f4ce91980 --- /dev/null +++ b/docs/4.8/Protocols/DatabaseWriter.html @@ -0,0 +1,1701 @@ + + + + DatabaseWriter Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseWriter

+
+
+
public protocol DatabaseWriter : DatabaseReader
+ +
+
+

The protocol for all types that can update a database.

+ +

It is adopted by DatabaseQueue and DatabasePool.

+ +

The protocol comes with isolation guarantees that describe the behavior of +adopting types in a multithreaded application.

+ +

Types that adopt the protocol can in practice provide stronger guarantees. +For example, DatabaseQueue provides a stronger isolation level +than DatabasePool.

+ +

Warning: Isolation guarantees stand as long as there is no external +connection to the database. Should you have to cope with external +connections, protect yourself with transactions, and be ready to setup a +busy handler.

+ +
+
+
+
+ + +
+ +

Writing in Database

+

+
+
+
    +
  • +
    + + + + write(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction, and returns the result.

    + +

    If the updates throw an error, the transaction is rollbacked and the +error is rethrown.

    + +

    Eventual concurrent database updates are postponed until the transaction +has completed.

    + +

    Eventual concurrent reads are guaranteed to not see any partial updates +of the database until the transaction has completed.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates, or by the +wrapping transaction. + +
    + +
    +

    Default Implementation

    +
    +

    Synchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction, and returns the result.

    + +

    If the updates throw an error, the transaction is rollbacked and the +error is rethrown.

    + +

    Eventual concurrent database updates are postponed until the transaction +has completed.

    + +

    Eventual concurrent reads are guaranteed to not see any partial updates +of the database until the transaction has completed.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates, or by the +wrapping transaction. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func write<T>(_ updates: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    + +

    Eventual concurrent database updates are postponed until the updates +are completed.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func writeWithoutTransaction<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + asyncWrite(_:completion:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Asynchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction.

    + +

    If the updates throw an error, the transaction is rollbacked.

    + +

    The completion closure is always called with the result of the +database updates. Its arguments are a database connection and the +result of the transaction. This result is a failure if the transaction +could not be committed.

    + +

    Eventual concurrent database updates are postponed until the transaction +and the completion closure have completed.

    + +

    Eventual concurrent reads are guaranteed to not see any partial updates +of the database until the transaction has completed.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates, or by the wrapping transaction. + +
    + +
    +

    Default Implementation

    +
    +

    Asynchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction.

    + +

    If the updates throw an error, the transaction is rollbacked.

    + +

    The completion closure is always called with the result of the +database updates. Its arguments are a database connection and the +result of the transaction. This result is a failure if the transaction +could not be committed. The completion closure is executed in a +protected dispatch queue, outside of any transaction.

    + +

    Eventual concurrent database updates are postponed until the transaction +and the completion closure have completed.

    + +

    Eventual concurrent reads are guaranteed to not see any partial updates +of the database until the transaction has completed.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates, or by the wrapping transaction. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func asyncWrite<T>(_ updates: @escaping (Database) throws -> T, completion: @escaping (Database, Result<T, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    + + completion + + +
    +

    A closure that is called with the eventual +transaction error.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously executes database updates in a protected dispatch queue, +outside of any transaction.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func asyncWriteWithoutTransaction(_ updates: @escaping (Database) -> Void)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    + +

    Eventual concurrent database updates are postponed until the updates +are completed.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +

    This method is reentrant. It should be avoided because it fosters +dangerous concurrency practices.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unsafeReentrantWrite<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Reading from Database

+

+
+
+
    +
  • +
    + + + + concurrentRead(_:) + +
    +
    +
    +
    +
    +
    +

    Concurrently executes a read-only block in a protected dispatch queue.

    + +

    This method must be called from a writing dispatch queue, outside of any +transaction. You’ll get a fatal error otherwise.

    + +

    The block argument is guaranteed to see the database in the last +committed state at the moment this method is called. Eventual concurrent +database updates are not visible inside the block.

    + +

    To access the fetched results, you call the wait() method of the +returned future, on any dispatch queue.

    + +

    In the example below, the number of players is fetched concurrently with +the player insertion. Yet the future is guaranteed to return zero:

    +
    try writer.writeWithoutTransaction { db in
    +    // Delete all players
    +    try Player.deleteAll()
    +
    +    // Count players concurrently
    +    let future = writer.concurrentRead { db in
    +        return try Player.fetchCount()
    +    }
    +
    +    // Insert a player
    +    try Player(...).insert(db)
    +
    +    // Guaranteed to be zero
    +    let count = try future.wait()
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func concurrentRead<T>(_ block: @escaping (Database) throws -> T) -> DatabaseFuture<T>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Transaction Observers

+

+
+
+
    +
  • +
    + + + + add(transactionObserver:extent:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Add a transaction observer, so that it gets notified of +database changes.

    + +

    To remove the observer, use DatabaseReader.remove(transactionObserver:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(
    +    transactionObserver: TransactionObserver,
    +    extent: Database.TransactionObservationExtent = .observerLifetime)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + transactionObserver + + +
    +

    A transaction observer.

    +
    +
    + + extent + + +
    +

    The duration of the observation. The default is +the observer lifetime (observation lasts until observer +is deallocated).

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Erasing the content of the database

+

+
+
+
    +
  • +
    + + + + erase() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Erases the content of the database.

    +
    +

    Precondition

    + database is not accessed concurrently during the +execution of this method. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func erase() throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Claiming Disk Space

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/EncodableRecord.html b/docs/4.8/Protocols/EncodableRecord.html new file mode 100644 index 000000000..c74250782 --- /dev/null +++ b/docs/4.8/Protocols/EncodableRecord.html @@ -0,0 +1,1490 @@ + + + + EncodableRecord Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

EncodableRecord

+
+
+
public protocol EncodableRecord
+ +
+
+

Types that adopt EncodableRecord can be encoded into the database.

+ +
+
+
+
    +
  • +
    + + + + encode(to:) + +
    +
    +
    +
    +
    +
    +

    Encodes the record into database values.

    + +

    Store in the container argument all values that should be stored in +the columns of the database table (see databaseTableName()).

    + +

    Primary key columns, if any, must be included.

    +
    struct Player: EncodableRecord {
    +    var id: Int64?
    +    var name: String?
    +
    +    func encode(to container: inout PersistenceContainer) {
    +        container["id"] = id
    +        container["name"] = name
    +    }
    +}
    +
    + +

    It is undefined behavior to set different values for the same column. +Column names are case insensitive, so defining both “name” and “NAME” +is considered undefined behavior.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func encode(to container: inout PersistenceContainer)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Customizing the Format of Database Columns

+

+
+
+
    +
  • +
    + + + + databaseEncodingUserInfo + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the EncodableRecord type also adopts the standard Encodable +protocol, you can use this dictionary to customize the encoding process +into database rows.

    + +

    For example:

    +
    // A key that holds a encoder's name
    +let encoderName = CodingUserInfoKey(rawValue: "encoderName")!
    +
    +struct Player: PersistableRecord, Encodable {
    +    // Customize the encoder name when encoding a database row
    +    static let databaseEncodingUserInfo: [CodingUserInfoKey: Any] = [encoderName: "Database"]
    +
    +    func encode(to encoder: Encoder) throws {
    +        // Print the encoder name
    +        print(encoder.userInfo[encoderName])
    +        ...
    +    }
    +}
    +
    +let player = Player(...)
    +
    +// prints "Database"
    +try player.insert(db)
    +
    +// prints "JSON"
    +let encoder = JSONEncoder()
    +encoder.userInfo = [encoderName: "JSON"]
    +let data = try encoder.encode(player)
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseEncodingUserInfo: [CodingUserInfoKey : Any] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseJSONEncoder(for:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the EncodableRecord type also adopts the standard Encodable +protocol, this method controls the encoding process of nested properties +into JSON database columns.

    + +

    The default implementation returns a JSONEncoder with the +following properties:

    + +
      +
    • dataEncodingStrategy: .base64
    • +
    • dateEncodingStrategy: .millisecondsSince1970
    • +
    • nonConformingFloatEncodingStrategy: .throw
    • +
    • outputFormatting: .sortedKeys (iOS 11.0+, macOS 10.13+, tvOS 11.0+, watchOS 4.0+)
    • +
    + +

    You can override those defaults:

    +
    struct Achievement: Encodable {
    +    var name: String
    +    var date: Date
    +}
    +
    +struct Player: Encodable, PersistableRecord {
    +    // stored in a JSON column
    +    var achievements: [Achievement]
    +
    +    static func databaseJSONEncoder(for column: String) -> JSONEncoder {
    +        let encoder = JSONEncoder()
    +        encoder.dateEncodingStrategy = .iso8601
    +        return encoder
    +    }
    +}
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func databaseJSONEncoder(for column: String) -> JSONEncoder
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseDateEncodingStrategy + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the EncodableRecord type also adopts the standard Encodable +protocol, this property controls the encoding of date properties.

    + +

    Default value is .deferredToDate

    + +

    For example:

    +
    struct Player: PersistableRecord, Encodable {
    +    static let databaseDateEncodingStrategy: DatabaseDateEncodingStrategy = .timeIntervalSince1970
    +
    +    var name: String
    +    var registrationDate: Date // encoded as an epoch timestamp
    +}
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseDateEncodingStrategy: DatabaseDateEncodingStrategy { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseUUIDEncodingStrategy + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the EncodableRecord type also adopts the standard Encodable +protocol, this property controls the encoding of UUID properties.

    + +

    Default value is .deferredToUUID

    + +

    For example:

    +
    struct Player: PersistableProtocol, Encodable {
    +    static let databaseUUIDEncodingStrategy: DatabaseUUIDEncodingStrategy = .string
    +
    +    // encoded in a string like "E621E1F8-C36C-495A-93FC-0C247A3E6E5F"
    +    var uuid: UUID
    +}
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseUUIDEncodingStrategy: DatabaseUUIDEncodingStrategy { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseDictionary + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A dictionary whose keys are the columns encoded in the encode(to:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseDictionary: [String : DatabaseValue] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Record Comparison

+

+
+
+
    +
  • +
    + + + + databaseEquals(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a boolean indicating whether this record and the other record +have the same database representation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func databaseEquals(_ record: Self) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseChanges(from:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A dictionary of values changed from the other record.

    + +

    Its keys are column names. Its values come from the other record.

    + +

    Note that this method is not symmetrical, not only in terms of values, +but also in terms of columns. When the two records don’t define the +same set of columns in their encode(to:) method, only the columns +defined by the receiver record are considered.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func databaseChanges<Record>(from record: Record) -> [String : DatabaseValue] where Record : EncodableRecord
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/FTS5CustomTokenizer.html b/docs/4.8/Protocols/FTS5CustomTokenizer.html new file mode 100644 index 000000000..43f40f741 --- /dev/null +++ b/docs/4.8/Protocols/FTS5CustomTokenizer.html @@ -0,0 +1,1218 @@ + + + + FTS5CustomTokenizer Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5CustomTokenizer

+
+
+
public protocol FTS5CustomTokenizer : FTS5Tokenizer
+ +
+
+

The protocol for custom FTS5 tokenizers.

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The name of the tokenizer; should uniquely identify your custom +tokenizer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var name: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(db:arguments:) + +
    +
    +
    +
    +
    +
    +

    Creates a custom tokenizer.

    + +

    The arguments parameter is an array of String built from the CREATE +VIRTUAL TABLE statement. In the example below, the arguments will +be ["arg1", "arg2"].

    +
    CREATE VIRTUAL TABLE document USING fts5(
    +    tokenize='custom arg1 arg2'
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(db: Database, arguments: [String]) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A Database connection

    +
    +
    + + arguments + + +
    +

    An array of string arguments

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + tokenizerDescriptor(arguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an FTS5 tokenizer descriptor.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +
    +db.create(virtualTable: "book", using: FTS5()) { t in
    +    let tokenizer = MyTokenizer.tokenizerDescriptor(arguments: ["unicode61", "remove_diacritics", "0"])
    +    t.tokenizer = tokenizer
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tokenizerDescriptor(arguments: [String] = []) -> FTS5TokenizerDescriptor
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/FTS5Tokenizer.html b/docs/4.8/Protocols/FTS5Tokenizer.html new file mode 100644 index 000000000..1bfb0e2f6 --- /dev/null +++ b/docs/4.8/Protocols/FTS5Tokenizer.html @@ -0,0 +1,1181 @@ + + + + FTS5Tokenizer Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5Tokenizer

+
+
+
public protocol FTS5Tokenizer : AnyObject
+ +
+
+

The protocol for FTS5 tokenizers

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Tokenizes the text described by pText and nText, and +notifies found tokens to the tokenCallback function.

    + +

    It matches the xTokenize function documented at https://www.sqlite.org/fts5.html#custom_tokenizers

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func tokenize(context: UnsafeMutableRawPointer?, tokenization: FTS5Tokenization, pText: UnsafePointer<Int8>?, nText: Int32, tokenCallback: @escaping FTS5TokenCallback) -> Int32
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + context + + +
    +

    An opaque pointer that is the first argument to +the tokenCallback function

    +
    +
    + + tokenization + + +
    +

    The reason why FTS5 is requesting tokenization.

    +
    +
    + + pText + + +
    +

    The tokenized text bytes. May or may not be +nul-terminated.

    +
    +
    + + nText + + +
    +

    The number of bytes in the tokenized text.

    +
    +
    + + tokenCallback + + +
    +

    The function to call for each found token. +It matches the xToken callback at https://www.sqlite.org/fts5.html#custom_tokenizers

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/FTS5WrapperTokenizer.html b/docs/4.8/Protocols/FTS5WrapperTokenizer.html new file mode 100644 index 000000000..2fea2c261 --- /dev/null +++ b/docs/4.8/Protocols/FTS5WrapperTokenizer.html @@ -0,0 +1,1284 @@ + + + + FTS5WrapperTokenizer Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5WrapperTokenizer

+
+
+
public protocol FTS5WrapperTokenizer : FTS5CustomTokenizer
+ +
+
+

The protocol for custom FTS5 tokenizers that wrap another tokenizer.

+ +

Types that adopt FTS5WrapperTokenizer don’t have to implement the +low-level FTS5Tokenizer.tokenize(context:flags:pText:nText:tokenCallback:).

+ +

Instead, they process regular Swift strings.

+ +

Here is the implementation for a trivial tokenizer that wraps the +built-in ascii tokenizer without any custom processing:

+
class TrivialAsciiTokenizer : FTS5WrapperTokenizer {
+    static let name = "trivial"
+    let wrappedTokenizer: FTS5Tokenizer
+
+    init(db: Database, arguments: [String]) throws {
+        wrappedTokenizer = try db.makeTokenizer(.ascii())
+    }
+
+    func accept(
+        token: String,
+        flags: FTS5TokenFlags,
+        for tokenization: FTS5Tokenization,
+        tokenCallback: FTS5WrapperTokenCallback)
+        throws
+    {
+        try tokenCallback(token, flags)
+    }
+}
+
+ +
+
+
+
    +
  • +
    + + + + wrappedTokenizer + +
    +
    +
    +
    +
    +
    +

    The wrapped tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var wrappedTokenizer: FTS5Tokenizer { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Given a token produced by the wrapped tokenizer, notifies customized +tokens to the tokenCallback function.

    + +

    For example:

    +
    func accept(
    +    token: String,
    +    flags: FTS5TokenFlags,
    +    for tokenization: FTS5Tokenization,
    +    tokenCallback: FTS5WrapperTokenCallback)
    +    throws
    +{
    +    // pass through:
    +    try tokenCallback(token, flags)
    +}
    +
    + +

    When implementing the accept method, there are a two rules +to observe:

    + +
      +
    1. Errors thrown by the tokenCallback function must not be caught.

    2. +
    3. The input flags should be given unmodified to the tokenCallback +function, unless you union it with the .colocated flag when the +tokenizer produces synonyms (see +https://www.sqlite.org/fts5.html#synonym_support).

    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func accept(token: String, flags: FTS5TokenFlags, for tokenization: FTS5Tokenization, tokenCallback: FTS5WrapperTokenCallback) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + token + + +
    +

    A token produced by the wrapped tokenizer

    +
    +
    + + flags + + +
    +

    Flags that tell SQLite how to register a token.

    +
    +
    + + tokenization + + +
    +

    The reason why FTS5 is requesting tokenization.

    +
    +
    + + tokenCallback + + +
    +

    The function to call for each customized token.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Default implementation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func tokenize(
    +    context: UnsafeMutableRawPointer?,
    +    tokenization: FTS5Tokenization,
    +    pText: UnsafePointer<Int8>?,
    +    nText: Int32,
    +    tokenCallback: @escaping FTS5TokenCallback)
    +    -> Int32
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/FetchRequest.html b/docs/4.8/Protocols/FetchRequest.html new file mode 100644 index 000000000..e21764e71 --- /dev/null +++ b/docs/4.8/Protocols/FetchRequest.html @@ -0,0 +1,3158 @@ + + + + FetchRequest Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FetchRequest

+
+
+
public protocol FetchRequest : DatabaseRegionConvertible
+ +
+
+

The protocol for all requests that fetch database rows, and tell how those +rows should be interpreted.

+
struct Player: FetchableRecord { ... }
+let request: ... // Some FetchRequest that fetches Player
+try request.fetchCursor(db) // Cursor of Player
+try request.fetchAll(db)    // [Player]
+try request.fetchOne(db)    // Player?
+
+ +
+
+
+
    +
  • +
    + + + + RowDecoder + +
    +
    +
    +
    +
    +
    +

    The type that tells how fetched database rows should be interpreted.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype RowDecoder
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    This method is deprecated. Use +makePreparedRequest(_:forSingleResult:) instead.

    + +

    Returns a tuple that contains a prepared statement that is ready to be +executed, and an eventual row adapter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func prepare(_ db: Database, forSingleResult singleResult: Bool) throws -> (SelectStatement, RowAdapter?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + singleResult + + +
    +

    A hint that a single result row will be +consumed. Implementations can optionally use this to optimize the +prepared statement.

    +
    +
    +
    +
    +

    Return Value

    +

    A prepared statement and an eventual row adapter.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a PreparedRequest that is ready to be executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func makePreparedRequest(_ db: Database, forSingleResult singleResult: Bool) throws -> PreparedRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + singleResult + + +
    +

    A hint that a single result row will be +consumed. Implementations can optionally use this to optimize the +prepared statement.

    +
    +
    +
    +
    +

    Return Value

    +

    A prepared request.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Returns the number of rows fetched by the request.

    + +

    The default implementation builds a naive SQL query based on the +statement returned by the prepare method: +SELECT COUNT(*) FROM (...).

    + +

    Adopting types can refine this method in order to use more +efficient SQL.

    + +
    +

    Default Implementation

    +
    +

    Returns the number of rows fetched by the request.

    + +

    This default implementation builds a naive SQL query based on the +statement returned by the prepare method: SELECT COUNT(*) FROM (...).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchCount(_ db: Database) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

FetchRequest

+

+
+
+
    +
  • +
    + + + + adapted(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an adapted request.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func adapted(_ adapter: @escaping (Database) throws -> RowAdapter) -> AdaptedFetchRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseRegion(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the database region that the request looks into.

    + +

    This default implementation returns a region built from the statement +returned by the prepare method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func databaseRegion(_ db: Database) throws -> DatabaseRegion
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Observation

+

+
+
+
    +
  • +
    + + + + observationForCount() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies its +count whenever it is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.all()
    +let observation = request.observationForCount()
    +
    +let observer = try observation.start(in: dbQueue) { count: Int in
    +    print("Number of players has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForCount() ->
    +    ValueObservation<ValueReducers.RemoveDuplicates<ValueReducers.Fetch<Int>>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Values

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched values.

    +
    let request: ... // Some FetchRequest that fetches String
    +let strings = try request.fetchCursor(db) // Cursor of String
    +while let string = try strings.next() {   // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> DatabaseValueCursor<RowDecoder>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched values.

    +
    let request: ... // Some FetchRequest that fetches String
    +let strings = try request.fetchAll(db) // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [RowDecoder]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The first fetched value.

    + +

    The result is nil if the request returns no row, or if no value can be +extracted from the first row.

    +
    let request: ... // Some FetchRequest that fetches String
    +let string = try request.fetchOne(db) // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne(_ db: Database) throws -> RowDecoder?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Optional values

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched optional values.

    +
    let request: ... // Some FetchRequest that fetches Optional<String>
    +let strings = try request.fetchCursor(db) // Cursor of String?
    +while let string = try strings.next() {   // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> NullableDatabaseValueCursor<RowDecoder._Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched optional values.

    +
    let request: ... // Some FetchRequest that fetches Optional<String>
    +let strings = try request.fetchAll(db) // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [RowDecoder._Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Rows

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched rows.

    +
    let request: ... // Some FetchRequest that fetches Row
    +let rows = try request.fetchCursor(db) // RowCursor
    +while let row = try rows.next() {  // Row
    +    let id: Int64 = row[0]
    +    let name: String = row[1]
    +}
    +
    + +

    Fetched rows are reused during the cursor iteration: don’t turn a row +cursor into an array with Array(rows) or rows.filter { ... } since +you would not get the distinct rows you expect. Use Row.fetchAll(...) +instead.

    + +

    For the same reason, make sure you make a copy whenever you extract a +row for later use: row.copy().

    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> RowCursor
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched rows.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched rows.

    +
    let request: ... // Some FetchRequest that fetches Row
    +let rows = try request.fetchAll(db)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [Row]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of fetched rows.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The first fetched row.

    +
    let request: ... // Some FetchRequest that fetches Row
    +let row = try request.fetchOne(db)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne(_ db: Database) throws -> Row?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional row.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Values

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched values.

    +
    let request: ... // Some FetchRequest that fetches String
    +let strings = try request.fetchCursor(db) // Cursor of String
    +while let string = try strings.next() {   // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> FastDatabaseValueCursor<RowDecoder>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched values.

    +
    let request: ... // Some FetchRequest that fetches String
    +let strings = try request.fetchAll(db) // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [RowDecoder]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The first fetched value.

    + +

    The result is nil if the request returns no row, or if no value can be +extracted from the first row.

    +
    let request: ... // Some FetchRequest that fetches String
    +let string = try request.fetchOne(db) // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne(_ db: Database) throws -> RowDecoder?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Optional values

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched optional values.

    +
    let request: ... // Some FetchRequest that fetches Optional<String>
    +let strings = try request.fetchCursor(db) // Cursor of String?
    +while let string = try strings.next() {   // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> FastNullableDatabaseValueCursor<RowDecoder._Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched optional values.

    +
    let request: ... // Some FetchRequest that fetches Optional<String>
    +let strings = try request.fetchAll(db) // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [RowDecoder._Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Records

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched records.

    +
    let request: ... // Some FetchRequest that fetches Player
    +let players = try request.fetchCursor(db) // Cursor of Player
    +while let player = try players.next() {   // Player
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> RecordCursor<RowDecoder>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched records.

    +
    let request: ... // Some FetchRequest that fetches Player
    +let players = try request.fetchAll(db) // [Player]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [RowDecoder]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The first fetched record.

    +
    let request: ... // Some FetchRequest that fetches Player
    +let player = try request.fetchOne(db) // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne(_ db: Database) throws -> RowDecoder?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Observation

+

+
+
+
    +
  • +
    + + + + observationForAll() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh values whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.select(Column("name"), as: String.self)
    +let observation = request.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { names: [String] in
    +    print("Player names have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForAll() -> ValueObservation<ValueReducers.AllValues<RowDecoder>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh value whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.select(max(Column("score")), as: Int.self)
    +let observation = request.observationForFirst()
    +
    +let observer = try observation.start(in: dbQueue) { maxScore: Int? in
    +    print("Maximum score has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForFirst() -> ValueObservation<ValueReducers.OneValue<RowDecoder>>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForAll() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh values whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.select(Column("name"), as: Optional<String>.self)
    +let observation = request.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { names: [String?] in
    +    print("Player names have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForAll() -> ValueObservation<ValueReducers.AllOptionalValues<RowDecoder._Wrapped>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh values whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.select(Column("name"), as: Optional<String>.self)
    +let observation = request.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { names: [String?] in
    +    print("Player names have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForFirst() -> ValueObservation<ValueReducers.OneValue<RowDecoder._Wrapped>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForAll() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh records whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.all()
    +let observation = request.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForAll() -> ValueObservation<ValueReducers.AllRecords<RowDecoder>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh record whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.filter(key: 1)
    +let observation = request.observationForFirst()
    +
    +let observer = try observation.start(in: dbQueue) { player: Player? in
    +    print("Player has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForFirst() -> ValueObservation<ValueReducers.OneRecord<RowDecoder>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForAll() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh rows whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = SQLRequest<Row>(sql: "SELECT * FROM player")
    +let observation = request.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { rows: [Row] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForAll() -> ValueObservation<ValueReducers.AllRows>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh row whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = SQLRequest<Row>(sql: "SELECT * FROM player WHERE id = ?", arguments: [1])
    +let observation = request.observationForFirst()
    +
    +let observer = try observation.start(in: dbQueue) { row: Row? in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForFirst() -> ValueObservation<ValueReducers.OneRow>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/FetchableRecord.html b/docs/4.8/Protocols/FetchableRecord.html new file mode 100644 index 000000000..12cdd9111 --- /dev/null +++ b/docs/4.8/Protocols/FetchableRecord.html @@ -0,0 +1,2941 @@ + + + + FetchableRecord Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FetchableRecord

+
+
+
public protocol FetchableRecord
+ +
+
+

Types that adopt FetchableRecord can be initialized from a database Row.

+
let row = try Row.fetchOne(db, sql: "SELECT ...")!
+let player = Player(row)
+
+ +

The protocol comes with built-in methods that allow to fetch cursors, +arrays, or single records:

+
try Player.fetchCursor(db, sql: "SELECT ...", arguments:...) // Cursor of Player
+try Player.fetchAll(db, sql: "SELECT ...", arguments:...)    // [Player]
+try Player.fetchOne(db, sql: "SELECT ...", arguments:...)    // Player?
+
+let statement = try db.makeSelectStatement(sql: "SELECT ...")
+try Player.fetchCursor(statement, arguments:...) // Cursor of Player
+try Player.fetchAll(statement, arguments:...)    // [Player]
+try Player.fetchOne(statement, arguments:...)    // Player?
+
+ +

FetchableRecord is adopted by Record.

+ +
+
+
+
+ + +
+ +

Row Decoding

+

+
+
+
    +
  • +
    + + + + init(row:) + +
    +
    +
    +
    +
    +
    +

    Creates a record from row.

    + +

    For performance reasons, the row argument may be reused during the +iteration of a fetch query. If you want to keep the row for later use, +make sure to store a copy: self.row = row.copy().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(row: Row)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Customizing the Format of Database Columns

+

+
+
+
    +
  • +
    + + + + databaseDecodingUserInfo + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the FetchableRecord type also adopts the standard Decodable +protocol, you can use this dictionary to customize the decoding process +from database rows.

    + +

    For example:

    +
    // A key that holds a decoder's name
    +let decoderName = CodingUserInfoKey(rawValue: "decoderName")!
    +
    +// A FetchableRecord + Decodable record
    +struct Player: FetchableRecord, Decodable {
    +    // Customize the decoder name when decoding a database row
    +    static let databaseDecodingUserInfo: [CodingUserInfoKey: Any] = [decoderName: "Database"]
    +
    +    init(from decoder: Decoder) throws {
    +        // Print the decoder name
    +        print(decoder.userInfo[decoderName])
    +        ...
    +    }
    +}
    +
    +// prints "Database"
    +let player = try Player.fetchOne(db, ...)
    +
    +// prints "JSON"
    +let decoder = JSONDecoder()
    +decoder.userInfo = [decoderName: "JSON"]
    +let player = try decoder.decode(Player.self, from: ...)
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseDecodingUserInfo: [CodingUserInfoKey : Any] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseJSONDecoder(for:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the FetchableRecord type also adopts the standard Decodable +protocol, this method controls the decoding process of nested properties +from JSON database columns.

    + +

    The default implementation returns a JSONDecoder with the +following properties:

    + +
      +
    • dataDecodingStrategy: .base64
    • +
    • dateDecodingStrategy: .millisecondsSince1970
    • +
    • nonConformingFloatDecodingStrategy: .throw
    • +
    + +

    You can override those defaults:

    +
    struct Achievement: Decodable {
    +    var name: String
    +    var date: Date
    +}
    +
    +struct Player: Decodable, FetchableRecord {
    +    // stored in a JSON column
    +    var achievements: [Achievement]
    +
    +    static func databaseJSONDecoder(for column: String) -> JSONDecoder {
    +        let decoder = JSONDecoder()
    +        decoder.dateDecodingStrategy = .iso8601
    +        return decoder
    +    }
    +}
    +
    + +
    +

    Default Implementation

    +
    +

    Returns a JSONDecoder with the following properties:

    + +
      +
    • dataDecodingStrategy: .base64
    • +
    • dateDecodingStrategy: .millisecondsSince1970
    • +
    • nonConformingFloatDecodingStrategy: .throw
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func databaseJSONDecoder(for column: String) -> JSONDecoder
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseDateDecodingStrategy + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the FetchableRecord type also adopts the standard Decodable +protocol, this property controls the decoding of date properties.

    + +

    Default value is .deferredToDate

    + +

    For example:

    +
    struct Player: FetchableRecord, Decodable {
    +    static let databaseDateDecodingStrategy: DatabaseDateDecodingStrategy = .timeIntervalSince1970
    +
    +    var name: String
    +    var registrationDate: Date // decoded from epoch timestamp
    +}
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseDateDecodingStrategy: DatabaseDateDecodingStrategy { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over records fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT * FROM player")
    +let players = try Player.fetchCursor(statement) // Cursor of Player
    +while let player = try players.next() { // Player
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> RecordCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of records fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT * FROM player")
    +let players = try Player.fetchAll(statement) // [Player]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single record fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT * FROM player")
    +let player = try Player.fetchOne(statement) // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over records fetched from an SQL query.

    +
    let players = try Player.fetchCursor(db, sql: "SELECT * FROM player") // Cursor of Player
    +while let player = try players.next() { // Player
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> RecordCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of records fetched from an SQL query.

    +
    let players = try Player.fetchAll(db, sql: "SELECT * FROM player") // [Player]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single record fetched from an SQL query.

    +
    let player = try Player.fetchOne(db, sql: "SELECT * FROM player") // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over records fetched from a fetch request.

    +
    let request = try Player.all()
    +let players = try Player.fetchCursor(db, request) // Cursor of Player
    +while let player = try players.next() { // Player
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R>(_ db: Database, _ request: R) throws -> RecordCursor<Self> where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    a FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of records fetched from a fetch request.

    +
    let request = try Player.all()
    +let players = try Player.fetchAll(db, request) // [Player]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Self] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    a FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single record fetched from a fetch request.

    +
    let request = try Player.filter(key: 1)
    +let player = try Player.fetchOne(db, request) // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<R>(_ db: Database, _ request: R) throws -> Self? where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    a FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching All

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over all records fetched from the database.

    +
    // SELECT * FROM player
    +let players = try Player.fetchCursor(db) // Cursor of Player
    +while let player = try players.next() {  // Player
    +    ...
    +}
    +
    + +

    Records are iterated in the natural ordering of the table.

    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(_ db: Database) throws -> RecordCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of all records fetched from the database.

    +
    // SELECT * FROM player
    +let players = try Player.fetchAll(db) // [Player]
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(_ db: Database) throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The first found record.

    +
    // SELECT * FROM player
    +let player = try Player.fetchOne(db) // Player?
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(_ db: Database) throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching by Single-Column Primary Key

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over records, given their primary keys.

    +
    let players = try Player.fetchCursor(db, keys: [1, 2, 3]) // Cursor of Player
    +while let player = try players.next() { // Player
    +    ...
    +}
    +
    + +

    Records are iterated in unspecified order.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<Sequence>(_ db: Database, keys: Sequence)
    +    throws -> RecordCursor<Self>
    +    where Sequence: Swift.Sequence, Sequence.Element: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    A sequence of primary keys.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of records, given their primary keys.

    +
    let players = try Player.fetchAll(db, keys: [1, 2, 3]) // [Player]
    +
    + +

    The order of records in the returned array is undefined.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<Sequence>(_ db: Database, keys: Sequence)
    +    throws -> [Self]
    +    where Sequence: Swift.Sequence, Sequence.Element: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    A sequence of primary keys.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single record given its primary key.

    +
    let player = try Player.fetchOne(db, key: 123) // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<PrimaryKeyType>(_ db: Database, key: PrimaryKeyType?)
    +    throws -> Self?
    +    where PrimaryKeyType: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + key + + +
    +

    A primary key value.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching by Key

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over records identified by the provided unique keys +(primary key or any key with a unique index on it).

    +
    // Cursor of Player
    +let players = try Player.fetchCursor(db, keys: [
    +    ["email": "a@example.com"],
    +    ["email": "b@example.com"]])
    +while let player = try players.next() { // Player
    +    ...
    +}
    +
    + +

    Records are iterated in unspecified order.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(_ db: Database, keys: [[String: DatabaseValueConvertible?]])
    +    throws -> RecordCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    An array of key dictionaries.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of records identified by the provided unique keys +(primary key or any key with a unique index on it).

    +
    // [Player]
    +let players = try Player.fetchAll(db, keys: [
    +    ["email": "a@example.com"],
    +    ["email": "b@example.com"]])
    +
    + +

    The order of records in the returned array is undefined.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(_ db: Database, keys: [[String : DatabaseValueConvertible?]]) throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    An array of key dictionaries.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single record identified by a unique key (the primary key or +any key with a unique index on it).

    +
    let player = try Player.fetchOne(db, key: ["name": Arthur"]) // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(_ db: Database, key: [String : DatabaseValueConvertible?]?) throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + key + + +
    +

    A dictionary of values.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/MutablePersistableRecord.html b/docs/4.8/Protocols/MutablePersistableRecord.html new file mode 100644 index 000000000..8c68a9974 --- /dev/null +++ b/docs/4.8/Protocols/MutablePersistableRecord.html @@ -0,0 +1,2861 @@ + + + + MutablePersistableRecord Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

MutablePersistableRecord

+
+
+
public protocol MutablePersistableRecord : EncodableRecord, TableRecord
+ +
+
+

Types that adopt MutablePersistableRecord can be inserted, updated, and deleted.

+ +
+
+
+
    +
  • +
    + + + + persistenceConflictPolicy + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The policy that handles SQLite conflicts when records are inserted +or updated.

    + +

    This property is optional: its default value uses the ABORT policy +for both insertions and updates, and has GRDB generate regular +INSERT and UPDATE queries.

    + +

    If insertions are resolved with .ignore policy, the +didInsert(with:for:) method is not called upon successful insertion, +even if a row was actually inserted without any conflict.

    + +

    See https://www.sqlite.org/lang_conflict.html

    + +
    +

    Default Implementation

    +
    +

    Describes the conflict policy for insertions and updates.

    + +

    The default value specifies ABORT policy for both insertions and +updates, which has GRDB generate regular INSERT and UPDATE queries.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var persistenceConflictPolicy: PersistenceConflictPolicy { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + didInsert(with:for:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies the record that it was succesfully inserted.

    + +

    Do not call this method directly: it is called for you, in a protected +dispatch queue, with the inserted RowID and the eventual +INTEGER PRIMARY KEY column name.

    + +

    This method is optional: the default implementation does nothing.

    +
    struct Player : MutablePersistableRecord {
    +    var id: Int64?
    +    var name: String?
    +
    +    mutating func didInsert(with rowID: Int64, for column: String?) {
    +        self.id = rowID
    +    }
    +}
    +
    + +
    +

    Default Implementation

    +
    +

    Notifies the record that it was succesfully inserted.

    + +

    The default implementation does nothing.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func didInsert(with rowID: Int64, for column: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + rowID + + +
    +

    The inserted rowID.

    +
    +
    + + column + + +
    +

    The name of the eventual INTEGER PRIMARY KEY column.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

CRUD

+

+
+
+
    +
  • +
    + + + + insert(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT statement.

    + +

    This method is guaranteed to have inserted a row in the database if it +returns without error.

    + +

    Upon successful insertion, the didInsert(with:for:) method +is called with the inserted RowID and the eventual INTEGER PRIMARY KEY +column name.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of insert(). In their implementation, it is recommended +that they invoke the performInsert() method.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +

    Default Implementation

    +
    +

    Executes an INSERT statement.

    + +

    The default implementation for insert() invokes performInsert().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func insert(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + update(_:columns:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes an UPDATE statement.

    + +

    This method is guaranteed to have updated a row in the database if it +returns without error.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of update(). In their implementation, it is recommended +that they invoke the performUpdate() method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database. + +
    + +
    +

    Default Implementation

    +
    +

    Executes an UPDATE statement.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func update(_ db: Database, columns: Set<String>) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + columns + + +
    +

    The columns to update.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + save(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT or an UPDATE statement so that self is saved in +the database.

    + +

    If the receiver has a non-nil primary key and a matching row in the +database, this method performs an update.

    + +

    Otherwise, performs an insert.

    + +

    This method is guaranteed to have inserted or updated a row in the +database if it returns without error.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of save(). In their implementation, it is recommended +that they invoke the performSave() method.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs, or errors +thrown by update(). + +
    + +
    +

    Default Implementation

    +
    +

    Executes an INSERT or an UPDATE statement so that self is saved in +the database.

    + +

    The default implementation for save() invokes performSave().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func save(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + delete(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes a DELETE statement.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of delete(). In their implementation, it is recommended +that they invoke the performDelete() method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +

    Default Implementation

    +
    +

    Executes a DELETE statement.

    + +

    The default implementation for delete() invokes performDelete().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +func delete(_ db: Database) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether a database row was deleted.

    +
    + +
    +
    +
  • +
  • +
    + + + + exists(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Returns true if and only if the primary key matches a row in +the database.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of exists(). In their implementation, it is recommended +that they invoke the performExists() method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +

    Default Implementation

    +
    +

    Returns true if and only if the primary key matches a row in +the database.

    + +

    The default implementation for exists() invokes performExists().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func exists(_ db: Database) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the primary key matches a row in the database.

    +
    + +
    +
    +
  • +
  • +
    + + + + update(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Executes an UPDATE statement that updates all table columns.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func update(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + updateChanges(_:from:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    If the record has any difference from the other record, executes an +UPDATE statement so that those differences and only those difference are +saved in the database.

    + +

    This method is guaranteed to have saved the eventual differences in the +database if it returns without error.

    + +

    For example:

    +
    if let oldPlayer = try Player.fetchOne(db, key: 42) {
    +    var newPlayer = oldPlayer
    +    newPlayer.score += 10
    +    newPlayer.hasAward = true
    +    try newPlayer.updateChanges(db, from: oldRecord)
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database and record could not be updated. + +
    +

    See also

    + updateChanges(_:with:) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func updateChanges<Record>(_ db: Database, from record: Record) throws -> Bool where Record : MutablePersistableRecord
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + record + + +
    +

    The comparison record.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the record had changes.

    +
    + +
    +
    +
  • +
  • +
    + + + + updateChanges(_:with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Mutates the record according to the provided closure, and then, if the +record has any difference from its previous version, executes an +UPDATE statement so that those differences and only those difference are +saved in the database.

    + +

    This method is guaranteed to have saved the eventual differences in the +database if it returns without error.

    + +

    For example:

    +
    if var player = try Player.fetchOne(db, key: 42) {
    +    try player.updateChanges(db) {
    +        $0.score += 10
    +        $0.hasAward = true
    +    }
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database and record could not be updated. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public mutating func updateChanges(_ db: Database, with change: (inout Self) throws -> Void) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + change + + +
    +

    A closure that modifies the record.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the record had changes.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

CRUD Internals

+

+
+
+
    +
  • +
    + + + + performInsert(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt MutablePersistableRecord.

    + +

    performInsert() provides the default implementation for insert(). Types +that adopt MutablePersistableRecord can invoke performInsert() in their +implementation of insert(). They should not provide their own +implementation of performInsert().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public mutating func performInsert(_ db: Database) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + performUpdate(_:columns:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt MutablePersistableRecord.

    + +

    performUpdate() provides the default implementation for update(). Types +that adopt MutablePersistableRecord can invoke performUpdate() in their +implementation of update(). They should not provide their own +implementation of performUpdate().

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func performUpdate(_ db: Database, columns: Set<String>) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + columns + + +
    +

    The columns to update.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + performSave(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt MutablePersistableRecord.

    + +

    performSave() provides the default implementation for save(). Types +that adopt MutablePersistableRecord can invoke performSave() in their +implementation of save(). They should not provide their own +implementation of performSave().

    + +

    This default implementation forwards the job to update or insert.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public mutating func performSave(_ db: Database) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + performDelete(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt MutablePersistableRecord.

    + +

    performDelete() provides the default implementation for deelte(). Types +that adopt MutablePersistableRecord can invoke performDelete() in +their implementation of delete(). They should not provide their own +implementation of performDelete().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func performDelete(_ db: Database) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + performExists(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt MutablePersistableRecord.

    + +

    performExists() provides the default implementation for exists(). Types +that adopt MutablePersistableRecord can invoke performExists() in +their implementation of exists(). They should not provide their own +implementation of performExists().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func performExists(_ db: Database) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Batch Delete

+

+
+
+
    +
  • +
    + + + + deleteAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Deletes all records; returns the number of deleted rows.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func deleteAll(_ db: Database) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of deleted rows

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Batch Update

+

+
+
+
    +
  • +
    + + + + updateAll(_:onConflict:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Updates all records; returns the number of updated records.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    try Player.updateAll(db, [Column("score") <- 0])
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func updateAll(
    +    _ db: Database,
    +    onConflict conflictResolution: Database.ConflictResolution? = nil,
    +    _ assignments: [ColumnAssignment])
    +    throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + conflictResolution + + +
    +

    A policy for conflict resolution, +defaulting to the record’s persistenceConflictPolicy.

    +
    +
    + + assignments + + +
    +

    An array of column assignments.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of updated rows.

    +
    + +
    +
    +
  • +
  • +
    + + + + updateAll(_:onConflict:_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Updates all records; returns the number of updated records.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    try Player.updateAll(db, Column("score") <- 0)
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func updateAll(
    +    _ db: Database,
    +    onConflict conflictResolution: Database.ConflictResolution? = nil,
    +    _ assignment: ColumnAssignment,
    +    _ otherAssignments: ColumnAssignment...)
    +    throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + conflictResolution + + +
    +

    A policy for conflict resolution, +defaulting to the record’s persistenceConflictPolicy.

    +
    +
    + + assignment + + +
    +

    A column assignment.

    +
    +
    + + otherAssignments + + +
    +

    Eventual other column assignments.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of updated rows.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Deleting by Single-Column Primary Key

+

+
+
+
    +
  • +
    + + + + deleteAll(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Delete records identified by their primary keys; returns the number of +deleted rows.

    +
    // DELETE FROM player WHERE id IN (1, 2, 3)
    +try Player.deleteAll(db, keys: [1, 2, 3])
    +
    +// DELETE FROM country WHERE code IN ('FR', 'US', 'DE')
    +try Country.deleteAll(db, keys: ["FR", "US", "DE"])
    +
    + +

    When the table has no explicit primary key, GRDB uses the hidden +“rowid” column:

    +
    // DELETE FROM document WHERE rowid IN (1, 2, 3)
    +try Document.deleteAll(db, keys: [1, 2, 3])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func deleteAll<Sequence>(_ db: Database, keys: Sequence)
    +    throws -> Int
    +    where Sequence: Swift.Sequence, Sequence.Element: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    A sequence of primary keys.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of deleted rows

    +
    + +
    +
    +
  • +
  • +
    + + + + deleteOne(_:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Delete a record, identified by its primary key; returns whether a +database row was deleted.

    +
    // DELETE FROM player WHERE id = 123
    +try Player.deleteOne(db, key: 123)
    +
    +// DELETE FROM country WHERE code = 'FR'
    +try Country.deleteOne(db, key: "FR")
    +
    + +

    When the table has no explicit primary key, GRDB uses the hidden +“rowid” column:

    +
    // DELETE FROM document WHERE rowid = 1
    +try Document.deleteOne(db, key: 1)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func deleteOne<PrimaryKeyType>(_ db: Database, key: PrimaryKeyType?)
    +    throws -> Bool
    +    where PrimaryKeyType: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + key + + +
    +

    A primary key value.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether a database row was deleted.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Deleting by Key

+

+
+
+
    +
  • +
    + + + + deleteAll(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Delete records identified by the provided unique keys (primary key or +any key with a unique index on it); returns the number of deleted rows.

    +
    try Player.deleteAll(db, keys: [["email": "a@example.com"], ["email": "b@example.com"]])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func deleteAll(_ db: Database, keys: [[String : DatabaseValueConvertible?]]) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    An array of key dictionaries.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of deleted rows

    +
    + +
    +
    +
  • +
  • +
    + + + + deleteOne(_:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Delete a record, identified by a unique key (the primary key or any key +with a unique index on it); returns whether a database row was deleted.

    +
    Player.deleteOne(db, key: ["name": Arthur"])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func deleteOne(_ db: Database, key: [String : DatabaseValueConvertible?]) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + key + + +
    +

    A dictionary of values.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether a database row was deleted.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Record Comparison

+

+
+
+
    +
  • +
    + + + + updateChanges(_:with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Mutates the record according to the provided closure, and then, if the +record has any difference from its previous version, executes an +UPDATE statement so that those differences and only those difference are +saved in the database.

    + +

    This method is guaranteed to have saved the eventual differences in the +database if it returns without error.

    + +

    For example:

    +
    if let player = try Player.fetchOne(db, key: 42) {
    +    try player.updateChanges(db) {
    +        $0.score += 10
    +        $0.hasAward = true
    +    }
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database and record could not be updated. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func updateChanges(_ db: Database, with change: (Self) throws -> Void) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + change + + +
    +

    A closure that modifies the record.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the record had changes.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/PersistableRecord.html b/docs/4.8/Protocols/PersistableRecord.html new file mode 100644 index 000000000..187c1c41c --- /dev/null +++ b/docs/4.8/Protocols/PersistableRecord.html @@ -0,0 +1,1414 @@ + + + + PersistableRecord Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PersistableRecord

+
+
+
public protocol PersistableRecord : MutablePersistableRecord
+ +
+
+

Types that adopt PersistableRecord can be inserted, updated, and deleted.

+ +

This protocol is intented for types that don’t have an INTEGER PRIMARY KEY.

+ +

Unlike MutablePersistableRecord, the insert() and save() methods are not +mutating methods.

+ +
+
+
+
    +
  • +
    + + + + didInsert(with:for:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies the record that it was succesfully inserted.

    + +

    Do not call this method directly: it is called for you, in a protected +dispatch queue, with the inserted RowID and the eventual +INTEGER PRIMARY KEY column name.

    + +

    This method is optional: the default implementation does nothing.

    + +

    If you need a mutating variant of this method, adopt the +MutablePersistableRecord protocol instead.

    + +
    +

    Default Implementation

    +
    +

    Notifies the record that it was succesfully inserted.

    + +

    The default implementation does nothing.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func didInsert(with rowID: Int64, for column: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + rowID + + +
    +

    The inserted rowID.

    +
    +
    + + column + + +
    +

    The name of the eventual INTEGER PRIMARY KEY column.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + insert(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT statement.

    + +

    This method is guaranteed to have inserted a row in the database if it +returns without error.

    + +

    Upon successful insertion, the didInsert(with:for:) method +is called with the inserted RowID and the eventual INTEGER PRIMARY KEY +column name.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of insert(). In their implementation, it is recommended +that they invoke the performInsert() method.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +

    Default Implementation

    +
    +

    Executes an INSERT statement.

    + +

    The default implementation for insert() invokes performInsert().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func insert(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + save(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT or an UPDATE statement so that self is saved in +the database.

    + +

    If the receiver has a non-nil primary key and a matching row in the +database, this method performs an update.

    + +

    Otherwise, performs an insert.

    + +

    This method is guaranteed to have inserted or updated a row in the +database if it returns without error.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of save(). In their implementation, it is recommended +that they invoke the performSave() method.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs, or errors +thrown by update(). + +
    + +
    +

    Default Implementation

    +
    +

    Executes an INSERT or an UPDATE statement so that self is saved in +the database.

    + +

    The default implementation for save() invokes performSave().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func save(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Immutable CRUD Internals

+

+
+
+
    +
  • +
    + + + + performInsert(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt PersistableRecord.

    + +

    performInsert() provides the default implementation for insert(). Types +that adopt PersistableRecord can invoke performInsert() in their +implementation of insert(). They should not provide their own +implementation of performInsert().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func performInsert(_ db: Database) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + performSave(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt PersistableRecord.

    + +

    performSave() provides the default implementation for save(). Types +that adopt PersistableRecord can invoke performSave() in their +implementation of save(). They should not provide their own +implementation of performSave().

    + +

    This default implementation forwards the job to update or insert.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func performSave(_ db: Database) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/RowAdapter.html b/docs/4.8/Protocols/RowAdapter.html new file mode 100644 index 000000000..e9bf16fea --- /dev/null +++ b/docs/4.8/Protocols/RowAdapter.html @@ -0,0 +1,1202 @@ + + + + RowAdapter Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

RowAdapter

+
+
+
public protocol RowAdapter
+ +
+
+

RowAdapter is a protocol that helps two incompatible row interfaces working +together.

+ +

GRDB ships with four concrete types that adopt the RowAdapter protocol:

+ +
    +
  • ColumnMapping: renames row columns
  • +
  • SuffixRowAdapter: hides the first columns of a row
  • +
  • RangeRowAdapter: only exposes a range of columns
  • +
  • ScopeAdapter: groups several adapters together to define named scopes
  • +
+ +

To use a row adapter, provide it to any method that fetches:

+
let adapter = SuffixRowAdapter(fromIndex: 2)
+let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
+
+// [baz:3]
+try Row.fetchOne(db, sql: sql, adapter: adapter)
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Experimental

    + +

    You never call this method directly. It is called for you whenever an +adapter has to be applied.

    + +

    The result is a value that adopts LayoutedRowAdapter, such as +LayoutedColumnMapping.

    + +

    For example:

    +
    // An adapter that turns any row to a row that contains a single
    +// column named "foo" whose value is the leftmost value of the
    +// base row.
    +struct FirstColumnAdapter : RowAdapter {
    +    func layoutedAdapter(from layout: RowLayout) throws -> LayoutedRowAdapter {
    +        return LayoutedColumnMapping(layoutColumns: [(0, "foo")])
    +    }
    +}
    +
    +// [foo:1]
    +try Row.fetchOne(db, sql: "SELECT 1, 2, 3", adapter: FirstColumnAdapter())
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func layoutedAdapter(from layout: RowLayout) throws -> LayoutedRowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + addingScopes(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an adapter based on self, with added scopes.

    + +

    If self already defines scopes, the added scopes replace +eventual existing scopes with the same name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addingScopes(_ scopes: [String : RowAdapter]) -> RowAdapter
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + scopes + + +
    +

    A dictionary that maps scope names to +row adapters.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/StatementColumnConvertible.html b/docs/4.8/Protocols/StatementColumnConvertible.html new file mode 100644 index 000000000..02378bc81 --- /dev/null +++ b/docs/4.8/Protocols/StatementColumnConvertible.html @@ -0,0 +1,1174 @@ + + + + StatementColumnConvertible Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

StatementColumnConvertible

+
+
+
public protocol StatementColumnConvertible
+ +
+
+

The StatementColumnConvertible protocol grants access to the low-level C +interface that extracts values from query results: +https://www.sqlite.org/c3ref/column_blob.html. It can bring performance +improvements.

+ +

To use it, have a value type adopt both StatementColumnConvertible and +DatabaseValueConvertible. GRDB will then automatically apply the +optimization whenever direct access to SQLite is possible:

+
let rows = Row.fetchCursor(db, sql: "SELECT ...")
+while let row = try rows.next() {
+    let int: Int = row[0]                 // there
+}
+let ints = Int.fetchAll(db, sql: "SELECT ...") // there
+struct Player {
+    init(row: Row) {
+        name = row["name"]                // there
+        score = row["score"]              // there
+    }
+}
+
+ +

StatementColumnConvertible is already adopted by all Swift integer types, +Float, Double, String, and Bool.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes a value from a raw SQLite statement pointer.

    + +

    For example, here is the how Int64 adopts StatementColumnConvertible:

    +
    extension Int64: StatementColumnConvertible {
    +    init(sqliteStatement: SQLiteStatement, index: Int32) {
    +        self = sqlite3_column_int64(sqliteStatement, index)
    +    }
    +}
    +
    + +

    This initializer is never called for NULL database values: don’t perform +any extra check.

    + +

    See https://www.sqlite.org/c3ref/column_blob.html for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/TableRecord.html b/docs/4.8/Protocols/TableRecord.html new file mode 100644 index 000000000..085010b7b --- /dev/null +++ b/docs/4.8/Protocols/TableRecord.html @@ -0,0 +1,3846 @@ + + + + TableRecord Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableRecord

+
+
+
public protocol TableRecord
+ +
+
+

Types that adopt TableRecord declare a particular relationship with +a database table.

+ +

Types that adopt both TableRecord and FetchableRecord are granted with +built-in methods that allow to fetch instances identified by key:

+
try Player.fetchOne(db, key: 123)  // Player?
+try Citizenship.fetchOne(db, key: ["citizenId": 12, "countryId": 45]) // Citizenship?
+
+ +

TableRecord is adopted by Record.

+ +
+
+
+
    +
  • +
    + + + + databaseTableName + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The name of the database table used to build requests.

    +
    struct Player : TableRecord {
    +    static var databaseTableName = "player"
    +}
    +
    +// SELECT * FROM player
    +try Player.fetchAll(db)
    +
    + +
    +

    Default Implementation

    +
    +

    The default name of the database table used to build requests.

    + +
      +
    • Player -> “player”
    • +
    • Place -> “place”
    • +
    • PostalAddress -> “postalAddress”
    • +
    • HTTPRequest -> “httpRequest”
    • +
    • TOEFL -> “toefl”
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseTableName: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseSelection + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The default request selection.

    + +

    Unless said otherwise, requests select all columns:

    +
    // SELECT * FROM player
    +try Player.fetchAll(db)
    +
    + +

    You can provide a custom implementation and provide an explicit list +of columns:

    +
    struct RestrictedPlayer : TableRecord {
    +    static var databaseTableName = "player"
    +    static var databaseSelection = [Column("id"), Column("name")]
    +}
    +
    +// SELECT id, name FROM player
    +try RestrictedPlayer.fetchAll(db)
    +
    + +

    You can also add extra columns such as the rowid column:

    +
    struct ExtendedPlayer : TableRecord {
    +    static var databaseTableName = "player"
    +    static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID]
    +}
    +
    +// SELECT *, rowid FROM player
    +try ExtendedPlayer.fetchAll(db)
    +
    + +
    +

    Default Implementation

    +
    +

    Default value: [AllColumns()].

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseSelection: [SQLSelectable] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Full Text Search

+

+
+
+
    +
  • +
    + + + + matching(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a QueryInterfaceRequest with a matching predicate.

    +
    // SELECT * FROM book WHERE book MATCH '...'
    +var request = Book.matching(pattern)
    +
    + +

    If the search pattern is nil, the request does not match any +database row.

    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func matching(_ pattern: FTS3Pattern?) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + belongsTo(_:key:using:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a “Belongs To” association between Self and the +destination type.

    +
    struct Author: TableRecord { ... }
    +struct Book: TableRecord {
    +    static let author = belongsTo(Author.self)
    +}
    +
    + +

    The association will let you define requests that load both the source +and the destination type:

    +
    // A request for all books with their authors:
    +let request = Book.including(optional: Book.author)
    +
    + +

    To consume those requests, define a type that adopts both the +FetchableRecord and Decodable protocols:

    +
    struct BookInfo: FetchableRecord, Decodable {
    +    var book: Book
    +    var author: Author?
    +}
    +
    +let bookInfos = try dbQueue.read { db in
    +    return try BookInfo.fetchAll(db, request)
    +}
    +for bookInfo in bookInfos {
    +    print("\(bookInfo.book.title) by \(bookInfo.author.name)")
    +}
    +
    + +

    It is recommended that you define, alongside the static association, a +property with the same name:

    +
    struct Book: TableRecord, EncodableRecord {
    +    static let author = belongsTo(Author.self)
    +    var author: QueryInterfaceRequest<Author> {
    +        return request(for: Book.author)
    +    }
    +}
    +
    + +

    This property will let you navigate from the source type to the +destination type:

    +
    try dbQueue.read { db in
    +    let book: Book = ...
    +    let author = try book.author.fetchOne(db) // Author?
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func belongsTo<Destination>(
    +    _ destination: Destination.Type,
    +    key: String? = nil,
    +    using foreignKey: ForeignKey? = nil)
    +    -> BelongsToAssociation<Self, Destination>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + destination + + +
    +

    The record type at the other side of the association.

    +
    +
    + + key + + +
    +

    An eventual decoding key for the association. By default, it +is destination.databaseTableName.

    +
    +
    + + foreignKey + + +
    +

    An eventual foreign key. You need to provide an +explicit foreign key when GRDB can’t infer one from the database +schema. This happens when the schema does not define any foreign +key to the destination table, or when the schema defines several +foreign keys to the destination table.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasMany(_:key:using:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a “Has many” association between Self and the +destination type.

    +
    struct Book: TableRecord { ... }
    +struct Author: TableRecord {
    +    static let books = hasMany(Book.self)
    +}
    +
    + +

    The association will let you define requests that load both the source +and the destination type:

    +
    // A request for all (author, book) pairs:
    +let request = Author.including(required: Author.books)
    +
    + +

    To consume those requests, define a type that adopts both the +FetchableRecord and Decodable protocols:

    +
    struct Authorship: FetchableRecord, Decodable {
    +    var author: Author
    +    var book: Book
    +}
    +
    +let authorships = try dbQueue.read { db in
    +    return try Authorship.fetchAll(db, request)
    +}
    +for authorship in authorships {
    +    print("\(authorship.author.name) wrote \(authorship.book.title)")
    +}
    +
    + +

    It is recommended that you define, alongside the static association, a +property with the same name:

    +
    struct Author: TableRecord, EncodableRecord {
    +    static let books = hasMany(Book.self)
    +    var books: QueryInterfaceRequest<Book> {
    +        return request(for: Author.books)
    +    }
    +}
    +
    + +

    This property will let you navigate from the source type to the +destination type:

    +
    try dbQueue.read { db in
    +    let author: Author = ...
    +    let books = try author.books.fetchAll(db) // [Book]
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasMany<Destination>(
    +    _ destination: Destination.Type,
    +    key: String? = nil,
    +    using foreignKey: ForeignKey? = nil)
    +    -> HasManyAssociation<Self, Destination>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + destination + + +
    +

    The record type at the other side of the association.

    +
    +
    + + key + + +
    +

    An eventual decoding key for the association. By default, it +is destination.databaseTableName.

    +
    +
    + + foreignKey + + +
    +

    An eventual foreign key. You need to provide an +explicit foreign key when GRDB can’t infer one from the database +schema. This happens when the schema does not define any foreign +key from the destination table, or when the schema defines several +foreign keys from the destination table.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasMany(_:through:using:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a “Has Many Through” association between Self and the +destination type.

    +
    struct Country: TableRecord {
    +    static let passports = hasMany(Passport.self)
    +    static let citizens = hasMany(Citizen.self, through: passports, using: Passport.citizen)
    +}
    +
    +struct Passport: TableRecord {
    +    static let citizen = belongsTo(Citizen.self)
    +}
    +
    +struct Citizen: TableRecord { }
    +
    + +

    The association will let you define requests that load both the source +and the destination type:

    +
    // A request for all (country, citizen) pairs:
    +let request = Country.including(required: Coutry.citizens)
    +
    + +

    To consume those requests, define a type that adopts both the +FetchableRecord and Decodable protocols:

    +
    struct Citizenship: FetchableRecord, Decodable {
    +    var country: Country
    +    var citizen: Citizen
    +}
    +
    +let citizenships = try dbQueue.read { db in
    +    return try Citizenship.fetchAll(db, request)
    +}
    +for citizenship in citizenships {
    +    print("\(citizenship.citizen.name) is a citizen of \(citizenship.country.name)")
    +}
    +
    + +

    It is recommended that you define, alongside the static association, a +property with the same name:

    +
    struct Country: TableRecord, EncodableRecord {
    +    static let passports = hasMany(Passport.self)
    +    static let citizens = hasMany(Citizen.self, through: passports, using: Passport.citizen)
    +    var citizens: QueryInterfaceRequest<Citizen> {
    +        return request(for: Country.citizens)
    +    }
    +}
    +
    + +

    This property will let you navigate from the source type to the +destination type:

    +
    try dbQueue.read { db in
    +    let country: Country = ...
    +    let citizens = try country.citizens.fetchAll(db) // [Country]
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasMany<Pivot, Target>(
    +    _ destination: Target.RowDecoder.Type,
    +    through pivot: Pivot,
    +    using target: Target,
    +    key: String? = nil)
    +    -> HasManyThroughAssociation<Self, Target.RowDecoder>
    +    where Pivot: Association,
    +    Target: Association,
    +    Pivot.OriginRowDecoder == Self,
    +    Pivot.RowDecoder == Target.OriginRowDecoder
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + destination + + +
    +

    The record type at the other side of the association.

    +
    +
    + + pivot + + +
    +

    An association from Self to the intermediate type.

    +
    +
    + + target + + +
    +

    A target association from the intermediate type to the +destination type.

    +
    +
    + + key + + +
    +

    An eventual decoding key for the association. By default, it +is the same key as the target.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasOne(_:key:using:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a “Has one” association between Self and the +destination type.

    +
    struct Demographics: TableRecord { ... }
    +struct Country: TableRecord {
    +    static let demographics = hasOne(Demographics.self)
    +}
    +
    + +

    The association will let you define requests that load both the source +and the destination type:

    +
    // A request for all countries with their demographic profile:
    +let request = Country.including(optional: Country.demographics)
    +
    + +

    To consume those requests, define a type that adopts both the +FetchableRecord and Decodable protocols:

    +
    struct CountryInfo: FetchableRecord, Decodable {
    +    var country: Country
    +    var demographics: Demographics?
    +}
    +
    +let countryInfos = try dbQueue.read { db in
    +    return try CountryInfo.fetchAll(db, request)
    +}
    +for countryInfo in countryInfos {
    +    print("\(countryInfo.country.name) has \(countryInfo.demographics.population) citizens")
    +}
    +
    + +

    It is recommended that you define, alongside the static association, a +property with the same name:

    +
    struct Country: TableRecord, EncodableRecord {
    +    static let demographics = hasOne(Demographics.self)
    +    var demographics: QueryInterfaceRequest<Demographics> {
    +        return request(for: Country.demographics)
    +    }
    +}
    +
    + +

    This property will let you navigate from the source type to the +destination type:

    +
    try dbQueue.read { db in
    +    let country: Country = ...
    +    let demographics = try country.demographics.fetchOne(db) // Demographics?
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasOne<Destination>(
    +    _ destination: Destination.Type,
    +    key: String? = nil,
    +    using foreignKey: ForeignKey? = nil)
    +    -> HasOneAssociation<Self, Destination>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + destination + + +
    +

    The record type at the other side of the association.

    +
    +
    + + key + + +
    +

    An eventual decoding key for the association. By default, it +is destination.databaseTableName.

    +
    +
    + + foreignKey + + +
    +

    An eventual foreign key. You need to provide an +explicit foreign key when GRDB can’t infer one from the database +schema. This happens when the schema does not define any foreign +key from the destination table, or when the schema defines several +foreign keys from the destination table.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasOne(_:through:using:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a “Has One Through” association between Self and the +destination type.

    +
    struct Book: TableRecord {
    +    static let library = belongsTo(Library.self)
    +    static let returnAddress = hasOne(Address.self, through: library, using: Library.address)
    +}
    +
    +struct Library: TableRecord {
    +    static let address = hasOne(Address.self)
    +}
    +
    +struct Address: TableRecord { ... }
    +
    + +

    The association will let you define requests that load both the source +and the destination type:

    +
    // A request for all (book, returnAddress) pairs:
    +let request = Book.including(required: Book.returnAddress)
    +
    + +

    To consume those requests, define a type that adopts both the +FetchableRecord and Decodable protocols:

    +
    struct Todo: FetchableRecord, Decodable {
    +    var book: Book
    +    var address: Address
    +}
    +
    +let todos = try dbQueue.read { db in
    +    return try Todo.fetchAll(db, request)
    +}
    +for todo in todos {
    +    print("Please return \(todo.book) to \(todo.address)")
    +}
    +
    + +

    It is recommended that you define, alongside the static association, a +property with the same name:

    +
    struct Book: TableRecord, EncodableRecord {
    +    static let library = belongsTo(Library.self)
    +    static let returnAddress = hasOne(Address.self, through: library, using: library.address)
    +    var returnAddress: QueryInterfaceRequest<Address> {
    +        return request(for: Book.returnAddress)
    +    }
    +}
    +
    + +

    This property will let you navigate from the source type to the +destination type:

    +
    try dbQueue.read { db in
    +    let book: Book = ...
    +    let address = try book.returnAddress.fetchOne(db) // Address?
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasOne<Pivot, Target>(
    +    _ destination: Target.RowDecoder.Type,
    +    through pivot: Pivot,
    +    using target: Target,
    +    key: String? = nil)
    +    -> HasOneThroughAssociation<Self, Target.RowDecoder>
    +    where Pivot: AssociationToOne,
    +    Target: AssociationToOne,
    +    Pivot.OriginRowDecoder == Self,
    +    Pivot.RowDecoder == Target.OriginRowDecoder
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + destination + + +
    +

    The record type at the other side of the association.

    +
    +
    + + pivot + + +
    +

    An association from Self to the intermediate type.

    +
    +
    + + target + + +
    +

    A target association from the intermediate type to the +destination type.

    +
    +
    + + key + + +
    +

    An eventual decoding key for the association. By default, it +is the same key as the target.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Associations

+

+
+
+
    +
  • +
    + + + + including(all:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that prefetches an association.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func including<A: AssociationToMany>(all association: A)
    +    -> QueryInterfaceRequest<Self>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + including(optional:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that includes an association. The columns of the +associated record are selected. The returned association does not +require that the associated database table contains a matching row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func including<A: Association>(optional association: A)
    +    -> QueryInterfaceRequest<Self>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + including(required:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that includes an association. The columns of the +associated record are selected. The returned association requires +that the associated database table contains a matching row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func including<A: Association>(required association: A)
    +    -> QueryInterfaceRequest<Self>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + joining(optional:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that includes an association. The columns of the +associated record are not selected. The returned association does not +require that the associated database table contains a matching row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func joining<A: Association>(optional association: A)
    +    -> QueryInterfaceRequest<Self>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + joining(required:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that includes an association. The columns of the +associated record are not selected. The returned association requires +that the associated database table contains a matching row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func joining<A: Association>(required association: A)
    +    -> QueryInterfaceRequest<Self>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Association Aggregates

+

+
+
+
    +
  • +
    + + + + annotated(with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with aggregates appended to the selection.

    +
    // SELECT player.*, COUNT(DISTINCT book.rowid) AS bookCount
    +// FROM player LEFT JOIN book ...
    +var request = Player.annotated(with: Player.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func annotated(with aggregates: AssociationAggregate<Self>...) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with aggregates appended to the selection.

    +
    // SELECT player.*, COUNT(DISTINCT book.rowid) AS bookCount
    +// FROM player LEFT JOIN book ...
    +var request = Player.annotated(with: [Player.books.count])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func annotated(with aggregates: [AssociationAggregate<Self>]) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + having(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided aggregate predicate.

    +
    // SELECT player.*
    +// FROM player LEFT JOIN book ...
    +// HAVING COUNT(DISTINCT book.rowid) = 0
    +var request = Player.all()
    +request = request.having(Player.books.isEmpty)
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func having(_ predicate: AssociationAggregate<Self>) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Request Derivation

+

+
+
+
    +
  • +
    + + + + all() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which fetches all records.

    +
    // SELECT * FROM player
    +let request = Player.all()
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func all() -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + none() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which fetches no record.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func none() -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection.

    +
    // SELECT id, email FROM player
    +let request = Player.select(Column("id"), Column("email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select(_ selection: SQLSelectable...) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection.

    +
    // SELECT id, email FROM player
    +let request = Player.select([Column("id"), Column("email")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select(_ selection: [SQLSelectable]) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(sql:arguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects sql.

    +
    // SELECT id, email FROM player
    +let request = Player.select(sql: "id, email")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments())
    +    -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(literal:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects an SQL literal.

    +
    // SELECT id, email FROM player
    +let request = Player.select(literal: SQLLiteral(sql: "id, email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select(literal sqlLiteral: SQLLiteral) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:as:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.select([max(Column("score"))], as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select<RowDecoder>(
    +    _ selection: [SQLSelectable],
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:as:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.select(max(Column("score")), as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select<RowDecoder>(
    +    _ selection: SQLSelectable...,
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(sql:arguments:as:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects sql, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.select(sql: "max(score)", as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select<RowDecoder>(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(literal:as:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects an SQL literal, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.select(literal: SQLLiteral(sql: "max(score)"), as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select<RowDecoder>(
    +    literal sqlLiteral: SQLLiteral,
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends selection.

    +
    // SELECT id, email, name FROM player
    +le request = Player
    +    .select([Column("id"), Column("email")])
    +    .annotated(with: [Column("name")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func annotated(with selection: [SQLSelectable]) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends selection.

    +
    // SELECT id, email, name FROM player
    +le request = Player
    +    .select([Column("id"), Column("email")])
    +    .annotated(with: Column("name"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func annotated(with selection: SQLSelectable...) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided predicate.

    +
    // SELECT * FROM player WHERE email = 'arthur@example.com'
    +let request = Player.filter(Column("email") == "arthur@example.com")
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter(_ predicate: SQLExpressible) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided primary key predicate.

    +
    // SELECT * FROM player WHERE id = 1
    +let request = Player.filter(key: 1)
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter<PrimaryKeyType>(key: PrimaryKeyType?)
    +    -> QueryInterfaceRequest<Self>
    +    where PrimaryKeyType: DatabaseValueConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided primary key predicate.

    +
    // SELECT * FROM player WHERE id IN (1, 2, 3)
    +let request = Player.filter(keys: [1, 2, 3])
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter<Sequence>(keys: Sequence)
    +    -> QueryInterfaceRequest<Self>
    +    where Sequence: Swift.Sequence, Sequence.Element: DatabaseValueConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided primary key predicate.

    +
    // SELECT * FROM passport WHERE personId = 1 AND countryCode = 'FR'
    +let request = Passport.filter(key: ["personId": 1, "countryCode": "FR"])
    +
    + +

    When executed, this request raises a fatal error if there is no unique +index on the key columns.

    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter(key: [String : DatabaseValueConvertible?]?) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided primary key predicate.

    +
    // SELECT * FROM passport WHERE (personId = 1 AND countryCode = 'FR') OR ...
    +let request = Passport.filter(keys: [["personId": 1, "countryCode": "FR"], ...])
    +
    + +

    When executed, this request raises a fatal error if there is no unique +index on the key columns.

    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter(keys: [[String : DatabaseValueConvertible?]]) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(sql:arguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided predicate.

    +
    // SELECT * FROM player WHERE email = 'arthur@example.com'
    +let request = Player.filter(sql: "email = ?", arguments: ["arthur@example.com"])
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments())
    +    -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(literal:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided predicate.

    +
    // SELECT * FROM player WHERE email = 'arthur@example.com'
    +let request = Player.filter(literal: SQLLiteral(sql: "email = ?", arguments: ["arthur@example.com"]))
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    let request = Player.filter(literal: "name = \("O'Brien"))
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter(literal sqlLiteral: SQLLiteral) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request sorted according to the +provided orderings.

    +
    // SELECT * FROM player ORDER BY name
    +let request = Player.order(Column("name"))
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func order(_ orderings: SQLOrderingTerm...) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request sorted according to the +provided orderings.

    +
    // SELECT * FROM player ORDER BY name
    +let request = Player.order([Column("name")])
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func order(_ orderings: [SQLOrderingTerm]) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + orderByPrimaryKey() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request sorted by primary key.

    +
    // SELECT * FROM player ORDER BY id
    +let request = Player.orderByPrimaryKey()
    +
    +// SELECT * FROM country ORDER BY code
    +let request = Country.orderByPrimaryKey()
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func orderByPrimaryKey() -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(sql:arguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request sorted according to sql.

    +
    // SELECT * FROM player ORDER BY name
    +let request = Player.order(sql: "name")
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func order(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments())
    +    -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(literal:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request sorted according to an SQL literal.

    +
    // SELECT * FROM player ORDER BY name
    +let request = Player.order(literal: SQLLiteral(sql: "name"))
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    // SELECT * FROM player ORDER BY name
    +let request = Player.order(literal: "name"))
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func order(literal sqlLiteral: SQLLiteral) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + limit(_:offset:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which fetches limit rows, starting at +offset.

    +
    // SELECT * FROM player LIMIT 1
    +let request = Player.limit(1)
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func limit(_ limit: Int, offset: Int? = nil) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + aliased(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that allows you to define expressions that target +a specific database table.

    + +

    In the example below, the “team.avgScore < player.score” condition in +the ON clause could be not achieved without table aliases.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// JOIN team ON ... AND team.avgScore < player.score
    +let playerAlias = TableAlias()
    +let request = Player
    +    .aliased(playerAlias)
    +    .including(required: Player.team.filter(Column("avgScore") < playerAlias[Column("score")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func aliased(_ alias: TableAlias) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Counting All

+

+
+
+
    +
  • +
    + + + + fetchCount(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The number of records.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCount(_ db: Database) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SQL Generation

+

+
+
+
    +
  • +
    + + + + selectionSQL(alias:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The selection as an SQL String.

    + +

    For example:

    +
    struct Player: TableRecord {
    +    static let databaseTableName = "player"
    +}
    +
    +// SELECT "player".* FROM player
    +let sql = "SELECT \(Player.selectionSQL()) FROM player"
    +
    +// SELECT "p".* FROM player AS p
    +let sql = "SELECT \(Player.selectionSQL(alias: "p")) FROM player p"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func selectionSQL(alias: String? = nil) -> String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + numberOfSelectedColumns(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the number of selected columns.

    + +

    For example:

    +
    struct Player: TableRecord {
    +    static let databaseTableName = "player"
    +}
    +
    +try dbQueue.write { db in
    +    try db.create(table: "player") { t in
    +        t.autoIncrementedPrimaryKey("id")
    +        t.column("name", .text)
    +        t.column("score", .integer)
    +    }
    +
    +    // 3
    +    try Player.numberOfSelectedColumns(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func numberOfSelectedColumns(_ db: Database) throws -> Int
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Observation

+

+
+
+
    +
  • +
    + + + + observationForCount() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes the record table, and notifies +its count whenever it is modified by a database transaction.

    + +

    For example:

    +
    let observation = Player.observationForCount()
    +
    +let observer = try observation.start(in: dbQueue) { count: Int in
    +    print("Number of players has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func observationForCount() ->
    +    ValueObservation<ValueReducers.RemoveDuplicates<ValueReducers.Fetch<Int>>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Full Text Search

+

+
+
+
    +
  • +
    + + + + matching(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a QueryInterfaceRequest with a matching predicate.

    +
    // SELECT * FROM book WHERE book MATCH '...'
    +var request = Book.matching(pattern)
    +
    + +

    If the search pattern is nil, the request does not match any +database row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func matching(_ pattern: FTS5Pattern?) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Self: EncodableRecord

+

+
+
+
    +
  • +
    + + + + request(for:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that fetches the associated record(s).

    + +

    For example:

    +
    struct Team: TableRecord, EncodableRecord {
    +    static let players = hasMany(Player.self)
    +    var players: QueryInterfaceRequest<Player> {
    +        return request(for: Team.players)
    +    }
    +}
    +
    +let team: Team = ...
    +let players = try team.players.fetchAll(db) // [Player]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func request<A: Association>(for association: A)
    +    -> QueryInterfaceRequest<A.RowDecoder>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Observation

+

+
+
+
    +
  • +
    + + + + observationForAll() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes the record table, and notifies +fresh records whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let observation = Player.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func observationForAll() -> ValueObservation<ValueReducers.AllRecords<Self>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes the table record, and notifies +a fresh record whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let observation = Player.observationForFirst()
    +
    +let observer = try observation.start(in: dbQueue) { player: Player? in
    +    print("Player has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func observationForFirst() -> ValueObservation<ValueReducers.OneRecord<Self>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/TransactionObserver.html b/docs/4.8/Protocols/TransactionObserver.html new file mode 100644 index 000000000..67357ed2d --- /dev/null +++ b/docs/4.8/Protocols/TransactionObserver.html @@ -0,0 +1,1403 @@ + + + + TransactionObserver Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TransactionObserver

+
+
+
public protocol TransactionObserver : AnyObject
+ +
+
+

A transaction observer is notified of all changes and transactions committed +or rollbacked on a database.

+ +

Adopting types must be a class.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Filters database changes that should be notified the the +databaseDidChange(with:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies a database change (insert, update, or delete).

    + +

    The change is pending until the current transaction ends. See +databaseWillCommit, databaseDidCommit and databaseDidRollback.

    + +

    This method is called in a protected dispatch queue, serialized will all +database updates.

    + +

    The event is only valid for the duration of this method call. If you +need to keep it longer, store a copy: event.copy()

    + +

    The observer has an opportunity to stop receiving further change events +from the current transaction by calling the +stopObservingDatabaseChangesUntilNextTransaction() method.

    +
    +

    Warning

    + this method must not change the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func databaseDidChange(with event: DatabaseEvent)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseWillCommit() + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When a transaction is about to be committed, the transaction observer +has an opportunity to rollback pending changes by throwing an error.

    + +

    This method is called on the database queue.

    +
    +

    Warning

    +

    this method must not change the database.

    + +
    +

    Throws

    +

    An eventual error that rollbacks pending changes.

    + +
    + +
    +

    Default Implementation

    +
    +

    Default implementation does nothing

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func databaseWillCommit() throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseDidCommit(_:) + +
    +
    +
    +
    +
    +
    +

    Database changes have been committed.

    + +

    This method is called on the database queue. It can change the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func databaseDidCommit(_ db: Database)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Database changes have been rollbacked.

    + +

    This method is called on the database queue. It can change the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func databaseDidRollback(_ db: Database)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseWillChange(with:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies before a database change (insert, update, or delete) +with change information (initial / final values for the row’s +columns). (Called before databaseDidChangeWithEvent.)

    + +

    The change is pending until the end of the current transaction, +and you always get a second chance to get basic event information in +the databaseDidChangeWithEvent callback.

    + +

    This callback is mostly useful for calculating detailed change +information for a row, and provides the initial / final values.

    + +

    This method is called in a protected dispatch queue, serialized will all +database updates.

    + +

    The event is only valid for the duration of this method call. If you +need to keep it longer, store a copy: event.copy()

    +
    +

    Warning

    + this method must not change the database. + +
    + +

    Availability Info

    + +

    Requires SQLite 3.13.0 + +Compiled with option SQLITE_ENABLE_PREUPDATE_HOOK

    + +

    As of OSX 10.11.5, and iOS 9.3.2, the built-in SQLite library +does not have this enabled, so you’ll need to compile your own +copy using GRDBCustomSQLite. +See https://github.com/groue/GRDB.swift/blob/master/Documentation/CustomSQLiteBuilds.md

    + +

    The databaseDidChangeWithEvent callback is always available, +and may provide most/all of what you need.

    + +
    +

    Default Implementation

    +
    +

    Default implementation does nothing

    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

TransactionObserver

+

+
+
+
    +
  • +
    + + + + stopObservingDatabaseChangesUntilNextTransaction() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    After this method has been called, the databaseDidChange(with:) +method won’t be called until the next transaction.

    + +

    For example:

    +
    class PlayerObserver: TransactionObserver {
    +    var playerTableWasModified = false
    +
    +    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool {
    +        return eventKind.tableName == "player"
    +    }
    +
    +    func databaseDidChange(with event: DatabaseEvent) {
    +        playerTableWasModified = true
    +
    +        // It is pointless to keep on tracking further changes:
    +        stopObservingDatabaseChangesUntilNextTransaction()
    +    }
    +}
    +
    +
    +

    Precondition

    + This method must be called from databaseDidChange(with:). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func stopObservingDatabaseChangesUntilNextTransaction()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/ValueReducer.html b/docs/4.8/Protocols/ValueReducer.html new file mode 100644 index 000000000..7c041749f --- /dev/null +++ b/docs/4.8/Protocols/ValueReducer.html @@ -0,0 +1,1359 @@ + + + + ValueReducer Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ValueReducer

+
+
+
public protocol ValueReducer
+ +
+
+

Experimental

+ +

The ValueReducer protocol supports ValueObservation.

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    +

    The type of fetched database values

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    +

    The type of observed values

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Value
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    +

    Feches database values upon changes in an observed database region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    +

    Transforms a fetched value into an eventual observed value. Returns nil +when observer should not be notified.

    + +

    This method runs inside a private dispatch queue.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compactMap(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Returns a reducer which outputs the non-nil results of calling the given +transformation which each element emitted by this reducer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func compactMap<T>(_ transform: @escaping (Value) -> T?) -> ValueReducers.CompactMap<Self, T>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + map(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Returns a reducer which outputs the results of calling the given +transformation which each element emitted by this reducer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func map<T>(_ transform: @escaping (Value) -> T) -> ValueReducers.Map<Self, T>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Value: Equatable

+

+
+
+
    +
  • +
    + + + + distinctUntilChanged() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Returns a ValueReducer which filters out consecutive equal values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, renamed: "removeDuplicates")
    +public func distinctUntilChanged() -> ValueReducers.RemoveDuplicates<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + removeDuplicates() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Returns a ValueReducer which filters out consecutive equal values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeDuplicates() -> ValueReducers.RemoveDuplicates<Self>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Protocols/VirtualTableModule.html b/docs/4.8/Protocols/VirtualTableModule.html new file mode 100644 index 000000000..85cf3f605 --- /dev/null +++ b/docs/4.8/Protocols/VirtualTableModule.html @@ -0,0 +1,1248 @@ + + + + VirtualTableModule Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

VirtualTableModule

+
+
+
public protocol VirtualTableModule
+ +
+
+

The protocol for SQLite virtual table modules. It lets you define a DSL for +the Database.create(virtualTable:using:) method:

+
let module = ...
+try db.create(virtualTable: "item", using: module) { t in
+    ...
+}
+
+ +

GRDB ships with three concrete classes that implement this protocol: FTS3, +FTS4 and FTS5.

+ +
+
+
+
    +
  • +
    + + + + TableDefinition + +
    +
    +
    +
    +
    +
    +

    The type of the closure argument in the +Database.create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "item", using: module) { t in
    +    // t is TableDefinition
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + moduleName + +
    +
    +
    +
    +
    +
    +

    The name of the module.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var moduleName: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + makeTableDefinition() + +
    +
    +
    +
    +
    +
    +

    Returns a table definition that is passed as the closure argument in the +Database.create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "item", using: module) { t in
    +    // t is the result of makeTableDefinition()
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func makeTableDefinition() -> TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the module arguments for the CREATE VIRTUAL TABLE query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func moduleArguments(for definition: TableDefinition, in db: Database) throws -> [String]
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Execute any relevant database statement after the virtual table has +been created.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func database(_ db: Database, didCreate tableName: String, using definition: TableDefinition) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs.html b/docs/4.8/Structs.html new file mode 100644 index 000000000..dbdf5d612 --- /dev/null +++ b/docs/4.8/Structs.html @@ -0,0 +1,3800 @@ + + + + Structures Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Structures

+

The following structures are available globally.

+ +
+
+
+
    +
  • +
    + + + + Configuration + +
    +
    +
    +
    +
    +
    +

    Configuration for a DatabaseQueue or DatabasePool.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Configuration
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ColumnInfo + +
    +
    +
    +
    +
    +
    +

    A column of a database table.

    + +

    This type closely matches the information returned by the +table_info pragma.

    +
    > CREATE TABLE player (
    +    id INTEGER PRIMARY KEY,
    +    firstName TEXT,
    +    lastName TEXT)
    +> PRAGMA table_info("player")
    +cid   name   type     notnull   dflt_value  pk
    +----  -----  -------  --------  ----------  ---
    +0     id     INTEGER  0         NULL        1
    +1     name   TEXT     0         NULL        0
    +2     score  INTEGER  0         NULL        0
    +
    + +

    See Database.columns(in:) and https://www.sqlite.org/pragma.html#pragma_table_info

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ColumnInfo : FetchableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + IndexInfo + +
    +
    +
    +
    +
    +
    +

    An index on a database table.

    + +

    See Database.indexes(on:)

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct IndexInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + PrimaryKeyInfo + +
    +
    +
    +
    +
    +
    +

    Primary keys are returned from the Database.primaryKey(_:) method.

    + +

    When the table’s primary key is the rowid:

    +
    // CREATE TABLE item (name TEXT)
    +let pk = try db.primaryKey("item")
    +pk.columns     // ["rowid"]
    +pk.rowIDColumn // nil
    +pk.isRowID     // true
    +
    +// CREATE TABLE citizen (
    +//   id INTEGER PRIMARY KEY,
    +//   name TEXT
    +// )
    +let pk = try db.primaryKey("citizen")!
    +pk.columns     // ["id"]
    +pk.rowIDColumn // "id"
    +pk.isRowID     // true
    +
    + +

    When the table’s primary key is not the rowid:

    +
    // CREATE TABLE country (
    +//   isoCode TEXT NOT NULL PRIMARY KEY
    +//   name TEXT
    +// )
    +let pk = db.primaryKey("country")!
    +pk.columns     // ["isoCode"]
    +pk.rowIDColumn // nil
    +pk.isRowID     // false
    +
    +// CREATE TABLE citizenship (
    +//   citizenID INTEGER NOT NULL REFERENCES citizen(id)
    +//   countryIsoCode TEXT NOT NULL REFERENCES country(isoCode)
    +//   PRIMARY KEY (citizenID, countryIsoCode)
    +// )
    +let pk = db.primaryKey("citizenship")!
    +pk.columns     // ["citizenID", "countryIsoCode"]
    +pk.rowIDColumn // nil
    +pk.isRowID     // false
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct PrimaryKeyInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ForeignKeyInfo + +
    +
    +
    +
    +
    +
    +

    You get foreign keys from table names, with the +foreignKeys(on:) method.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ForeignKeyInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ResultCode + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ResultCode : RawRepresentable, Equatable, CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseError + +
    +
    +
    +
    +
    +
    +

    DatabaseError wraps an SQLite error.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseError : Error, CustomStringConvertible, CustomNSError
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseRegion + +
    +
    +
    +
    +
    +
    +

    DatabaseRegion defines a region in the database. DatabaseRegion is dedicated +to help transaction observers recognize impactful database changes in their +observes(eventsOfKind:) and databaseDidChange(with:) methods.

    + +

    A database region is the union of any number of “table regions”, which can +cover a full table, or the combination of columns and rows:

    +
    |Table1 |   |Table2 |   |Table3 |   |Table4 |   |Table5 |
    +|-------|   |-------|   |-------|   |-------|   |-------|
    +|x|x|x|x|   |x| | | |   |x|x|x|x|   |x|x| |x|   | | | | |
    +|x|x|x|x|   |x| | | |   | | | | |   | | | | |   | |x| | |
    +|x|x|x|x|   |x| | | |   | | | | |   |x|x| |x|   | | | | |
    +|x|x|x|x|   |x| | | |   | | | | |   | | | | |   | | | | |
    +
    + +

    To create a database region, you use one of those methods:

    + +
      +
    • DatabaseRegion.fullDatabase: the region that covers all database tables.

    • +
    • DatabaseRegion(): the empty region.

    • +
    • DatabaseRegion(table:): the region that covers one database table.

    • +
    • SelectStatement.databaseRegion:

      +
      let statement = try db.makeSelectStatement(sql: "SELECT name, score FROM player")
      +let region = statement.databaseRegion
      +
    • +
    • FetchRequest.databaseRegion(_:)

      +
      let request = Player.filter(key: 1)
      +let region = try request.databaseRegion(db)
      +
    • +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseRegion : CustomStringConvertible, Equatable
    +
    extension DatabaseRegion: DatabaseRegionConvertible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseRegionConvertible

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    A type-erased DatabaseRegionConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct AnyDatabaseRegionConvertible : DatabaseRegionConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    DatabaseRegionObservation tracks changes in the results of database +requests, and notifies each database transaction whenever the +database changes.

    + +

    For example:

    +
    let observation = DatabaseRegionObservation(tracking: Player.all)
    +let observer = try observation.start(in: dbQueue) { db: Database in
    +    print("Players have changed.")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseRegionObservation
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseValue

+

+
+
+ +
+
+
+ + +
+ +

PreparedRequest

+

+
+
+
    +
  • +
    + + + + PreparedRequest + +
    +
    +
    +
    +
    +
    +

    A PreparedRequest is a request that is ready to be executed.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct PreparedRequest
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

AdaptedFetchRequest

+

+
+
+ +
+
+
+ + +
+ +

AnyFetchRequest

+

+
+
+
    +
  • +
    + + + + AnyFetchRequest + +
    +
    +
    +
    +
    +
    +

    A type-erased FetchRequest.

    + +

    An AnyFetchRequest forwards its operations to an underlying request, +hiding its specifics.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct AnyFetchRequest<T> : FetchRequest
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

RowIndex

+

+
+
+
    +
  • +
    + + + + RowIndex + +
    +
    +
    +
    +
    +
    +

    Indexes to (ColumnName, DatabaseValue) pairs in a database row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RowIndex : Comparable, Strideable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + EmptyRowAdapter + +
    +
    +
    +
    +
    +
    +

    EmptyRowAdapter is a row adapter that hides all columns.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct EmptyRowAdapter : RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ColumnMapping + +
    +
    +
    +
    +
    +
    +

    ColumnMapping is a row adapter that maps column names.

    +
    let adapter = ColumnMapping(["foo": "bar"])
    +let sql = "SELECT 'foo' AS foo, 'bar' AS bar, 'baz' AS baz"
    +
    +// [foo:"bar"]
    +try Row.fetchOne(db, sql: sql, adapter: adapter)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ColumnMapping : RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SuffixRowAdapter + +
    +
    +
    +
    +
    +
    +

    SuffixRowAdapter is a row adapter that hides the first columns in a row.

    +
    let adapter = SuffixRowAdapter(fromIndex: 2)
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +
    +// [baz:3]
    +try Row.fetchOne(db, sql: sql, adapter: adapter)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SuffixRowAdapter : RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RangeRowAdapter + +
    +
    +
    +
    +
    +
    +

    RangeRowAdapter is a row adapter that only exposes a range of columns.

    +
    let adapter = RangeRowAdapter(1..<3)
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz, 4 as qux"
    +
    +// [bar:2 baz:3]
    +try Row.fetchOne(db, sql: sql, adapter: adapter)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RangeRowAdapter : RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ScopeAdapter + +
    +
    +
    +
    +
    +
    +

    ScopeAdapter is a row adapter that lets you define scopes on rows.

    +
    // Two adapters
    +let fooAdapter = ColumnMapping(["value": "foo"])
    +let barAdapter = ColumnMapping(["value": "bar"])
    +
    +// Define scopes
    +let adapter = ScopeAdapter([
    +    "foo": fooAdapter,
    +    "bar": barAdapter])
    +
    +// Fetch
    +let sql = "SELECT 'foo' AS foo, 'bar' AS bar"
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
    +
    +// Scoped rows:
    +if let fooRow = row.scopes["foo"] {
    +    fooRow["value"]    // "foo"
    +}
    +if let barRow = row.scopes["bar"] {
    +    barRow["value"]    // "bar"
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ScopeAdapter : RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLLiteral + +
    +
    +
    +
    +
    +
    +

    SQLLiteral is a type which support SQL +Interpolation.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    let name: String = ...
    +    let id: Int64 = ...
    +    let query: SQLLiteral = "UPDATE player SET name = \(name) WHERE id = \(id)"
    +    try db.execute(literal: query)
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SQLLiteral
    +
    extension SQLLiteral: ExpressibleByStringInterpolation
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLRequest + +
    +
    +
    +
    +
    +
    +

    A FetchRequest built from raw SQL.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SQLRequest<T> : FetchRequest
    +
    extension SQLRequest: ExpressibleByStringInterpolation
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

StatementArguments

+

+
+
+
    +
  • +
    + + + + StatementArguments + +
    +
    +
    +
    +
    +
    +

    StatementArguments provide values to argument placeholders in raw +SQL queries.

    + +

    Placeholders can take several forms (see https://www.sqlite.org/lang_expr.html#varparam +for more information):

    + +
      +
    • ?NNN (e.g. ?2): the NNN-th argument (starts at 1)
    • +
    • ?: the N-th argument, where N is one greater than the largest argument +number already assigned
    • +
    • :AAAA (e.g. :name): named argument

    • +
    • $AAAA (e.g. $name): named argument

    • +
    +

    Positional Arguments

    + +

    To fill question marks placeholders, feed StatementArguments with an array:

    +
    db.execute(
    +    sql: "INSERT ... (?, ?)",
    +    arguments: StatementArguments(["Arthur", 41]))
    +
    +// Array literals are automatically converted:
    +db.execute(
    +    sql: "INSERT ... (?, ?)",
    +    arguments: ["Arthur", 41])
    +
    +

    Named Arguments

    + +

    To fill named arguments, feed StatementArguments with a dictionary:

    +
    db.execute(
    +    sql: "INSERT ... (:name, :score)",
    +    arguments: StatementArguments(["name": "Arthur", "score": 41]))
    +
    +// Dictionary literals are automatically converted:
    +db.execute(
    +    sql: "INSERT ... (:name, :score)",
    +    arguments: ["name": "Arthur", "score": 41])
    +
    +

    Concatenating Arguments

    + +

    Several arguments can be concatenated and mixed with the +append(contentsOf:) method and the +, &+, += operators:

    +
    var arguments: StatementArguments = ["Arthur"]
    +arguments += [41]
    +db.execute(sql: "INSERT ... (?, ?)", arguments: arguments)
    +
    + +

    + and += operators consider that overriding named arguments is a +programmer error:

    +
    var arguments: StatementArguments = ["name": "Arthur"]
    +arguments += ["name": "Barbara"]
    +// fatal error: already defined statement argument: name
    +
    + +

    &+ and append(contentsOf:) allow overriding named arguments:

    +
    var arguments: StatementArguments = ["name": "Arthur"]
    +arguments = arguments &+ ["name": "Barbara"]
    +print(arguments)
    +// Prints ["name": "Barbara"]
    +
    +

    Mixed Arguments

    + +

    It is possible to mix named and positional arguments. Yet this is usually +confusing, and it is best to avoid this practice:

    +
    let sql = "SELECT ?2 AS two, :foo AS foo, ?1 AS one, :foo AS foo2, :bar AS bar"
    +var arguments: StatementArguments = [1, 2, "bar"] + ["foo": "foo"]
    +let row = try Row.fetchOne(db, sql: sql, arguments: arguments)!
    +print(row)
    +// Prints [two:2 foo:"foo" one:1 foo2:"foo" bar:"bar"]
    +
    + +

    Mixed arguments exist as a support for requests like the following:

    +
    let players = try Player
    +    .filter(sql: "team = :team", arguments: ["team": "Blue"])
    +    .filter(sql: "score > ?", arguments: [1000])
    +    .fetchAll(db)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct StatementArguments: CustomStringConvertible, Equatable,
    +    ExpressibleByArrayLiteral, ExpressibleByDictionaryLiteral
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    DatabaseDateComponents reads and stores DateComponents in the database.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseDateComponents : DatabaseValueConvertible, StatementColumnConvertible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database events

+

+
+
+
    +
  • +
    + + + + DatabaseEvent + +
    +
    +
    +
    +
    +
    +

    A database event, notified to TransactionObserver.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseEvent
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS3 + +
    +
    +
    +
    +
    +
    +

    FTS3 lets you define “fts3” virtual tables.

    +
    // CREATE VIRTUAL TABLE document USING fts3(content)
    +try db.create(virtualTable: "document", using: FTS3()) { t in
    +    t.column("content")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct FTS3 : VirtualTableModule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS3Pattern + +
    +
    +
    +
    +
    +
    +

    A full text pattern that can query FTS3 and FTS4 virtual tables.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct FTS3Pattern
    +
    extension FTS3Pattern: DatabaseValueConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An FTS3 tokenizer, suitable for FTS3 and FTS4 table definitions:

    +
    db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.tokenizer = .simple // FTS3TokenizerDescriptor
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#tokenizer

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct FTS3TokenizerDescriptor
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS4 + +
    +
    +
    +
    +
    +
    +

    FTS4 lets you define “fts4” virtual tables.

    +
    // CREATE VIRTUAL TABLE document USING fts4(content)
    +try db.create(virtualTable: "document", using: FTS4()) { t in
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct FTS4 : VirtualTableModule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5 + +
    +
    +
    +
    +
    +
    +

    FTS5 lets you define “fts5” virtual tables.

    +
    // CREATE VIRTUAL TABLE document USING fts5(content)
    +try db.create(virtualTable: "document", using: FTS5()) { t in
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS5Pattern + +
    +
    +
    +
    +
    +
    +

    A full text pattern that can query FTS5 virtual tables.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    + +
    +
    +
    +
    +
  • +
  • +
    + + + + FTS5Tokenization + +
    +
    +
    +
    +
    +
    +

    The reason why FTS5 is requesting tokenization.

    + +

    See https://www.sqlite.org/fts5.html#custom_tokenizers

    + + See more +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An FTS5 tokenizer, suitable for FTS5 table definitions:

    +
    db.create(virtualTable: "book", using: FTS5()) { t in
    +    t.tokenizer = .unicode61() // FTS5TokenizerDescriptor
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html#tokenizers

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS5TokenFlags + +
    +
    +
    +
    +
    +
    +

    Flags that tell SQLite how to register a token.

    + +

    See https://www.sqlite.org/fts5.html#custom_tokenizers

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + DatabaseMigrator + +
    +
    +
    +
    +
    +
    +

    A DatabaseMigrator registers and applies database migrations.

    + +

    Migrations are named blocks of SQL statements that are guaranteed to be +applied in order, once and only once.

    + +

    When a user upgrades your application, only non-applied migration are run.

    + +

    Usage:

    +
    var migrator = DatabaseMigrator()
    +
    +// 1st migration
    +migrator.registerMigration("createLibrary") { db in
    +    try db.create(table: "author") { t in
    +        t.autoIncrementedPrimaryKey("id")
    +        t.column("creationDate", .datetime)
    +        t.column("name", .text).notNull()
    +    }
    +
    +    try db.create(table: "book") { t in
    +        t.autoIncrementedPrimaryKey("id")
    +        t.column("authorId", .integer)
    +            .notNull()
    +            .references("author", onDelete: .cascade)
    +        t.column("title", .text).notNull()
    +    }
    +}
    +
    +// 2nd migration
    +migrator.registerMigration("AddBirthYearToAuthors") { db in
    +    try db.alter(table: "author") { t
    +        t.add(column: "birthYear", .integer)
    +    }
    +}
    +
    +// Migrations for future versions will be inserted here:
    +//
    +// // 3rd migration
    +// migrator.registerMigration("...") { db in
    +//     ...
    +// }
    +
    +try migrator.migrate(dbQueue)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseMigrator
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + AssociationAggregate + +
    +
    +
    +
    +
    +
    +

    An AssociationAggregate is able to compute aggregated values from a +population of associated records.

    + +

    For example:

    +
    struct Author: TableRecord {
    +    static let books = hasMany(Book.self)
    +}
    +
    +let bookCount = Author.books.count // AssociationAggregate<Author>
    +
    + +

    Association aggregates can be used in the annotated(with:) and +having(_:) request methods:

    +
    let request = Author.annotated(with: bookCount)
    +let request = Author.having(bookCount >= 10)
    +
    + +

    The RowDecoder generic type helps the compiler prevent incorrect use +of aggregates:

    +
    // Won't compile because Fruit is not Author.
    +let request = Fruit.annotated(with: bookCount)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + BelongsToAssociation + +
    +
    +
    +
    +
    +
    +

    The BelongsTo association sets up a one-to-one connection from a record +type to another record type, such as each instance of the declaring record +“belongs to” an instance of the other record.

    + +

    For example, if your application includes authors and books, and each book +is assigned its author, you’d declare the association this way:

    +
    struct Author: TableRecord { ... }
    +struct Book: TableRecord {
    +    static let author = belongsTo(Author.self)
    +    ...
    +}
    +
    + +

    A BelongsTo associations should be supported by an SQLite foreign key.

    + +

    Foreign keys are the recommended way to declare relationships between +database tables because not only will SQLite guarantee the integrity of your +data, but GRDB will be able to use those foreign keys to automatically +configure your association.

    + +

    You define the foreign key when you create database tables. For example:

    +
    try db.create(table: "author") { t in
    +    t.autoIncrementedPrimaryKey("id")             // (1)
    +    t.column("name", .text)
    +}
    +try db.create(table: "book") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("authorId", .integer)                // (2)
    +        .notNull()                                // (3)
    +        .indexed()                                // (4)
    +        .references("author", onDelete: .cascade) // (5)
    +    t.column("title", .text)
    +}
    +
    + +
      +
    1. The author table has a primary key.
    2. +
    3. The book.authorId column is used to link a book to the author it +belongs to.
    4. +
    5. Make the book.authorId column not null if you want SQLite to guarantee +that all books have an author.
    6. +
    7. Create an index on the book.authorId column in order to ease the +selection of an author’s books.
    8. +
    9. Create a foreign key from book.authorId column to authors.id, so that +SQLite guarantees that no book refers to a missing author. The +onDelete: .cascade option has SQLite automatically delete all of an +author’s books when that author is deleted. +See https://sqlite.org/foreignkeys.html#fk_actions for more information.
    10. +
    + +

    The example above uses auto-incremented primary keys. But generally +speaking, all primary keys are supported.

    + +

    If the database schema does not define foreign keys between tables, you can +still use BelongsTo associations. But your help is needed to define the +missing foreign key:

    +
    struct Book: FetchableRecord, TableRecord {
    +    static let author = belongsTo(Author.self, using: ForeignKey(...))
    +}
    +
    + +

    See ForeignKey for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct BelongsToAssociation<Origin, Destination> : AssociationToOne where Origin : TableRecord, Destination : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + HasManyAssociation + +
    +
    +
    +
    +
    +
    +

    The HasMany association indicates a one-to-many connection between two +record types, such as each instance of the declaring record “has many” +instances of the other record.

    + +

    For example, if your application includes authors and books, and each author +is assigned zero or more books, you’d declare the association this way:

    +
    struct Book: TableRecord { ... }
    +struct Author: TableRecord {
    +    static let books = hasMany(Book.self)
    +    ...
    +}
    +
    + +

    HasMany associations should be supported by an SQLite foreign key.

    + +

    Foreign keys are the recommended way to declare relationships between +database tables because not only will SQLite guarantee the integrity of your +data, but GRDB will be able to use those foreign keys to automatically +configure your association.

    + +

    You define the foreign key when you create database tables. For example:

    +
    try db.create(table: "author") { t in
    +    t.autoIncrementedPrimaryKey("id")             // (1)
    +    t.column("name", .text)
    +}
    +try db.create(table: "book") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("authorId", .integer)                // (2)
    +        .notNull()                                // (3)
    +        .indexed()                                // (4)
    +        .references("author", onDelete: .cascade) // (5)
    +    t.column("title", .text)
    +}
    +
    + +
      +
    1. The author table has a primary key.
    2. +
    3. The book.authorId column is used to link a book to the author it +belongs to.
    4. +
    5. Make the book.authorId column not null if you want SQLite to guarantee +that all books have an author.
    6. +
    7. Create an index on the book.authorId column in order to ease the +selection of an author’s books.
    8. +
    9. Create a foreign key from book.authorId column to authors.id, so that +SQLite guarantees that no book refers to a missing author. The +onDelete: .cascade option has SQLite automatically delete all of an +author’s books when that author is deleted. +See https://sqlite.org/foreignkeys.html#fk_actions for more information.
    10. +
    + +

    The example above uses auto-incremented primary keys. But generally +speaking, all primary keys are supported.

    + +

    If the database schema does not define foreign keys between tables, you can +still use HasMany associations. But your help is needed to define the +missing foreign key:

    +
    struct Author: TableRecord {
    +    static let books = hasMany(Book.self, using: ForeignKey(...))
    +}
    +
    + +

    See ForeignKey for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct HasManyAssociation<Origin, Destination> : AssociationToMany where Origin : TableRecord, Destination : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The HasManyThrough association is often used to set up a many-to-many +connection with another record. This association indicates that the +declaring record can be matched with zero or more instances of another +record by proceeding through a third record.

    + +

    For example, consider the practice of passport delivery. One coutry +“has many” citizens “through” its passports:

    +
    struct Country: TableRecord {
    +    static let passports = hasMany(Passport.self)
    +    static let citizens = hasMany(Citizen.self, through: passports, using: Passport.citizen)
    +    ...
    +}
    +
    +struct Passport: TableRecord {
    +    static let citizen = belongsTo(Citizen.self)
    +    ...
    +}
    +
    +struct Citizen: TableRecord { ... }
    +
    + +

    The HasManyThrough association is also useful for setting up +“shortcuts” through nested HasMany associations. For example, if a document +has many sections, and a section has many paragraphs, you may sometimes want +to get a simple collection of all paragraphs in the document. You could set +that up this way:

    +
    struct Document: TableRecord {
    +    static let sections = hasMany(Section.self)
    +    static let paragraphs = hasMany(Paragraph.self, through: sections, using: Section.paragraphs)
    +}
    +
    +struct Section: TableRecord {
    +    static let paragraphs = hasMany(Paragraph.self)
    +}
    +
    +struct Paragraph: TableRecord {
    +}
    +
    + +

    As in the examples above, HasManyThrough association is always built from +two other associations: the through: and using: arguments. Those +associations can be any other association (BelongsTo, HasMany, +HasManyThrough, etc).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct HasManyThroughAssociation<Origin, Destination> : AssociationToMany where Origin : TableRecord, Destination : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + HasOneAssociation + +
    +
    +
    +
    +
    +
    +

    The HasOne association indicates a one-to-one connection between two +record types, such as each instance of the declaring record “has one” +instances of the other record.

    + +

    For example, if your application has one database table for countries, and +another for their demographic profiles, you’d declare the association +this way:

    +
    struct Demographics: TableRecord { ... }
    +struct Country: TableRecord {
    +    static let demographics = hasOne(Demographics.self)
    +    ...
    +}
    +
    + +

    HasOne associations should be supported by an SQLite foreign key.

    + +

    Foreign keys are the recommended way to declare relationships between +database tables because not only will SQLite guarantee the integrity of your +data, but GRDB will be able to use those foreign keys to automatically +configure your association.

    + +

    You define the foreign key when you create database tables. For example:

    +
    try db.create(table: "country") { t in
    +    t.column("code", .text).primaryKey()           // (1)
    +    t.column("name", .text)
    +}
    +try db.create(table: "demographics") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("countryCode", .text)                 // (2)
    +        .notNull()                                 // (3)
    +        .unique()                                  // (4)
    +        .references("country", onDelete: .cascade) // (5)
    +    t.column("population", .integer)
    +    t.column("density", .double)
    +}
    +
    + +
      +
    1. The country table has a primary key.
    2. +
    3. The demographics.countryCode column is used to link a demographic +profile to the country it belongs to.
    4. +
    5. Make the demographics.countryCode column not null if you want SQLite to +guarantee that all profiles are linked to a country.
    6. +
    7. Create a unique index on the demographics.countryCode column in order to +guarantee the unicity of any country’s profile.
    8. +
    9. Create a foreign key from demographics.countryCode column to +country.code, so that SQLite guarantees that no profile refers to a +missing country. The onDelete: .cascade option has SQLite automatically +delete a profile when its country is deleted. +See https://sqlite.org/foreignkeys.html#fk_actions for more information.
    10. +
    + +

    The example above uses a string primary for the country table. But generally +speaking, all primary keys are supported.

    + +

    If the database schema does not follow this convention, and does not define +foreign keys between tables, you can still use HasOne associations. But +your help is needed to define the missing foreign key:

    +
    struct Country: FetchableRecord, TableRecord {
    +    static let demographics = hasOne(Demographics.self, using: ForeignKey(...))
    +}
    +
    + +

    See ForeignKey for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct HasOneAssociation<Origin, Destination> : AssociationToOne where Origin : TableRecord, Destination : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A HasOneThrough association sets up a one-to-one connection with +another record. This association indicates that the declaring record can be +matched with one instance of another record by proceeding through a third +record. For example, if each book belongs to a library, and each library has +one address, then one knows where the book should be returned to:

    +
    struct Book: TableRecord {
    +    static let library = belongsTo(Library.self)
    +    static let returnAddress = hasOne(Address.self, through: library, using: Library.address)
    +    ...
    +}
    +
    +struct Library: TableRecord {
    +    static let address = hasOne(Address.self)
    +    ...
    +}
    +
    +struct Address: TableRecord { ... }
    +
    + +

    As in the example above, HasOneThrough association is always built from +two other associations: the through: and using: arguments. Those +associations can be any other association to one (BelongsTo, HasOne, +HasOneThrough).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct HasOneThroughAssociation<Origin, Destination> : AssociationToOne where Origin : TableRecord, Destination : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + QueryInterfaceRequest + +
    +
    +
    +
    +
    +
    +

    QueryInterfaceRequest is a request that generates SQL for you.

    + +

    For example:

    +
    try dbQueue.read { db in
    +    let request = Player
    +        .filter(Column("score") > 1000)
    +        .order(Column("name"))
    +    let players = try request.fetchAll(db) // [Player]
    +}
    +
    + +

    See https://github.com/groue/GRDB.swift#the-query-interface

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct QueryInterfaceRequest<T>
    +
    extension QueryInterfaceRequest: FetchRequest
    +
    extension QueryInterfaceRequest: SelectionRequest
    +
    extension QueryInterfaceRequest: FilteredRequest
    +
    extension QueryInterfaceRequest: OrderedRequest
    +
    extension QueryInterfaceRequest: AggregatingRequest
    +
    extension QueryInterfaceRequest: _JoinableRequest
    +
    extension QueryInterfaceRequest: TableRequest
    +
    extension QueryInterfaceRequest: JoinableRequest where T: TableRecord
    +
    extension QueryInterfaceRequest: DerivableRequest where T: TableRecord
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ColumnAssignment

+

+
+
+
    +
  • +
    + + + + ColumnAssignment + +
    +
    +
    +
    +
    +
    +

    A ColumnAssignment can update rows in the database.

    + +

    You create an assignment from a column and an assignment operator, such as +<- or +=:

    +
    try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    let assignment = Column("score") <- 0
    +    try Player.updateAll(db, assignment)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Column + +
    +
    +
    +
    +
    +
    +

    A column in a database table.

    + +

    When you need to introduce your own column type, don’t wrap a Column. +Instead, adopt the ColumnExpression protocol.

    + +

    See https://github.com/groue/GRDB.swift#the-query-interface

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Column : ColumnExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SQLExpressionLiteral

+

+
+
+
    +
  • +
    + + + + SQLExpressionLiteral + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    SQLExpressionLiteral is an expression built from a raw SQL snippet.

    +
    SQLExpressionLiteral(sql: "1 + 2")
    +
    + +

    The SQL literal may contain ? and colon-prefixed arguments:

    +
    SQLExpressionLiteral(sql: "? + ?", arguments: [1, 2])
    +SQLExpressionLiteral(sql: ":one + :two", arguments: ["one": 1, "two": 2])
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SQLExpressionLiteral : SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SQLExpressionFunction

+

+
+
+ +
+
+
+ + +
+ +

AllColumns

+

+
+
+
    +
  • +
    + + + + AllColumns + +
    +
    +
    +
    +
    +
    +

    AllColumns is the * in SELECT *.

    + +

    You use AllColumns in your custom implementation of +TableRecord.databaseSelection.

    + +

    For example:

    +
    struct Player : TableRecord {
    +    static var databaseTableName = "player"
    +    static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID]
    +}
    +
    +// SELECT *, rowid FROM player
    +let request = Player.all()
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct AllColumns
    +
    extension AllColumns: SQLSelectable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ForeignKey + +
    +
    +
    +
    +
    +
    +

    A ForeignKey helps building associations when GRDB can’t infer a foreign +key from the database schema.

    + +

    Sometimes the database schema does not define any foreign key between two +tables. And sometimes, there are several foreign keys from a table +to another:

    +
    | Table book   |       | Table person |
    +| ------------ |       | ------------ |
    +| id           |   +-->• id           |
    +| authorId     •---+   | name         |
    +| translatorId •---+
    +| title        |
    +
    + +

    When this happens, associations can’t be automatically inferred from the +database schema. GRDB will complain with a fatal error such as “Ambiguous +foreign key from book to person”, or “Could not infer foreign key from book +to person”.

    + +

    Your help is needed. You have to instruct GRDB which foreign key to use:

    +
    struct Book: TableRecord {
    +    // Define foreign keys
    +    static let authorForeignKey = ForeignKey(["authorId"]))
    +    static let translatorForeignKey = ForeignKey(["translatorId"]))
    +
    +    // Use foreign keys to define associations:
    +    static let author = belongsTo(Person.self, using: authorForeignKey)
    +    static let translator = belongsTo(Person.self, using: translatorForeignKey)
    +}
    +
    + +

    Foreign keys are always defined from the table that contains the columns at +the origin of the foreign key. Person’s symmetric HasMany associations reuse +Book’s foreign keys:

    +
    struct Person: TableRecord {
    +    static let writtenBooks = hasMany(Book.self, using: Book.authorForeignKey)
    +    static let translatedBooks = hasMany(Book.self, using: Book.translatorForeignKey)
    +}
    +
    + +

    Foreign keys can also be defined from query interface columns:

    +
    struct Book: TableRecord {
    +    enum Columns: String, ColumnExpression {
    +        case id, title, authorId, translatorId
    +    }
    +
    +    static let authorForeignKey = ForeignKey([Columns.authorId]))
    +    static let translatorForeignKey = ForeignKey([Columns.translatorId]))
    +}
    +
    + +

    When the destination table of a foreign key does not define any primary key, +you need to provide the full definition of a foreign key:

    +
    struct Book: TableRecord {
    +    static let authorForeignKey = ForeignKey(["authorId"], to: ["id"]))
    +    static let author = belongsTo(Person.self, using: authorForeignKey)
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ForeignKey
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

PersistenceContainer

+

+
+
+
    +
  • +
    + + + + PersistenceContainer + +
    +
    +
    +
    +
    +
    +

    Use persistence containers in the encode(to:) method of your +encodable records:

    +
    struct Player: EncodableRecord {
    +    var id: Int64?
    +    var name: String?
    +
    +    func encode(to container: inout PersistenceContainer) {
    +        container["id"] = id
    +        container["name"] = name
    +    }
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct PersistenceContainer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

UITableView Support

+

+
+
+ +
+
+
+ + +
+ +

ValueObservation

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/AdaptedFetchRequest.html b/docs/4.8/Structs/AdaptedFetchRequest.html new file mode 100644 index 000000000..ae698a0f8 --- /dev/null +++ b/docs/4.8/Structs/AdaptedFetchRequest.html @@ -0,0 +1,1107 @@ + + + + AdaptedFetchRequest Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AdaptedFetchRequest

+
+
+
public struct AdaptedFetchRequest<Base> : FetchRequest where Base : FetchRequest
+ +
+
+

An adapted request.

+ +
+
+
+
    +
  • +
    + + + + RowDecoder + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias RowDecoder = Base.RowDecoder
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/AllColumns.html b/docs/4.8/Structs/AllColumns.html new file mode 100644 index 000000000..3b34b02f8 --- /dev/null +++ b/docs/4.8/Structs/AllColumns.html @@ -0,0 +1,1122 @@ + + + + AllColumns Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AllColumns

+
+
+
public struct AllColumns
+
extension AllColumns: SQLSelectable
+ +
+
+

AllColumns is the * in SELECT *.

+ +

You use AllColumns in your custom implementation of +TableRecord.databaseSelection.

+ +

For example:

+
struct Player : TableRecord {
+    static var databaseTableName = "player"
+    static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID]
+}
+
+// SELECT *, rowid FROM player
+let request = Player.all()
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/AnyDatabaseRegionConvertible.html b/docs/4.8/Structs/AnyDatabaseRegionConvertible.html new file mode 100644 index 000000000..4bb0e8b7b --- /dev/null +++ b/docs/4.8/Structs/AnyDatabaseRegionConvertible.html @@ -0,0 +1,1138 @@ + + + + AnyDatabaseRegionConvertible Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyDatabaseRegionConvertible

+
+
+
public struct AnyDatabaseRegionConvertible : DatabaseRegionConvertible
+ +
+
+

A type-erased DatabaseRegionConvertible

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/AnyFetchRequest.html b/docs/4.8/Structs/AnyFetchRequest.html new file mode 100644 index 000000000..1aca5f18a --- /dev/null +++ b/docs/4.8/Structs/AnyFetchRequest.html @@ -0,0 +1,1172 @@ + + + + AnyFetchRequest Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyFetchRequest

+
+
+
public struct AnyFetchRequest<T> : FetchRequest
+ +
+
+

A type-erased FetchRequest.

+ +

An AnyFetchRequest forwards its operations to an underlying request, +hiding its specifics.

+ +
+
+
+
    +
  • +
    + + + + RowDecoder + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias RowDecoder = T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request that wraps and forwards operations to request.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Request>(_ request: Request) where Request : FetchRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request whose prepare() method wraps and forwards +operations the argument closure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Define your own FetchRequest type instead.")
    +public init(_ prepare: @escaping (Database, _ singleResult: Bool) throws -> (SelectStatement, RowAdapter?))
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/AnyValueReducer.html b/docs/4.8/Structs/AnyValueReducer.html new file mode 100644 index 000000000..0fc30b168 --- /dev/null +++ b/docs/4.8/Structs/AnyValueReducer.html @@ -0,0 +1,1160 @@ + + + + AnyValueReducer Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyValueReducer

+
+
+
public struct AnyValueReducer<Fetched, Value> : ValueReducer
+ +
+
+

Experimental

+ +

A type-erased ValueReducer.

+ +

An AnyValueReducer forwards its operations to an underlying reducer, +hiding its specifics.

+ +
+
+
+
    +
  • +
    + + + + init(fetch:value:) + +
    +
    +
    +
    +
    +
    +

    Creates a reducer whose fetch(_:) and value(_:) methods wrap and +forward operations the argument closures.

    + +

    For example, this reducer counts the number of a times the player table +is modified:

    +
    var count = 0
    +let reducer = AnyValueReducer(
    +    fetch: { _ in },
    +    value: { _ -> Int? in
    +        count += 1
    +        return count
    +})
    +let observer = ValueObservation
    +    .tracking(Player.all(), reducer: reducer)
    +    .start(in: dbQueue) { count: Int in
    +        print("Players have been modified \(count) times.")
    +    }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fetch: @escaping (Database) throws -> Fetched, value: @escaping (Fetched) -> Value?)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a reducer that wraps and forwards operations to reducer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Base>(_ reducer: Base) where Fetched == Base.Fetched, Value == Base.Value, Base : ValueReducer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/AssociationAggregate.html b/docs/4.8/Structs/AssociationAggregate.html new file mode 100644 index 000000000..70faabe6d --- /dev/null +++ b/docs/4.8/Structs/AssociationAggregate.html @@ -0,0 +1,1265 @@ + + + + AssociationAggregate Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AssociationAggregate

+
+
+
public struct AssociationAggregate<RowDecoder>
+ +
+
+

An AssociationAggregate is able to compute aggregated values from a +population of associated records.

+ +

For example:

+
struct Author: TableRecord {
+    static let books = hasMany(Book.self)
+}
+
+let bookCount = Author.books.count // AssociationAggregate<Author>
+
+ +

Association aggregates can be used in the annotated(with:) and +having(_:) request methods:

+
let request = Author.annotated(with: bookCount)
+let request = Author.having(bookCount >= 10)
+
+ +

The RowDecoder generic type helps the compiler prevent incorrect use +of aggregates:

+
// Won't compile because Fruit is not Author.
+let request = Fruit.annotated(with: bookCount)
+
+ +
+
+
+
    +
  • +
    + + + + aliased(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that is selected in a column with the given name.

    + +

    For example:

    +
    let aggregate = Author.books.count.aliased("numberOfBooks")
    +let request = Author.annotated(with: aggregate)
    +if let row = try Row.fetchOne(db, request) {
    +    let numberOfBooks: Int = row["numberOfBooks"]
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, renamed: "forKey(_:﹚")
    +public func aliased(_ name: String) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + forKey(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that is selected in a column with the given name.

    + +

    For example:

    +
    let aggregate = Author.books.count.forKey("numberOfBooks")
    +let request = Author.annotated(with: aggregate)
    +if let row = try Row.fetchOne(db, request) {
    +    let numberOfBooks: Int = row["numberOfBooks"]
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func forKey(_ key: String) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + aliased(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that is selected in a column named like the given +coding key.

    + +

    For example:

    +
    struct AuthorInfo: Decodable, FetchableRecord {
    +    var author: Author
    +    var numberOfBooks: Int
    +
    +    static func fetchAll(_ db: Database) throws -> [AuthorInfo] {
    +        let aggregate = Author.books.count.aliased(CodingKeys.numberOfBooks)
    +        let request = Author.annotated(with: aggregate)
    +        return try AuthorInfo.fetchAll(db, request)
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, renamed: "forKey(_:﹚")
    +public func aliased(_ key: CodingKey) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + forKey(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that is selected in a column named like the given +coding key.

    + +

    For example:

    +
    struct AuthorInfo: Decodable, FetchableRecord {
    +    var author: Author
    +    var numberOfBooks: Int
    +
    +    static func fetchAll(_ db: Database) throws -> [AuthorInfo] {
    +        let aggregate = Author.books.count.forKey(CodingKeys.numberOfBooks)
    +        let request = Author.annotated(with: aggregate)
    +        return try AuthorInfo.fetchAll(db, request)
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func forKey(_ key: CodingKey) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/Column.html b/docs/4.8/Structs/Column.html new file mode 100644 index 000000000..0e1b1bd09 --- /dev/null +++ b/docs/4.8/Structs/Column.html @@ -0,0 +1,1233 @@ + + + + Column Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Column

+
+
+
public struct Column : ColumnExpression
+ +
+
+

A column in a database table.

+ +

When you need to introduce your own column type, don’t wrap a Column. +Instead, adopt the ColumnExpression protocol.

+ +

See https://github.com/groue/GRDB.swift#the-query-interface

+ +
+
+
+
    +
  • +
    + + + + rowID + +
    +
    +
    +
    +
    +
    +

    The hidden rowID column

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let rowID: Column
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The name of the column

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a column given its name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ name: String)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a column given a CodingKey.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ codingKey: CodingKey)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rank + +
    +
    +
    +
    +
    +
    +

    The FTS5 rank column

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let rank: Column
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/ColumnInfo.html b/docs/4.8/Structs/ColumnInfo.html new file mode 100644 index 000000000..2879dc138 --- /dev/null +++ b/docs/4.8/Structs/ColumnInfo.html @@ -0,0 +1,1279 @@ + + + + ColumnInfo Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ColumnInfo

+
+
+
public struct ColumnInfo : FetchableRecord
+ +
+
+

A column of a database table.

+ +

This type closely matches the information returned by the +table_info pragma.

+
> CREATE TABLE player (
+    id INTEGER PRIMARY KEY,
+    firstName TEXT,
+    lastName TEXT)
+> PRAGMA table_info("player")
+cid   name   type     notnull   dflt_value  pk
+----  -----  -------  --------  ----------  ---
+0     id     INTEGER  0         NULL        1
+1     name   TEXT     0         NULL        0
+2     score  INTEGER  0         NULL        0
+
+ +

See Database.columns(in:) and https://www.sqlite.org/pragma.html#pragma_table_info

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The column name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + type + +
    +
    +
    +
    +
    +
    +

    The column data type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let type: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isNotNull + +
    +
    +
    +
    +
    +
    +

    True if and only if the column is constrained to be not null.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isNotNull: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + defaultValueSQL + +
    +
    +
    +
    +
    +
    +

    The SQL snippet that defines the default value, if any.

    + +

    When nil, the column has no default value.

    + +

    When not nil, it contains an SQL string that defines an expression. That +expression may be a literal, as 1, or 'foo'. It may also contain a +non-constant expression such as CURRENT_TIMESTAMP.

    + +

    For example:

    +
    try db.execute(sql: """
    +    CREATE TABLE player(
    +        id INTEGER PRIMARY KEY,
    +        name TEXT DEFAULT 'Anonymous',
    +        score INT DEFAULT 0,
    +        creationDate DATE DEFAULT CURRENT_TIMESTAMP
    +    )
    +    """)
    +let columnInfos = try db.columns(in: "player")
    +columnInfos[0].defaultValueSQL // nil
    +columnInfos[1].defaultValueSQL // "'Anoynymous'"
    +columnInfos[2].defaultValueSQL // "0"
    +columnInfos[3].defaultValueSQL // "CURRENT_TIMESTAMP"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let defaultValueSQL: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + primaryKeyIndex + +
    +
    +
    +
    +
    +
    +

    Zero for columns that are not part of the primary key.

    + +

    Before SQLite 3.7.16, it is 1 for columns that are part of the +primary key.

    + +

    Starting from SQLite 3.7.16, it is the one-based index of the column in +the primary key for columns that are part of the primary key.

    + +

    References:

    + + + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let primaryKeyIndex: Int
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/ColumnMapping.html b/docs/4.8/Structs/ColumnMapping.html new file mode 100644 index 000000000..b3b5a87eb --- /dev/null +++ b/docs/4.8/Structs/ColumnMapping.html @@ -0,0 +1,1115 @@ + + + + ColumnMapping Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ColumnMapping

+
+
+
public struct ColumnMapping : RowAdapter
+ +
+
+

ColumnMapping is a row adapter that maps column names.

+
let adapter = ColumnMapping(["foo": "bar"])
+let sql = "SELECT 'foo' AS foo, 'bar' AS bar, 'baz' AS baz"
+
+// [foo:"bar"]
+try Row.fetchOne(db, sql: sql, adapter: adapter)
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ColumnMapping with a dictionary from mapped column names to +column names in a base row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ mapping: [String : String])
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/Configuration.html b/docs/4.8/Structs/Configuration.html new file mode 100644 index 000000000..c25ec0414 --- /dev/null +++ b/docs/4.8/Structs/Configuration.html @@ -0,0 +1,1752 @@ + + + + Configuration Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Configuration

+
+
+
public struct Configuration
+ +
+
+

Configuration for a DatabaseQueue or DatabasePool.

+ +
+
+
+
+ + +
+ +

Misc options

+

+
+
+
    +
  • +
    + + + + foreignKeysEnabled + +
    +
    +
    +
    +
    +
    +

    If true, foreign key constraints are checked.

    + +

    Default: true

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var foreignKeysEnabled: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + readonly + +
    +
    +
    +
    +
    +
    +

    If true, database modifications are disallowed.

    + +

    Default: false

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var readonly: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + label + +
    +
    +
    +
    +
    +
    +

    The database label.

    + +

    You can query this label at runtime:

    +
    var configuration = Configuration()
    +configuration.label = "MyDatabase"
    +let dbQueue = try DatabaseQueue(path: ..., configuration: configuration)
    +
    +try dbQueue.read { db in
    +    print(db.configuration.label) // Prints "MyDatabase"
    +}
    +
    + +

    The database label is also used to name the various dispatch queues +created by GRDB, visible in debugging sessions and crash logs. However +those dispatch queue labels are intended for debugging only. Their +format may change between GRDB releases. Applications should not depend +on the GRDB dispatch queue labels.

    + +

    If the database label is nil, the current GRDB implementation uses the +following dispatch queue labels:

    + +
      +
    • GRDB.DatabaseQueue: the (unique) dispatch queue of a DatabaseQueue
    • +
    • GRDB.DatabasePool.writer: the (unique) writer dispatch queue of +a DatabasePool
    • +
    • GRDB.DatabasePool.reader.N, where N is 1, 2, …: one of the reader +dispatch queue(s) of a DatabasePool. N grows with the number of SQLite +connections: it may get bigger than the maximum number of concurrent +readers, as SQLite connections get closed and new ones are opened.
    • +
    • GRDB.DatabasePool.snapshot.N: the dispatch queue of a +DatabaseSnapshot. N grows with the number of snapshots.
    • +
    + +

    If the database label is not nil, for example “MyDatabase”, the current +GRDB implementation uses the following dispatch queue labels:

    + +
      +
    • MyDatabase: the (unique) dispatch queue of a DatabaseQueue
    • +
    • MyDatabase.writer: the (unique) writer dispatch queue of +a DatabasePool
    • +
    • MyDatabase.reader.N, where N is 1, 2, …: one of the reader +dispatch queue(s) of a DatabasePool. N grows with the number of SQLite +connections: it may get bigger than the maximum number of concurrent +readers, as SQLite connections get closed and new ones are opened.
    • +
    • MyDatabase.snapshot.N: the dispatch queue of a +DatabaseSnapshot. N grows with the number of snapshots.
    • +
    + +

    The default label is nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var label: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + trace + +
    +
    +
    +
    +
    +
    +

    A function that is called on every statement executed by the database.

    + +

    Default: nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var trace: TraceFunction?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    If false, SQLite from version 3.29.0 will not interpret a double-quoted +string as a string literal if it does not match any valid identifier.

    + +

    For example:

    +
    // Error: no such column: foo
    +let name = try String.fetchOne(db, sql: """
    +    SELECT "foo" FROM "player"
    +    """)
    +
    + +

    When true, or before version 3.29.0, such strings are interpreted as +string literals, as in the example below. This is a well known SQLite +misfeature.

    +
    // Success: "foo"
    +let name = try String.fetchOne(db, sql: """
    +    SELECT "foo" FROM "player"
    +    """)
    +
    +
      +
    • Default value: false
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var acceptsDoubleQuotedStringLiterals: Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    When true, the Database.suspendNotification and +Database.resumeNotification suspend and resume the database. Database +suspension helps avoiding the 0xdead10cc +exception.

    + +

    During suspension, all database accesses but reads in WAL mode may throw +a DatabaseError of code SQLITE_INTERRUPT, or SQLITE_ABORT. You can +check for those error codes with the +DatabaseError.isInterruptionError property.

    + +

    Experimental

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var observesSuspensionNotifications: Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Managing SQLite Connections

+

+
+
+
    +
  • +
    + + + + prepareDatabase + +
    +
    +
    +
    +
    +
    +

    A function that is run when an SQLite connection is opened, before the +connection is made available for database access methods.

    + +

    For example:

    +
    var config = Configuration()
    +config.prepareDatabase = { db in
    +    try db.execute(sql: "PRAGMA kdf_iter = 10000")
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var prepareDatabase: ((Database) throws -> Void)?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Transactions

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    The default kind of transaction.

    + +

    Default: deferred

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var defaultTransactionKind: Database.TransactionKind
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    If false, it is a programmer error to leave a transaction opened at the +end of a database access block.

    + +

    For example:

    +
    let dbQueue = DatabaseQueue()
    +
    +// fatal error: A transaction has been left opened at the end of a database access
    +try dbQueue.inDatabase { db in
    +    try db.beginTransaction()
    +}
    +
    + +

    If true, one can leave opened transaction at the end of database access +blocks:

    +
    var config = Configuration()
    +config.allowsUnsafeTransactions = true
    +let dbQueue = DatabaseQueue(configuration: config)
    +
    +try dbQueue.inDatabase { db in
    +    try db.beginTransaction()
    +}
    +
    +try dbQueue.inDatabase { db in
    +    try db.commit()
    +}
    +
    + +

    This configuration flag has no effect on DatabasePool readers: those +never allow leaving a transaction opened at the end of a read access.

    + +

    Default: false

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var allowsUnsafeTransactions: Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Concurrency

+

+
+
+
    +
  • +
    + + + + busyMode + +
    +
    +
    +
    +
    +
    +

    The behavior in case of SQLITE_BUSY error. See https://www.sqlite.org/rescode.html#busy

    + +

    Default: immediateError

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var busyMode: Database.BusyMode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + maximumReaderCount + +
    +
    +
    +
    +
    +
    +

    The maximum number of concurrent readers (applies to database +pools only).

    + +

    Default: 5

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var maximumReaderCount: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + qos + +
    +
    +
    +
    +
    +
    +

    The quality of service class for the work performed by the database.

    + +

    The quality of service is ignored if you supply a target queue.

    + +

    Default: .default (.unspecified on macOS < 10.10)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var qos: DispatchQoS
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + targetQueue + +
    +
    +
    +
    +
    +
    +

    The target queue for all database accesses.

    + +

    When you use a database pool, make sure the queue is concurrent. If +it is serial, no concurrent database access can happen, and you may +experience deadlocks.

    + +

    If the queue is nil, all database accesses happen in unspecified +dispatch queues whose quality of service and label are determined by the +qos and label Configuration properties.

    + +

    Default: nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var targetQueue: DispatchQueue?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Factory Configuration

+

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a factory configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Encryption

+

+
+
+
    +
  • +
    + + + + passphrase + +
    +
    +
    +
    +
    +
    +

    The passphrase for the encrypted database.

    + +

    Default: nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use Database.usePassphrase(_:﹚ in Configuration.prepareDatabase instead.")
    +public var passphrase: String? { get set }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabaseDateComponents.html b/docs/4.8/Structs/DatabaseDateComponents.html new file mode 100644 index 000000000..358dc72d1 --- /dev/null +++ b/docs/4.8/Structs/DatabaseDateComponents.html @@ -0,0 +1,1392 @@ + + + + DatabaseDateComponents Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseDateComponents

+
+
+
public struct DatabaseDateComponents : DatabaseValueConvertible, StatementColumnConvertible
+ +
+
+

DatabaseDateComponents reads and stores DateComponents in the database.

+ +
+
+
+
    +
  • +
    + + + + Format + +
    +
    +
    +
    +
    +
    +

    The available formats for reading and storing date components.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Format : String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

NSDateComponents conversion

+

+
+
+
    +
  • +
    + + + + dateComponents + +
    +
    +
    +
    +
    +
    +

    The date components

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let dateComponents: DateComponents
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + format + +
    +
    +
    +
    +
    +
    +

    The database format

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let format: Format
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:format:) + +
    +
    +
    +
    +
    +
    +

    Creates a DatabaseDateComponents from a DateComponents and a format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ dateComponents: DateComponents, format: Format)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + dateComponents + + +
    +

    An optional DateComponents.

    +
    +
    + + format + + +
    +

    The format used for storing the date components in +the database.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

StatementColumnConvertible adoption

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseValueConvertible adoption

+

+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a DatabaseDateComponents if dbValue contains a +valid date.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> DatabaseDateComponents?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabaseDateComponents/Format.html b/docs/4.8/Structs/DatabaseDateComponents/Format.html new file mode 100644 index 000000000..393a5607f --- /dev/null +++ b/docs/4.8/Structs/DatabaseDateComponents/Format.html @@ -0,0 +1,1294 @@ + + + + Format Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Format

+
+
+
public enum Format : String
+ +
+
+

The available formats for reading and storing date components.

+ +
+
+
+
    +
  • +
    + + + + YMD + +
    +
    +
    +
    +
    +
    +

    The format “yyyy-MM-dd”.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case YMD = "yyyy-MM-dd"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + YMD_HM + +
    +
    +
    +
    +
    +
    +

    The format “yyyy-MM-dd HH:mm”.

    + +

    This format is lexically comparable with SQLite’s CURRENT_TIMESTAMP.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case YMD_HM = "yyyy-MM-dd HH:mm"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + YMD_HMS + +
    +
    +
    +
    +
    +
    +

    The format “yyyy-MM-dd HH:mm:ss”.

    + +

    This format is lexically comparable with SQLite’s CURRENT_TIMESTAMP.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case YMD_HMS = "yyyy-MM-dd HH:mm:ss"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + YMD_HMSS + +
    +
    +
    +
    +
    +
    +

    The format “yyyy-MM-dd HH:mm:ss.SSS”.

    + +

    This format is lexically comparable with SQLite’s CURRENT_TIMESTAMP.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case YMD_HMSS = "yyyy-MM-dd HH:mm:ss.SSS"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + HM + +
    +
    +
    +
    +
    +
    +

    The format “HH:mm”.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case HM = "HH:mm"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + HMS + +
    +
    +
    +
    +
    +
    +

    The format “HH:mm:ss”.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case HMS = "HH:mm:ss"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + HMSS + +
    +
    +
    +
    +
    +
    +

    The format “HH:mm:ss.SSS”.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case HMSS = "HH:mm:ss.SSS"
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabaseError.html b/docs/4.8/Structs/DatabaseError.html new file mode 100644 index 000000000..bd6e532ee --- /dev/null +++ b/docs/4.8/Structs/DatabaseError.html @@ -0,0 +1,1290 @@ + + + + DatabaseError Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseError

+
+
+
public struct DatabaseError : Error, CustomStringConvertible, CustomNSError
+ +
+
+

DatabaseError wraps an SQLite error.

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabaseEvent.html b/docs/4.8/Structs/DatabaseEvent.html new file mode 100644 index 000000000..af8d9316f --- /dev/null +++ b/docs/4.8/Structs/DatabaseEvent.html @@ -0,0 +1,1266 @@ + + + + DatabaseEvent Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseEvent

+
+
+
public struct DatabaseEvent
+ +
+
+

A database event, notified to TransactionObserver.

+ +
+
+
+
    +
  • +
    + + + + Kind + +
    +
    +
    +
    +
    +
    +

    An event kind

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Kind : Int32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    The event kind

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: Kind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseName + +
    +
    +
    +
    +
    +
    +

    The database name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseName: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + tableName + +
    +
    +
    +
    +
    +
    +

    The table name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var tableName: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rowID + +
    +
    +
    +
    +
    +
    +

    The rowID of the changed row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rowID: Int64
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + copy() + +
    +
    +
    +
    +
    +
    +

    Returns an event that can be stored:

    +
    class MyObserver: TransactionObserver {
    +    var events: [DatabaseEvent]
    +    func databaseDidChange(with event: DatabaseEvent) {
    +        events.append(event.copy())
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func copy() -> DatabaseEvent
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabaseEvent/Kind.html b/docs/4.8/Structs/DatabaseEvent/Kind.html new file mode 100644 index 000000000..b45e825ea --- /dev/null +++ b/docs/4.8/Structs/DatabaseEvent/Kind.html @@ -0,0 +1,1168 @@ + + + + Kind Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Kind

+
+
+
public enum Kind : Int32
+ +
+
+

An event kind

+ +
+
+
+
    +
  • +
    + + + + insert + +
    +
    +
    +
    +
    +
    +

    SQLITE_INSERT

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case insert = 18
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + delete + +
    +
    +
    +
    +
    +
    +

    SQLITE_DELETE

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case delete = 9
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + update + +
    +
    +
    +
    +
    +
    +

    SQLITE_UPDATE

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case update = 23
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabaseMigrator.html b/docs/4.8/Structs/DatabaseMigrator.html new file mode 100644 index 000000000..91fece8f3 --- /dev/null +++ b/docs/4.8/Structs/DatabaseMigrator.html @@ -0,0 +1,1457 @@ + + + + DatabaseMigrator Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseMigrator

+
+
+
public struct DatabaseMigrator
+ +
+
+

A DatabaseMigrator registers and applies database migrations.

+ +

Migrations are named blocks of SQL statements that are guaranteed to be +applied in order, once and only once.

+ +

When a user upgrades your application, only non-applied migration are run.

+ +

Usage:

+
var migrator = DatabaseMigrator()
+
+// 1st migration
+migrator.registerMigration("createLibrary") { db in
+    try db.create(table: "author") { t in
+        t.autoIncrementedPrimaryKey("id")
+        t.column("creationDate", .datetime)
+        t.column("name", .text).notNull()
+    }
+
+    try db.create(table: "book") { t in
+        t.autoIncrementedPrimaryKey("id")
+        t.column("authorId", .integer)
+            .notNull()
+            .references("author", onDelete: .cascade)
+        t.column("title", .text).notNull()
+    }
+}
+
+// 2nd migration
+migrator.registerMigration("AddBirthYearToAuthors") { db in
+    try db.alter(table: "author") { t
+        t.add(column: "birthYear", .integer)
+    }
+}
+
+// Migrations for future versions will be inserted here:
+//
+// // 3rd migration
+// migrator.registerMigration("...") { db in
+//     ...
+// }
+
+try migrator.migrate(dbQueue)
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    When the eraseDatabaseOnSchemaChange flag is true, the migrator will +automatically wipe out the full database content, and recreate the whole +database from scratch, if it detects that a migration has changed its +definition.

    + +

    This flag can destroy your precious users’ data!

    + +

    But it may be useful in two situations:

    + +
      +
    1. During application development, as you are still designing +migrations, and the schema changes often.

      + +

      In this case, it is recommended that you make sure this flag does +not ship in the distributed application, in order to avoid undesired +data loss:

      +
      var migrator = DatabaseMigrator()
      +#if DEBUG
      +// Speed up development by nuking the database when migrations change
      +migrator.eraseDatabaseOnSchemaChange = true
      +#endif
      +
    2. +
    3. When the database content can easily be recreated, such as a cache +for some downloaded data.

    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var eraseDatabaseOnSchemaChange: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    A new migrator.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers a migration.

    +
    migrator.registerMigration("createAuthors") { db in
    +    try db.create(table: "author") { t in
    +        t.autoIncrementedPrimaryKey("id")
    +        t.column("creationDate", .datetime)
    +        t.column("name", .text).notNull()
    +    }
    +}
    +
    +
    +

    Precondition

    + No migration with the same same as already been registered. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func registerMigration(_ identifier: String, migrate: @escaping (Database) throws -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + identifier + + +
    +

    The migration identifier.

    +
    +
    + + block + + +
    +

    The migration block that performs SQL statements.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func registerMigrationWithDeferredForeignKeyCheck(
    +    _ identifier: String,
    +    migrate: @escaping (Database) throws -> Void)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + migrate(_:) + +
    +
    +
    +
    +
    +
    +

    Iterate migrations in the same order as they were registered. If a +migration has not yet been applied, its block is executed in +a transaction.

    +
    +

    Throws

    + An eventual error thrown by the registered migration blocks. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func migrate(_ writer: DatabaseWriter) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A DatabaseWriter (DatabaseQueue or DatabasePool) where +migrations should apply.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + migrate(_:upTo:) + +
    +
    +
    +
    +
    +
    +

    Iterate migrations in the same order as they were registered, up to the +provided target. If a migration has not yet been applied, its block is +executed in a transaction.

    + +
      +
    • targetIdentifier: The identifier of a registered migration.
    • +
    +

    Throws

    + An eventual error thrown by the registered migration blocks. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func migrate(_ writer: DatabaseWriter, upTo targetIdentifier: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A DatabaseWriter (DatabaseQueue or DatabasePool) where +migrations should apply.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the set of applied migration identifiers.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appliedMigrations(in reader: DatabaseReader) throws -> Set<String>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabasePreUpdateEvent.html b/docs/4.8/Structs/DatabasePreUpdateEvent.html new file mode 100644 index 000000000..b1b0b3886 --- /dev/null +++ b/docs/4.8/Structs/DatabasePreUpdateEvent.html @@ -0,0 +1,1348 @@ + + + + DatabasePreUpdateEvent Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabasePreUpdateEvent

+ +
+
+
+
    +
  • +
    + + + + Kind + +
    +
    +
    +
    +
    +
    +

    An event kind

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    The event kind

    + +
    +
    +
    +
  • +
  • +
    + + + + databaseName + +
    +
    +
    +
    +
    +
    +

    The database name

    + +
    +
    +
    +
  • +
  • +
    + + + + tableName + +
    +
    +
    +
    +
    +
    +

    The table name

    + +
    +
    +
    +
  • +
  • +
    + + + + count + +
    +
    +
    +
    +
    +
    +

    The number of columns in the row that is being inserted, updated, or deleted.

    + +
    +
    +
    +
  • +
  • +
    + + + + depth + +
    +
    +
    +
    +
    +
    +

    1 for inserts, updates, or deletes invoked by top-level triggers; +2 for changes resulting from triggers called by top-level triggers; +… and so forth

    + +
    +
    +
    +
  • +
  • +
    + + + + initialRowID + +
    +
    +
    +
    +
    +
    +

    The initial rowID of the row being changed for .Update and .Delete changes, +and nil for .Insert changes.

    + +
    +
    +
    +
  • +
  • +
    + + + + finalRowID + +
    +
    +
    +
    +
    +
    +

    The final rowID of the row being changed for .Update and .Insert changes, +and nil for .Delete changes.

    + +
    +
    +
    +
  • +
  • +
    + + + + initialDatabaseValues + +
    +
    +
    +
    +
    +
    +

    The initial database values in the row.

    + +

    Values appear in the same order as the columns in the table.

    + +

    The result is nil if the event is an .Insert event.

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the initial DatabaseValue at given index.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    The result is nil if the event is an .Insert event.

    + +
    +
    +
    +
  • +
  • +
    + + + + finalDatabaseValues + +
    +
    +
    +
    +
    +
    +

    The final database values in the row.

    + +

    Values appear in the same order as the columns in the table.

    + +

    The result is nil if the event is a .Delete event.

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the final DatabaseValue at given index.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    The result is nil if the event is a .Delete event.

    + +
    +
    +
    +
  • +
  • +
    + + + + copy() + +
    +
    +
    +
    +
    +
    +

    Returns an event that can be stored:

    +
    class MyObserver: TransactionObserver {
    +    var events: [DatabasePreUpdateEvent]
    +    func databaseWillChange(with event: DatabasePreUpdateEvent) {
    +        events.append(event.copy())
    +    }
    +}
    +
    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabasePreUpdateEvent/Kind.html b/docs/4.8/Structs/DatabasePreUpdateEvent/Kind.html new file mode 100644 index 000000000..b1e62a104 --- /dev/null +++ b/docs/4.8/Structs/DatabasePreUpdateEvent/Kind.html @@ -0,0 +1,1129 @@ + + + + Kind Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Kind

+

An event kind

+ +
+
+
+
    +
  • +
    + + + + insert + +
    +
    +
    +
    +
    +
    +

    SQLITE_INSERT

    + +
    +
    +
    +
  • +
  • +
    + + + + delete + +
    +
    +
    +
    +
    +
    +

    SQLITE_DELETE

    + +
    +
    +
    +
  • +
  • +
    + + + + update + +
    +
    +
    +
    +
    +
    +

    SQLITE_UPDATE

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabaseRegion.html b/docs/4.8/Structs/DatabaseRegion.html new file mode 100644 index 000000000..4765b0b39 --- /dev/null +++ b/docs/4.8/Structs/DatabaseRegion.html @@ -0,0 +1,1388 @@ + + + + DatabaseRegion Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseRegion

+
+
+
public struct DatabaseRegion : CustomStringConvertible, Equatable
+
extension DatabaseRegion: DatabaseRegionConvertible
+ +
+
+

DatabaseRegion defines a region in the database. DatabaseRegion is dedicated +to help transaction observers recognize impactful database changes in their +observes(eventsOfKind:) and databaseDidChange(with:) methods.

+ +

A database region is the union of any number of “table regions”, which can +cover a full table, or the combination of columns and rows:

+
|Table1 |   |Table2 |   |Table3 |   |Table4 |   |Table5 |
+|-------|   |-------|   |-------|   |-------|   |-------|
+|x|x|x|x|   |x| | | |   |x|x|x|x|   |x|x| |x|   | | | | |
+|x|x|x|x|   |x| | | |   | | | | |   | | | | |   | |x| | |
+|x|x|x|x|   |x| | | |   | | | | |   |x|x| |x|   | | | | |
+|x|x|x|x|   |x| | | |   | | | | |   | | | | |   | | | | |
+
+ +

To create a database region, you use one of those methods:

+ +
    +
  • DatabaseRegion.fullDatabase: the region that covers all database tables.

  • +
  • DatabaseRegion(): the empty region.

  • +
  • DatabaseRegion(table:): the region that covers one database table.

  • +
  • SelectStatement.databaseRegion:

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name, score FROM player")
    +let region = statement.databaseRegion
    +
  • +
  • FetchRequest.databaseRegion(_:)

    +
    let request = Player.filter(key: 1)
    +let region = try request.databaseRegion(db)
    +
  • +
+ +
+
+
+
    +
  • +
    + + + + isEmpty + +
    +
    +
    +
    +
    +
    +

    Returns whether the region is empty.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isEmpty: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fullDatabase + +
    +
    +
    +
    +
    +
    +

    The region that covers the full database: all columns and all rows +from all tables.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let fullDatabase: DatabaseRegion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates an empty database region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(table:) + +
    +
    +
    +
    +
    +
    +

    Creates a region that spans all rows and columns of a database table.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(table: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + table + + +
    +

    A table name.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + union(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the union of this region and the given one.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func union(_ other: DatabaseRegion) -> DatabaseRegion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + formUnion(_:) + +
    +
    +
    +
    +
    +
    +

    Inserts the given region into this region

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func formUnion(_ other: DatabaseRegion)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Events

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns whether the content in the region would be impacted if the +database were modified by an event of this kind.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isModified(byEventsOfKind eventKind: DatabaseEventKind) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isModified(by:) + +
    +
    +
    +
    +
    +
    +

    Returns whether the content in the region is impacted by this event.

    +
    +

    Precondition

    + event has been filtered by the same region +in the TransactionObserver.observes(eventsOfKind:) method, by calling +region.isModified(byEventsOfKind:) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isModified(by event: DatabaseEvent) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabaseRegionObservation.html b/docs/4.8/Structs/DatabaseRegionObservation.html new file mode 100644 index 000000000..41185a7ba --- /dev/null +++ b/docs/4.8/Structs/DatabaseRegionObservation.html @@ -0,0 +1,1320 @@ + + + + DatabaseRegionObservation Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseRegionObservation

+
+
+
public struct DatabaseRegionObservation
+ +
+
+

DatabaseRegionObservation tracks changes in the results of database +requests, and notifies each database transaction whenever the +database changes.

+ +

For example:

+
let observation = DatabaseRegionObservation(tracking: Player.all)
+let observer = try observation.start(in: dbQueue) { db: Database in
+    print("Players have changed.")
+}
+
+ +
+
+
+
    +
  • +
    + + + + extent + +
    +
    +
    +
    +
    +
    +

    The extent of the database observation. The default is +.observerLifetime: the observation lasts until the +observer returned by the start(in:onChange:) method +is deallocated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var extent: Database.TransactionObservationExtent
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(tracking:) + +
    +
    +
    +
    +
    +
    +

    Creates a DatabaseRegionObservation which observes regions, and +notifies whenever one of the observed regions is modified by a +database transaction.

    + +

    For example, this sample code counts the number of a times the player +table is modified:

    +
    let observation = DatabaseRegionObservation(tracking: Player.all())
    +
    +var count = 0
    +let observer = observation.start(in: dbQueue) { _ in
    +    count += 1
    +    print("Players have been modified \(count) times.")
    +}
    +
    + +

    The observation lasts until the observer returned by start is +deallocated. See the extent property for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(tracking regions: DatabaseRegionConvertible...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(tracking:) + +
    +
    +
    +
    +
    +
    +

    Creates a DatabaseRegionObservation which observes regions, and +notifies whenever one of the observed regions is modified by a +database transaction.

    + +

    For example, this sample code counts the number of a times the player +table is modified:

    +
    let observation = DatabaseRegionObservation(tracking: [Player.all()])
    +
    +var count = 0
    +let observer = observation.start(in: dbQueue) { _ in
    +    count += 1
    +    print("Players have been modified \(count) times.")
    +}
    +
    + +

    The observation lasts until the observer returned by start is +deallocated. See the extent property for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(tracking regions: [DatabaseRegionConvertible])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + start(in:onChange:) + +
    +
    +
    +
    +
    +
    +

    Starts the observation in the provided database writer (such as +a database queue or database pool), and returns a transaction observer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func start(
    +    in dbWriter: DatabaseWriter,
    +    onChange: @escaping (Database) -> Void)
    +    throws -> TransactionObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + reader + + +
    +

    A DatabaseWriter.

    +
    +
    + + onChange + + +
    +

    A closure that is provided a database connection +with write access each time the observed region has been modified.

    +
    +
    +
    +
    +

    Return Value

    +

    a TransactionObserver

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabaseValue.html b/docs/4.8/Structs/DatabaseValue.html new file mode 100644 index 000000000..b4d08fc0a --- /dev/null +++ b/docs/4.8/Structs/DatabaseValue.html @@ -0,0 +1,1363 @@ + + + + DatabaseValue Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseValue

+
+
+
public struct DatabaseValue : Hashable, CustomStringConvertible, DatabaseValueConvertible, SQLExpression
+ +
+
+

DatabaseValue is the intermediate type between SQLite and your values.

+ +

See https://www.sqlite.org/datatype3.html

+ +
+
+
+
    +
  • +
    + + + + storage + +
    +
    +
    +
    +
    +
    +

    The SQLite storage

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let storage: Storage
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + null + +
    +
    +
    +
    +
    +
    +

    The NULL DatabaseValue.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let null: DatabaseValue
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Storage + +
    +
    +
    +
    +
    +
    +

    An SQLite storage (NULL, INTEGER, REAL, TEXT, BLOB).

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Storage : Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(value:) + +
    +
    +
    +
    +
    +
    +

    Creates a DatabaseValue from Any.

    + +

    The result is nil unless object adopts DatabaseValueConvertible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(value: Any)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Extracting Value

+

+
+
+
    +
  • +
    + + + + isNull + +
    +
    +
    +
    +
    +
    +

    Returns true if databaseValue is NULL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isNull: Bool { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Hashable & Equatable

+

+
+
+
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns whether two DatabaseValues are equal.

    +
    1.databaseValue == "foo".databaseValue // false
    +1.databaseValue == 1.databaseValue     // true
    +
    + +

    When comparing integers and doubles, the result is true if and only +values are equal, and if converting one type to the other does +not lose information:

    +
    1.databaseValue == 1.0.databaseValue   // true
    +
    + +

    For a comparison that distinguishes integer and doubles, compare +storages instead:

    +
    1.databaseValue.storage == 1.0.databaseValue.storage // false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: DatabaseValue, rhs: DatabaseValue) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns self

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the database value

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> DatabaseValue?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/DatabaseValue/Storage.html b/docs/4.8/Structs/DatabaseValue/Storage.html new file mode 100644 index 000000000..b71501a07 --- /dev/null +++ b/docs/4.8/Structs/DatabaseValue/Storage.html @@ -0,0 +1,1292 @@ + + + + Storage Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Storage

+
+
+
public enum Storage : Equatable
+ +
+
+

An SQLite storage (NULL, INTEGER, REAL, TEXT, BLOB).

+ +
+
+
+
    +
  • +
    + + + + null + +
    +
    +
    +
    +
    +
    +

    The NULL storage class.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case null
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + int64(_:) + +
    +
    +
    +
    +
    +
    +

    The INTEGER storage class, wrapping an Int64.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case int64(Int64)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + double(_:) + +
    +
    +
    +
    +
    +
    +

    The REAL storage class, wrapping a Double.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case double(Double)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + string(_:) + +
    +
    +
    +
    +
    +
    +

    The TEXT storage class, wrapping a String.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case string(String)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + blob(_:) + +
    +
    +
    +
    +
    +
    +

    The BLOB storage class, wrapping Data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case blob(Data)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    Returns Int64, Double, String, Data or nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: DatabaseValueConvertible? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Return true if the storages are identical.

    + +

    Unlike DatabaseValue equality that considers the integer 1 to be +equal to the 1.0 double (as SQLite does), int64 and double storages +are never equal.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: Storage, rhs: Storage) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/EmptyRowAdapter.html b/docs/4.8/Structs/EmptyRowAdapter.html new file mode 100644 index 000000000..56031e9ef --- /dev/null +++ b/docs/4.8/Structs/EmptyRowAdapter.html @@ -0,0 +1,1108 @@ + + + + EmptyRowAdapter Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

EmptyRowAdapter

+
+
+
public struct EmptyRowAdapter : RowAdapter
+ +
+
+

EmptyRowAdapter is a row adapter that hides all columns.

+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates an EmptyRowAdapter

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FTS3.html b/docs/4.8/Structs/FTS3.html new file mode 100644 index 000000000..c06f8d8c2 --- /dev/null +++ b/docs/4.8/Structs/FTS3.html @@ -0,0 +1,1292 @@ + + + + FTS3 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS3

+
+
+
public struct FTS3 : VirtualTableModule
+ +
+
+

FTS3 lets you define “fts3” virtual tables.

+
// CREATE VIRTUAL TABLE document USING fts3(content)
+try db.create(virtualTable: "document", using: FTS3()) { t in
+    t.column("content")
+}
+
+ +
+
+
+
    +
  • +
    + + + + Diacritics + +
    +
    +
    +
    +
    +
    +

    Options for Latin script characters. Matches the raw “remove_diacritics” +tokenizer argument.

    + +

    See https://www.sqlite.org/fts3.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Diacritics
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a FTS3 module suitable for the Database +create(virtualTable:using:) method.

    +
    // CREATE VIRTUAL TABLE document USING fts3(content)
    +try db.create(virtualTable: "document", using: FTS3()) { t in
    +    t.column("content")
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

VirtualTableModule Adoption

+

+
+
+
    +
  • +
    + + + + moduleName + +
    +
    +
    +
    +
    +
    +

    The virtual table module name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let moduleName: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + makeTableDefinition() + +
    +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeTableDefinition() -> FTS3TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func moduleArguments(for definition: FTS3TableDefinition, in db: Database) -> [String]
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func database(_ db: Database, didCreate tableName: String, using definition: FTS3TableDefinition)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FTS3/Diacritics.html b/docs/4.8/Structs/FTS3/Diacritics.html new file mode 100644 index 000000000..2a2da23c8 --- /dev/null +++ b/docs/4.8/Structs/FTS3/Diacritics.html @@ -0,0 +1,1164 @@ + + + + Diacritics Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Diacritics

+
+
+
public enum Diacritics
+ +
+
+

Options for Latin script characters. Matches the raw “remove_diacritics” +tokenizer argument.

+ +

See https://www.sqlite.org/fts3.html

+ +
+
+
+
    +
  • +
    + + + + keep + +
    +
    +
    +
    +
    +
    +

    Do not remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=0” tokenizer argument.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case keep
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + removeLegacy + +
    +
    +
    +
    +
    +
    +

    Remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=1” tokenizer argument.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case removeLegacy
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove + +
    +
    +
    +
    +
    +
    +

    Remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=2” tokenizer argument, +available from SQLite 3.27.0

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FTS3Pattern.html b/docs/4.8/Structs/FTS3Pattern.html new file mode 100644 index 000000000..51dc4f9ad --- /dev/null +++ b/docs/4.8/Structs/FTS3Pattern.html @@ -0,0 +1,1437 @@ + + + + FTS3Pattern Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS3Pattern

+
+
+
public struct FTS3Pattern
+
extension FTS3Pattern: DatabaseValueConvertible
+ +
+
+

A full text pattern that can query FTS3 and FTS4 virtual tables.

+ +
+
+
+
    +
  • +
    + + + + rawPattern + +
    +
    +
    +
    +
    +
    +

    The raw pattern string. Guaranteed to be a valid FTS3/4 pattern.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawPattern: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawPattern:) + +
    +
    +
    +
    +
    +
    +

    Creates a pattern from a raw pattern string; throws DatabaseError on +invalid syntax.

    + +

    The pattern syntax is documented at https://www.sqlite.org/fts3.html#full_text_index_queries

    +
    try FTS3Pattern(rawPattern: "and") // OK
    +try FTS3Pattern(rawPattern: "AND") // malformed MATCH expression: [AND]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawPattern: String) throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches any token found in the input string; +returns nil if no pattern could be built.

    +
    FTS3Pattern(matchingAnyTokenIn: "")        // nil
    +FTS3Pattern(matchingAnyTokenIn: "foo bar") // foo OR bar
    +
    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches all tokens found in the input string; +returns nil if no pattern could be built.

    +
    FTS3Pattern(matchingAllTokensIn: "")        // nil
    +FTS3Pattern(matchingAllTokensIn: "foo bar") // foo bar
    +
    + +
    +
    +
    +
  • +
  • +
    + + + + init(matchingPhrase:) + +
    +
    +
    +
    +
    +
    +

    Creates a pattern that matches a contiguous string; returns nil if no +pattern could be built.

    +
    FTS3Pattern(matchingPhrase: "")        // nil
    +FTS3Pattern(matchingPhrase: "foo bar") // "foo bar"
    +
    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches any token found in the input string; +returns nil if no pattern could be built.

    +
    FTS3Pattern(matchingAnyTokenIn: "")        // nil
    +FTS3Pattern(matchingAnyTokenIn: "foo bar") // foo OR bar
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public init?(matchingAnyTokenIn string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS3 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches all tokens found in the input string; +returns nil if no pattern could be built.

    +
    FTS3Pattern(matchingAllTokensIn: "")        // nil
    +FTS3Pattern(matchingAllTokensIn: "foo bar") // foo bar
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public init?(matchingAllTokensIn string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS3 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(matchingPhrase:) + +
    +
    +
    +
    +
    +
    +

    Creates a pattern that matches a contiguous string; returns nil if no +pattern could be built.

    +
    FTS3Pattern(matchingPhrase: "")        // nil
    +FTS3Pattern(matchingPhrase: "foo bar") // "foo bar"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public init?(matchingPhrase string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS3 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an FTS3Pattern initialized from dbValue, if it contains +a suitable value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> FTS3Pattern?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FTS3TokenizerDescriptor.html b/docs/4.8/Structs/FTS3TokenizerDescriptor.html new file mode 100644 index 000000000..6ccaea909 --- /dev/null +++ b/docs/4.8/Structs/FTS3TokenizerDescriptor.html @@ -0,0 +1,1268 @@ + + + + FTS3TokenizerDescriptor Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS3TokenizerDescriptor

+
+
+
public struct FTS3TokenizerDescriptor
+ +
+
+

An FTS3 tokenizer, suitable for FTS3 and FTS4 table definitions:

+
db.create(virtualTable: "book", using: FTS4()) { t in
+    t.tokenizer = .simple // FTS3TokenizerDescriptor
+}
+
+ +

See https://www.sqlite.org/fts3.html#tokenizer

+ +
+
+
+
    +
  • +
    + + + + simple + +
    +
    +
    +
    +
    +
    +

    The “simple” tokenizer.

    +
    db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.tokenizer = .simple
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let simple: FTS3TokenizerDescriptor
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + porter + +
    +
    +
    +
    +
    +
    +

    The “porter” tokenizer.

    +
    db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.tokenizer = .porter
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let porter: FTS3TokenizerDescriptor
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The “unicode61” tokenizer.

    +
    db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.tokenizer = .unicode61()
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#tokenizer

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The “unicode61” tokenizer.

    +
    db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.tokenizer = .unicode61()
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public static func unicode61(
    +    diacritics: FTS3.Diacritics = .removeLegacy,
    +    separators: Set<Character> = [],
    +    tokenCharacters: Set<Character> = [])
    +    -> FTS3TokenizerDescriptor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + diacritics + + +
    +

    By default SQLite will strip diacritics from +latin characters.

    +
    +
    + + separators + + +
    +

    Unless empty (the default), SQLite will consider these +characters as token separators.

    +
    +
    + + tokenCharacters + + +
    +

    Unless empty (the default), SQLite will consider +these characters as token characters.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FTS4.html b/docs/4.8/Structs/FTS4.html new file mode 100644 index 000000000..f35cffe42 --- /dev/null +++ b/docs/4.8/Structs/FTS4.html @@ -0,0 +1,1262 @@ + + + + FTS4 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS4

+
+
+
public struct FTS4 : VirtualTableModule
+ +
+
+

FTS4 lets you define “fts4” virtual tables.

+
// CREATE VIRTUAL TABLE document USING fts4(content)
+try db.create(virtualTable: "document", using: FTS4()) { t in
+    t.column("content")
+}
+
+ +

See https://www.sqlite.org/fts3.html

+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a FTS4 module suitable for the Database +create(virtualTable:using:) method.

    +
    // CREATE VIRTUAL TABLE document USING fts4(content)
    +try db.create(virtualTable: "document", using: FTS4()) { t in
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

VirtualTableModule Adoption

+

+
+
+
    +
  • +
    + + + + moduleName + +
    +
    +
    +
    +
    +
    +

    The virtual table module name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let moduleName: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + makeTableDefinition() + +
    +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeTableDefinition() -> FTS4TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func moduleArguments(for definition: FTS4TableDefinition, in db: Database) -> [String]
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func database(_ db: Database, didCreate tableName: String, using definition: FTS4TableDefinition) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FTS5.html b/docs/4.8/Structs/FTS5.html new file mode 100644 index 000000000..ba65f008a --- /dev/null +++ b/docs/4.8/Structs/FTS5.html @@ -0,0 +1,1292 @@ + + + + FTS5 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5

+
+
+
public struct FTS5 : VirtualTableModule
+ +
+
+

FTS5 lets you define “fts5” virtual tables.

+
// CREATE VIRTUAL TABLE document USING fts5(content)
+try db.create(virtualTable: "document", using: FTS5()) { t in
+    t.column("content")
+}
+
+ +

See https://www.sqlite.org/fts5.html

+ +
+
+
+
    +
  • +
    + + + + Diacritics + +
    +
    +
    +
    +
    +
    +

    Options for Latin script characters. Matches the raw “remove_diacritics” +tokenizer argument.

    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Diacritics
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a FTS5 module suitable for the Database +create(virtualTable:using:) method.

    +
    // CREATE VIRTUAL TABLE document USING fts5(content)
    +try db.create(virtualTable: "document", using: FTS5()) { t in
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

VirtualTableModule Adoption

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FTS5/Diacritics.html b/docs/4.8/Structs/FTS5/Diacritics.html new file mode 100644 index 000000000..8cf6c38e9 --- /dev/null +++ b/docs/4.8/Structs/FTS5/Diacritics.html @@ -0,0 +1,1164 @@ + + + + Diacritics Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Diacritics

+
+
+
public enum Diacritics
+ +
+
+

Options for Latin script characters. Matches the raw “remove_diacritics” +tokenizer argument.

+ +

See https://www.sqlite.org/fts5.html

+ +
+
+
+
    +
  • +
    + + + + keep + +
    +
    +
    +
    +
    +
    +

    Do not remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=0” tokenizer argument.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case keep
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + removeLegacy + +
    +
    +
    +
    +
    +
    +

    Remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=1” tokenizer argument.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case removeLegacy
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove + +
    +
    +
    +
    +
    +
    +

    Remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=2” tokenizer argument, +available from SQLite 3.27.0

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FTS5Pattern.html b/docs/4.8/Structs/FTS5Pattern.html new file mode 100644 index 000000000..b3293c6b6 --- /dev/null +++ b/docs/4.8/Structs/FTS5Pattern.html @@ -0,0 +1,1382 @@ + + + + FTS5Pattern Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5Pattern

+
+
+
public struct FTS5Pattern
+
extension FTS5Pattern: DatabaseValueConvertible
+ +
+
+

A full text pattern that can query FTS5 virtual tables.

+ +
+
+
+
    +
  • +
    + + + + rawPattern + +
    +
    +
    +
    +
    +
    +

    The raw pattern string. Guaranteed to be a valid FTS5 pattern.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawPattern: String
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches any token found in the input string; +returns nil if no pattern could be built.

    +
    FTS5Pattern(matchingAnyTokenIn: "")        // nil
    +FTS5Pattern(matchingAnyTokenIn: "foo bar") // foo OR bar
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(matchingAnyTokenIn string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS5 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches all tokens found in the input string; +returns nil if no pattern could be built.

    +
    FTS5Pattern(matchingAllTokensIn: "")        // nil
    +FTS5Pattern(matchingAllTokensIn: "foo bar") // foo bar
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(matchingAllTokensIn string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS5 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(matchingPhrase:) + +
    +
    +
    +
    +
    +
    +

    Creates a pattern that matches a contiguous string; returns nil if no +pattern could be built.

    +
    FTS5Pattern(matchingPhrase: "")        // nil
    +FTS5Pattern(matchingPhrase: "foo bar") // "foo bar"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(matchingPhrase string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS5 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches a contiguous string prefix; returns +nil if no pattern could be built.

    +
    FTS5Pattern(matchingPrefixPhrase: "")        // nil
    +FTS5Pattern(matchingPrefixPhrase: "foo bar") // ^"foo bar"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(matchingPrefixPhrase string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS5 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an FTS5Pattern initialized from dbValue, if it +contains a suitable value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> FTS5Pattern?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FTS5TokenFlags.html b/docs/4.8/Structs/FTS5TokenFlags.html new file mode 100644 index 000000000..95a551686 --- /dev/null +++ b/docs/4.8/Structs/FTS5TokenFlags.html @@ -0,0 +1,1168 @@ + + + + FTS5TokenFlags Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5TokenFlags

+
+
+
public struct FTS5TokenFlags : OptionSet
+ +
+
+

Flags that tell SQLite how to register a token.

+ +

See https://www.sqlite.org/fts5.html#custom_tokenizers

+ +
+
+
+
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: Int32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: Int32)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + colocated + +
    +
    +
    +
    +
    +
    +

    FTS5_TOKEN_COLOCATED

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let colocated: FTS5TokenFlags
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FTS5Tokenization.html b/docs/4.8/Structs/FTS5Tokenization.html new file mode 100644 index 000000000..636d38b19 --- /dev/null +++ b/docs/4.8/Structs/FTS5Tokenization.html @@ -0,0 +1,1258 @@ + + + + FTS5Tokenization Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5Tokenization

+
+
+
public struct FTS5Tokenization : OptionSet
+ +
+
+

The reason why FTS5 is requesting tokenization.

+ +

See https://www.sqlite.org/fts5.html#custom_tokenizers

+ +
+
+
+
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: Int32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: Int32)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + query + +
    +
    +
    +
    +
    +
    +

    FTS5_TOKENIZE_QUERY

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let query: FTS5Tokenization
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + prefix + +
    +
    +
    +
    +
    +
    +

    FTS5_TOKENIZE_PREFIX

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let prefix: FTS5Tokenization
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + document + +
    +
    +
    +
    +
    +
    +

    FTS5_TOKENIZE_DOCUMENT

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let document: FTS5Tokenization
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + aux + +
    +
    +
    +
    +
    +
    +

    FTS5_TOKENIZE_AUX

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let aux: FTS5Tokenization
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FTS5TokenizerDescriptor.html b/docs/4.8/Structs/FTS5TokenizerDescriptor.html new file mode 100644 index 000000000..3f4d03532 --- /dev/null +++ b/docs/4.8/Structs/FTS5TokenizerDescriptor.html @@ -0,0 +1,1332 @@ + + + + FTS5TokenizerDescriptor Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5TokenizerDescriptor

+
+
+
public struct FTS5TokenizerDescriptor
+ +
+
+

An FTS5 tokenizer, suitable for FTS5 table definitions:

+
db.create(virtualTable: "book", using: FTS5()) { t in
+    t.tokenizer = .unicode61() // FTS5TokenizerDescriptor
+}
+
+ +

See https://www.sqlite.org/fts5.html#tokenizers

+ +
+
+
+
    +
  • +
    + + + + components + +
    +
    +
    +
    +
    +
    +

    The tokenizer components

    +
    // ["unicode61"]
    +FTS5TokenizerDescriptor.unicode61().components
    +
    +// ["unicode61", "remove_diacritics", "0"]
    +FTS5TokenizerDescriptor.unicode61(removeDiacritics: false)).components
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let components: [String]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(components:) + +
    +
    +
    +
    +
    +
    +

    Creates an FTS5 tokenizer descriptor.

    +
    db.create(virtualTable: "book", using: FTS5()) { t in
    +    let tokenizer = FTS5TokenizerDescriptor(components: ["porter", "unicode61", "remove_diacritics", "0"])
    +    t.tokenizer = tokenizer
    +}
    +
    +
    +

    Precondition

    + Components is not empty + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(components: [String])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ascii(separators:) + +
    +
    +
    +
    +
    +
    +

    The “ascii” tokenizer

    +
    db.create(virtualTable: "book", using: FTS5()) { t in
    +    t.tokenizer = .ascii()
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html#ascii_tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascii(separators: Set<Character> = []) -> FTS5TokenizerDescriptor
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + separators + + +
    +

    Unless empty (the default), SQLite will consider +these characters as token separators.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + porter(wrapping:) + +
    +
    +
    +
    +
    + +
    +

    Declaration

    +
    +

    Swift

    +
    public static func porter(wrapping base: FTS5TokenizerDescriptor? = nil) -> FTS5TokenizerDescriptor
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An “unicode61” tokenizer

    +
    db.create(virtualTable: "book", using: FTS5()) { t in
    +    t.tokenizer = .unicode61()
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html#unicode61_tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func unicode61(
    +    diacritics: FTS5.Diacritics = .removeLegacy,
    +    separators: Set<Character> = [],
    +    tokenCharacters: Set<Character> = [])
    +    -> FTS5TokenizerDescriptor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + diacritics + + +
    +

    By default SQLite will strip diacritics from +latin characters.

    +
    +
    + + separators + + +
    +

    Unless empty (the default), SQLite will consider +these characters as token separators.

    +
    +
    + + tokenCharacters + + +
    +

    Unless empty (the default), SQLite will +consider these characters as token characters.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/FetchedRecordsSectionInfo.html b/docs/4.8/Structs/FetchedRecordsSectionInfo.html new file mode 100644 index 000000000..126d6ea76 --- /dev/null +++ b/docs/4.8/Structs/FetchedRecordsSectionInfo.html @@ -0,0 +1,1138 @@ + + + + FetchedRecordsSectionInfo Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FetchedRecordsSectionInfo

+
+
+
public struct FetchedRecordsSectionInfo<Record> where Record : FetchableRecord
+ +
+
+

A section given by a FetchedRecordsController.

+ +
+
+
+
    +
  • +
    + + + + numberOfRecords + +
    +
    +
    +
    +
    +
    +

    The number of records (rows) in the section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var numberOfRecords: Int { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + records + +
    +
    +
    +
    +
    +
    +

    The array of records in the section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var records: [Record] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/ForeignKey.html b/docs/4.8/Structs/ForeignKey.html new file mode 100644 index 000000000..740503964 --- /dev/null +++ b/docs/4.8/Structs/ForeignKey.html @@ -0,0 +1,1286 @@ + + + + ForeignKey Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ForeignKey

+
+
+
public struct ForeignKey
+ +
+
+

A ForeignKey helps building associations when GRDB can’t infer a foreign +key from the database schema.

+ +

Sometimes the database schema does not define any foreign key between two +tables. And sometimes, there are several foreign keys from a table +to another:

+
| Table book   |       | Table person |
+| ------------ |       | ------------ |
+| id           |   +-->• id           |
+| authorId     •---+   | name         |
+| translatorId •---+
+| title        |
+
+ +

When this happens, associations can’t be automatically inferred from the +database schema. GRDB will complain with a fatal error such as “Ambiguous +foreign key from book to person”, or “Could not infer foreign key from book +to person”.

+ +

Your help is needed. You have to instruct GRDB which foreign key to use:

+
struct Book: TableRecord {
+    // Define foreign keys
+    static let authorForeignKey = ForeignKey(["authorId"]))
+    static let translatorForeignKey = ForeignKey(["translatorId"]))
+
+    // Use foreign keys to define associations:
+    static let author = belongsTo(Person.self, using: authorForeignKey)
+    static let translator = belongsTo(Person.self, using: translatorForeignKey)
+}
+
+ +

Foreign keys are always defined from the table that contains the columns at +the origin of the foreign key. Person’s symmetric HasMany associations reuse +Book’s foreign keys:

+
struct Person: TableRecord {
+    static let writtenBooks = hasMany(Book.self, using: Book.authorForeignKey)
+    static let translatedBooks = hasMany(Book.self, using: Book.translatorForeignKey)
+}
+
+ +

Foreign keys can also be defined from query interface columns:

+
struct Book: TableRecord {
+    enum Columns: String, ColumnExpression {
+        case id, title, authorId, translatorId
+    }
+
+    static let authorForeignKey = ForeignKey([Columns.authorId]))
+    static let translatorForeignKey = ForeignKey([Columns.translatorId]))
+}
+
+ +

When the destination table of a foreign key does not define any primary key, +you need to provide the full definition of a foreign key:

+
struct Book: TableRecord {
+    static let authorForeignKey = ForeignKey(["authorId"], to: ["id"]))
+    static let author = belongsTo(Person.self, using: authorForeignKey)
+}
+
+ +
+
+
+
    +
  • +
    + + + + init(_:to:) + +
    +
    +
    +
    +
    +
    +

    Creates a ForeignKey intended to define a record association.

    +
    struct Book: TableRecord {
    +    // Define foreign keys
    +    static let authorForeignKey = ForeignKey(["authorId"]))
    +    static let translatorForeignKey = ForeignKey(["translatorId"]))
    +
    +    // Use foreign keys to define associations:
    +    static let author = belongsTo(Person.self, using: authorForeignKey)
    +    static let translator = belongsTo(Person.self, using: translatorForeignKey)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ originColumns: [String], to destinationColumns: [String]? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + originColumns + + +
    +

    The columns at the origin of the foreign key.

    +
    +
    + + destinationColumns + + +
    +

    The columns at the destination of the +foreign key. When nil (the default), GRDB automatically uses the +primary key.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:to:) + +
    +
    +
    +
    +
    +
    +

    Creates a ForeignKey intended to define a record association.

    +
    struct Book: TableRecord {
    +    // Define columns
    +    enum Columns: String, ColumnExpression {
    +        case id, title, authorId, translatorId
    +    }
    +
    +    // Define foreign keys
    +    static let authorForeignKey = ForeignKey([Columns.authorId]))
    +    static let translatorForeignKey = ForeignKey([Columns.translatorId]))
    +
    +    // Use foreign keys to define associations:
    +    static let author = belongsTo(Person.self, using: authorForeignKey)
    +    static let translator = belongsTo(Person.self, using: translatorForeignKey)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ originColumns: [ColumnExpression], to destinationColumns: [ColumnExpression]? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + originColumns + + +
    +

    The columns at the origin of the foreign key.

    +
    +
    + + destinationColumns + + +
    +

    The columns at the destination of the +foreign key. When nil (the default), GRDB automatically uses the +primary key.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/ForeignKeyInfo.html b/docs/4.8/Structs/ForeignKeyInfo.html new file mode 100644 index 000000000..da6493a0a --- /dev/null +++ b/docs/4.8/Structs/ForeignKeyInfo.html @@ -0,0 +1,1199 @@ + + + + ForeignKeyInfo Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ForeignKeyInfo

+
+
+
public struct ForeignKeyInfo
+ +
+
+

You get foreign keys from table names, with the +foreignKeys(on:) method.

+ +
+
+
+
    +
  • +
    + + + + destinationTable + +
    +
    +
    +
    +
    +
    +

    The name of the destination table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let destinationTable: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + mapping + +
    +
    +
    +
    +
    +
    +

    The column to column mapping

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let mapping: [(origin: String, destination: String)]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + originColumns + +
    +
    +
    +
    +
    +
    +

    The origin columns

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var originColumns: [String] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + destinationColumns + +
    +
    +
    +
    +
    +
    +

    The destination columns

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var destinationColumns: [String] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/IndexInfo.html b/docs/4.8/Structs/IndexInfo.html new file mode 100644 index 000000000..5574d6cb9 --- /dev/null +++ b/docs/4.8/Structs/IndexInfo.html @@ -0,0 +1,1170 @@ + + + + IndexInfo Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

IndexInfo

+
+
+
public struct IndexInfo
+ +
+
+

An index on a database table.

+ +

See Database.indexes(on:)

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The name of the index

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + columns + +
    +
    +
    +
    +
    +
    +

    The indexed columns

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let columns: [String]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isUnique + +
    +
    +
    +
    +
    +
    +

    True if the index is unique

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isUnique: Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/Inflections.html b/docs/4.8/Structs/Inflections.html new file mode 100644 index 000000000..15d450464 --- /dev/null +++ b/docs/4.8/Structs/Inflections.html @@ -0,0 +1,1502 @@ + + + + Inflections Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Inflections

+
+
+
public struct Inflections
+ +
+
+

Experimental

+ +

A type that controls GRDB string inflections.

+ +
+
+
+
+ + +
+ +

Initialization

+

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Configuration

+

+
+
+
    +
  • +
    + + + + plural(_:options:_:) + +
    +
    +
    +
    +
    +
    +

    Appends a pluralization rule.

    +
    var inflections = Inflections()
    +inflections.plural("$", "s")
    +inflections.pluralize("player") // "players"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func plural(
    +    _ pattern: String,
    +    options: NSRegularExpression.Options = [.caseInsensitive],
    +    _ template: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + pattern + + +
    +

    A regular expression pattern.

    +
    +
    + + options + + +
    +

    Regular expression options (defaults to +[.caseInsensitive]).

    +
    +
    + + template + + +
    +

    A replacement template string.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Appends a singularization rule.

    +
    var inflections = Inflections()
    +inflections.singular("s$", "")
    +inflections.singularize("players") // "player"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func singular(
    +    _ pattern: String,
    +    options: NSRegularExpression.Options = [.caseInsensitive],
    +    _ template: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + pattern + + +
    +

    A regular expression pattern.

    +
    +
    + + options + + +
    +

    Regular expression options (defaults to +[.caseInsensitive]).

    +
    +
    + + template + + +
    +

    A replacement template string.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + uncountableWords(_:) + +
    +
    +
    +
    +
    +
    +

    Appends uncountable words.

    +
    var inflections = Inflections()
    +inflections.plural("$", "s")
    +inflections.uncountableWords(["foo"])
    +inflections.pluralize("foo") // "foo"
    +inflections.pluralize("bar") // "bars"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func uncountableWords(_ words: [String])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + irregularSuffix(_:_:) + +
    +
    +
    +
    +
    +
    +

    Appends an irregular singular/plural pair.

    +
    var inflections = Inflections()
    +inflections.plural("$", "s")
    +inflections.irregularSuffix("man", "men")
    +inflections.pluralize("man")      // "men"
    +inflections.singularizes("women") // "woman"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func irregularSuffix(_ singular: String, _ plural: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + singular + + +
    +

    The singular form.

    +
    +
    + + plural + + +
    +

    The plural form.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Inflections

+

+
+
+
    +
  • +
    + + + + pluralize(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a pluralized string.

    +
    Inflections.default.pluralize("player") // "players"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func pluralize(_ string: String) -> String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + singularize(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a singularized string.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func singularize(_ string: String) -> String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + default + +
    +
    +
    +
    +
    +
    +

    The default inflections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var `default`: Inflections
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/PersistenceConflictPolicy.html b/docs/4.8/Structs/PersistenceConflictPolicy.html new file mode 100644 index 000000000..a63ecfa57 --- /dev/null +++ b/docs/4.8/Structs/PersistenceConflictPolicy.html @@ -0,0 +1,1173 @@ + + + + PersistenceConflictPolicy Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PersistenceConflictPolicy

+
+
+
public struct PersistenceConflictPolicy
+ +
+
+

The MutablePersistableRecord protocol uses this type in order to handle SQLite +conflicts when records are inserted or updated.

+ +

See MutablePersistableRecord.persistenceConflictPolicy.

+ +

See https://www.sqlite.org/lang_conflict.html

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/PersistenceContainer.html b/docs/4.8/Structs/PersistenceContainer.html new file mode 100644 index 000000000..0399ee7cd --- /dev/null +++ b/docs/4.8/Structs/PersistenceContainer.html @@ -0,0 +1,1159 @@ + + + + PersistenceContainer Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PersistenceContainer

+
+
+
public struct PersistenceContainer
+ +
+
+

Use persistence containers in the encode(to:) method of your +encodable records:

+
struct Player: EncodableRecord {
+    var id: Int64?
+    var name: String?
+
+    func encode(to container: inout PersistenceContainer) {
+        container["id"] = id
+        container["name"] = name
+    }
+}
+
+ +
+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses the value associated with the given column.

    + +

    It is undefined behavior to set different values for the same column. +Column names are case insensitive, so defining both “name” and “NAME” +is considered undefined behavior.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript(column: String) -> DatabaseValueConvertible? { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses the value associated with the given column.

    + +

    It is undefined behavior to set different values for the same column. +Column names are case insensitive, so defining both “name” and “NAME” +is considered undefined behavior.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Column>(column: Column) -> DatabaseValueConvertible? where Column : ColumnExpression { get set }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/PreparedRequest.html b/docs/4.8/Structs/PreparedRequest.html new file mode 100644 index 000000000..92215cdf3 --- /dev/null +++ b/docs/4.8/Structs/PreparedRequest.html @@ -0,0 +1,1203 @@ + + + + PreparedRequest Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PreparedRequest

+
+
+
public struct PreparedRequest
+ +
+
+

A PreparedRequest is a request that is ready to be executed.

+ +
+
+
+
    +
  • +
    + + + + statement + +
    +
    +
    +
    +
    +
    +

    A prepared statement

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var statement: SelectStatement
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + adapter + +
    +
    +
    +
    +
    +
    +

    An eventual adapter for rows fetched by the select statement

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var adapter: RowAdapter?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a PreparedRequest.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    statement: SelectStatement,
    +    adapter: RowAdapter? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + statement + + +
    +

    A prepared statement that is ready to +be executed.

    +
    +
    + + adapter + + +
    +

    An eventual adapter for rows fetched by the +select statement.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/PrimaryKeyInfo.html b/docs/4.8/Structs/PrimaryKeyInfo.html new file mode 100644 index 000000000..73be5fe87 --- /dev/null +++ b/docs/4.8/Structs/PrimaryKeyInfo.html @@ -0,0 +1,1206 @@ + + + + PrimaryKeyInfo Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PrimaryKeyInfo

+
+
+
public struct PrimaryKeyInfo
+ +
+
+

Primary keys are returned from the Database.primaryKey(_:) method.

+ +

When the table’s primary key is the rowid:

+
// CREATE TABLE item (name TEXT)
+let pk = try db.primaryKey("item")
+pk.columns     // ["rowid"]
+pk.rowIDColumn // nil
+pk.isRowID     // true
+
+// CREATE TABLE citizen (
+//   id INTEGER PRIMARY KEY,
+//   name TEXT
+// )
+let pk = try db.primaryKey("citizen")!
+pk.columns     // ["id"]
+pk.rowIDColumn // "id"
+pk.isRowID     // true
+
+ +

When the table’s primary key is not the rowid:

+
// CREATE TABLE country (
+//   isoCode TEXT NOT NULL PRIMARY KEY
+//   name TEXT
+// )
+let pk = db.primaryKey("country")!
+pk.columns     // ["isoCode"]
+pk.rowIDColumn // nil
+pk.isRowID     // false
+
+// CREATE TABLE citizenship (
+//   citizenID INTEGER NOT NULL REFERENCES citizen(id)
+//   countryIsoCode TEXT NOT NULL REFERENCES country(isoCode)
+//   PRIMARY KEY (citizenID, countryIsoCode)
+// )
+let pk = db.primaryKey("citizenship")!
+pk.columns     // ["citizenID", "countryIsoCode"]
+pk.rowIDColumn // nil
+pk.isRowID     // false
+
+ +
+
+
+
    +
  • +
    + + + + columns + +
    +
    +
    +
    +
    +
    +

    The columns in the primary key; this array is never empty.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var columns: [String] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rowIDColumn + +
    +
    +
    +
    +
    +
    +

    When not nil, the name of the column that contains the INTEGER PRIMARY KEY.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var rowIDColumn: String? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRowID + +
    +
    +
    +
    +
    +
    +

    When true, the primary key is the rowid:

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isRowID: Bool { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/QueryInterfaceRequest.html b/docs/4.8/Structs/QueryInterfaceRequest.html new file mode 100644 index 000000000..99bc1907b --- /dev/null +++ b/docs/4.8/Structs/QueryInterfaceRequest.html @@ -0,0 +1,2194 @@ + + + + QueryInterfaceRequest Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

QueryInterfaceRequest

+
+
+
public struct QueryInterfaceRequest<T>
+
extension QueryInterfaceRequest: FetchRequest
+
extension QueryInterfaceRequest: SelectionRequest
+
extension QueryInterfaceRequest: FilteredRequest
+
extension QueryInterfaceRequest: OrderedRequest
+
extension QueryInterfaceRequest: AggregatingRequest
+
extension QueryInterfaceRequest: _JoinableRequest
+
extension QueryInterfaceRequest: TableRequest
+
extension QueryInterfaceRequest: JoinableRequest where T: TableRecord
+
extension QueryInterfaceRequest: DerivableRequest where T: TableRecord
+ +
+
+

QueryInterfaceRequest is a request that generates SQL for you.

+ +

For example:

+
try dbQueue.read { db in
+    let request = Player
+        .filter(Column("score") > 1000)
+        .order(Column("name"))
+    let players = try request.fetchAll(db) // [Player]
+}
+
+ +

See https://github.com/groue/GRDB.swift#the-query-interface

+ +
+
+
+
    +
  • +
    + + + + RowDecoder + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias RowDecoder = T
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Request Derivation

+

+
+
+
    +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection.

    +
    // SELECT id, email FROM player
    +var request = Player.all()
    +request = request.select([Column("id"), Column("email")])
    +
    + +

    Any previous selection is replaced:

    +
    // SELECT email FROM player
    +request
    +    .select([Column("id")])
    +    .select([Column("email")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select(_ selection: [SQLSelectable]) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:as:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.all().select([max(Column("score"))], as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<RowDecoder>(_ selection: [SQLSelectable], as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:as:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.all().select(max(Column("score")), as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<RowDecoder>(_ selection: SQLSelectable..., as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a request which selects sql, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.all().select(sql: "max(score)", as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<RowDecoder>(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(literal:as:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects an SQL literal, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT IFNULL(name, 'Anonymous') FROM player WHERE id = 42
    +    let request = Player.
    +        .filter(primaryKey: 42)
    +        .select(
    +            SQLLiteral(
    +                sql: "IFNULL(name, ?)",
    +                arguments: ["Anonymous"]),
    +            as: String.self)
    +    let name: String? = try request.fetchOne(db)
    +}
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    try dbQueue.read { db in
    +    // SELECT IFNULL(name, 'Anonymous') FROM player WHERE id = 42
    +    let request = Player.
    +        .filter(primaryKey: 42)
    +        .select(
    +            literal: "IFNULL(name, \("Anonymous"))",
    +            as: String.self)
    +    let name: String? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<RowDecoder>(
    +    literal sqlLiteral: SQLLiteral,
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends selection.

    +
    // SELECT id, email, name FROM player
    +var request = Player.all()
    +request = request
    +    .select([Column("id"), Column("email")])
    +    .annotated(with: [Column("name")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func annotated(with selection: [SQLSelectable]) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided predicate promise added to the +eventual set of already applied predicates.

    +
    // SELECT * FROM player WHERE 1
    +var request = Player.all()
    +request = request.filter { db in true }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func filter(_ predicate: @escaping (Database) throws -> SQLExpressible) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided orderings promise.

    +
    // SELECT * FROM player ORDER BY name
    +var request = Player.all()
    +request = request.order { _ in [Column("name")] }
    +
    + +

    Any previous ordering is replaced:

    +
    // SELECT * FROM player ORDER BY name
    +request
    +    .order{ _ in [Column("email")] }
    +    .reversed()
    +    .order{ _ in [Column("name")] }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func order(_ orderings: @escaping (Database) throws -> [SQLOrderingTerm]) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reversed() + +
    +
    +
    +
    +
    +
    +

    Creates a request that reverses applied orderings.

    +
    // SELECT * FROM player ORDER BY name DESC
    +var request = Player.all().order(Column("name"))
    +request = request.reversed()
    +
    + +

    If no ordering was applied, the returned request is identical.

    +
    // SELECT * FROM player
    +var request = Player.all()
    +request = request.reversed()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reversed() -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unordered() + +
    +
    +
    +
    +
    +
    +

    Creates a request without any ordering.

    +
    // SELECT * FROM player
    +var request = Player.all().order(Column("name"))
    +request = request.unordered()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unordered() -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + group(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request grouped according to expressions promise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func group(_ expressions: @escaping (Database) throws -> [SQLExpressible]) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + having(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided predicate added to the +eventual set of already applied predicates.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func having(_ predicate: SQLExpressible) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + distinct() + +
    +
    +
    +
    +
    +
    +

    Creates a request which returns distinct rows.

    +
    // SELECT DISTINCT * FROM player
    +var request = Player.all()
    +request = request.distinct()
    +
    +// SELECT DISTINCT name FROM player
    +var request = Player.select(Column("name"))
    +request = request.distinct()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func distinct() -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + limit(_:offset:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which fetches limit rows, starting at offset.

    +
    // SELECT * FROM player LIMIT 1
    +var request = Player.all()
    +request = request.limit(1)
    +
    + +

    Any previous limit is replaced.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func limit(_ limit: Int, offset: Int? = nil) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + aliased(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request that allows you to define expressions that target +a specific database table.

    + +

    In the example below, the “team.avgScore < player.score” condition in +the ON clause could be not achieved without table aliases.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// JOIN team ON ... AND team.avgScore < player.score
    +let playerAlias = TableAlias()
    +let request = Player
    +    .all()
    +    .aliased(playerAlias)
    +    .including(required: Player.team.filter(Column("avgScore") < playerAlias[Column("score")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func aliased(_ alias: TableAlias) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + asRequest(of:) + +
    +
    +
    +
    +
    +
    +

    Creates a request bound to type Target.

    + +

    The returned request can fetch if the type Target is fetchable (Row, +value, record).

    +
    // Int?
    +let maxScore = try Player
    +    .select(max(scoreColumn))
    +    .asRequest(of: Int.self)    // <--
    +    .fetchOne(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asRequest<RowDecoder>(of type: RowDecoder.Type) -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + type + + +
    +

    The fetched type Target

    +
    +
    +
    +
    +

    Return Value

    +

    A typed request bound to type Target.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Association Aggregates

+

+
+
+
    +
  • +
    + + + + annotated(with:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends aggregates to the current selection.

    +
    // SELECT player.*, COUNT(DISTINCT book.rowid) AS bookCount
    +// FROM player LEFT JOIN book ...
    +var request = Player.all()
    +request = request.annotated(with: Player.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func annotated(with aggregates: AssociationAggregate<RowDecoder>...) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends aggregates to the current selection.

    +
    // SELECT player.*, COUNT(DISTINCT book.rowid) AS bookCount
    +// FROM player LEFT JOIN book ...
    +var request = Player.all()
    +request = request.annotated(with: [Player.books.count])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func annotated(with aggregates: [AssociationAggregate<RowDecoder>]) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + having(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends the provided aggregate predicate to +the eventual set of already applied predicates.

    +
    // SELECT player.*
    +// FROM player LEFT JOIN book ...
    +// HAVING COUNT(DISTINCT book.rowid) = 0
    +var request = Player.all()
    +request = request.having(Player.books.isEmpty)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func having(_ predicate: AssociationAggregate<RowDecoder>) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Batch Delete

+

+
+
+
    +
  • +
    + + + + deleteAll(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes matching rows; returns the number of deleted rows.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func deleteAll(_ db: Database) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of deleted rows

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Batch Update

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Updates matching rows; returns the number of updated rows.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    try Player.all().updateAll(db, [Column("score") <- 0])
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func updateAll(
    +    _ db: Database,
    +    onConflict conflictResolution: Database.ConflictResolution? = nil,
    +    _ assignments: [ColumnAssignment]) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + conflictResolution + + +
    +

    A policy for conflict resolution, +defaulting to the record’s persistenceConflictPolicy.

    +
    +
    + + assignments + + +
    +

    An array of column assignments.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of updated rows.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Updates matching rows; returns the number of updated rows.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    try Player.all().updateAll(db, Column("score") <- 0)
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func updateAll(
    +    _ db: Database,
    +    onConflict conflictResolution: Database.ConflictResolution? = nil,
    +    _ assignment: ColumnAssignment,
    +    _ otherAssignments: ColumnAssignment...)
    +    throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + conflictResolution + + +
    +

    A policy for conflict resolution, +defaulting to the record’s persistenceConflictPolicy.

    +
    +
    + + assignment + + +
    +

    A column assignment.

    +
    +
    + + otherAssignments + + +
    +

    Eventual other column assignments.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of updated rows.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/RangeRowAdapter.html b/docs/4.8/Structs/RangeRowAdapter.html new file mode 100644 index 000000000..066919481 --- /dev/null +++ b/docs/4.8/Structs/RangeRowAdapter.html @@ -0,0 +1,1144 @@ + + + + RangeRowAdapter Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

RangeRowAdapter

+
+
+
public struct RangeRowAdapter : RowAdapter
+ +
+
+

RangeRowAdapter is a row adapter that only exposes a range of columns.

+
let adapter = RangeRowAdapter(1..<3)
+let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz, 4 as qux"
+
+// [bar:2 baz:3]
+try Row.fetchOne(db, sql: sql, adapter: adapter)
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a RangeRowAdapter that only exposes a range of columns.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ range: CountableRange<Int>)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a RangeRowAdapter that only exposes a range of columns.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ range: CountableClosedRange<Int>)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/ResultCode.html b/docs/4.8/Structs/ResultCode.html new file mode 100644 index 000000000..01f41eeb7 --- /dev/null +++ b/docs/4.8/Structs/ResultCode.html @@ -0,0 +1,4149 @@ + + + + ResultCode Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ResultCode

+
+
+
public struct ResultCode : RawRepresentable, Equatable, CustomStringConvertible
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: Int32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: Int32)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + primaryResultCode + +
    +
    +
    +
    +
    +
    +

    A result code limited to the least significant 8 bits of the receiver. +See https://www.sqlite.org/rescode.html for more information.

    +
    let resultCode = .SQLITE_CONSTRAINT_FOREIGNKEY
    +resultCode.primaryResultCode == .SQLITE_CONSTRAINT // true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var primaryResultCode: ResultCode { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns true if the code on the left matches the code on the right.

    + +

    Primary result codes match themselves and their extended result codes, +while extended result codes match only themselves:

    +
    switch error.extendedResultCode {
    +case .SQLITE_CONSTRAINT_FOREIGNKEY: // foreign key constraint error
    +case .SQLITE_CONSTRAINT:            // any other constraint error
    +default:                            // any other database error
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ~= (pattern: ResultCode, code: ResultCode) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_OK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_OK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ERROR + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ERROR: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_INTERNAL + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_INTERNAL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_PERM + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_PERM: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ABORT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ABORT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_BUSY + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_BUSY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_LOCKED + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_LOCKED: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_NOMEM + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOMEM: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_READONLY + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_INTERRUPT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_INTERRUPT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_CORRUPT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CORRUPT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_NOTFOUND + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOTFOUND: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_FULL + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_FULL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_CANTOPEN + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_PROTOCOL + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_PROTOCOL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_EMPTY + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_EMPTY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_SCHEMA + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_SCHEMA: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_TOOBIG + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_TOOBIG: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_CONSTRAINT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_MISMATCH + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_MISMATCH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_MISUSE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_MISUSE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_NOLFS + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOLFS: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_AUTH + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_AUTH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_FORMAT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_FORMAT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_RANGE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_RANGE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_NOTADB + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOTADB: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_NOTICE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOTICE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_WARNING + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_WARNING: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ROW + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ROW: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_DONE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_DONE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ERROR_MISSING_COLLSEQ: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ERROR_RETRY + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ERROR_RETRY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ERROR_SNAPSHOT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ERROR_SNAPSHOT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_READ + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_READ: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SHORT_READ: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_WRITE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_WRITE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_FSYNC + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_FSYNC: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_DIR_FSYNC: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_TRUNCATE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_TRUNCATE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_FSTAT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_FSTAT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_UNLOCK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_UNLOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_RDLOCK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_RDLOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_DELETE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_DELETE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_BLOCKED + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_BLOCKED: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_NOMEM + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_NOMEM: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_ACCESS + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_ACCESS: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_CHECKRESERVEDLOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_LOCK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_LOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_CLOSE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_CLOSE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_DIR_CLOSE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_SHMOPEN + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SHMOPEN: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_SHMSIZE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SHMSIZE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_SHMLOCK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SHMLOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_SHMMAP + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SHMMAP: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_SEEK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SEEK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_DELETE_NOENT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_MMAP + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_MMAP: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_GETTEMPPATH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_CONVPATH + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_CONVPATH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_VNODE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_VNODE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_AUTH + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_AUTH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_BEGIN_ATOMIC: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_COMMIT_ATOMIC: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_ROLLBACK_ATOMIC: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_LOCKED_SHAREDCACHE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_LOCKED_VTAB + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_LOCKED_VTAB: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_BUSY_RECOVERY + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_BUSY_RECOVERY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_BUSY_SNAPSHOT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_BUSY_SNAPSHOT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN_NOTEMPDIR: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_CANTOPEN_ISDIR + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN_ISDIR: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN_FULLPATH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN_CONVPATH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN_DIRTYWAL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_CORRUPT_VTAB + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CORRUPT_VTAB: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CORRUPT_SEQUENCE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_RECOVERY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_CANTLOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_ROLLBACK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_DBMOVED: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_CANTINIT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_DIRECTORY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ABORT_ROLLBACK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ABORT_ROLLBACK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_CHECK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_COMMITHOOK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_FOREIGNKEY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_FUNCTION: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_NOTNULL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_PRIMARYKEY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_TRIGGER: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_UNIQUE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_VTAB: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_ROWID: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOTICE_RECOVER_WAL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOTICE_RECOVER_ROLLBACK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_WARNING_AUTOINDEX: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_AUTH_USER + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_AUTH_USER: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_OK_LOAD_PERMANENTLY: ResultCode
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/SQLExpressionLiteral.html b/docs/4.8/Structs/SQLExpressionLiteral.html new file mode 100644 index 000000000..c7a1b8fd1 --- /dev/null +++ b/docs/4.8/Structs/SQLExpressionLiteral.html @@ -0,0 +1,1224 @@ + + + + SQLExpressionLiteral Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SQLExpressionLiteral

+
+
+
public struct SQLExpressionLiteral : SQLExpression
+ +
+
+

Experimental

+ +

SQLExpressionLiteral is an expression built from a raw SQL snippet.

+
SQLExpressionLiteral(sql: "1 + 2")
+
+ +

The SQL literal may contain ? and colon-prefixed arguments:

+
SQLExpressionLiteral(sql: "? + ?", arguments: [1, 2])
+SQLExpressionLiteral(sql: ":one + :two", arguments: ["one": 1, "two": 2])
+
+ +
+
+
+
    +
  • +
    + + + + sql + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sql: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + arguments + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var arguments: StatementArguments { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(sql:arguments:) + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Creates an SQL literal expression.

    +
    SQLExpressionLiteral(sql: "1 + 2")
    +SQLExpressionLiteral(sql: "? + ?", arguments: [1, 2])
    +SQLExpressionLiteral(sql: ":one + :two", arguments: ["one": 1, "two": 2])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(sql: String, arguments: StatementArguments = StatementArguments())
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(literal:) + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Creates an SQL literal expression.

    +
    SQLExpressionLiteral(literal: SQLLiteral(sql: "1 + 2")
    +SQLExpressionLiteral(literal: SQLLiteral(sql: "? + ?", arguments: [1, 2]))
    +SQLExpressionLiteral(literal: SQLLiteral(sql: ":one + :two", arguments: ["one": 1, "two": 2]))
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    SQLExpressionLiteral(literal: "\(1) + \(2)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(literal sqlLiteral: SQLLiteral)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/SQLFunctionName.html b/docs/4.8/Structs/SQLFunctionName.html new file mode 100644 index 000000000..853ce1eb6 --- /dev/null +++ b/docs/4.8/Structs/SQLFunctionName.html @@ -0,0 +1,1377 @@ + + + + SQLFunctionName Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SQLFunctionName

+
+
+
public struct SQLFunctionName : Hashable
+ +
+
+

Experimental

+ +

SQLFunctionName is an SQL function name.

+ +
+
+
+
+ + +
+ +

ABS(…)

+

+
+
+
    +
  • +
    + + + + abs + +
    +
    +
    +
    +
    +
    +

    The ABS function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let abs: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

AVG(…)

+

+
+
+
    +
  • +
    + + + + avg + +
    +
    +
    +
    +
    +
    +

    The AVG function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let avg: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

IFNULL(…)

+

+
+
+
    +
  • +
    + + + + ifNull + +
    +
    +
    +
    +
    +
    +

    The IFNULL function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let ifNull: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

LENGTH(…)

+

+
+
+
    +
  • +
    + + + + length + +
    +
    +
    +
    +
    +
    +

    The LENGTH function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let length: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

MAX(…)

+

+
+
+
    +
  • +
    + + + + max + +
    +
    +
    +
    +
    +
    +

    The MAX function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let max: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

MIN(…)

+

+
+
+
    +
  • +
    + + + + min + +
    +
    +
    +
    +
    +
    +

    The MIN function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let min: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SUM(…)

+

+
+
+
    +
  • +
    + + + + sum + +
    +
    +
    +
    +
    +
    +

    The SUM function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let sum: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/SQLLiteral.html b/docs/4.8/Structs/SQLLiteral.html new file mode 100644 index 000000000..10efb77fe --- /dev/null +++ b/docs/4.8/Structs/SQLLiteral.html @@ -0,0 +1,1395 @@ + + + + SQLLiteral Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SQLLiteral

+
+
+
public struct SQLLiteral
+
extension SQLLiteral: ExpressibleByStringInterpolation
+ +
+
+

SQLLiteral is a type which support SQL +Interpolation.

+ +

For example:

+
try dbQueue.write { db in
+    let name: String = ...
+    let id: Int64 = ...
+    let query: SQLLiteral = "UPDATE player SET name = \(name) WHERE id = \(id)"
+    try db.execute(literal: query)
+}
+
+ +
+
+
+
    +
  • +
    + + + + sql + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var sql: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + arguments + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var arguments: StatementArguments
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(sql:arguments:) + +
    +
    +
    +
    +
    +
    +

    Creates an SQLLiteral from a plain SQL string, and eventual arguments.

    + +

    For example:

    +
    let query = SQLLiteral(
    +    sql: "UPDATE player SET name = ? WHERE id = ?",
    +    arguments: [name, id])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(sql: String, arguments: StatementArguments = StatementArguments())
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + mapSQL(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a literal whose SQL is transformed by the given closure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func mapSQL(_ transform: (String) throws -> String) rethrows -> SQLLiteral
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns the SQLLiteral produced by the concatenation of two literals.

    +
    let name = "O'Brien"
    +let selection: SQLLiteral = "SELECT * FROM player "
    +let condition: SQLLiteral = "WHERE name = \(name)"
    +let query = selection + condition
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func + (lhs: SQLLiteral, rhs: SQLLiteral) -> SQLLiteral
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Appends an SQLLiteral to the receiver.

    +
    let name = "O'Brien"
    +var query: SQLLiteral = "SELECT * FROM player "
    +query += "WHERE name = \(name)"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func += (lhs: inout SQLLiteral, rhs: SQLLiteral)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + append(literal:) + +
    +
    +
    +
    +
    +
    +

    Appends an SQLLiteral to the receiver.

    +
    let name = "O'Brien"
    +var query: SQLLiteral = "SELECT * FROM player "
    +query.append(literal: "WHERE name = \(name)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func append(literal sqlLiteral: SQLLiteral)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Appends a plain SQL string to the receiver, and eventual arguments.

    +
    let name = "O'Brien"
    +var query: SQLLiteral = "SELECT * FROM player "
    +query.append(sql: "WHERE name = ?", arguments: [name])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func append(sql: String, arguments: StatementArguments = StatementArguments())
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ExpressibleByStringInterpolation

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/SQLRequest.html b/docs/4.8/Structs/SQLRequest.html new file mode 100644 index 000000000..d99df0d43 --- /dev/null +++ b/docs/4.8/Structs/SQLRequest.html @@ -0,0 +1,1513 @@ + + + + SQLRequest Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SQLRequest

+
+
+
public struct SQLRequest<T> : FetchRequest
+
extension SQLRequest: ExpressibleByStringInterpolation
+ +
+
+

A FetchRequest built from raw SQL.

+ +
+
+
+
    +
  • +
    + + + + RowDecoder + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias RowDecoder = T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + sql + +
    +
    +
    +
    +
    +
    +

    The raw SQL query

    +
    let id = 42
    +let request: SQLRequest<Player> = "SELECT * FROM player WHERE id = \(id)"
    +request.sql // "SELECT * FROM player WHERE id = ?"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sql: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + arguments + +
    +
    +
    +
    +
    +
    +

    The request argument

    +
    let id = 42
    +let request: SQLRequest<Player> = "SELECT * FROM player WHERE id = \(id)"
    +request.arguments // [42]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var arguments: StatementArguments { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + adapter + +
    +
    +
    +
    +
    +
    +

    The request adapter

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var adapter: RowAdapter?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a request from an SQL string, optional arguments, and +optional row adapter.

    +
    let request = SQLRequest<String>(sql: """
    +    SELECT name FROM player
    +    """)
    +let request = SQLRequest<Player>(sql: """
    +    SELECT * FROM player WHERE id = ?
    +    """, arguments: [1])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil,
    +    cached: Bool = false)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter.

    +
    +
    + + cached + + +
    +

    Defaults to false. If true, the request reuses a cached +prepared statement.

    +
    +
    +
    +
    +

    Return Value

    +

    A SQLRequest

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a request from an SQLLiteral, and optional row adapter.

    +
    let request = SQLRequest<String>(literal: SQLLiteral(sql: """
    +    SELECT name FROM player
    +    """))
    +let request = SQLRequest<Player>(literal: SQLLiteral(sql: """
    +    SELECT * FROM player WHERE name = ?
    +    """, arguments: ["O'Brien"]))
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    let request = SQLRequest<Player>(literal: """
    +    SELECT * FROM player WHERE name = \("O'brien")
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(literal sqlLiteral: SQLLiteral, adapter: RowAdapter? = nil, cached: Bool = false)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + sqlLiteral + + +
    +

    An SQLLiteral.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter.

    +
    +
    + + cached + + +
    +

    Defaults to false. If true, the request reuses a cached +prepared statement.

    +
    +
    +
    +
    +

    Return Value

    +

    A SQLRequest

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an SQL request from any other fetch request.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Request>(
    +    _ db: Database,
    +    request: Request,
    +    cached: Bool = false)
    +    throws
    +    where Request: FetchRequest, Request.RowDecoder == RowDecoder
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A request.

    +
    +
    + + cached + + +
    +

    Defaults to false. If true, the request reuses a cached +prepared statement.

    +
    +
    +
    +
    +

    Return Value

    +

    An SQLRequest

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    :nodoc

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(unicodeScalarLiteral: String)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/ScopeAdapter.html b/docs/4.8/Structs/ScopeAdapter.html new file mode 100644 index 000000000..badf3d93e --- /dev/null +++ b/docs/4.8/Structs/ScopeAdapter.html @@ -0,0 +1,1232 @@ + + + + ScopeAdapter Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ScopeAdapter

+
+
+
public struct ScopeAdapter : RowAdapter
+ +
+
+

ScopeAdapter is a row adapter that lets you define scopes on rows.

+
// Two adapters
+let fooAdapter = ColumnMapping(["value": "foo"])
+let barAdapter = ColumnMapping(["value": "bar"])
+
+// Define scopes
+let adapter = ScopeAdapter([
+    "foo": fooAdapter,
+    "bar": barAdapter])
+
+// Fetch
+let sql = "SELECT 'foo' AS foo, 'bar' AS bar"
+let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
+
+// Scoped rows:
+if let fooRow = row.scopes["foo"] {
+    fooRow["value"]    // "foo"
+}
+if let barRow = row.scopes["bar"] {
+    barRow["value"]    // "bar"
+}
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates an adapter that preserves row contents and add scoped rows.

    + +

    For example:

    +
    let adapter = ScopeAdapter(["suffix": SuffixRowAdapter(fromIndex: 1)])
    +let row = try Row.fetchOne(db, sql: "SELECT 1, 2, 3", adapter: adapter)!
    +row                  // [1, 2, 3]
    +row.scopes["suffix"] // [2, 3]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ scopes: [String : RowAdapter])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + scopes + + +
    +

    A dictionary that maps scope names to +row adapters.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(base:scopes:) + +
    +
    +
    +
    +
    +
    +

    Creates an adapter based on the base adapter, and add scoped rows.

    + +

    For example:

    +
    let baseAdapter = RangeRowAdapter(0..<1)
    +let adapter = ScopeAdapter(base: baseAdapter, scopes: ["suffix": SuffixRowAdapter(fromIndex: 1)])
    +let row = try Row.fetchOne(db, sql: "SELECT 1, 2, 3", adapter: adapter)!
    +row                   // [1]
    +row.scopes["initial"] // [2, 3]
    +
    + +

    If the base adapter already defines scopes, the given scopes replace +eventual existing scopes with the same name.

    + +

    This initializer is equivalent to baseAdapter.addingScopes(scopes).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(base: RowAdapter, scopes: [String : RowAdapter])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + base + + +
    +

    A dictionary that maps scope names to +row adapters.

    +
    +
    + + scopes + + +
    +

    A dictionary that maps scope names to +row adapters.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/StatementArguments.html b/docs/4.8/Structs/StatementArguments.html new file mode 100644 index 000000000..9a10e42eb --- /dev/null +++ b/docs/4.8/Structs/StatementArguments.html @@ -0,0 +1,1925 @@ + + + + StatementArguments Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

StatementArguments

+
+
+
public struct StatementArguments: CustomStringConvertible, Equatable,
+    ExpressibleByArrayLiteral, ExpressibleByDictionaryLiteral
+ +
+
+

StatementArguments provide values to argument placeholders in raw +SQL queries.

+ +

Placeholders can take several forms (see https://www.sqlite.org/lang_expr.html#varparam +for more information):

+ +
    +
  • ?NNN (e.g. ?2): the NNN-th argument (starts at 1)
  • +
  • ?: the N-th argument, where N is one greater than the largest argument +number already assigned
  • +
  • :AAAA (e.g. :name): named argument

  • +
  • $AAAA (e.g. $name): named argument

  • +
+

Positional Arguments

+ +

To fill question marks placeholders, feed StatementArguments with an array:

+
db.execute(
+    sql: "INSERT ... (?, ?)",
+    arguments: StatementArguments(["Arthur", 41]))
+
+// Array literals are automatically converted:
+db.execute(
+    sql: "INSERT ... (?, ?)",
+    arguments: ["Arthur", 41])
+
+

Named Arguments

+ +

To fill named arguments, feed StatementArguments with a dictionary:

+
db.execute(
+    sql: "INSERT ... (:name, :score)",
+    arguments: StatementArguments(["name": "Arthur", "score": 41]))
+
+// Dictionary literals are automatically converted:
+db.execute(
+    sql: "INSERT ... (:name, :score)",
+    arguments: ["name": "Arthur", "score": 41])
+
+

Concatenating Arguments

+ +

Several arguments can be concatenated and mixed with the +append(contentsOf:) method and the +, &+, += operators:

+
var arguments: StatementArguments = ["Arthur"]
+arguments += [41]
+db.execute(sql: "INSERT ... (?, ?)", arguments: arguments)
+
+ +

+ and += operators consider that overriding named arguments is a +programmer error:

+
var arguments: StatementArguments = ["name": "Arthur"]
+arguments += ["name": "Barbara"]
+// fatal error: already defined statement argument: name
+
+ +

&+ and append(contentsOf:) allow overriding named arguments:

+
var arguments: StatementArguments = ["name": "Arthur"]
+arguments = arguments &+ ["name": "Barbara"]
+print(arguments)
+// Prints ["name": "Barbara"]
+
+

Mixed Arguments

+ +

It is possible to mix named and positional arguments. Yet this is usually +confusing, and it is best to avoid this practice:

+
let sql = "SELECT ?2 AS two, :foo AS foo, ?1 AS one, :foo AS foo2, :bar AS bar"
+var arguments: StatementArguments = [1, 2, "bar"] + ["foo": "foo"]
+let row = try Row.fetchOne(db, sql: sql, arguments: arguments)!
+print(row)
+// Prints [two:2 foo:"foo" one:1 foo2:"foo" bar:"bar"]
+
+ +

Mixed arguments exist as a support for requests like the following:

+
let players = try Player
+    .filter(sql: "team = :team", arguments: ["team": "Blue"])
+    .filter(sql: "score > ?", arguments: [1000])
+    .fetchAll(db)
+
+ +
+
+
+
    +
  • +
    + + + + isEmpty + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isEmpty: Bool { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Empty Arguments

+

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates empty StatementArguments.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Positional Arguments

+

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from a sequence of optional values.

    +
    let values: [DatabaseValueConvertible?] = ["foo", 1, nil]
    +db.execute(sql: "INSERT ... (?,?,?)", arguments: StatementArguments(values))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Sequence>(_ sequence: Sequence) where Sequence : Sequence, Sequence.Element == DatabaseValueConvertible?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sequence + + +
    +

    A sequence of DatabaseValueConvertible values.

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from a sequence of optional values.

    +
    let values: [String] = ["foo", "bar"]
    +db.execute(sql: "INSERT ... (?,?)", arguments: StatementArguments(values))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Sequence>(_ sequence: Sequence) where Sequence : Sequence, Sequence.Element : DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sequence + + +
    +

    A sequence of DatabaseValueConvertible values.

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from any array. The result is nil unless all +array elements adopt DatabaseValueConvertible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(_ array: [Any])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + array + + +
    +

    An array

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Named Arguments

+

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from a sequence of (key, value) dictionary, +such as a dictionary.

    +
    let values: [String: DatabaseValueConvertible?] = ["firstName": nil, "lastName": "Miller"]
    +db.execute(sql: "INSERT ... (:firstName, :lastName)", arguments: StatementArguments(values))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ dictionary: [String : DatabaseValueConvertible?])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sequence + + +
    +

    A sequence of (key, value) pairs

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from a sequence of (key, value) pairs, such +as a dictionary.

    +
    let values: [String: DatabaseValueConvertible?] = ["firstName": nil, "lastName": "Miller"]
    +db.execute(sql: "INSERT ... (:firstName, :lastName)", arguments: StatementArguments(values))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Sequence>(_ sequence: Sequence)
    +    where Sequence: Swift.Sequence, Sequence.Element == (String, DatabaseValueConvertible?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sequence + + +
    +

    A sequence of (key, value) pairs

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from [AnyHashable: Any].

    + +

    The result is nil unless all dictionary keys are strings, and values +adopt DatabaseValueConvertible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(_ dictionary: [AnyHashable : Any])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + dictionary + + +
    +

    A dictionary.

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Adding arguments

+

+
+
+
    +
  • +
    + + + + append(contentsOf:) + +
    +
    +
    +
    +
    +
    +

    Extends statement arguments with other arguments.

    + +

    Positional arguments (provided as arrays) are concatenated:

    +
    var arguments: StatementArguments = [1]
    +arguments.append(contentsOf: [2, 3])
    +print(arguments)
    +// Prints [1, 2, 3]
    +
    + +

    Named arguments (provided as dictionaries) are updated:

    +
    var arguments: StatementArguments = ["foo": 1]
    +arguments.append(contentsOf: ["bar": 2])
    +print(arguments)
    +// Prints ["foo": 1, "bar": 2]
    +
    + +

    Arguments that were replaced, if any, are returned:

    +
    var arguments: StatementArguments = ["foo": 1, "bar": 2]
    +let replacedValues = arguments.append(contentsOf: ["foo": 3])
    +print(arguments)
    +// Prints ["foo": 3, "bar": 2]
    +print(replacedValues)
    +// Prints ["foo": 1]
    +
    + +

    You can mix named and positional arguments (see documentation of +the StatementArguments type for more information about mixed arguments):

    +
    var arguments: StatementArguments = ["foo": 1]
    +arguments.append(contentsOf: [2, 3])
    +print(arguments)
    +// Prints ["foo": 1, 2, 3]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func append(contentsOf arguments: StatementArguments) -> [String : DatabaseValue]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new StatementArguments by extending the left-hand size +arguments with the right-hand side arguments.

    + +

    Positional arguments (provided as arrays) are concatenated:

    +
    let arguments: StatementArguments = [1] + [2, 3]
    +print(arguments)
    +// Prints [1, 2, 3]
    +
    + +

    Named arguments (provided as dictionaries) are updated:

    +
    let arguments: StatementArguments = ["foo": 1] + ["bar": 2]
    +print(arguments)
    +// Prints ["foo": 1, "bar": 2]
    +
    + +

    You can mix named and positional arguments (see documentation of +the StatementArguments type for more information about mixed arguments):

    +
    let arguments: StatementArguments = ["foo": 1] + [2, 3]
    +print(arguments)
    +// Prints ["foo": 1, 2, 3]
    +
    + +

    If the arguments on the right-hand side has named parameters that are +already defined on the left, a fatal error is raised:

    +
    let arguments: StatementArguments = ["foo": 1] + ["foo": 2]
    +// fatal error: already defined statement argument: foo
    +
    + +

    This fatal error can be avoided with the &+ operator, or the +append(contentsOf:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func + (lhs: StatementArguments, rhs: StatementArguments) -> StatementArguments
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + &+(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new StatementArguments by extending the left-hand size +arguments with the right-hand side arguments.

    + +

    Positional arguments (provided as arrays) are concatenated:

    +
    let arguments: StatementArguments = [1] &+ [2, 3]
    +print(arguments)
    +// Prints [1, 2, 3]
    +
    + +

    Named arguments (provided as dictionaries) are updated:

    +
    let arguments: StatementArguments = ["foo": 1] &+ ["bar": 2]
    +print(arguments)
    +// Prints ["foo": 1, "bar": 2]
    +
    + +

    You can mix named and positional arguments (see documentation of +the StatementArguments type for more information about mixed arguments):

    +
    let arguments: StatementArguments = ["foo": 1] &+ [2, 3]
    +print(arguments)
    +// Prints ["foo": 1, 2, 3]
    +
    + +

    If a named arguments is defined in both arguments, the right-hand +side wins:

    +
    let arguments: StatementArguments = ["foo": 1] &+ ["foo": 2]
    +print(arguments)
    +// Prints ["foo": 2]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func &+ (lhs: StatementArguments, rhs: StatementArguments) -> StatementArguments
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Extends the left-hand size arguments with the right-hand side arguments.

    + +

    Positional arguments (provided as arrays) are concatenated:

    +
    var arguments: StatementArguments = [1]
    +arguments += [2, 3]
    +print(arguments)
    +// Prints [1, 2, 3]
    +
    + +

    Named arguments (provided as dictionaries) are updated:

    +
    var arguments: StatementArguments = ["foo": 1]
    +arguments += ["bar": 2]
    +print(arguments)
    +// Prints ["foo": 1, "bar": 2]
    +
    + +

    You can mix named and positional arguments (see documentation of +the StatementArguments type for more information about mixed arguments):

    +
    var arguments: StatementArguments = ["foo": 1]
    +arguments.append(contentsOf: [2, 3])
    +print(arguments)
    +// Prints ["foo": 1, 2, 3]
    +
    + +

    If the arguments on the right-hand side has named parameters that are +already defined on the left, a fatal error is raised:

    +
    var arguments: StatementArguments = ["foo": 1]
    +arguments += ["foo": 2]
    +// fatal error: already defined statement argument: foo
    +
    + +

    This fatal error can be avoided with the &+ operator, or the +append(contentsOf:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func += (lhs: inout StatementArguments, rhs: StatementArguments)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

StatementArguments

+

+
+
+
    +
  • +
    + + + + init(arrayLiteral:) + +
    +
    +
    +
    +
    +
    +

    Returns a StatementArguments from an array literal:

    +
    let arguments: StatementArguments = ["Arthur", 41]
    +try db.execute(
    +    sql: "INSERT INTO player (name, score) VALUES (?, ?)"
    +    arguments: arguments)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(arrayLiteral elements: DatabaseValueConvertible?...)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a StatementArguments from a dictionary literal:

    +
    let arguments: StatementArguments = ["name": "Arthur", "score": 41]
    +try db.execute(
    +    sql: "INSERT INTO player (name, score) VALUES (:name, :score)"
    +    arguments: arguments)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(dictionaryLiteral elements: (String, DatabaseValueConvertible?)...)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/SuffixRowAdapter.html b/docs/4.8/Structs/SuffixRowAdapter.html new file mode 100644 index 000000000..72b9eeb8a --- /dev/null +++ b/docs/4.8/Structs/SuffixRowAdapter.html @@ -0,0 +1,1117 @@ + + + + SuffixRowAdapter Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SuffixRowAdapter

+
+
+
public struct SuffixRowAdapter : RowAdapter
+ +
+
+

SuffixRowAdapter is a row adapter that hides the first columns in a row.

+
let adapter = SuffixRowAdapter(fromIndex: 2)
+let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
+
+// [baz:3]
+try Row.fetchOne(db, sql: sql, adapter: adapter)
+
+ +
+
+
+
    +
  • +
    + + + + init(fromIndex:) + +
    +
    +
    +
    +
    +
    +

    Creates a SuffixRowAdapter that hides all columns before the +provided index.

    + +

    If index is 0, the layout row is identical to the base row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fromIndex index: Int)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Structs/ValueObservation.html b/docs/4.8/Structs/ValueObservation.html new file mode 100644 index 000000000..7a1ba9753 --- /dev/null +++ b/docs/4.8/Structs/ValueObservation.html @@ -0,0 +1,3245 @@ + + + + ValueObservation Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ValueObservation

+
+
+
public struct ValueObservation<Reducer>
+ +
+
+

ValueObservation tracks changes in the results of database requests, and +notifies fresh values whenever the database changes.

+ +

For example:

+
let observation = Player.observationForAll()
+let observer = try observation.start(in: dbQueue) { players: [Player] in
+    print("Players have changed.")
+}
+
+ +
+
+
+
    +
  • +
    + + + + requiresWriteAccess + +
    +
    +
    +
    +
    +
    +

    Default is false. Set this property to true when the observation +requires write access in order to fetch fresh values. Fetches are then +wrapped inside a savepoint.

    + +

    Don’t set this flag to true unless you really need it. A read/write +observation is less efficient than a read-only observation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var requiresWriteAccess: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + scheduling + +
    +
    +
    +
    +
    +
    +

    scheduling controls how fresh values are notified. Default +is .mainQueue.

    + +
      +
    • .mainQueue: all values are notified on the main queue.

      + +

      If the observation starts on the main queue, an initial value is +notified right upon subscription, synchronously::

      +
      // On main queue
      +let observation = Player.observationForAll()
      +let observer = try observation.start(in: dbQueue) { players: [Player] in
      +    print("fresh players: \(players)")
      +}
      +// <- here "fresh players" is already printed.
      +
      + +

      If the observation does not start on the main queue, an initial +value is also notified on the main queue, but asynchronously:

      +
      // Not on the main queue: "fresh players" is eventually printed
      +// on the main queue.
      +let observation = Player.observationForAll()
      +let observer = try observation.start(in: dbQueue) { players: [Player] in
      +    print("fresh players: \(players)")
      +}
      +
      + +

      When the database changes, fresh values are asynchronously notified:

      +
      // Eventually prints "fresh players" on the main queue
      +try dbQueue.write { db in
      +    try Player(...).insert(db)
      +}
      +
    • +
    • .onQueue(_:startImmediately:): all values are asychronously notified +on the specified queue.

      + +

      An initial value is fetched and notified if startImmediately +is true.

    • +
    • unsafe(startImmediately:): values are not all notified on the same +dispatch queue.

      + +

      If startImmediately is true, an initial value is notified right +upon subscription, synchronously, on the dispatch queue which starts +the observation.

      +
      // On any queue
      +var observation = Player.observationForAll()
      +observation.scheduling = .unsafe(startImmediately: true)
      +let observer = try observation.start(in: dbQueue) { players: [Player] in
      +    print("fresh players: \(players)")
      +}
      +// <- here "fresh players" is already printed.
      +
      + +

      When the database changes, other values are notified on +unspecified queues.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var scheduling: ValueScheduling
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + mapReducer(_:) + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Returns a ValueObservation with a transformed reducer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func mapReducer<R>(_ transform: @escaping (Database, Reducer) throws -> R) -> ValueObservation<R>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Count Observation

+

+
+
+
    +
  • +
    + + + + trackingCount(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies its +count whenever it is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.all()
    +let observation = ValueObservation.trackingCount(request)
    +
    +let observer = try observation.start(in: dbQueue) { count: Int in
    +    print("Number of players has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForCount(﹚ instead")
    +public static func trackingCount<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<ValueReducers.RemoveDuplicates<ValueReducers.Fetch<Int>>>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseValueConvertible Observation

+

+
+
+
    +
  • +
    + + + + trackingAll(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh values whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.select(Column("name"), as: String.self)
    +let observation = ValueObservation.trackingAll(request)
    +
    +let observer = try observation.start(in: dbQueue) { names: [String] in
    +    print("Player names have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForAll(﹚ instead")
    +public static func trackingAll<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<DatabaseValuesReducer<Request.RowDecoder>>
    +    where Request.RowDecoder: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + trackingOne(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh value whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.select(max(Column("score")), as: Int.self)
    +let observation = ValueObservation.trackingOne(request)
    +
    +let observer = try observation.start(in: dbQueue) { maxScore: Int? in
    +    print("Maximum score has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForFirst(﹚ instead")
    +public static func trackingOne<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<DatabaseValueReducer<Request.RowDecoder>>
    +    where Request.RowDecoder: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + trackingAll(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh values whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.select(Column("name"), as: Optional<String>.self)
    +let observation = ValueObservation.trackingAll(request)
    +
    +let observer = try observation.start(in: dbQueue) { names: [String?] in
    +    print("Player names have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForAll(﹚ instead")
    +public static func trackingAll<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<OptionalDatabaseValuesReducer<Request.RowDecoder._Wrapped>>
    +    where Request.RowDecoder: _OptionalProtocol,
    +    Request.RowDecoder._Wrapped: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

FetchableRecord Observation

+

+
+
+
    +
  • +
    + + + + trackingAll(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh records whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.all()
    +let observation = ValueObservation.trackingAll(request)
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForAll(﹚ instead")
    +public static func trackingAll<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<FetchableRecordsReducer<Request.RowDecoder>>
    +    where Request.RowDecoder: FetchableRecord
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + trackingOne(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh record whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.filter(key: 1)
    +let observation = ValueObservation.trackingOne(request)
    +
    +let observer = try observation.start(in: dbQueue) { player: Player? in
    +    print("Player has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForFirst(﹚ instead")
    +public static func trackingOne<Request: FetchRequest>(_ request: Request) ->
    +    ValueObservation<FetchableRecordReducer<Request.RowDecoder>>
    +    where Request.RowDecoder: FetchableRecord
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Row Observation

+

+
+
+
    +
  • +
    + + + + trackingAll(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh rows whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = SQLRequest<Row>(sql: "SELECT * FROM player")
    +let observation = ValueObservation.trackingAll(request)
    +
    +let observer = try observation.start(in: dbQueue) { rows: [Row] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForAll(﹚ instead")
    +public static func trackingAll<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<RowsReducer>
    +    where Request.RowDecoder == Row
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + trackingOne(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh row whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = SQLRequest<Row>(sql: "SELECT * FROM player WHERE id = ?", arguments: [1])
    +let observation = ValueObservation.trackingOne(request)
    +
    +let observer = try observation.start(in: dbQueue) { row: Row? in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForFirst(﹚ instead")
    +public static func trackingOne<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<RowReducer>
    +    where Request.RowDecoder == Row
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Starting Observation

+

+
+
+
    +
  • +
    + + + + start(in:onChange:) + +
    +
    +
    +
    +
    +
    +

    Starts the value observation in the provided database reader (such as +a database queue or database pool), and returns a transaction observer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func start(
    +    in reader: DatabaseReader,
    +    onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + reader + + +
    +

    A DatabaseReader.

    +
    +
    + + onChange + + +
    +

    A closure that is provided fresh values

    +
    +
    +
    +
    +

    Return Value

    +

    a TransactionObserver

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Starts the value observation in the provided database reader (such as +a database queue or database pool), and returns a transaction observer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func start(
    +    in reader: DatabaseReader,
    +    onError: @escaping (Error) -> Void,
    +    onChange: @escaping (Reducer.Value) -> Void) -> TransactionObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + reader + + +
    +

    A DatabaseReader.

    +
    +
    + + onError + + +
    +

    A closure that is provided eventual errors that +happen during observation

    +
    +
    + + onChange + + +
    +

    A closure that is provided fresh values

    +
    +
    +
    +
    +

    Return Value

    +

    a TransactionObserver

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Creating ValueObservation from ValueReducer

+

+
+
+
    +
  • +
    + + + + tracking(_:reducer:) + +
    +
    +
    +
    +
    +
    +

    Returns a ValueObservation which observes regions, and notifies the +values returned by the reducer whenever one of the observed +regions is modified by a database transaction.

    + +

    This method is the most fundamental way to create a ValueObservation.

    + +

    For example, this observation counts the number of a times the player +table is modified:

    +
    var count = 0
    +let reducer = AnyValueReducer(
    +    fetch: { _ in /* don't fetch anything */ },
    +    value: { _ -> Int? in
    +        defer { count += 1 }
    +        return count })
    +let observation = ValueObservation.tracking(Player.all(), reducer: { db in reducer })
    +let observer = observation.start(in: dbQueue) { count: Int in
    +    print("Players have been modified \(count) times.")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tracking(
    +    _ regions: DatabaseRegionConvertible...,
    +    reducer: @escaping (Database) throws -> Reducer)
    +    -> ValueObservation
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    + + reducer + + +
    +

    A reducer that turns database changes in the +modified regions into fresh values. Currently only reducers that adopt +the ValueReducer protocol are supported.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + tracking(_:reducer:) + +
    +
    +
    +
    +
    +
    +

    Returns a ValueObservation which observes regions, and notifies the +values returned by the reducer whenever one of the observed +regions is modified by a database transaction.

    + +

    This method is the most fundamental way to create a ValueObservation.

    + +

    For example, this observation counts the number of a times the player +table is modified:

    +
    var count = 0
    +let reducer = AnyValueReducer(
    +    fetch: { _ in /* don't fetch anything */ },
    +    value: { _ -> Int? in
    +        defer { count += 1 }
    +        return count })
    +let observation = ValueObservation.tracking([Player.all()], reducer: { db in reducer })
    +let observer = observation.start(in: dbQueue) { count: Int in
    +    print("Players have been modified \(count) times.")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tracking(
    +    _ regions: [DatabaseRegionConvertible],
    +    reducer: @escaping (Database) throws -> Reducer)
    +    -> ValueObservation
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    + + reducer + + +
    +

    A reducer that turns database changes in the +modified regions into fresh values. Currently only reducers that adopt +the ValueReducer protocol are supported.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Creating ValueObservation from Fetch Closures

+

+
+
+
    +
  • +
    + + + + tracking(value:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which notifies the values returned by the +fetch closure whenever a database transaction changes them.

    + +

    For example:

    +
    let observation = ValueObservation.tracking { db in
    +    try Player.fetchAll(db)
    +}
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tracking<Value>(
    +    value: @escaping (Database) throws -> Value)
    +    -> ValueObservation<ValueReducers.Fetch<Value>>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    A closure that fetches a value.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + tracking(_:fetch:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes regions, and notifies the +values returned by the fetch closure whenever one of the observed +regions is modified by a database transaction.

    + +

    For example:

    +
    let observation = ValueObservation.tracking(
    +    Player.all(),
    +    fetch: { db in return try Player.fetchAll(db) })
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tracking<Value>(
    +    _ regions: DatabaseRegionConvertible...,
    +    fetch: @escaping (Database) throws -> Value)
    +    -> ValueObservation<ValueReducers.Fetch<Value>>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    + + fetch + + +
    +

    A closure that fetches a value.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + tracking(_:fetch:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes regions, and notifies the +values returned by the fetch closure whenever one of the observed +regions is modified by a database transaction.

    + +

    For example:

    +
    let observation = ValueObservation.tracking(
    +    [Player.all()],
    +    fetch: { db in return try Player.fetchAll(db) })
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tracking<Value>(
    +    _ regions: [DatabaseRegionConvertible],
    +    fetch: @escaping (Database) throws -> Value)
    +    -> ValueObservation<ValueReducers.Fetch<Value>>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    + + fetch + + +
    +

    A closure that fetches a value.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer == Void

+

+
+
+ +
+
+
+ + +
+ +

Available where Reducer: ValueReducer

+

+
+
+
    +
  • +
    + + + + combine(_:_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combine<
    +    R1: ValueReducer,
    +    Combined>(
    +    _ other: ValueObservation<R1>,
    +    _ transform: @escaping (Reducer.Value, R1.Value) -> Combined)
    +    -> ValueObservation<ValueReducers.Map<ValueReducers.Combine2<Reducer, R1>, Combined>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer == Void

+

+
+
+ +
+
+
+ + +
+ +

Available where Reducer: ValueReducer

+

+
+
+
    +
  • +
    + + + + combine(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combine<
    +    R1: ValueReducer,
    +    R2: ValueReducer,
    +    Combined>(
    +    _ observation1: ValueObservation<R1>,
    +    _ observation2: ValueObservation<R2>,
    +    _ transform: @escaping (Reducer.Value, R1.Value, R2.Value) -> Combined)
    +    -> ValueObservation<ValueReducers.Map<ValueReducers.Combine3<Reducer, R1, R2>, Combined>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer == Void

+

+
+
+ +
+
+
+ + +
+ +

Available where Reducer: ValueReducer

+

+
+
+
    +
  • +
    + + + + combine(_:_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combine<
    +    R1: ValueReducer,
    +    R2: ValueReducer,
    +    R3: ValueReducer,
    +    Combined>(
    +    _ observation1: ValueObservation<R1>,
    +    _ observation2: ValueObservation<R2>,
    +    _ observation3: ValueObservation<R3>,
    +    _ transform: @escaping (Reducer.Value, R1.Value, R2.Value, R3.Value) -> Combined)
    +    -> ValueObservation<ValueReducers.Map<ValueReducers.Combine4<Reducer, R1, R2, R3>, Combined>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer == Void

+

+
+
+ +
+
+
+ + +
+ +

Available where Reducer: ValueReducer

+

+
+
+
    +
  • +
    + + + + combine(_:_:_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combine<
    +    R1: ValueReducer,
    +    R2: ValueReducer,
    +    R3: ValueReducer,
    +    R4: ValueReducer,
    +    Combined>(
    +    _ observation1: ValueObservation<R1>,
    +    _ observation2: ValueObservation<R2>,
    +    _ observation3: ValueObservation<R3>,
    +    _ observation4: ValueObservation<R4>,
    +    _ transform: @escaping (Reducer.Value, R1.Value, R2.Value, R3.Value, R4.Value) -> Combined)
    +    -> ValueObservation<ValueReducers.Map<ValueReducers.Combine5<Reducer, R1, R2, R3, R4>, Combined>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer == Void

+

+
+
+ +
+
+
+ + +
+ +

Available where Reducer: ValueReducer

+

+
+
+
    +
  • +
    + + + + compactMap(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a ValueObservation which notifies the non-nil results of calling +the given transformation which each element notified by this +value observation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func compactMap<T>(_ transform: @escaping (Reducer.Value) -> T?)
    +    -> ValueObservation<ValueReducers.CompactMap<Reducer, T>>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + map(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a ValueObservation which notifies the results of calling the +given transformation which each element notified by this +value observation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func map<T>(_ transform: @escaping (Reducer.Value) -> T)
    +    -> ValueObservation<ValueReducers.Map<Reducer, T>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer: ValueReducer, Reducer.Value: Equatable

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a ValueObservation which filters out consecutive equal values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, renamed: "removeDuplicates")
    +public func distinctUntilChanged()
    +    -> ValueObservation<ValueReducers.RemoveDuplicates<Reducer>>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + removeDuplicates() + +
    +
    +
    +
    +
    +
    +

    Returns a ValueObservation which filters out consecutive equal values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeDuplicates()
    +    -> ValueObservation<ValueReducers.RemoveDuplicates<Reducer>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/Typealiases.html b/docs/4.8/Typealiases.html new file mode 100644 index 000000000..a08aff5d2 --- /dev/null +++ b/docs/4.8/Typealiases.html @@ -0,0 +1,1268 @@ + + + + Type Aliases Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Type Aliases

+

The following type aliases are available globally.

+ +
+
+
+
    +
  • +
    + + + + TraceFunction + +
    +
    +
    +
    +
    +
    +

    A tracing function that takes an SQL string.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias TraceFunction = (String) -> Void
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLiteConnection + +
    +
    +
    +
    +
    +
    +

    A raw SQLite connection, suitable for the SQLite C API.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias SQLiteConnection = OpaquePointer
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLiteStatement + +
    +
    +
    +
    +
    +
    +

    A raw SQLite statement, suitable for the SQLite C API.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias SQLiteStatement = OpaquePointer
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5TokenCallback + +
    +
    +
    +
    +
    +
    +

    A low-level SQLite function that lets FTS5Tokenizer notify tokens.

    + +

    See FTS5Tokenizer.tokenize(context:flags:pText:nText:tokenCallback:)

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A function that lets FTS5WrapperTokenizer notify tokens.

    + +

    See FTS5WrapperTokenizer.accept(token:flags:tokenCallback:)

    + +
    +
    +
    +
  • +
  • +
    + + + + FTS5TokenCallback + +
    +
    +
    +
    +
    +
    +

    A low-level SQLite function that lets FTS5Tokenizer notify tokens.

    + +

    See FTS5Tokenizer.tokenize(context:flags:pText:nText:tokenCallback:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias FTS5TokenCallback = @convention(c) (_ context: UnsafeMutableRawPointer?, _ flags: Int32, _ pToken: UnsafePointer<Int8>?, _ nToken: Int32, _ iStart: Int32, _ iEnd: Int32) -> Int32
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A function that lets FTS5WrapperTokenizer notify tokens.

    + +

    See FTS5WrapperTokenizer.accept(token:flags:tokenCallback:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias FTS5WrapperTokenCallback = (_ token: String, _ flags: FTS5TokenFlags) throws -> Void
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/badge.svg b/docs/4.8/badge.svg new file mode 100644 index 000000000..afb579661 --- /dev/null +++ b/docs/4.8/badge.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + documentation + + + documentation + + + 90% + + + 90% + + + diff --git a/docs/4.8/css/highlight.css b/docs/4.8/css/highlight.css new file mode 100644 index 000000000..d0db0e13b --- /dev/null +++ b/docs/4.8/css/highlight.css @@ -0,0 +1,200 @@ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight { + /* Comment */ + /* Error */ + /* Keyword */ + /* Operator */ + /* Comment.Multiline */ + /* Comment.Preproc */ + /* Comment.Single */ + /* Comment.Special */ + /* Generic.Deleted */ + /* Generic.Deleted.Specific */ + /* Generic.Emph */ + /* Generic.Error */ + /* Generic.Heading */ + /* Generic.Inserted */ + /* Generic.Inserted.Specific */ + /* Generic.Output */ + /* Generic.Prompt */ + /* Generic.Strong */ + /* Generic.Subheading */ + /* Generic.Traceback */ + /* Keyword.Constant */ + /* Keyword.Declaration */ + /* Keyword.Pseudo */ + /* Keyword.Reserved */ + /* Keyword.Type */ + /* Literal.Number */ + /* Literal.String */ + /* Name.Attribute */ + /* Name.Builtin */ + /* Name.Class */ + /* Name.Constant */ + /* Name.Entity */ + /* Name.Exception */ + /* Name.Function */ + /* Name.Namespace */ + /* Name.Tag */ + /* Name.Variable */ + /* Operator.Word */ + /* Text.Whitespace */ + /* Literal.Number.Float */ + /* Literal.Number.Hex */ + /* Literal.Number.Integer */ + /* Literal.Number.Oct */ + /* Literal.String.Backtick */ + /* Literal.String.Char */ + /* Literal.String.Doc */ + /* Literal.String.Double */ + /* Literal.String.Escape */ + /* Literal.String.Heredoc */ + /* Literal.String.Interpol */ + /* Literal.String.Other */ + /* Literal.String.Regex */ + /* Literal.String.Single */ + /* Literal.String.Symbol */ + /* Name.Builtin.Pseudo */ + /* Name.Variable.Class */ + /* Name.Variable.Global */ + /* Name.Variable.Instance */ + /* Literal.Number.Integer.Long */ } + .highlight .c { + color: #999988; + font-style: italic; } + .highlight .err { + color: #a61717; + background-color: #e3d2d2; } + .highlight .k { + color: #000000; + font-weight: bold; } + .highlight .o { + color: #000000; + font-weight: bold; } + .highlight .cm { + color: #999988; + font-style: italic; } + .highlight .cp { + color: #999999; + font-weight: bold; } + .highlight .c1 { + color: #999988; + font-style: italic; } + .highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + .highlight .gd { + color: #000000; + background-color: #ffdddd; } + .highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + .highlight .ge { + color: #000000; + font-style: italic; } + .highlight .gr { + color: #aa0000; } + .highlight .gh { + color: #999999; } + .highlight .gi { + color: #000000; + background-color: #ddffdd; } + .highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + .highlight .go { + color: #888888; } + .highlight .gp { + color: #555555; } + .highlight .gs { + font-weight: bold; } + .highlight .gu { + color: #aaaaaa; } + .highlight .gt { + color: #aa0000; } + .highlight .kc { + color: #000000; + font-weight: bold; } + .highlight .kd { + color: #000000; + font-weight: bold; } + .highlight .kp { + color: #000000; + font-weight: bold; } + .highlight .kr { + color: #000000; + font-weight: bold; } + .highlight .kt { + color: #445588; } + .highlight .m { + color: #009999; } + .highlight .s { + color: #d14; } + .highlight .na { + color: #008080; } + .highlight .nb { + color: #0086B3; } + .highlight .nc { + color: #445588; + font-weight: bold; } + .highlight .no { + color: #008080; } + .highlight .ni { + color: #800080; } + .highlight .ne { + color: #990000; + font-weight: bold; } + .highlight .nf { + color: #990000; } + .highlight .nn { + color: #555555; } + .highlight .nt { + color: #000080; } + .highlight .nv { + color: #008080; } + .highlight .ow { + color: #000000; + font-weight: bold; } + .highlight .w { + color: #bbbbbb; } + .highlight .mf { + color: #009999; } + .highlight .mh { + color: #009999; } + .highlight .mi { + color: #009999; } + .highlight .mo { + color: #009999; } + .highlight .sb { + color: #d14; } + .highlight .sc { + color: #d14; } + .highlight .sd { + color: #d14; } + .highlight .s2 { + color: #d14; } + .highlight .se { + color: #d14; } + .highlight .sh { + color: #d14; } + .highlight .si { + color: #d14; } + .highlight .sx { + color: #d14; } + .highlight .sr { + color: #009926; } + .highlight .s1 { + color: #d14; } + .highlight .ss { + color: #990073; } + .highlight .bp { + color: #999999; } + .highlight .vc { + color: #008080; } + .highlight .vg { + color: #008080; } + .highlight .vi { + color: #008080; } + .highlight .il { + color: #009999; } diff --git a/docs/4.8/css/jazzy.css b/docs/4.8/css/jazzy.css new file mode 100644 index 000000000..2d5656d5b --- /dev/null +++ b/docs/4.8/css/jazzy.css @@ -0,0 +1,372 @@ +html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { + background: transparent; + border: 0; + margin: 0; + outline: 0; + padding: 0; + vertical-align: baseline; } + +body { + background-color: #f2f2f2; + font-family: Helvetica, freesans, Arial, sans-serif; + font-size: 14px; + -webkit-font-smoothing: subpixel-antialiased; + word-wrap: break-word; } + +h1, h2, h3 { + margin-top: 0.8em; + margin-bottom: 0.3em; + font-weight: 100; + color: black; } + +h1 { + font-size: 2.5em; } + +h2 { + font-size: 2em; + border-bottom: 1px solid #e2e2e2; } + +h4 { + font-size: 13px; + line-height: 1.5; + margin-top: 21px; } + +h5 { + font-size: 1.1em; } + +h6 { + font-size: 1.1em; + color: #777; } + +.section-name { + color: gray; + display: block; + font-family: Helvetica; + font-size: 22px; + font-weight: 100; + margin-bottom: 15px; } + +pre, code { + font: 0.95em Menlo, monospace; + color: #777; + word-wrap: normal; } + +p code, li code { + background-color: #eee; + padding: 2px 4px; + border-radius: 4px; } + +a { + color: #0088cc; + text-decoration: none; } + +ul { + padding-left: 15px; } + +li { + line-height: 1.8em; } + +img { + max-width: 100%; } + +blockquote { + margin-left: 0; + padding: 0 10px; + border-left: 4px solid #ccc; } + +.content-wrapper { + margin: 0 auto; + width: 980px; } + +header { + font-size: 0.85em; + line-height: 26px; + background-color: #414141; + position: fixed; + width: 100%; + z-index: 2; } + header img { + padding-right: 6px; + vertical-align: -4px; + height: 16px; } + header a { + color: #fff; } + header p { + float: left; + color: #999; } + header .header-right { + float: right; + margin-left: 16px; } + +#breadcrumbs { + background-color: #f2f2f2; + height: 27px; + padding-top: 17px; + position: fixed; + width: 100%; + z-index: 2; + margin-top: 26px; } + #breadcrumbs #carat { + height: 10px; + margin: 0 5px; } + +.sidebar { + background-color: #f9f9f9; + border: 1px solid #e2e2e2; + overflow-y: auto; + overflow-x: hidden; + position: fixed; + top: 70px; + bottom: 0; + width: 230px; + word-wrap: normal; } + +.nav-groups { + list-style-type: none; + background: #fff; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #e2e2e2; + font-size: 1.1em; + font-weight: 100; + padding: 15px 0 15px 20px; } + .nav-group-name > a { + color: #333; } + +.nav-group-tasks { + margin-top: 5px; } + +.nav-group-task { + font-size: 0.9em; + list-style-type: none; + white-space: nowrap; } + .nav-group-task a { + color: #888; } + +.main-content { + background-color: #fff; + border: 1px solid #e2e2e2; + margin-left: 246px; + position: absolute; + overflow: hidden; + padding-bottom: 20px; + top: 70px; + width: 734px; } + .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { + margin-bottom: 1em; } + .main-content p { + line-height: 1.8em; } + .main-content section .section:first-child { + margin-top: 0; + padding-top: 0; } + .main-content section .task-group-section .task-group:first-of-type { + padding-top: 10px; } + .main-content section .task-group-section .task-group:first-of-type .section-name { + padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + .main-content .section-name p { + margin-bottom: inherit; + line-height: inherit; } + .main-content .section-name code { + background-color: inherit; + padding: inherit; + color: inherit; } + +.section { + padding: 0 25px; } + +.highlight { + background-color: #eee; + padding: 10px 12px; + border: 1px solid #e2e2e2; + border-radius: 4px; + overflow-x: auto; } + +.declaration .highlight { + overflow-x: initial; + padding: 0 40px 40px 0; + margin-bottom: -25px; + background-color: transparent; + border: none; } + +.section-name { + margin: 0; + margin-left: 18px; } + +.task-group-section { + padding-left: 6px; + border-top: 1px solid #e2e2e2; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + +.section-name-container { + position: relative; + display: inline-block; } + .section-name-container .section-name-link { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin-bottom: 0; } + .section-name-container .section-name { + position: relative; + pointer-events: none; + z-index: 1; } + .section-name-container .section-name a { + pointer-events: auto; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + .item code { + background-color: transparent; + padding: 0; } + .item .token, .item .direct-link { + padding-left: 3px; + margin-left: 15px; + font-size: 11.9px; + transition: all 300ms; } + .item .token-open { + margin-left: 0px; } + .item .discouraged { + text-decoration: line-through; } + .item .declaration-note { + font-size: .85em; + color: gray; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #e2e2e2; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + background: #f9f9f9; + border-left: 1px solid #e2e2e2; + border-top: 1px solid #e2e2e2; + height: 12px; + left: 21px; + top: -7px; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); + position: absolute; + width: 12px; } + +.height-container { + display: none; + left: -25px; + padding: 0 25px; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #f9f9f9; + border-bottom: 1px solid #e2e2e2; + left: -25px; + position: relative; + width: 100%; + padding-top: 10px; + padding-bottom: 5px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4b8afb; } + +.aside-warning, .aside-deprecated, .aside-unavailable { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #e2e2e2; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +#footer { + position: relative; + top: 10px; + bottom: 0px; + margin-left: 25px; } + #footer p { + margin: 0; + color: #aaa; + font-size: 0.8em; } + +html.dash header, html.dash #breadcrumbs, html.dash .sidebar { + display: none; } + +html.dash .main-content { + width: 980px; + margin-left: 0; + border: none; + width: 100%; + top: 0; + padding-bottom: 0; } + +html.dash .height-container { + display: block; } + +html.dash .item .token { + margin-left: 0; } + +html.dash .content-wrapper { + width: auto; } + +html.dash #footer { + position: static; } diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Info.plist b/docs/4.8/docsets/GRDB.docset/Contents/Info.plist new file mode 100644 index 000000000..3208ceda9 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleIdentifier + com.jazzy.grdb + CFBundleName + GRDB + DocSetPlatformFamily + grdb + isDashDocset + + dashIndexFilePath + index.html + isJavaScriptEnabled + + DashDocSetFamily + dashtoc + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes.html new file mode 100644 index 000000000..4c0caf6d8 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes.html @@ -0,0 +1,2372 @@ + + + + Classes Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Classes

+

The following classes are available globally.

+ +
+
+
+
+ + +
+ +

Specialized Cursors

+

+
+
+
    +
  • +
    + + + + AnyCursor + +
    +
    +
    +
    +
    +
    +

    A type-erased cursor of Element.

    + +

    This cursor forwards its next() method to an arbitrary underlying cursor +having the same Element type, hiding the specifics of the underlying +cursor.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class AnyCursor<Element> : Cursor
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Database + +
    +
    +
    +
    +
    +
    +

    A Database connection.

    + +

    You don’t create a database directly. Instead, you use a DatabaseQueue, or +a DatabasePool:

    +
    let dbQueue = DatabaseQueue(...)
    +
    +// The Database is the `db` in the closure:
    +try dbQueue.write { db in
    +    try Player(...).insert(db)
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Database
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseCollation + +
    +
    +
    +
    +
    +
    +

    A Collation is a string comparison function used by SQLite.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DatabaseCollation
    +
    extension DatabaseCollation: Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseFunction + +
    +
    +
    +
    +
    +
    +

    An SQL function or aggregate.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DatabaseFunction : Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabasePool + +
    +
    +
    +
    +
    +
    +

    A DatabasePool grants concurrent accesses to an SQLite database.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DatabasePool : DatabaseWriter
    +
    extension DatabasePool: DatabaseReader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseQueue + +
    +
    +
    +
    +
    +
    +

    A DatabaseQueue serializes access to an SQLite database.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DatabaseQueue : DatabaseWriter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + AnyDatabaseReader + +
    +
    +
    +
    +
    +
    +

    A type-erased DatabaseReader

    + +

    Instances of AnyDatabaseReader forward their methods to an arbitrary +underlying database reader.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class AnyDatabaseReader : DatabaseReader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseSnapshot + +
    +
    +
    +
    +
    +
    +

    A DatabaseSnapshot sees an unchanging database content, as it existed at the +moment it was created.

    + +

    See DatabasePool.makeSnapshot()

    + +

    For more information, read about “snapshot isolation” at https://sqlite.org/isolation.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class DatabaseSnapshot : DatabaseReader
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseValueConvertible

+

+
+
+
    +
  • +
    + + + + DatabaseValueCursor + +
    +
    +
    +
    +
    +
    +

    A cursor of database values extracted from a single column. +For example:

    +
    try dbQueue.read { db in
    +    let urls: DatabaseValueCursor<URL> = try URL.fetchCursor(db, sql: "SELECT url FROM link")
    +    while let url = urls.next() { // URL
    +        print(url)
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class DatabaseValueCursor<Value> : Cursor where Value : DatabaseValueConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A cursor of optional database values extracted from a single column. +For example:

    +
    try dbQueue.read { db in
    +    let urls: NullableDatabaseValueCursor<URL> = try Optional<URL>.fetchCursor(db, sql: "SELECT url FROM link")
    +    while let url = urls.next() { // URL?
    +        print(url)
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class NullableDatabaseValueCursor<Value> : Cursor where Value : DatabaseValueConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseFuture + +
    +
    +
    +
    +
    +
    +

    A future database value, returned by the DatabaseWriter.concurrentRead(_:) +method.

    +
    let futureCount: Future<Int> = try writer.writeWithoutTransaction { db in
    +    try Player(...).insert()
    +
    +    // Count players concurrently
    +    return writer.concurrentRead { db in
    +        return try Player.fetchCount()
    +    }
    +}
    +
    +let count: Int = try futureCount.wait()
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class DatabaseFuture<Value>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + AnyDatabaseWriter + +
    +
    +
    +
    +
    +
    +

    A type-erased DatabaseWriter

    + +

    Instances of AnyDatabaseWriter forward their methods to an arbitrary +underlying database writer.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class AnyDatabaseWriter : DatabaseWriter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Row + +
    +
    +
    +
    +
    +
    +

    A database row.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class Row: Equatable, Hashable, RandomAccessCollection,
    +    ExpressibleByDictionaryLiteral, CustomStringConvertible,
    +    CustomDebugStringConvertible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

RowCursor

+

+
+
+
    +
  • +
    + + + + RowCursor + +
    +
    +
    +
    +
    +
    +

    A cursor of database rows. For example:

    +
    try dbQueue.read { db in
    +    let rows: RowCursor = try Row.fetchCursor(db, sql: "SELECT * FROM player")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class RowCursor : Cursor
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SelectStatement

+

+
+
+
    +
  • +
    + + + + SelectStatement + +
    +
    +
    +
    +
    +
    +

    A subclass of Statement that fetches database rows.

    + +

    You create SelectStatement with the Database.makeSelectStatement() method:

    +
    try dbQueue.read { db in
    +    let statement = try db.makeSelectStatement(sql: "SELECT COUNT(*) FROM player WHERE score > ?")
    +    let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
    +    let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SelectStatement : Statement
    +
    extension SelectStatement: RowLayout
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Statement + +
    +
    +
    +
    +
    +
    +

    A statement represents an SQL query.

    + +

    It is the base class of UpdateStatement that executes update statements, +and SelectStatement that fetches rows.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class Statement
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

UpdateStatement

+

+
+
+
    +
  • +
    + + + + UpdateStatement + +
    +
    +
    +
    +
    +
    +

    A subclass of Statement that executes SQL queries.

    + +

    You create UpdateStatement with the Database.makeUpdateStatement() method:

    +
    try dbQueue.inTransaction { db in
    +    let statement = try db.makeUpdateStatement(sql: "INSERT INTO player (name) VALUES (?)")
    +    try statement.execute(arguments: ["Arthur"])
    +    try statement.execute(arguments: ["Barbara"])
    +    return .commit
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UpdateStatement : Statement
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A cursor of database values extracted from a single column. +For example:

    +
    try dbQueue.read { db in
    +    let names: ColumnCursor<String> = try String.fetchCursor(db, sql: "SELECT name FROM player")
    +    while let name = names.next() { // String
    +        print(name)
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FastDatabaseValueCursor<Value> : Cursor where Value : DatabaseValueConvertible, Value : StatementColumnConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A cursor of optional database values extracted from a single column. +For example:

    +
    try dbQueue.read { db in
    +    let emails: FastNullableDatabaseValueCursor<String> =
    +        try Optional<String>.fetchCursor(db, sql: "SELECT email FROM player")
    +    while let email = emails.next() { // String?
    +        print(email ?? "<NULL>")
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FastNullableDatabaseValueCursor<Value>: Cursor
    +    where Value: DatabaseValueConvertible & StatementColumnConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS3TableDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS3TableDefinition class lets you define columns of a FTS3 virtual table.

    + +

    You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "document", using: FTS3()) { t in // t is FTS3TableDefinition
    +    t.column("content")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FTS3TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS4TableDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS4TableDefinition class lets you define columns of a FTS4 virtual table.

    + +

    You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "document", using: FTS4()) { t in // t is FTS4TableDefinition
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FTS4TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS4ColumnDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS4ColumnDefinition class lets you refine a column of an FTS4 +virtual table.

    + +

    You get instances of this class when you create an FTS4 table:

    +
    try db.create(virtualTable: "document", using: FTS4()) { t in
    +    t.column("content")      // FTS4ColumnDefinition
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FTS4ColumnDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5TableDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS5TableDefinition class lets you define columns of a FTS5 virtual table.

    + +

    You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "document", using: FTS5()) { t in // t is FTS5TableDefinition
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS5ColumnDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS5ColumnDefinition class lets you refine a column of an FTS5 +virtual table.

    + +

    You get instances of this class when you create an FTS5 table:

    +
    try db.create(virtualTable: "document", using: FTS5()) { t in
    +    t.column("content")      // FTS5ColumnDefinition
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

TableAlias

+

+
+
+
    +
  • +
    + + + + TableAlias + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    A TableAlias identifies a table in a request.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class TableAlias : Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TableDefinition + +
    +
    +
    +
    +
    +
    +

    The TableDefinition class lets you define table columns and constraints.

    + +

    You don’t create instances of this class. Instead, you use the Database +create(table:) method:

    +
    try db.create(table: "player") { t in // t is TableDefinition
    +    t.column(...)
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TableAlteration + +
    +
    +
    +
    +
    +
    +

    The TableAlteration class lets you alter database tables.

    + +

    You don’t create instances of this class. Instead, you use the Database +alter(table:) method:

    +
    try db.alter(table: "player") { t in // t is TableAlteration
    +    t.add(column: ...)
    +}
    +
    + +

    See https://www.sqlite.org/lang_altertable.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class TableAlteration
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ColumnDefinition + +
    +
    +
    +
    +
    +
    +

    The ColumnDefinition class lets you refine a table column.

    + +

    You get instances of this class when you create or alter a database table:

    +
    try db.create(table: "player") { t in
    +    t.column(...)      // ColumnDefinition
    +}
    +
    +try db.alter(table: "player") { t in
    +    t.add(column: ...) // ColumnDefinition
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html and +https://www.sqlite.org/lang_altertable.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class ColumnDefinition
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

RecordCursor

+

+
+
+ +
+
+
+ + +
+ +

Record

+

+
+
+
    +
  • +
    + + + + Record + +
    +
    +
    +
    +
    +
    +

    Record is a class that wraps a table row, or the result of any query. It is +designed to be subclassed.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class Record : FetchableRecord, TableRecord, PersistableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5TableDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS5TableDefinition class lets you define columns of a FTS5 virtual table.

    + +

    You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "document", using: FTS5()) { t in // t is FTS5TableDefinition
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FTS5TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5ColumnDefinition + +
    +
    +
    +
    +
    +
    +

    The FTS5ColumnDefinition class lets you refine a column of an FTS5 +virtual table.

    + +

    You get instances of this class when you create an FTS5 table:

    +
    try db.create(virtualTable: "document", using: FTS5()) { t in
    +    t.column("content")      // FTS5ColumnDefinition
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class FTS5ColumnDefinition
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/AnyCursor.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/AnyCursor.html new file mode 100644 index 000000000..643c1ba58 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/AnyCursor.html @@ -0,0 +1,1205 @@ + + + + AnyCursor Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyCursor

+
+
+
public final class AnyCursor<Element> : Cursor
+ +
+
+

A type-erased cursor of Element.

+ +

This cursor forwards its next() method to an arbitrary underlying cursor +having the same Element type, hiding the specifics of the underlying +cursor.

+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a cursor that wraps a base cursor but whose type depends only on +the base cursor’s element type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<C>(_ base: C) where Element == C.Element, C : Cursor
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(iterator:) + +
    +
    +
    +
    +
    +
    +

    Creates a cursor that wraps a base iterator but whose type depends only +on the base iterator’s element type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init<I>(iterator: I) where Element == I.Element, I : IteratorProtocol
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a cursor that wraps a base sequence but whose type depends only +on the base sequence’s element type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init<S>(_ s: S) where Element == S.Element, S : Sequence
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a cursor that wraps the given closure in its next() method

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ body: @escaping () throws -> Element?)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/AnyDatabaseReader.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/AnyDatabaseReader.html new file mode 100644 index 000000000..8f2c9f971 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/AnyDatabaseReader.html @@ -0,0 +1,1111 @@ + + + + AnyDatabaseReader Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyDatabaseReader

+
+
+
public final class AnyDatabaseReader : DatabaseReader
+ +
+
+

A type-erased DatabaseReader

+ +

Instances of AnyDatabaseReader forward their methods to an arbitrary +underlying database reader.

+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a database reader that wraps a base database reader.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ base: DatabaseReader)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/AnyDatabaseWriter.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/AnyDatabaseWriter.html new file mode 100644 index 000000000..1e3504189 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/AnyDatabaseWriter.html @@ -0,0 +1,1111 @@ + + + + AnyDatabaseWriter Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyDatabaseWriter

+
+
+
public final class AnyDatabaseWriter : DatabaseWriter
+ +
+
+

A type-erased DatabaseWriter

+ +

Instances of AnyDatabaseWriter forward their methods to an arbitrary +underlying database writer.

+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a database writer that wraps a base database writer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ base: DatabaseWriter)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/ColumnDefinition.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/ColumnDefinition.html new file mode 100644 index 000000000..5fe59acd4 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/ColumnDefinition.html @@ -0,0 +1,1736 @@ + + + + ColumnDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ColumnDefinition

+
+
+
public final class ColumnDefinition
+ +
+
+

The ColumnDefinition class lets you refine a table column.

+ +

You get instances of this class when you create or alter a database table:

+
try db.create(table: "player") { t in
+    t.column(...)      // ColumnDefinition
+}
+
+try db.alter(table: "player") { t in
+    t.add(column: ...) // ColumnDefinition
+}
+
+ +

See https://www.sqlite.org/lang_createtable.html and +https://www.sqlite.org/lang_altertable.html

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Adds a primary key constraint on the column.

    +
    try db.create(table: "player") { t in
    +    t.column("id", .integer).primaryKey()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#primkeyconst and +https://www.sqlite.org/lang_createtable.html#rowid

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func primaryKey(
    +    onConflict conflictResolution: Database.ConflictResolution? = nil,
    +    autoincrement: Bool = false)
    +    -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    + + autoincrement + + +
    +

    If true, the primary key is autoincremented.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + notNull(onConflict:) + +
    +
    +
    +
    +
    +
    +

    Adds a NOT NULL constraint on the column.

    +
    try db.create(table: "player") { t in
    +    t.column("name", .text).notNull()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#notnullconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func notNull(onConflict conflictResolution: Database.ConflictResolution? = nil) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + unique(onConflict:) + +
    +
    +
    +
    +
    +
    +

    Adds a UNIQUE constraint on the column.

    +
    try db.create(table: "player") { t in
    +    t.column("email", .text).unique()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#uniqueconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func unique(onConflict conflictResolution: Database.ConflictResolution? = nil) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + indexed() + +
    +
    +
    +
    +
    +
    +

    Adds an index of the column.

    +
    try db.create(table: "player") { t in
    +    t.column("email", .text).indexed()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#uniqueconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func indexed() -> Self
    + +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + check(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a CHECK constraint on the column.

    +
    try db.create(table: "player") { t in
    +    t.column("name", .text).check { length($0) > 0 }
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#ckconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func check(_ condition: (Column) -> SQLExpressible) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + condition + + +
    +

    A closure whose argument is an Column that +represents the defined column, and returns the expression to check.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + check(sql:) + +
    +
    +
    +
    +
    +
    +

    Adds a CHECK constraint on the column.

    +
    try db.create(table: "player") { t in
    +    t.column("name", .text).check(sql: "LENGTH(name) > 0")
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#ckconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func check(sql: String) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL snippet.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + defaults(to:) + +
    +
    +
    +
    +
    +
    +

    Defines the default column value.

    +
    try db.create(table: "player") { t in
    +    t.column("name", .text).defaults(to: "Anonymous")
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#dfltval

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func defaults(to value: DatabaseValueConvertible) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    A DatabaseValueConvertible value.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + defaults(sql:) + +
    +
    +
    +
    +
    +
    +

    Defines the default column value.

    +
    try db.create(table: "player") { t in
    +    t.column("creationDate", .DateTime).defaults(sql: "CURRENT_TIMESTAMP")
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#dfltval

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func defaults(sql: String) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL snippet.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + collate(_:) + +
    +
    +
    +
    +
    +
    +
    try db.create(table: "player") { t in
    +    t.column("email", .text).collate(.nocase)
    +}
    +
    + +

    See https://www.sqlite.org/datatype3.html#collation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func collate(_ collation: Database.CollationName) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + collation + + +
    +

    An Database.CollationName.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + collate(_:) + +
    +
    +
    +
    +
    +
    +
    try db.create(table: "player") { t in
    +    t.column("name", .text).collate(.localizedCaseInsensitiveCompare)
    +}
    +
    + +

    See https://www.sqlite.org/datatype3.html#collation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func collate(_ collation: DatabaseCollation) -> Self
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + collation + + +
    +

    A custom DatabaseCollation.

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Defines a foreign key.

    +
    try db.create(table: "book") { t in
    +    t.column("authorId", .integer).references("author", onDelete: .cascade)
    +}
    +
    + +

    See https://www.sqlite.org/foreignkeys.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func references(
    +    _ table: String,
    +    column: String? = nil,
    +    onDelete deleteAction: Database.ForeignKeyAction? = nil,
    +    onUpdate updateAction: Database.ForeignKeyAction? = nil,
    +    deferred: Bool = false) -> Self
    + +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database.html new file mode 100644 index 000000000..6fc9c37df --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database.html @@ -0,0 +1,4754 @@ + + + + Database Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Database

+
+
+
public final class Database
+ +
+
+

A Database connection.

+ +

You don’t create a database directly. Instead, you use a DatabaseQueue, or +a DatabasePool:

+
let dbQueue = DatabaseQueue(...)
+
+// The Database is the `db` in the closure:
+try dbQueue.write { db in
+    try Player(...).insert(db)
+}
+
+ +
+
+
+
+ + +
+ +

SQLite C API

+

+
+
+ +
+
+
+ + +
+ +

Configuration

+

+
+
+
    +
  • +
    + + + + logError + +
    +
    +
    +
    +
    +
    +

    The error logging function.

    + +

    Quoting https://www.sqlite.org/errlog.html:

    + +
    +

    SQLite can be configured to invoke a callback function containing an +error code and a terse error message whenever anomalies occur. This +mechanism is very helpful in tracking obscure problems that occur +rarely and in the field. Application developers are encouraged to take +advantage of the error logging facility of SQLite in their products, +as it is very low CPU and memory cost but can be a huge aid +for debugging.

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var logError: Database.LogErrorFunction? { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The database configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let configuration: Configuration
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Information

+

+
+
+
    +
  • +
    + + + + lastInsertedRowID + +
    +
    +
    +
    +
    +
    +

    The rowID of the most recently inserted row.

    + +

    If no row has ever been inserted using this database connection, +returns zero.

    + +

    For more detailed information, see https://www.sqlite.org/c3ref/last_insert_rowid.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lastInsertedRowID: Int64 { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + changesCount + +
    +
    +
    +
    +
    +
    +

    The number of rows modified, inserted or deleted by the most recent +successful INSERT, UPDATE or DELETE statement.

    + +

    For more detailed information, see https://www.sqlite.org/c3ref/changes.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var changesCount: Int { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + totalChangesCount + +
    +
    +
    +
    +
    +
    +

    The total number of rows modified, inserted or deleted by all successful +INSERT, UPDATE or DELETE statements since the database connection was +opened.

    + +

    For more detailed information, see https://www.sqlite.org/c3ref/total_changes.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var totalChangesCount: Int { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isInsideTransaction + +
    +
    +
    +
    +
    +
    +

    True if the database connection is currently in a transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isInsideTransaction: Bool { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Internal properties

+

+
+
+
    +
  • +
    + + + + lastErrorCode + +
    +
    +
    +
    +
    +
    +

    The last error code

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lastErrorCode: ResultCode { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lastErrorMessage + +
    +
    +
    +
    +
    +
    +

    The last error message

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lastErrorMessage: String? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Functions

+

+
+
+
    +
  • +
    + + + + add(function:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine an SQL function.

    +
    let fn = DatabaseFunction("succ", argumentCount: 1) { dbValues in
    +    guard let int = Int.fromDatabaseValue(dbValues[0]) else {
    +        return nil
    +    }
    +    return int + 1
    +}
    +db.add(function: fn)
    +try Int.fetchOne(db, sql: "SELECT succ(1)")! // 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(function:) + +
    +
    +
    +
    +
    +
    +

    Remove an SQL function.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Collations

+

+
+
+
    +
  • +
    + + + + add(collation:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine a collation.

    +
    let collation = DatabaseCollation("localized_standard") { (string1, string2) in
    +    return (string1 as NSString).localizedStandardCompare(string2)
    +}
    +db.add(collation: collation)
    +try db.execute(sql: "CREATE TABLE files (name TEXT COLLATE localized_standard")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(collation:) + +
    +
    +
    +
    +
    +
    +

    Remove a collation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Suspension

+

+
+
+ +
+
+
+ + +
+ +

Transactions & Savepoint

+

+
+
+
    +
  • +
    + + + + inTransaction(_:_:) + +
    +
    +
    +
    +
    +
    +

    Executes a block inside a database transaction.

    +
    try dbQueue.inDatabase do {
    +    try db.inTransaction {
    +        try db.execute(sql: "INSERT ...")
    +        return .commit
    +    }
    +}
    +
    + +

    If the block throws an error, the transaction is rollbacked and the +error is rethrown.

    + +

    This method is not reentrant: you can’t nest transactions.

    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func inTransaction(_ kind: TransactionKind? = nil, _ block: () throws -> TransactionCompletion) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + kind + + +
    +

    The transaction type (default nil). If nil, the transaction +type is configuration.defaultTransactionKind, which itself +defaults to .deferred. See https://www.sqlite.org/lang_transaction.html +for more information.

    +
    +
    + + block + + +
    +

    A block that executes SQL statements and return either +.commit or .rollback.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + inSavepoint(_:) + +
    +
    +
    +
    +
    +
    +

    Executes a block inside a savepoint.

    +
    try dbQueue.inDatabase do {
    +    try db.inSavepoint {
    +        try db.execute(sql: "INSERT ...")
    +        return .commit
    +    }
    +}
    +
    + +

    If the block throws an error, the savepoint is rollbacked and the +error is rethrown.

    + +

    This method is reentrant: you can nest savepoints.

    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func inSavepoint(_ block: () throws -> TransactionCompletion) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that executes SQL statements and return +either .commit or .rollback.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + beginTransaction(_:) + +
    +
    +
    +
    +
    +
    +

    Begins a database transaction.

    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func beginTransaction(_ kind: TransactionKind? = nil) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + kind + + +
    +

    The transaction type (default nil). If nil, the +transaction type is configuration.defaultTransactionKind, which itself +defaults to .deferred. See https://www.sqlite.org/lang_transaction.html +for more information.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + rollback() + +
    +
    +
    +
    +
    +
    +

    Rollbacks a database transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rollback() throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + commit() + +
    +
    +
    +
    +
    +
    +

    Commits a database transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func commit() throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Schema

+

+
+
+
    +
  • +
    + + + + clearSchemaCache() + +
    +
    +
    +
    +
    +
    +

    Clears the database schema cache.

    + +

    You may need to clear the cache manually if the database schema is +modified by another connection.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func clearSchemaCache()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + tableExists(_:) + +
    +
    +
    +
    +
    +
    +

    Returns whether a table exists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func tableExists(_ name: String) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns whether a table is an internal SQLite table.

    + +

    Those are tables whose name begins with “sqlite_”.

    + +

    For more information, see https://www.sqlite.org/fileformat2.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isSQLiteInternalTable(_ tableName: String) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns whether a table is an internal GRDB table.

    + +

    Those are tables whose name begins with “grdb_”.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isGRDBInternalTable(_ tableName: String) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + viewExists(_:) + +
    +
    +
    +
    +
    +
    +

    Returns whether a view exists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func viewExists(_ name: String) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + triggerExists(_:) + +
    +
    +
    +
    +
    +
    +

    Returns whether a trigger exists.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func triggerExists(_ name: String) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + primaryKey(_:) + +
    +
    +
    +
    +
    +
    +

    The primary key for table named tableName.

    + +

    All tables have a primary key, even when it is not explicit. When a +table has no explicit primary key, the result is the hidden +“rowid” column.

    +
    +

    Throws

    + A DatabaseError if table does not exist. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primaryKey(_ tableName: String) throws -> PrimaryKeyInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + indexes(on:) + +
    +
    +
    +
    +
    +
    +

    The indexes on table named tableName; returns the empty array if the +table does not exist.

    + +

    Note: SQLite does not define any index for INTEGER PRIMARY KEY columns: +this method does not return any index that represents this primary key.

    + +

    If you want to know if a set of columns uniquely identify a row, prefer +table(_:hasUniqueKey:) instead.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func indexes(on tableName: String) throws -> [IndexInfo]
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    True if a sequence of columns uniquely identifies a row, that is to say +if the columns are the primary key, or if there is a unique index on them.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func table<T: Sequence>(
    +    _ tableName: String,
    +    hasUniqueKey columns: T)
    +    throws -> Bool
    +    where T.Iterator.Element == String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + foreignKeys(on:) + +
    +
    +
    +
    +
    +
    +

    The foreign keys defined on table named tableName.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func foreignKeys(on tableName: String) throws -> [ForeignKeyInfo]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + columns(in:) + +
    +
    +
    +
    +
    +
    +

    The columns in the table named tableName

    +
    +

    Throws

    + A DatabaseError if table does not exist. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func columns(in tableName: String) throws -> [ColumnInfo]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Statements

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a new prepared statement that can be reused.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT COUNT(*) FROM player WHERE score > ?")
    +let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
    +let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
    +
    +
    +

    Throws

    + A DatabaseError whenever SQLite could not parse the sql query. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeSelectStatement(sql: String) throws -> SelectStatement
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    +
    +
    +

    Return Value

    +

    A SelectStatement.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a prepared statement that can be reused.

    +
    let statement = try db.cachedSelectStatement(sql: "SELECT COUNT(*) FROM player WHERE score > ?")
    +let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
    +let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
    +
    + +

    The returned statement may have already been used: it may or may not +contain values for its eventual arguments.

    +
    +

    Throws

    + A DatabaseError whenever SQLite could not parse the sql query. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cachedSelectStatement(sql: String) throws -> SelectStatement
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    +
    +
    +

    Return Value

    +

    An UpdateStatement.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a new prepared statement that can be reused.

    +
    let statement = try db.makeUpdateStatement(sql: "INSERT INTO player (name) VALUES (?)")
    +try statement.execute(arguments: ["Arthur"])
    +try statement.execute(arguments: ["Barbara"])
    +
    +
    +

    Throws

    + A DatabaseError whenever SQLite could not parse the sql query. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeUpdateStatement(sql: String) throws -> UpdateStatement
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    +
    +
    +

    Return Value

    +

    An UpdateStatement.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a prepared statement that can be reused.

    +
    let statement = try db.cachedUpdateStatement(sql: "INSERT INTO player (name) VALUES (?)")
    +try statement.execute(arguments: ["Arthur"])
    +try statement.execute(arguments: ["Barbara"])
    +
    + +

    The returned statement may have already been used: it may or may not +contain values for its eventual arguments.

    +
    +

    Throws

    + A DatabaseError whenever SQLite could not parse the sql query. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func cachedUpdateStatement(sql: String) throws -> UpdateStatement
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    +
    +
    +

    Return Value

    +

    An UpdateStatement.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Executes one or several SQL statements, separated by semi-colons.

    +
    try db.execute(
    +    sql: "INSERT INTO player (name) VALUES (:name)",
    +    arguments: ["name": "Arthur"])
    +
    +try db.execute(sql: """
    +    INSERT INTO player (name) VALUES (?);
    +    INSERT INTO player (name) VALUES (?);
    +    INSERT INTO player (name) VALUES (?);
    +    """, arguments: ["Arthur", "Barbara", "O'Brien"])
    +
    + +

    This method may throw a DatabaseError.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func execute(sql: String, arguments: StatementArguments = StatementArguments()) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + execute(literal:) + +
    +
    +
    +
    +
    +
    +

    Executes one or several SQL statements, separated by semi-colons.

    +
    try db.execute(literal: SQLLiteral(
    +    sql: "INSERT INTO player (name) VALUES (:name)",
    +    arguments: ["name": "Arthur"]))
    +
    +try db.execute(literal: SQLLiteral(sql: """
    +    INSERT INTO player (name) VALUES (?);
    +    INSERT INTO player (name) VALUES (?);
    +    INSERT INTO player (name) VALUES (?);
    +    """, arguments: ["Arthur", "Barbara", "O'Brien"]))
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    try db.execute(literal: """
    +    INSERT INTO player (name) VALUES (\("Arthur"));
    +    INSERT INTO player (name) VALUES (\("Barbara"));
    +    INSERT INTO player (name) VALUES (\("O'Brien"));
    +    """)
    +
    + +

    This method may throw a DatabaseError.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func execute(literal sqlLiteral: SQLLiteral) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sqlLiteral + + +
    +

    An SQLLiteral.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + BusyCallback + +
    +
    +
    +
    +
    + +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias BusyCallback = (_ numberOfTries: Int) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + BusyMode + +
    +
    +
    +
    +
    +
    +

    When there are several connections to a database, a connection may try +to access the database while it is locked by another connection.

    + +

    The BusyMode enum describes the behavior of GRDB when such a situation +occurs:

    + +
      +
    • .immediateError: The SQLITE_BUSY error is immediately returned to the +connection that tries to access the locked database.

    • +
    • .timeout: The SQLITE_BUSY error will be returned only if the database +remains locked for more than the specified duration.

    • +
    • .callback: Perform your custom lock handling.

    • +
    + +

    To set the busy mode of a database, use Configuration:

    +
    // Wait 1 second before failing with SQLITE_BUSY
    +let configuration = Configuration(busyMode: .timeout(1))
    +let dbQueue = DatabaseQueue(path: "...", configuration: configuration)
    +
    + +

    Relevant SQLite documentation:

    + + + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum BusyMode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CheckpointMode + +
    +
    +
    +
    +
    +
    +

    The available checkpoint modes.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum CheckpointMode : Int32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CollationName + +
    +
    +
    +
    +
    +
    +

    A built-in SQLite collation.

    + +

    See https://www.sqlite.org/datatype3.html#collation

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct CollationName : RawRepresentable, Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ColumnType + +
    +
    +
    +
    +
    +
    +

    An SQL column type.

    +
    try db.create(table: "player") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("title", .text)
    +}
    +
    + +

    See https://www.sqlite.org/datatype3.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ColumnType : RawRepresentable, Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ConflictResolution + +
    +
    +
    +
    +
    +
    +

    An SQLite conflict resolution.

    + +

    See https://www.sqlite.org/lang_conflict.html.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ConflictResolution : String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ForeignKeyAction + +
    +
    +
    +
    +
    +
    +

    A foreign key action.

    + +

    See https://www.sqlite.org/foreignkeys.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ForeignKeyAction : String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + LogErrorFunction + +
    +
    +
    +
    +
    +
    +

    log function that takes an error message.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias LogErrorFunction = (_ resultCode: ResultCode, _ message: String) -> Void
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TransactionCompletion + +
    +
    +
    +
    +
    +
    +

    The end of a transaction: Commit, or Rollback

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TransactionCompletion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + TransactionKind + +
    +
    +
    +
    +
    +
    +

    An SQLite transaction kind. See https://www.sqlite.org/lang_transaction.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TransactionKind : String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Observation

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Add a transaction observer, so that it gets notified of +database changes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(
    +    transactionObserver: TransactionObserver,
    +    extent: TransactionObservationExtent = .observerLifetime)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + transactionObserver + + +
    +

    A transaction observer.

    +
    +
    + + extent + + +
    +

    The duration of the observation. The default is +the observer lifetime (observation lasts until observer +is deallocated).

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Remove a transaction observer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(transactionObserver: TransactionObserver)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers a closure to be executed after the next or current +transaction completion.

    +
    try dbQueue.write { db in
    +    db.afterNextTransactionCommit { _ in
    +        print("success")
    +    }
    +    ...
    +} // prints "success"
    +
    + +

    If the transaction is rollbacked, the closure is not executed.

    + +

    If the transaction is committed, the closure is executed in a protected +dispatch queue, serialized will all database updates.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func afterNextTransactionCommit(_ closure: @escaping (Database) -> Void)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The extent of a transaction observation

    + +

    See Database.add(transactionObserver:extent:)

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum TransactionObservationExtent
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Deletes the synchronization triggers for a synchronized FTS4 table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropFTS4SynchronizationTriggers(forTable tableName: String) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Schema

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a database table.

    +
    try db.create(table: "place") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("title", .text)
    +    t.column("favorite", .boolean).notNull().default(false)
    +    t.column("longitude", .double).notNull()
    +    t.column("latitude", .double).notNull()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html and +https://www.sqlite.org/withoutrowid.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a database table.

    +
    try db.create(table: "place") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("title", .text)
    +    t.column("favorite", .boolean).notNull().default(false)
    +    t.column("longitude", .double).notNull()
    +    t.column("latitude", .double).notNull()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html and +https://www.sqlite.org/withoutrowid.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public func create(
    +    table name: String,
    +    temporary: Bool = false,
    +    ifNotExists: Bool = false,
    +    withoutRowID: Bool,
    +    body: (TableDefinition) -> Void)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The table name.

    +
    +
    + + temporary + + +
    +

    If true, creates a temporary table.

    +
    +
    + + ifNotExists + + +
    +

    If false (the default), an error is thrown if the +table already exists. Otherwise, the table is created unless it +already exists.

    +
    +
    + + withoutRowID + + +
    +

    If true, uses WITHOUT ROWID optimization.

    +
    +
    + + body + + +
    +

    A closure that defines table columns and constraints.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a database table.

    +
    try db.create(table: "place") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("title", .text)
    +    t.column("favorite", .boolean).notNull().default(false)
    +    t.column("longitude", .double).notNull()
    +    t.column("latitude", .double).notNull()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create(
    +    table name: String,
    +    temporary: Bool = false,
    +    ifNotExists: Bool = false,
    +    body: (TableDefinition) -> Void)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The table name.

    +
    +
    + + temporary + + +
    +

    If true, creates a temporary table.

    +
    +
    + + ifNotExists + + +
    +

    If false (the default), an error is thrown if the +table already exists. Otherwise, the table is created unless it +already exists.

    +
    +
    + + body + + +
    +

    A closure that defines table columns and constraints.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + rename(table:to:) + +
    +
    +
    +
    +
    +
    +

    Renames a database table.

    + +

    See https://www.sqlite.org/lang_altertable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func rename(table name: String, to newName: String) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + alter(table:body:) + +
    +
    +
    +
    +
    +
    +

    Modifies a database table.

    +
    try db.alter(table: "player") { t in
    +    t.add(column: "url", .text)
    +}
    +
    + +

    See https://www.sqlite.org/lang_altertable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func alter(table name: String, body: (TableAlteration) -> Void) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    The table name.

    +
    +
    + + body + + +
    +

    A closure that defines table alterations.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + drop(table:) + +
    +
    +
    +
    +
    +
    +

    Deletes a database table.

    + +

    See https://www.sqlite.org/lang_droptable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func drop(table name: String) throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an index.

    +
    try db.create(index: "playerByEmail", on: "player", columns: ["email"])
    +
    + +

    SQLite can also index expressions (https://www.sqlite.org/expridx.html) +and use specific collations. To create such an index, use a raw SQL +query.

    +
    try db.execute(sql: "CREATE INDEX ...")
    +
    + +

    See https://www.sqlite.org/lang_createindex.html

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an index.

    +
    try db.create(index: "playerByEmail", on: "player", columns: ["email"])
    +
    + +

    SQLite can also index expressions (https://www.sqlite.org/expridx.html) +and use specific collations. To create such an index, use a raw SQL +query.

    +
    try db.execute(sql: "CREATE INDEX ...")
    +
    + +

    See https://www.sqlite.org/lang_createindex.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create(
    +    index name: String,
    +    on table: String,
    +    columns: [String],
    +    unique: Bool = false,
    +    ifNotExists: Bool = false)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The index name.

    +
    +
    + + table + + +
    +

    The name of the indexed table.

    +
    +
    + + columns + + +
    +

    The indexed columns.

    +
    +
    + + unique + + +
    +

    If true, creates a unique index.

    +
    +
    + + ifNotExists + + +
    +

    If false, no error is thrown if index already exists.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a partial index.

    +
    try db.create(index: "playerByEmail", on: "player", columns: ["email"], condition: Column("email") != nil)
    +
    + +

    See https://www.sqlite.org/lang_createindex.html, and +https://www.sqlite.org/partialindex.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public func create(
    +    index name: String,
    +    on table: String,
    +    columns: [String],
    +    unique: Bool = false,
    +    ifNotExists: Bool = false,
    +    condition: SQLExpressible)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The index name.

    +
    +
    + + table + + +
    +

    The name of the indexed table.

    +
    +
    + + columns + + +
    +

    The indexed columns.

    +
    +
    + + unique + + +
    +

    If true, creates a unique index.

    +
    +
    + + ifNotExists + + +
    +

    If false, no error is thrown if index already exists.

    +
    +
    + + condition + + +
    +

    The condition that indexed rows must verify.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + drop(index:) + +
    +
    +
    +
    +
    +
    +

    Deletes a database index.

    + +

    See https://www.sqlite.org/lang_dropindex.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func drop(index name: String) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reindex(collation:) + +
    +
    +
    +
    +
    +
    +

    Delete and recreate from scratch all indices that use this collation.

    + +

    This method is useful when the definition of a collation sequence +has changed.

    + +

    See https://www.sqlite.org/lang_reindex.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reindex(collation: Database.CollationName) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reindex(collation:) + +
    +
    +
    +
    +
    +
    +

    Delete and recreate from scratch all indices that use this collation.

    + +

    This method is useful when the definition of a collation sequence +has changed.

    + +

    See https://www.sqlite.org/lang_reindex.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reindex(collation: DatabaseCollation) throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a virtual database table.

    +
    try db.create(virtualTable: "vocabulary", using: "spellfix1")
    +
    + +

    See https://www.sqlite.org/lang_createtable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create(virtualTable name: String, ifNotExists: Bool = false, using module: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The table name.

    +
    +
    + + ifNotExists + + +
    +

    If false (the default), an error is thrown if the +table already exists. Otherwise, the table is created unless it +already exists.

    +
    +
    + + module + + +
    +

    The name of an SQLite virtual table module.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a virtual database table.

    +
    let module = ...
    +try db.create(virtualTable: "book", using: module) { t in
    +    ...
    +}
    +
    + +

    The type of the closure argument t depends on the type of the module +argument: refer to this module’s documentation.

    + +

    Use this method to create full-text tables using the FTS3, FTS4, or +FTS5 modules:

    +
    try db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.column("title")
    +    t.column("author")
    +    t.column("body")
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create<Module: VirtualTableModule>(
    +    virtualTable tableName: String,
    +    ifNotExists: Bool = false,
    +    using module: Module,
    +    _ body: ((Module.TableDefinition) -> Void)? = nil)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The table name.

    +
    +
    + + ifNotExists + + +
    +

    If false (the default), an error is thrown if the +table already exists. Otherwise, the table is created unless it +already exists.

    +
    +
    + + module + + +
    +

    a VirtualTableModule

    +
    +
    + + body + + +
    +

    An optional closure that defines the virtual table.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Encryption

+

+
+
+
    +
  • +
    + + + + usePassphrase(_:) + +
    +
    +
    +
    +
    +
    +

    Sets the passphrase used to crypt and decrypt an SQLCipher database.

    + +

    Call this method from Configuration.prepareDatabase, as in the example below:

    +
    var config = Configuration()
    +config.prepareDatabase = { db in
    +    try db.usePassphrase("secret")
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func usePassphrase(_ passphrase: String) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + changePassphrase(_:) + +
    +
    +
    +
    +
    +
    +

    Changes the passphrase used by an SQLCipher encrypted database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func changePassphrase(_ passphrase: String) throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Deletes the synchronization triggers for a synchronized FTS5 table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropFTS5SynchronizationTriggers(forTable tableName: String) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

FTS5

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +db.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add<Tokenizer>(tokenizer: Tokenizer.Type) where Tokenizer : FTS5CustomTokenizer
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern from a raw pattern string; throws DatabaseError on +invalid syntax.

    + +

    The pattern syntax is documented at https://www.sqlite.org/fts5.html#full_text_query_syntax

    +
    try db.makeFTS5Pattern(rawPattern: "and", forTable: "document") // OK
    +try db.makeFTS5Pattern(rawPattern: "AND", forTable: "document") // malformed MATCH expression: [AND]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeFTS5Pattern(rawPattern: String, forTable table: String) throws -> FTS5Pattern
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + makeTokenizer(_:) + +
    +
    +
    +
    +
    +
    +

    Creates an FTS5 tokenizer, given its descriptor.

    +
    let unicode61 = try db.makeTokenizer(.unicode61())
    +
    + +

    It is a programmer error to use the tokenizer outside of a protected +database queue, or after the database has been closed.

    + +

    Use this method when you implement a custom wrapper tokenizer:

    +
    final class MyTokenizer : FTS5WrapperTokenizer {
    +    var wrappedTokenizer: FTS5Tokenizer
    +
    +    init(db: Database, arguments: [String]) throws {
    +        wrappedTokenizer = try db.makeTokenizer(.unicode61())
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeTokenizer(_ descriptor: FTS5TokenizerDescriptor) throws -> FTS5Tokenizer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Schema

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a database table.

    +
    try db.create(table: "place") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("title", .text)
    +    t.column("favorite", .boolean).notNull().default(false)
    +    t.column("longitude", .double).notNull()
    +    t.column("latitude", .double).notNull()
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an index.

    +
    try db.create(index: "playerByEmail", on: "player", columns: ["email"])
    +
    + +

    SQLite can also index expressions (https://www.sqlite.org/expridx.html) +and use specific collations. To create such an index, use a raw SQL +query.

    +
    try db.execute(sql: "CREATE INDEX ...")
    +
    + +

    See https://www.sqlite.org/lang_createindex.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func create(
    +    index name: String,
    +    on table: String,
    +    columns: [String],
    +    unique: Bool = false,
    +    ifNotExists: Bool = false,
    +    condition: SQLExpressible? = nil)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The index name.

    +
    +
    + + table + + +
    +

    The name of the indexed table.

    +
    +
    + + columns + + +
    +

    The indexed columns.

    +
    +
    + + unique + + +
    +

    If true, creates a unique index.

    +
    +
    + + ifNotExists + + +
    +

    If false, no error is thrown if index already exists.

    +
    +
    + + condition + + +
    +

    If not nil, creates a partial index +(see https://www.sqlite.org/partialindex.html).

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an index.

    +
    try db.create(index: "playerByEmail", on: "player", columns: ["email"])
    +
    + +

    SQLite can also index expressions (https://www.sqlite.org/expridx.html) +and use specific collations. To create such an index, use a raw SQL +query.

    +
    try db.execute(sql: "CREATE INDEX ...")
    +
    + +

    See https://www.sqlite.org/lang_createindex.html

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/BusyMode.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/BusyMode.html new file mode 100644 index 000000000..1f3cb1992 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/BusyMode.html @@ -0,0 +1,1198 @@ + + + + BusyMode Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

BusyMode

+
+
+
public enum BusyMode
+ +
+
+

When there are several connections to a database, a connection may try +to access the database while it is locked by another connection.

+ +

The BusyMode enum describes the behavior of GRDB when such a situation +occurs:

+ +
    +
  • .immediateError: The SQLITE_BUSY error is immediately returned to the +connection that tries to access the locked database.

  • +
  • .timeout: The SQLITE_BUSY error will be returned only if the database +remains locked for more than the specified duration.

  • +
  • .callback: Perform your custom lock handling.

  • +
+ +

To set the busy mode of a database, use Configuration:

+
// Wait 1 second before failing with SQLITE_BUSY
+let configuration = Configuration(busyMode: .timeout(1))
+let dbQueue = DatabaseQueue(path: "...", configuration: configuration)
+
+ +

Relevant SQLite documentation:

+ + + +
+
+
+
    +
  • +
    + + + + immediateError + +
    +
    +
    +
    +
    +
    +

    The SQLITE_BUSY error is immediately returned to the connection that +tries to access the locked database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case immediateError
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + timeout(_:) + +
    +
    +
    +
    +
    +
    +

    The SQLITE_BUSY error will be returned only if the database remains +locked for more than the specified duration (in seconds).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case timeout(TimeInterval)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + callback(_:) + +
    +
    +
    +
    +
    +
    +

    A custom callback that is called when a database is locked. +See https://www.sqlite.org/c3ref/busy_handler.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case callback(BusyCallback)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/CheckpointMode.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/CheckpointMode.html new file mode 100644 index 000000000..ccd728307 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/CheckpointMode.html @@ -0,0 +1,1198 @@ + + + + CheckpointMode Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

CheckpointMode

+
+
+
public enum CheckpointMode : Int32
+ +
+
+

The available checkpoint modes.

+ +
+
+
+
    +
  • +
    + + + + passive + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case passive = 0
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + full + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case full = 1
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + restart + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case restart = 2
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + truncate + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case truncate = 3
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/CollationName.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/CollationName.html new file mode 100644 index 000000000..a513eae49 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/CollationName.html @@ -0,0 +1,1200 @@ + + + + CollationName Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

CollationName

+
+
+
public struct CollationName : RawRepresentable, Hashable
+ +
+
+

A built-in SQLite collation.

+ +

See https://www.sqlite.org/datatype3.html#collation

+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ rawValue: String)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + binary + +
    +
    +
    +
    +
    +
    +

    The BINARY built-in SQL collation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let binary: Database.CollationName
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + nocase + +
    +
    +
    +
    +
    +
    +

    The NOCASE built-in SQL collation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let nocase: Database.CollationName
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rtrim + +
    +
    +
    +
    +
    +
    +

    The RTRIM built-in SQL collation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let rtrim: Database.CollationName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/ColumnType.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/ColumnType.html new file mode 100644 index 000000000..8235b7e85 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/ColumnType.html @@ -0,0 +1,1355 @@ + + + + ColumnType Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ColumnType

+
+
+
public struct ColumnType : RawRepresentable, Hashable
+ +
+
+

An SQL column type.

+
try db.create(table: "player") { t in
+    t.autoIncrementedPrimaryKey("id")
+    t.column("title", .text)
+}
+
+ +

See https://www.sqlite.org/datatype3.html

+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ rawValue: String)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + text + +
    +
    +
    +
    +
    +
    +

    The TEXT SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let text: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + integer + +
    +
    +
    +
    +
    +
    +

    The INTEGER SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let integer: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + double + +
    +
    +
    +
    +
    +
    +

    The DOUBLE SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let double: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + numeric + +
    +
    +
    +
    +
    +
    +

    The NUMERIC SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let numeric: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + boolean + +
    +
    +
    +
    +
    +
    +

    The BOOLEAN SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let boolean: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + blob + +
    +
    +
    +
    +
    +
    +

    The BLOB SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let blob: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + date + +
    +
    +
    +
    +
    +
    +

    The DATE SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let date: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + datetime + +
    +
    +
    +
    +
    +
    +

    The DATETIME SQL column type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let datetime: Database.ColumnType
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/ConflictResolution.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/ConflictResolution.html new file mode 100644 index 000000000..7fa816b0d --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/ConflictResolution.html @@ -0,0 +1,1230 @@ + + + + ConflictResolution Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ConflictResolution

+
+
+
public enum ConflictResolution : String
+ +
+
+

An SQLite conflict resolution.

+ +

See https://www.sqlite.org/lang_conflict.html.

+ +
+
+
+
    +
  • +
    + + + + rollback + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case rollback = "ROLLBACK"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + abort + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case abort = "ABORT"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fail + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case fail = "FAIL"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ignore + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case ignore = "IGNORE"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + replace + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case replace = "REPLACE"
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/ForeignKeyAction.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/ForeignKeyAction.html new file mode 100644 index 000000000..ebfddd6cb --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/ForeignKeyAction.html @@ -0,0 +1,1200 @@ + + + + ForeignKeyAction Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ForeignKeyAction

+
+
+
public enum ForeignKeyAction : String
+ +
+
+

A foreign key action.

+ +

See https://www.sqlite.org/foreignkeys.html

+ +
+
+
+
    +
  • +
    + + + + cascade + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case cascade = "CASCADE"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + restrict + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case restrict = "RESTRICT"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + setNull + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case setNull = "SET NULL"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + setDefault + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case setDefault = "SET DEFAULT"
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/TransactionCompletion.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/TransactionCompletion.html new file mode 100644 index 000000000..dbb2cb84b --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/TransactionCompletion.html @@ -0,0 +1,1138 @@ + + + + TransactionCompletion Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TransactionCompletion

+
+
+
public enum TransactionCompletion
+ +
+
+

The end of a transaction: Commit, or Rollback

+ +
+
+
+
    +
  • +
    + + + + commit + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case commit
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rollback + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case rollback
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/TransactionKind.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/TransactionKind.html new file mode 100644 index 000000000..20870cc74 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/TransactionKind.html @@ -0,0 +1,1168 @@ + + + + TransactionKind Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TransactionKind

+
+
+
public enum TransactionKind : String
+ +
+
+

An SQLite transaction kind. See https://www.sqlite.org/lang_transaction.html

+ +
+
+
+
    +
  • +
    + + + + deferred + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deferred = "DEFERRED"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + immediate + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case immediate = "IMMEDIATE"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + exclusive + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case exclusive = "EXCLUSIVE"
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/TransactionObservationExtent.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/TransactionObservationExtent.html new file mode 100644 index 000000000..ee5d8f811 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Database/TransactionObservationExtent.html @@ -0,0 +1,1170 @@ + + + + TransactionObservationExtent Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TransactionObservationExtent

+
+
+
public enum TransactionObservationExtent
+ +
+
+

The extent of a transaction observation

+ +

See Database.add(transactionObserver:extent:)

+ +
+
+
+
    +
  • +
    + + + + observerLifetime + +
    +
    +
    +
    +
    +
    +

    Observation lasts until observer is deallocated

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case observerLifetime
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + nextTransaction + +
    +
    +
    +
    +
    +
    +

    Observation lasts until the next transaction

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case nextTransaction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseLifetime + +
    +
    +
    +
    +
    +
    +

    Observation lasts until the database is closed

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case databaseLifetime
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseCollation.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseCollation.html new file mode 100644 index 000000000..35ce60cc5 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseCollation.html @@ -0,0 +1,1404 @@ + + + + DatabaseCollation Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseCollation

+
+
+
public final class DatabaseCollation
+
extension DatabaseCollation: Hashable
+ +
+
+

A Collation is a string comparison function used by SQLite.

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:function:) + +
    +
    +
    +
    +
    +
    +

    Creates a collation.

    +
    let collation = DatabaseCollation("localized_standard") { (string1, string2) in
    +    return (string1 as NSString).localizedStandardCompare(string2)
    +}
    +db.add(collation: collation)
    +try db.execute(sql: "CREATE TABLE file (name TEXT COLLATE localized_standard")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ name: String, function: @escaping (String, String) -> ComparisonResult)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    The function name.

    +
    +
    + + function + + +
    +

    A function that compares two strings.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SQLite Collations

+

+
+
+
    +
  • +
    + + + + unicodeCompare + +
    +
    +
    +
    +
    +
    +

    A collation, or SQL string comparison function, that compares strings +according to the the Swift built-in == and <= operators.

    + +

    This collation is automatically added by GRDB to your database +connections.

    + +

    You can use it when creating database tables:

    +
    let collationName = DatabaseCollation.caseInsensitiveCompare.name
    +dbQueue.execute(sql: """
    +    CREATE TABLE players (
    +      name TEXT COLLATE \(collationName)
    +    )
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let unicodeCompare: DatabaseCollation
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A collation, or SQL string comparison function, that compares strings +according to the the Swift built-in caseInsensitiveCompare(_:) method.

    + +

    This collation is automatically added by GRDB to your database +connections.

    + +

    You can use it when creating database tables:

    +
    let collationName = DatabaseCollation.caseInsensitiveCompare.name
    +dbQueue.execute(sql: """
    +    CREATE TABLE players (
    +      name TEXT COLLATE \(collationName)
    +    )
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let caseInsensitiveCompare: DatabaseCollation
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A collation, or SQL string comparison function, that compares strings +according to the the Swift built-in localizedCaseInsensitiveCompare(_:) method.

    + +

    This collation is automatically added by GRDB to your database +connections.

    + +

    You can use it when creating database tables:

    +
    let collationName = DatabaseCollation.localizedCaseInsensitiveCompare.name
    +dbQueue.execute(sql: """
    +    CREATE TABLE players (
    +      name TEXT COLLATE \(collationName)
    +    )
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let localizedCaseInsensitiveCompare: DatabaseCollation
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + localizedCompare + +
    +
    +
    +
    +
    +
    +

    A collation, or SQL string comparison function, that compares strings +according to the the Swift built-in localizedCompare(_:) method.

    + +

    This collation is automatically added by GRDB to your database +connections.

    + +

    You can use it when creating database tables:

    +
    let collationName = DatabaseCollation.localizedCompare.name
    +dbQueue.execute(sql: """
    +    CREATE TABLE players (
    +      name TEXT COLLATE \(collationName)
    +    )
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let localizedCompare: DatabaseCollation
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A collation, or SQL string comparison function, that compares strings +according to the the Swift built-in localizedStandardCompare(_:) method.

    + +

    This collation is automatically added by GRDB to your database +connections.

    + +

    You can use it when creating database tables:

    +
    let collationName = DatabaseCollation.localizedStandardCompare.name
    +dbQueue.execute(sql: """
    +    CREATE TABLE players (
    +      name TEXT COLLATE \(collationName)
    +    )
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let localizedStandardCompare: DatabaseCollation
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseFunction.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseFunction.html new file mode 100644 index 000000000..66433ed4e --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseFunction.html @@ -0,0 +1,1642 @@ + + + + DatabaseFunction Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseFunction

+
+
+
public final class DatabaseFunction : Hashable
+ +
+
+

An SQL function or aggregate.

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an SQL function.

    +
    let fn = DatabaseFunction("succ", argumentCount: 1) { dbValues in
    +    guard let int = Int.fromDatabaseValue(dbValues[0]) else {
    +        return nil
    +    }
    +    return int + 1
    +}
    +db.add(function: fn)
    +try Int.fetchOne(db, sql: "SELECT succ(1)")! // 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    _ name: String,
    +    argumentCount: Int32? = nil,
    +    pure: Bool = false,
    +    function: @escaping ([DatabaseValue]) throws -> DatabaseValueConvertible?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The function name.

    +
    +
    + + argumentCount + + +
    +

    The number of arguments of the function. If +omitted, or nil, the function accepts any number of arguments.

    +
    +
    + + pure + + +
    +

    Whether the function is “pure”, which means that its results +only depends on its inputs. When a function is pure, SQLite has +the opportunity to perform additional optimizations. Default value +is false.

    +
    +
    + + function + + +
    +

    A function that takes an array of DatabaseValue +arguments, and returns an optional DatabaseValueConvertible such +as Int, String, NSDate, etc. The array is guaranteed to have +exactly argumentCount elements, provided argumentCount is +not nil.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an SQL aggregate function.

    +
    struct MySum : DatabaseAggregate {
    +    var sum: Int = 0
    +
    +    mutating func step(_ dbValues: [DatabaseValue]) {
    +        if let int = Int.fromDatabaseValue(dbValues[0]) {
    +            sum += int
    +        }
    +    }
    +
    +    func finalize() -> DatabaseValueConvertible? {
    +        return sum
    +    }
    +}
    +
    +let dbQueue = DatabaseQueue()
    +let fn = DatabaseFunction("mysum", argumentCount: 1, aggregate: MySum.self)
    +dbQueue.add(function: fn)
    +try dbQueue.write { db in
    +    try db.execute(sql: "CREATE TABLE test(i)")
    +    try db.execute(sql: "INSERT INTO test(i) VALUES (1)")
    +    try db.execute(sql: "INSERT INTO test(i) VALUES (2)")
    +    try Int.fetchOne(db, sql: "SELECT mysum(i) FROM test")! // 3
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Aggregate: DatabaseAggregate>(
    +    _ name: String,
    +    argumentCount: Int32? = nil,
    +    pure: Bool = false,
    +    aggregate: Aggregate.Type)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + name + + +
    +

    The function name.

    +
    +
    + + argumentCount + + +
    +

    The number of arguments of the aggregate. If +omitted, or nil, the aggregate accepts any number of arguments.

    +
    +
    + + pure + + +
    +

    Whether the aggregate is “pure”, which means that its +results only depends on its inputs. When an aggregate is pure, +SQLite has the opportunity to perform additional optimizations. +Default value is false.

    +
    +
    + + aggregate + + +
    +

    A type that implements the DatabaseAggregate protocol. +For each step of the aggregation, its step method is called with +an array of DatabaseValue arguments. The array is guaranteed to +have exactly argumentCount elements, provided argumentCount is +not nil.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SQL Functions

+

+
+
+
    +
  • +
    + + + + capitalize + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in capitalized +String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +capitalized:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.capitalized)
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let capitalize: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lowercase + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in lowercased +String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +lowercased:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.lowercased())
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let lowercase: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + uppercase + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in uppercased +String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +uppercased:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.uppercased())
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let uppercase: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + localizedCapitalize + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in +localizedCapitalized String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +localizedCapitalized:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.localizedCapitalized)
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(iOS 9.0, OSX 10.11, watchOS 3.0, *)
    +public static let localizedCapitalize: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + localizedLowercase + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in +localizedLowercased String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +localizedLowercased:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.localizedLowercased)
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(iOS 9.0, OSX 10.11, watchOS 3.0, *)
    +public static let localizedLowercase: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + localizedUppercase + +
    +
    +
    +
    +
    +
    +

    An SQL function that returns the Swift built-in +localizedUppercased String property.

    + +

    The function returns NULL for non-strings values.

    + +

    This function is automatically added by GRDB to your database +connections. It is the function used by the query interface’s +localizedUppercased:

    +
    let nameColumn = Column("name")
    +let request = Player.select(nameColumn.localizedUppercased)
    +let names = try String.fetchAll(dbQueue, request)   // [String]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(iOS 9.0, OSX 10.11, watchOS 3.0, *)
    +public static let localizedUppercase: DatabaseFunction
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Custom Functions

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseFuture.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseFuture.html new file mode 100644 index 000000000..31b4a7e04 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseFuture.html @@ -0,0 +1,1127 @@ + + + + DatabaseFuture Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseFuture

+
+
+
public class DatabaseFuture<Value>
+ +
+
+

A future database value, returned by the DatabaseWriter.concurrentRead(_:) +method.

+
let futureCount: Future<Int> = try writer.writeWithoutTransaction { db in
+    try Player(...).insert()
+
+    // Count players concurrently
+    return writer.concurrentRead { db in
+        return try Player.fetchCount()
+    }
+}
+
+let count: Int = try futureCount.wait()
+
+ +
+
+
+
    +
  • +
    + + + + wait() + +
    +
    +
    +
    +
    +
    +

    Blocks the current thread until the value is available, and returns it.

    + +

    It is a programmer error to call this method several times.

    +
    +

    Throws

    + Any error that prevented the value from becoming available. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func wait() throws -> Value
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabasePool.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabasePool.html new file mode 100644 index 000000000..f340a3ace --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabasePool.html @@ -0,0 +1,2609 @@ + + + + DatabasePool Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabasePool

+
+
+
public final class DatabasePool : DatabaseWriter
+
extension DatabasePool: DatabaseReader
+ +
+
+

A DatabasePool grants concurrent accesses to an SQLite database.

+ +
+
+
+
+ + +
+ +

Database Information

+

+
+
+
    +
  • +
    + + + + path + +
    +
    +
    +
    +
    +
    +

    The path to the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var path: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var configuration: Configuration { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initializer

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Opens the SQLite database at path path.

    +
    let dbPool = try DatabasePool(path: "/path/to/database.sqlite")
    +
    + +

    Database connections get closed when the database pool gets deallocated.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(path: String, configuration: Configuration = Configuration()) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + path + + +
    +

    The path to the database file.

    +
    +
    + + configuration + + +
    +

    A configuration.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

WAL Checkpoints

+

+
+
+ +
+
+
+ + +
+ +

Memory management

+

+
+
+
    +
  • +
    + + + + releaseMemory() + +
    +
    +
    +
    +
    +
    +

    Free as much memory as possible.

    + +

    This method blocks the current thread until all database accesses +are completed.

    + +

    See also setupMemoryManagement(application:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func releaseMemory()
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Listens to UIApplicationDidEnterBackgroundNotification and +UIApplicationDidReceiveMemoryWarningNotification in order to release +as much memory as possible.

    + +
      +
    • param application: The UIApplication that will start a background +task to let the database pool release its memory when the application +enters background.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setupMemoryManagement(in application: UIApplication)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Interrupting Database Operations

+

+
+
+
    +
  • +
    + + + + interrupt() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func interrupt()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Reading from Database

+

+
+
+
    +
  • +
    + + + + read(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block in a protected dispatch queue, +and returns its result. The block is wrapped in a deferred transaction.

    +
    let players = try dbPool.read { db in
    +    try Player.fetchAll(...)
    +}
    +
    + +

    The block is completely isolated. Eventual concurrent database updates +are not visible inside the block:

    +
    try dbPool.read { db in
    +    // Those two values are guaranteed to be equal, even if the
    +    // `wine` table is modified between the two requests:
    +    let count1 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +    let count2 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +}
    +
    +try dbPool.read { db in
    +    // Now this value may be different:
    +    let count = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +}
    +
    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func read<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + asyncRead(_:) + +
    +
    +
    +
    +
    +
    +

    Asynchronously executes a read-only block in a protected dispatch queue.

    +
    let players = try dbQueue.asyncRead { result in
    +    do {
    +        let db = try result.get()
    +        let count = try Player.fetchCount(db)
    +    } catch {
    +        // Handle error
    +    }
    +}
    +
    + +

    Starting SQLite 3.8.0 (iOS 8.2+, OSX 10.10+, custom SQLite builds and +SQLCipher), attempts to write in the database from this method throw a +DatabaseError of resultCode SQLITE_READONLY.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncRead(_ block: @escaping (Result<Database, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + unsafeRead(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block in a protected dispatch queue, +and returns its result.

    + +

    The block argument is not isolated: eventual concurrent database updates +are visible inside the block:

    +
    try dbPool.unsafeRead { db in
    +    // Those two values may be different because some other thread
    +    // may have inserted or deleted a wine between the two requests:
    +    let count1 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +    let count2 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +}
    +
    + +

    Cursor iteration is safe, though:

    +
    try dbPool.unsafeRead { db in
    +    // No concurrent update can mess with this iteration:
    +    let rows = try Row.fetchCursor(db, sql: "SELECT ...")
    +    while let row = try rows.next() { ... }
    +}
    +
    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeRead<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block in a protected dispatch queue, +and returns its result.

    + +

    The block argument is not isolated: eventual concurrent database updates +are visible inside the block:

    +
    try dbPool.unsafeReentrantRead { db in
    +    // Those two values may be different because some other thread
    +    // may have inserted or deleted a wine between the two requests:
    +    let count1 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +    let count2 = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM wine")!
    +}
    +
    + +

    Cursor iteration is safe, though:

    +
    try dbPool.unsafeReentrantRead { db in
    +    // No concurrent update can mess with this iteration:
    +    let rows = try Row.fetchCursor(db, sql: "SELECT ...")
    +    while let row = try rows.next() { ... }
    +}
    +
    + +

    This method is reentrant. It is unsafe because it fosters dangerous +concurrency practices.

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeReentrantRead<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + concurrentRead(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func concurrentRead<T>(_ block: @escaping (Database) throws -> T) -> DatabaseFuture<T>
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously executes a read-only block in a protected dispatch queue.

    + +

    This method must be called from a writing dispatch queue, outside of any +transaction. You’ll get a fatal error otherwise.

    + +

    The block argument is guaranteed to see the database in the last +committed state at the moment this method is called. Eventual concurrent +database updates are not visible inside the block.

    + +

    This method returns as soon as the isolation guarantees described above +are established.

    + +

    In the example below, the number of players is fetched concurrently with +the player insertion. Yet the future is guaranteed to return zero:

    +
    try writer.asyncWriteWithoutTransaction { db in
    +    // Delete all players
    +    try Player.deleteAll()
    +
    +    // Count players concurrently
    +    writer.asyncConcurrentRead { result in
    +        do {
    +            let db = try result.get()
    +            // Guaranteed to be zero
    +            let count = try Player.fetchCount(db)
    +        } catch {
    +            // Handle error
    +        }
    +    }
    +
    +    // Insert a player
    +    try Player(...).insert(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncConcurrentRead(_ block: @escaping (Result<Database, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Invalidates open read-only SQLite connections.

    + +

    After this method is called, read-only database access methods will use +new SQLite connections.

    + +

    Eventual concurrent read-only accesses are not invalidated: they will +proceed until completion.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func invalidateReadOnlyConnections()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Writing in Database

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    + +

    Eventual concurrent database updates are postponed until the updates +are completed.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func writeWithoutTransaction<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A barrier write ensures that no database access is executed until all +previous accesses have completed, and the specified updates have been +executed.

    + +

    This method is not reentrant.

    +
    +

    Important

    + Reads executed by concurrent database snapshots are not +considered: they can run concurrently with the barrier updates. + +
    +

    Throws

    + The error thrown by the updates. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func barrierWriteWithoutTransaction<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction, and returns the result.

    + +

    If the updates throws an error, the transaction is rollbacked and the +error is rethrown. If the updates return .rollback, the transaction is +also rollbacked, but no error is thrown.

    + +

    Eventual concurrent database updates are postponed until the transaction +has completed.

    + +

    Eventual concurrent reads are guaranteed to not see any partial updates +of the database until the transaction has completed.

    + +

    This method is not reentrant.

    +
    try dbPool.writeInTransaction { db in
    +    db.execute(...)
    +    return .commit
    +}
    +
    +
    +

    Throws

    + The error thrown by the updates, or by the +wrapping transaction. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func writeInTransaction(
    +    _ kind: Database.TransactionKind? = nil,
    +    _ updates: (Database) throws -> Database.TransactionCompletion)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + kind + + +
    +

    The transaction type (default nil). If nil, the transaction +type is configuration.defaultTransactionKind, which itself +defaults to .deferred. See https://www.sqlite.org/lang_transaction.html +for more information.

    +
    +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    + +

    Eventual concurrent database updates are postponed until the updates +are completed.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +

    This method is reentrant. It should be avoided because it fosters +dangerous concurrency practices.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeReentrantWrite<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously executes database updates in a protected dispatch queue, +outside of any transaction.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncWriteWithoutTransaction(_ updates: @escaping (Database) -> Void)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Functions

+

+
+
+
    +
  • +
    + + + + add(function:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine an SQL function.

    +
    let fn = DatabaseFunction("succ", argumentCount: 1) { dbValues in
    +    guard let int = Int.fromDatabaseValue(dbValues[0]) else {
    +        return nil
    +    }
    +    return int + 1
    +}
    +dbPool.add(function: fn)
    +try dbPool.read { db in
    +    try Int.fetchOne(db, sql: "SELECT succ(1)") // 2
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(function:) + +
    +
    +
    +
    +
    +
    +

    Remove an SQL function.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Collations

+

+
+
+
    +
  • +
    + + + + add(collation:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine a collation.

    +
    let collation = DatabaseCollation("localized_standard") { (string1, string2) in
    +    return (string1 as NSString).localizedStandardCompare(string2)
    +}
    +dbPool.add(collation: collation)
    +try dbPool.write { db in
    +    try db.execute(sql: "CREATE TABLE file (name TEXT COLLATE LOCALIZED_STANDARD")
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(collation:) + +
    +
    +
    +
    +
    +
    +

    Remove a collation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Custom FTS5 Tokenizers

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +dbPool.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Snapshots

+

+
+
+
    +
  • +
    + + + + makeSnapshot() + +
    +
    +
    +
    +
    +
    +

    Creates a database snapshot.

    + +

    The snapshot sees an unchanging database content, as it existed at the +moment it was created.

    + +

    When you want to control the latest committed changes seen by a +snapshot, create it from the pool’s writer protected dispatch queue:

    +
    let snapshot1 = try dbPool.write { db -> DatabaseSnapshot in
    +    try Player.deleteAll()
    +    return try dbPool.makeSnapshot()
    +}
    +// <- Other threads may modify the database here
    +let snapshot2 = try dbPool.makeSnapshot()
    +
    +try snapshot1.read { db in
    +    // Guaranteed to be zero
    +    try Player.fetchCount(db)
    +}
    +
    +try snapshot2.read { db in
    +    // Could be anything
    +    try Player.fetchCount(db)
    +}
    +
    + +

    It is forbidden to create a snapshot from the writer protected dispatch +queue when a transaction is opened, though, because it is likely a +programmer error:

    +
    try dbPool.write { db in
    +    try db.inTransaction {
    +        try Player.deleteAll()
    +        // fatal error: makeSnapshot() must not be called from inside a transaction
    +        let snapshot = try dbPool.makeSnapshot()
    +        return .commit
    +    }
    +}
    +
    + +

    To avoid this fatal error, create the snapshot before or after the +transaction:

    +
    try dbPool.writeWithoutTransaction { db in
    +    // OK
    +    let snapshot = try dbPool.makeSnapshot()
    +
    +    try db.inTransaction {
    +        try Player.deleteAll()
    +        return .commit
    +    }
    +
    +    // OK
    +    let snapshot = try dbPool.makeSnapshot()
    +}
    +
    + +

    You can create as many snapshots as you need, regardless of the maximum +number of reader connections in the pool.

    + +

    For more information, read about “snapshot isolation” at https://sqlite.org/isolation.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeSnapshot() throws -> DatabaseSnapshot
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Memory management

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Listens to UIApplicationDidEnterBackgroundNotification and +UIApplicationDidReceiveMemoryWarningNotification in order to release +as much memory as possible.

    + +
      +
    • param application: The UIApplication that will start a background +task to let the database pool release its memory when the application +enters background.
    • +
    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Encryption

+

+
+
+
    +
  • +
    + + + + change(passphrase:) + +
    +
    +
    +
    +
    +
    +

    Changes the passphrase of an encrypted database

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use Database.changePassphrase(_:﹚ instead")
    +public func change(passphrase: String) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Custom FTS5 Tokenizers

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +dbPool.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add<Tokenizer>(tokenizer: Tokenizer.Type) where Tokenizer : FTS5CustomTokenizer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseQueue.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseQueue.html new file mode 100644 index 000000000..a51a61f6d --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseQueue.html @@ -0,0 +1,2167 @@ + + + + DatabaseQueue Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseQueue

+
+
+
public final class DatabaseQueue : DatabaseWriter
+ +
+
+

A DatabaseQueue serializes access to an SQLite database.

+ +
+
+
+
+ + +
+ +

Configuration

+

+
+
+
    +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The database configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var configuration: Configuration { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + path + +
    +
    +
    +
    +
    +
    +

    The path to the database file; it is “:memory:” for in-memory databases.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var path: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initializers

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Opens the SQLite database at path path.

    +
    let dbQueue = try DatabaseQueue(path: "/path/to/database.sqlite")
    +
    + +

    Database connections get closed when the database queue gets deallocated.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(path: String, configuration: Configuration = Configuration()) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + path + + +
    +

    The path to the database file.

    +
    +
    + + configuration + + +
    +

    A configuration.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(configuration:) + +
    +
    +
    +
    +
    +
    +

    Opens an in-memory SQLite database.

    +
    let dbQueue = DatabaseQueue()
    +
    + +

    Database memory is released when the database queue gets deallocated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(configuration: Configuration = Configuration())
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    A configuration.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Memory management

+

+
+
+
    +
  • +
    + + + + releaseMemory() + +
    +
    +
    +
    +
    +
    +

    Free as much memory as possible.

    + +

    This method blocks the current thread until all database accesses are completed.

    + +

    See also setupMemoryManagement(application:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func releaseMemory()
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Listens to UIApplicationDidEnterBackgroundNotification and +UIApplicationDidReceiveMemoryWarningNotification in order to release +as much memory as possible.

    + +
      +
    • param application: The UIApplication that will start a background +task to let the database queue release its memory when the application +enters background.
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setupMemoryManagement(in application: UIApplication)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Interrupting Database Operations

+

+
+
+
    +
  • +
    + + + + interrupt() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func interrupt()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Reading from Database

+

+
+
+
    +
  • +
    + + + + read(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block in a protected dispatch queue, +and returns its result.

    +
    let players = try dbQueue.read { db in
    +    try Player.fetchAll(db)
    +}
    +
    + +

    This method is not reentrant.

    + +

    Starting SQLite 3.8.0 (iOS 8.2+, OSX 10.10+, custom SQLite builds and +SQLCipher), attempts to write in the database from this method throw a +DatabaseError of resultCode SQLITE_READONLY.

    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func read<T>(_ block: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + asyncRead(_:) + +
    +
    +
    +
    +
    +
    +

    Asynchronously executes a read-only block in a protected dispatch queue.

    +
    let players = try dbQueue.asyncRead { result in
    +    do {
    +        let db = try result.get()
    +        let count = try Player.fetchCount(db)
    +    } catch {
    +        // Handle error
    +    }
    +}
    +
    + +

    Starting SQLite 3.8.0 (iOS 8.2+, OSX 10.10+, custom SQLite builds and +SQLCipher), attempts to write in the database from this method throw a +DatabaseError of resultCode SQLITE_READONLY.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncRead(_ block: @escaping (Result<Database, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + concurrentRead(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func concurrentRead<T>(_ block: @escaping (Database) throws -> T) -> DatabaseFuture<T>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Writing in Database

+

+
+
+
    +
  • +
    + + + + inTransaction(_:_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction, and returns the result.

    + +

    If the updates throws an error, the transaction is rollbacked and the +error is rethrown. If the updates return .rollback, the transaction is +also rollbacked, but no error is thrown.

    + +

    Eventual concurrent database accesses are postponed until the +transaction has completed.

    + +

    This method is not reentrant.

    +
    try dbQueue.writeInTransaction { db in
    +    db.execute(...)
    +    return .commit
    +}
    +
    +
    +

    Throws

    + The error thrown by the updates, or by the +wrapping transaction. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func inTransaction(
    +    _ kind: Database.TransactionKind? = nil,
    +    _ updates: (Database) throws -> Database.TransactionCompletion)
    +    throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + kind + + +
    +

    The transaction type (default nil). If nil, the transaction +type is configuration.defaultTransactionKind, which itself +defaults to .deferred. See https://www.sqlite.org/lang_transaction.html +for more information.

    +
    +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    + +

    Eventual concurrent database accesses are postponed until the updates +are completed.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func writeWithoutTransaction<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + inDatabase(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    +
    // INSERT INTO player ...
    +let players = try dbQueue.inDatabase { db in
    +    try Player(...).insert(db)
    +}
    +
    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func inDatabase<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, and +returns the result.

    +
    // INSERT INTO player ...
    +try dbQueue.unsafeReentrantWrite { db in
    +    try Player(...).insert(db)
    +}
    +
    + +

    This method is reentrant. It is unsafe because it fosters dangerous +concurrency practices.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeReentrantWrite<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously executes database updates in a protected dispatch queue, +outside of any transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncWriteWithoutTransaction(_ updates: @escaping (Database) -> Void)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Functions

+

+
+
+
    +
  • +
    + + + + add(function:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine an SQL function.

    +
    let fn = DatabaseFunction("succ", argumentCount: 1) { dbValues in
    +    guard let int = Int.fromDatabaseValue(dbValues[0]) else {
    +        return nil
    +    }
    +    return int + 1
    +}
    +dbQueue.add(function: fn)
    +try dbQueue.read { db in
    +    try Int.fetchOne(db, sql: "SELECT succ(1)") // 2
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(function:) + +
    +
    +
    +
    +
    +
    +

    Remove an SQL function.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Collations

+

+
+
+
    +
  • +
    + + + + add(collation:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine a collation.

    +
    let collation = DatabaseCollation("localized_standard") { (string1, string2) in
    +    return (string1 as NSString).localizedStandardCompare(string2)
    +}
    +dbQueue.add(collation: collation)
    +try dbQueue.write { db in
    +    try db.execute(sql: "CREATE TABLE file (name TEXT COLLATE LOCALIZED_STANDARD")
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(collation:) + +
    +
    +
    +
    +
    +
    +

    Remove a collation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func remove(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Memory management

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Listens to UIApplicationDidEnterBackgroundNotification and +UIApplicationDidReceiveMemoryWarningNotification in order to release +as much memory as possible.

    + +
      +
    • param application: The UIApplication that will start a background +task to let the database queue release its memory when the application +enters background.
    • +
    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Encryption

+

+
+
+
    +
  • +
    + + + + change(passphrase:) + +
    +
    +
    +
    +
    +
    +

    Changes the passphrase of an encrypted database

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use Database.changePassphrase(_:﹚ instead")
    +public func change(passphrase: String) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Custom FTS5 Tokenizers

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +dbQueue.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add<Tokenizer>(tokenizer: Tokenizer.Type) where Tokenizer : FTS5CustomTokenizer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseSnapshot.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseSnapshot.html new file mode 100644 index 000000000..3138854ba --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/DatabaseSnapshot.html @@ -0,0 +1,1502 @@ + + + + DatabaseSnapshot Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseSnapshot

+
+
+
public class DatabaseSnapshot : DatabaseReader
+ +
+
+

A DatabaseSnapshot sees an unchanging database content, as it existed at the +moment it was created.

+ +

See DatabasePool.makeSnapshot()

+ +

For more information, read about “snapshot isolation” at https://sqlite.org/isolation.html

+ +
+
+
+
    +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The database configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var configuration: Configuration { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Interrupting Database Operations

+

+
+
+
    +
  • +
    + + + + interrupt() + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func interrupt()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Reading from Database

+

+
+
+
    +
  • +
    + + + + read(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block that takes a database +connection, and returns its result.

    +
    let players = try snapshot.read { db in
    +    try Player.fetchAll(...)
    +}
    +
    +
    +

    Throws

    + The error thrown by the block. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func read<T>(_ block: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + asyncRead(_:) + +
    +
    +
    +
    +
    +
    +

    Asynchronously executes a read-only block in a protected dispatch queue.

    +
    let players = try snapshot.asyncRead { result in
    +    do {
    +        let db = try result.get()
    +        let count = try Player.fetchCount(db)
    +    } catch {
    +        // Handle error
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asyncRead(_ block: @escaping (Result<Database, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Functions

+

+
+
+ +
+
+
+ + +
+ +

Collations

+

+
+
+ +
+
+
+ + +
+ +

Value Observation

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS3TableDefinition.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS3TableDefinition.html new file mode 100644 index 000000000..a026aee66 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS3TableDefinition.html @@ -0,0 +1,1174 @@ + + + + FTS3TableDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS3TableDefinition

+
+
+
public final class FTS3TableDefinition
+ +
+
+

The FTS3TableDefinition class lets you define columns of a FTS3 virtual table.

+ +

You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

+
try db.create(virtualTable: "document", using: FTS3()) { t in // t is FTS3TableDefinition
+    t.column("content")
+}
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS4ColumnDefinition.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS4ColumnDefinition.html new file mode 100644 index 000000000..709ab28aa --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS4ColumnDefinition.html @@ -0,0 +1,1172 @@ + + + + FTS4ColumnDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS4ColumnDefinition

+
+
+
public final class FTS4ColumnDefinition
+ +
+
+

The FTS4ColumnDefinition class lets you refine a column of an FTS4 +virtual table.

+ +

You get instances of this class when you create an FTS4 table:

+
try db.create(virtualTable: "document", using: FTS4()) { t in
+    t.column("content")      // FTS4ColumnDefinition
+}
+
+ +

See https://www.sqlite.org/fts3.html

+ +
+
+
+
    +
  • +
    + + + + notIndexed() + +
    +
    +
    +
    +
    +
    +

    Excludes the column from the full-text index.

    +
    try db.create(virtualTable: "document", using: FTS4()) { t in
    +    t.column("a")
    +    t.column("b").notIndexed()
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#the_notindexed_option

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +@discardableResult
    +public func notIndexed() -> Self
    + +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + asLanguageId() + +
    +
    +
    +
    +
    +
    +

    Uses the column as the Int32 language id hidden column.

    +
    try db.create(virtualTable: "document", using: FTS4()) { t in
    +    t.column("a")
    +    t.column("lid").asLanguageId()
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#the_languageid_option

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func asLanguageId() -> Self
    + +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS4TableDefinition.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS4TableDefinition.html new file mode 100644 index 000000000..d0c03398f --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS4TableDefinition.html @@ -0,0 +1,1387 @@ + + + + FTS4TableDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS4TableDefinition

+
+
+
public final class FTS4TableDefinition
+ +
+
+

The FTS4TableDefinition class lets you define columns of a FTS4 virtual table.

+ +

You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

+
try db.create(virtualTable: "document", using: FTS4()) { t in // t is FTS4TableDefinition
+    t.column("content")
+}
+
+ +

See https://www.sqlite.org/fts3.html

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS5ColumnDefinition.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS5ColumnDefinition.html new file mode 100644 index 000000000..285d3774b --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS5ColumnDefinition.html @@ -0,0 +1,1129 @@ + + + + FTS5ColumnDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5ColumnDefinition

+
+
+
public final class FTS5ColumnDefinition
+ +
+
+

The FTS5ColumnDefinition class lets you refine a column of an FTS5 +virtual table.

+ +

You get instances of this class when you create an FTS5 table:

+
try db.create(virtualTable: "document", using: FTS5()) { t in
+    t.column("content")      // FTS5ColumnDefinition
+}
+
+ +

See https://www.sqlite.org/fts5.html

+ +
+
+
+
    +
  • +
    + + + + notIndexed() + +
    +
    +
    +
    +
    +
    +

    Excludes the column from the full-text index.

    +
    try db.create(virtualTable: "document", using: FTS5()) { t in
    +    t.column("a")
    +    t.column("b").notIndexed()
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html#the_unindexed_column_option

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func notIndexed() -> Self
    + +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS5TableDefinition.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS5TableDefinition.html new file mode 100644 index 000000000..9d1e485b0 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FTS5TableDefinition.html @@ -0,0 +1,1388 @@ + + + + FTS5TableDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5TableDefinition

+
+
+
public final class FTS5TableDefinition
+ +
+
+

The FTS5TableDefinition class lets you define columns of a FTS5 virtual table.

+ +

You don’t create instances of this class. Instead, you use the Database +create(virtualTable:using:) method:

+
try db.create(virtualTable: "document", using: FTS5()) { t in // t is FTS5TableDefinition
+    t.column("content")
+}
+
+ +

See https://www.sqlite.org/fts5.html

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FetchedRecordsController.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FetchedRecordsController.html new file mode 100644 index 000000000..0c6395cda --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/FetchedRecordsController.html @@ -0,0 +1,2254 @@ + + + + FetchedRecordsController Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FetchedRecordsController

+
+
+
public final class FetchedRecordsController<Record> where Record : FetchableRecord
+ +
+
+

You use FetchedRecordsController to track changes in the results of an +SQLite request.

+ +

See https://github.com/groue/GRDB.swift#fetchedrecordscontroller for +more information.

+ +
+
+
+
+ + +
+ +

Initialization

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a fetched records controller initialized from a SQL query and +its eventual arguments.

    +
    let controller = FetchedRecordsController<Wine>(
    +    dbQueue,
    +    sql: "SELECT * FROM wine WHERE color = ? ORDER BY name",
    +    arguments: [Color.red],
    +    isSameRecord: { (wine1, wine2) in wine1.id == wine2.id })
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ databaseWriter: DatabaseWriter,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil,
    +    queue: DispatchQueue = .main,
    +    isSameRecord: ((Record, Record) -> Bool)? = nil) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + databaseWriter + + +
    +

    A DatabaseWriter (DatabaseQueue, or DatabasePool)

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    + + queue + + +
    +

    A serial dispatch queue (defaults to the main queue)

    + +

    The fetched records controller tracking callbacks will be +notified of changes in this queue. The controller itself must be +used from this queue.

    +
    +
    + + isSameRecord + + +
    +

    Optional function that compares two records.

    + +

    This function should return true if the two records have the +same identity. For example, they have the same id.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a fetched records controller initialized from a fetch request +from the Query Interface.

    +
    let request = Wine.order(Column("name"))
    +let controller = FetchedRecordsController(
    +    dbQueue,
    +    request: request,
    +    isSameRecord: { (wine1, wine2) in wine1.id == wine2.id })
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init<Request>(
    +    _ databaseWriter: DatabaseWriter,
    +    request: Request,
    +    queue: DispatchQueue = .main,
    +    isSameRecord: ((Record, Record) -> Bool)? = nil) throws
    +    where Request: FetchRequest, Request.RowDecoder == Record
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + databaseWriter + + +
    +

    A DatabaseWriter (DatabaseQueue, or DatabasePool)

    +
    +
    + + request + + +
    +

    A fetch request.

    +
    +
    + + queue + + +
    +

    A serial dispatch queue (defaults to the main queue)

    + +

    The fetched records controller tracking callbacks will be +notified of changes in this queue. The controller itself must be +used from this queue.

    +
    +
    + + isSameRecord + + +
    +

    Optional function that compares two records.

    + +

    This function should return true if the two records have the +same identity. For example, they have the same id.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + performFetch() + +
    +
    +
    +
    +
    +
    +

    Executes the controller’s fetch request.

    + +

    After executing this method, you can access the the fetched objects with +the fetchedRecords property.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func performFetch() throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Configuration

+

+
+
+
    +
  • +
    + + + + databaseWriter + +
    +
    +
    +
    +
    +
    +

    The database writer used to fetch records.

    + +

    The controller registers as a transaction observer in order to respond +to changes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let databaseWriter: DatabaseWriter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + queue + +
    +
    +
    +
    +
    +
    +

    The dispatch queue on which the controller must be used.

    + +

    Unless specified otherwise at initialization time, it is the main queue.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let queue: DispatchQueue
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + setRequest(_:) + +
    +
    +
    +
    +
    +
    +

    Updates the fetch request, and eventually notifies the tracking +callbacks if performFetch() has been called.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setRequest<Request>(_ request: Request)
    +    throws
    +    where Request: FetchRequest, Request.RowDecoder == Record
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Updates the fetch request, and eventually notifies the tracking +callbacks if performFetch() has been called.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func setRequest(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers changes notification callbacks.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func trackChanges(
    +    willChange: ((FetchedRecordsController<Record>) -> Void)? = nil,
    +    onChange: ((FetchedRecordsController<Record>, Record, FetchedRecordChange) -> Void)? = nil,
    +    didChange: ((FetchedRecordsController<Record>) -> Void)? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + willChange + + +
    +

    Invoked before records are updated.

    +
    +
    + + onChange + + +
    +

    Invoked for each record that has been added, +removed, moved, or updated.

    +
    +
    + + didChange + + +
    +

    Invoked after records have been updated.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers changes notification callbacks.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func trackChanges<T>(
    +    fetchAlongside: @escaping (Database) throws -> T,
    +    willChange: ((FetchedRecordsController<Record>, _ fetchedAlongside: T) -> Void)? = nil,
    +    onChange: ((FetchedRecordsController<Record>, Record, FetchedRecordChange) -> Void)? = nil,
    +    didChange: ((FetchedRecordsController<Record>, _ fetchedAlongside: T) -> Void)? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + fetchAlongside + + +
    +

    The value returned from this closure is given to +willChange and didChange callbacks, as their +fetchedAlongside argument. The closure is guaranteed to see the +database in the state it has just after eventual changes to the +fetched records have been performed. Use it in order to fetch +values that must be consistent with the fetched records.

    +
    +
    + + willChange + + +
    +

    Invoked before records are updated.

    +
    +
    + + onChange + + +
    +

    Invoked for each record that has been added, +removed, moved, or updated.

    +
    +
    + + didChange + + +
    +

    Invoked after records have been updated.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + trackErrors(_:) + +
    +
    +
    +
    +
    +
    +

    Registers an error callback.

    + +

    Whenever the controller could not look for changes after a transaction +has potentially modified the tracked request, this error handler is +called.

    + +

    The request observation is not stopped, though: future transactions may +successfully be handled, and the notified changes will then be based on +the last successful fetch.

    + +

    This method must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func trackErrors(_ errorHandler: @escaping (FetchedRecordsController<Record>, Error) -> Void)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Call this method when changes performed while the application is +in the background should be processed before the application enters the +suspended state.

    + +

    Whenever the tracked request is changed, the fetched records controller +sets up a background task using +UIApplication.beginBackgroundTask(expirationHandler:) which is ended +after the didChange callback has completed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func allowBackgroundChangesTracking(in application: UIApplication)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Accessing Records

+

+
+
+
    +
  • +
    + + + + fetchedRecords + +
    +
    +
    +
    +
    +
    +

    The fetched records.

    + +

    The value of this property is nil until performFetch() has been called.

    + +

    The records reflect the state of the database after the initial +call to performFetch, and after each database transaction that affects +the results of the fetch request.

    + +

    This property must be used from the controller’s dispatch queue (the +main queue unless stated otherwise in the controller’s initializer).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var fetchedRecords: [Record] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Configuration

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Call this method when changes performed while the application is +in the background should be processed before the application enters the +suspended state.

    + +

    Whenever the tracked request is changed, the fetched records controller +sets up a background task using +UIApplication.beginBackgroundTask(expirationHandler:) which is ended +after the didChange callback has completed.

    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Accessing Records

+

+
+
+
    +
  • +
    + + + + record(at:) + +
    +
    +
    +
    +
    +
    +

    Returns the object at the given index path.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func record(at indexPath: IndexPath) -> Record
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + indexPath + + +
    +

    An index path in the fetched records.

    + +

    If indexPath does not describe a valid index path in the fetched +records, a fatal error is raised.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Querying Sections Information

+

+
+
+
    +
  • +
    + + + + sections + +
    +
    +
    +
    +
    +
    +

    The sections for the fetched records.

    + +

    You typically use the sections array when implementing +UITableViewDataSource methods, such as numberOfSectionsInTableView.

    + +

    The sections array is never empty, even when there are no fetched +records. In this case, there is a single empty section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sections: [FetchedRecordsSectionInfo<Record>] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initialization

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a fetched records controller initialized from a SQL query and +its eventual arguments.

    +
    let controller = FetchedRecordsController<Wine>(
    +    dbQueue,
    +    sql: "SELECT * FROM wine WHERE color = ? ORDER BY name",
    +    arguments: [Color.red])
    +
    + +

    The records are compared by primary key (single-column primary key, +compound primary key, or implicit rowid). For a database table which +has an id primary key, this initializer is equivalent to:

    +
    // Assuming the wine table has an `id` primary key:
    +let controller = FetchedRecordsController<Wine>(
    +    dbQueue,
    +    sql: "SELECT * FROM wine WHERE color = ? ORDER BY name",
    +    arguments: [Color.red],
    +    isSameRecord: { (wine1, wine2) in wine1.id == wine2.id })
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(
    +    _ databaseWriter: DatabaseWriter,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil,
    +    queue: DispatchQueue = .main) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + databaseWriter + + +
    +

    A DatabaseWriter (DatabaseQueue, or DatabasePool)

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    + + queue + + +
    +

    A serial dispatch queue (defaults to the main queue)

    + +

    The fetched records controller tracking callbacks will be +notified of changes in this queue. The controller itself must be +used from this queue.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a fetched records controller initialized from a fetch request +from the Query Interface.

    +
    let request = Wine.order(Column("name"))
    +let controller = FetchedRecordsController(
    +    dbQueue,
    +    request: request)
    +
    + +

    The records are compared by primary key (single-column primary key, +compound primary key, or implicit rowid). For a database table which +has an id primary key, this initializer is equivalent to:

    +
    // Assuming the wine table has an `id` primary key:
    +let controller = FetchedRecordsController<Wine>(
    +    dbQueue,
    +    request: request,
    +    isSameRecord: { (wine1, wine2) in wine1.id == wine2.id })
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init<Request>(
    +    _ databaseWriter: DatabaseWriter,
    +    request: Request,
    +    queue: DispatchQueue = .main) throws
    +    where Request: FetchRequest, Request.RowDecoder == Record
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + databaseWriter + + +
    +

    A DatabaseWriter (DatabaseQueue, or DatabasePool)

    +
    +
    + + request + + +
    +

    A fetch request.

    +
    +
    + + queue + + +
    +

    A serial dispatch queue (defaults to the main queue)

    + +

    The fetched records controller tracking callbacks will be +notified of changes in this queue. The controller itself must be +used from this queue.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Record: EncodableRecord

+

+
+
+
    +
  • +
    + + + + indexPath(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the indexPath of a given record.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func indexPath(for record: Record) -> IndexPath?
    + +
    +
    +
    +

    Return Value

    +

    The index path of record in the fetched records, or nil +if record could not be found.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Record.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Record.html new file mode 100644 index 000000000..ded7e39f4 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Record.html @@ -0,0 +1,1934 @@ + + + + Record Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Record

+
+
+
open class Record : FetchableRecord, TableRecord, PersistableRecord
+ +
+
+

Record is a class that wraps a table row, or the result of any query. It is +designed to be subclassed.

+ +
+
+
+
+ + +
+ +

Initializers

+

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a Record.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(row:) + +
    +
    +
    +
    +
    +
    +

    Creates a Record from a row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public required init(row: Row)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Core methods

+

+
+
+
    +
  • +
    + + + + databaseTableName + +
    +
    +
    +
    +
    +
    +

    The name of a database table.

    + +

    This table name is required by the insert, update, save, delete, +and exists methods.

    +
    class Player : Record {
    +    override class var databaseTableName: String {
    +        return "player"
    +    }
    +}
    +
    + +

    The implementation of the base class Record raises a fatal error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class var databaseTableName: String { get }
    + +
    +
    +
    +

    Return Value

    +

    The name of a database table.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The policy that handles SQLite conflicts when records are inserted +or updated.

    + +

    This property is optional: its default value uses the ABORT policy +for both insertions and updates, and has GRDB generate regular +INSERT and UPDATE queries.

    + +

    If insertions are resolved with .ignore policy, the +didInsert(with:for:) method is not called upon successful insertion, +even if a row was actually inserted without any conflict.

    + +

    See https://www.sqlite.org/lang_conflict.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class var persistenceConflictPolicy: PersistenceConflictPolicy { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseSelection + +
    +
    +
    +
    +
    +
    +

    The default request selection.

    + +

    Unless this method is overriden, requests select all columns:

    +
    // SELECT * FROM player
    +try Player.fetchAll(db)
    +
    + +

    You can override this property and provide an explicit list +of columns:

    +
    class RestrictedPlayer : Record {
    +    override static var databaseSelection: [SQLSelectable] {
    +        return [Column("id"), Column("name")]
    +    }
    +}
    +
    +// SELECT id, name FROM player
    +try RestrictedPlayer.fetchAll(db)
    +
    + +

    You can also add extra columns such as the rowid column:

    +
    class ExtendedPlayer : Player {
    +    override static var databaseSelection: [SQLSelectable] {
    +        return [AllColumns(), Column.rowID]
    +    }
    +}
    +
    +// SELECT *, rowid FROM player
    +try ExtendedPlayer.fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class var databaseSelection: [SQLSelectable] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + encode(to:) + +
    +
    +
    +
    +
    +
    +

    Defines the values persisted in the database.

    + +

    Store in the container argument all values that should be stored in +the columns of the database table (see Record.databaseTableName()).

    + +

    Primary key columns, if any, must be included.

    +
    class Player : Record {
    +    var id: Int64?
    +    var name: String?
    +
    +    override func encode(to container: inout PersistenceContainer) {
    +        container["id"] = id
    +        container["name"] = name
    +    }
    +}
    +
    + +

    The implementation of the base class Record does not store any value in +the container.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func encode(to container: inout PersistenceContainer)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + didInsert(with:for:) + +
    +
    +
    +
    +
    +
    +

    Notifies the record that it was succesfully inserted.

    + +

    Do not call this method directly: it is called for you, in a protected +dispatch queue, with the inserted RowID and the eventual +INTEGER PRIMARY KEY column name.

    + +

    The implementation of the base Record class does nothing.

    +
    class Player : Record {
    +    var id: Int64?
    +    var name: String?
    +
    +    func didInsert(with rowID: Int64, for column: String?) {
    +        id = rowID
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func didInsert(with rowID: Int64, for column: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + rowID + + +
    +

    The inserted rowID.

    +
    +
    + + column + + +
    +

    The name of the eventual INTEGER PRIMARY KEY column.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Copy

+

+
+
+
    +
  • +
    + + + + copy() + +
    +
    +
    +
    +
    +
    +

    Returns a copy of self, initialized from all values encoded in the +encode(to:) method.

    + +

    The eventual primary key is copied, as well as the +hasDatabaseChanges flag.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func copy() -> Self
    + +
    +
    +
    +

    Return Value

    +

    A copy of self.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Compare with Previous Versions

+

+
+
+
    +
  • +
    + + + + hasDatabaseChanges + +
    +
    +
    +
    +
    +
    +

    A boolean that indicates whether the record has changes that have not +been saved.

    + +

    This flag is purely informative, and does not prevent insert(), +update(), and save() from performing their database queries.

    + +

    A record is edited if has been changed since last database +synchronization (fetch, update, insert). Comparison +is performed between values (values stored in the encode(to:) +method, and values loaded from the database). Property setters do not +trigger this flag.

    + +

    You can rely on the Record base class to compute this flag for you, or +you may set it to true or false when you know better. Setting it to +false does not prevent it from turning true on subsequent modifications +of the record.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var hasDatabaseChanges: Bool { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseChanges + +
    +
    +
    +
    +
    +
    +

    A dictionary of changes that have not been saved.

    + +

    Its keys are column names, and values the old values that have been +changed since last fetching or saving of the record.

    + +

    Unless the record has actually been fetched or saved, the old values +are nil.

    + +

    See hasDatabaseChanges for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseChanges: [String : DatabaseValue?] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

CRUD

+

+
+
+
    +
  • +
    + + + + insert(_:) + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT statement.

    + +

    On success, this method sets the hasDatabaseChanges flag to false.

    + +

    This method is guaranteed to have inserted a row in the database if it +returns without error.

    + +

    Records whose primary key is declared as “INTEGER PRIMARY KEY” have +their id automatically set after successful insertion, if it was nil +before the insertion.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func insert(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + update(_:columns:) + +
    +
    +
    +
    +
    +
    +

    Executes an UPDATE statement.

    + +

    On success, this method sets the hasDatabaseChanges flag to false.

    + +

    This method is guaranteed to have updated a row in the database if it +returns without error.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database and record could not be updated. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open func update(_ db: Database, columns: Set<String>) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + columns + + +
    +

    The columns to update.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + updateChanges(_:) + +
    +
    +
    +
    +
    +
    +

    If the record has been changed, executes an UPDATE statement so that +those changes and only those changes are saved in the database.

    + +

    On success, this method sets the hasDatabaseChanges flag to false.

    + +

    This method is guaranteed to have saved the eventual changes in the +database if it returns without error.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database and record could not be updated. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public final func updateChanges(_ db: Database) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + columns + + +
    +

    The columns to update.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the record had changes.

    +
    + +
    +
    +
  • +
  • +
    + + + + save(_:) + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT or an UPDATE statement so that self is saved in +the database.

    + +

    If the record has a non-nil primary key and a matching row in the +database, this method performs an update.

    + +

    Otherwise, performs an insert.

    + +

    On success, this method sets the hasDatabaseChanges flag to false.

    + +

    This method is guaranteed to have inserted or updated a row in the +database if it returns without error.

    + +

    You can’t override this method. Instead, override insert(_:) +or update(_:columns:).

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs, or errors +thrown by update(). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final func save(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + delete(_:) + +
    +
    +
    +
    +
    +
    +

    Executes a DELETE statement.

    + +

    On success, this method sets the hasDatabaseChanges flag to true.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +open func delete(_ db: Database) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether a database row was deleted.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row.html new file mode 100644 index 000000000..17fc62319 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row.html @@ -0,0 +1,3798 @@ + + + + Row Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Row

+
+
+
public final class Row: Equatable, Hashable, RandomAccessCollection,
+    ExpressibleByDictionaryLiteral, CustomStringConvertible,
+    CustomDebugStringConvertible
+ +
+
+

A database row.

+ +
+
+
+
    +
  • +
    + + + + count + +
    +
    +
    +
    +
    +
    +

    The number of columns in the row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let count: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + prefetchedRows + +
    +
    +
    +
    +
    +
    +

    A view on the prefetched associated rows.

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row)
    +// Prints [id:1 name:"Herman Melville"]
    +
    +let bookRows = row.prefetchedRows["books"]
    +print(bookRows[0])
    +// Prints [id:42 title:"Moby-Dick"]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var prefetchedRows: Row.PrefetchedRowsView
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Building rows

+

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates an empty row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a row from a dictionary of values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(_ dictionary: [String : DatabaseValueConvertible?])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a row from [AnyHashable: Any].

    + +

    The result is nil unless all dictionary keys are strings, and values +adopt DatabaseValueConvertible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init?(_ dictionary: [AnyHashable : Any])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + copy() + +
    +
    +
    +
    +
    +
    +

    Returns an immutable copy of the row.

    + +

    For performance reasons, rows fetched from a cursor are reused during +the iteration of a query: make sure to make a copy of it whenever you +want to keep a specific one: row.copy().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func copy() -> Row
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Columns

+

+
+
+
    +
  • +
    + + + + columnNames + +
    +
    +
    +
    +
    +
    +

    The names of columns in the row.

    + +

    Columns appear in the same order as they occur as the .0 member +of column-value pairs in self.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var columnNames: LazyMapCollection<Row, String> { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasColumn(_:) + +
    +
    +
    +
    +
    +
    +

    Returns true if and only if the row has that column.

    + +

    This method is case-insensitive.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasColumn(_ columnName: String) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Extracting Values

+

+
+
+
    +
  • +
    + + + + containsNonNullValue + +
    +
    +
    +
    +
    +
    +

    Returns true if and only if one column contains a non-null value, or if +the row was fetched with a row adapter that defines a scoped row that +contains a non-null value.

    + +

    For example:

    +
    let row = try Row.fetchOne(db, sql: "SELECT 'foo', 1")!
    +row.containsNonNullValue // true
    +
    +let row = try Row.fetchOne(db, sql: "SELECT NULL, NULL")!
    +row.containsNonNullValue // false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var containsNonNullValue: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasNull(atIndex:) + +
    +
    +
    +
    +
    +
    +

    Returns true if the row contains null at given index.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    This method is equivalent to row[index] == nil, but may be preferred +in performance-critical code because it can avoid decoding database +values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasNull(atIndex index: Int) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns Int64, Double, String, Data or nil, depending on the value +stored at the given index.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(index: Int) -> DatabaseValueConvertible? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given index, converted to the requested type.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    If the SQLite value is NULL, the result is nil. Otherwise the SQLite +value is converted to the requested type Value. Should this conversion +fail, a fatal error is raised.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(index: Int) -> Value? where Value : DatabaseValueConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given index, converted to the requested type.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    If the SQLite value is NULL, the result is nil. Otherwise the SQLite +value is converted to the requested type Value. Should this conversion +fail, a fatal error is raised.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(index: Int) -> Value? where Value : DatabaseValueConvertible, Value : StatementColumnConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given index, converted to the requested type.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(index: Int) -> Value where Value : DatabaseValueConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given index, converted to the requested type.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(index: Int) -> Value where Value : DatabaseValueConvertible, Value : StatementColumnConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns Int64, Double, String, Data or nil, depending on the value +stored at the given column.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    The result is nil if the row does not contain the column.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(columnName: String) -> DatabaseValueConvertible? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. Otherwise the SQLite value is converted to the requested type +Value. Should this conversion fail, a fatal error is raised.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(columnName: String) -> Value? where Value : DatabaseValueConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. Otherwise the SQLite value is converted to the requested type +Value. Should this conversion fail, a fatal error is raised.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(columnName: String) -> Value? where Value : DatabaseValueConvertible, Value : StatementColumnConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the row does not contain the column, a fatal error is raised.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(columnName: String) -> Value where Value : DatabaseValueConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the row does not contain the column, a fatal error is raised.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value>(columnName: String) -> Value where Value : DatabaseValueConvertible, Value : StatementColumnConvertible { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns Int64, Double, String, NSData or nil, depending on the value +stored at the given column.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    The result is nil if the row does not contain the column.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Column>(column: Column) -> DatabaseValueConvertible? where Column : ColumnExpression { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. Otherwise the SQLite value is converted to the requested type +Value. Should this conversion fail, a fatal error is raised.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value, Column>(column: Column) -> Value? where Value : DatabaseValueConvertible, Column : ColumnExpression { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. Otherwise the SQLite value is converted to the requested type +Value. Should this conversion fail, a fatal error is raised.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value, Column>(_ column: Column)
    +    -> Value?
    +    where
    +    Value: DatabaseValueConvertible & StatementColumnConvertible,
    +    Column: ColumnExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the row does not contain the column, a fatal error is raised.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value, Column>(column: Column) -> Value where Value : DatabaseValueConvertible, Column : ColumnExpression { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the value at given column, converted to the requested type.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the row does not contain the column, a fatal error is raised.

    + +

    This method crashes if the fetched SQLite value is NULL, or if the +SQLite value can not be converted to Value.

    + +

    This method exists as an optimization opportunity for types that adopt +StatementColumnConvertible. It may trigger SQLite built-in conversions +(see https://www.sqlite.org/datatype3.html).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Value, Column>(_ column: Column)
    +    -> Value
    +    where
    +    Value: DatabaseValueConvertible & StatementColumnConvertible,
    +    Column: ColumnExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dataNoCopy(atIndex:) + +
    +
    +
    +
    +
    +
    +

    Returns the optional Data at given index.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    If the SQLite value is NULL, the result is nil. If the SQLite value can +not be converted to Data, a fatal error is raised.

    + +

    The returned data does not owns its bytes: it must not be used longer +than the row’s lifetime.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dataNoCopy(atIndex index: Int) -> Data?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dataNoCopy(named:) + +
    +
    +
    +
    +
    +
    +

    Returns the optional Data at given column.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. If the SQLite value can not be converted to Data, a fatal error +is raised.

    + +

    The returned data does not owns its bytes: it must not be used longer +than the row’s lifetime.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dataNoCopy(named columnName: String) -> Data?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + dataNoCopy(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the optional NSData at given column.

    + +

    Column name lookup is case-insensitive, and when several columns have +the same name, the leftmost column is considered.

    + +

    If the column is missing or if the SQLite value is NULL, the result is +nil. If the SQLite value can not be converted to NSData, a fatal error +is raised.

    + +

    The returned data does not owns its bytes: it must not be used longer +than the row’s lifetime.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dataNoCopy<Column>(_ column: Column) -> Data? where Column : ColumnExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Extracting DatabaseValue

+

+
+
+
    +
  • +
    + + + + databaseValues + +
    +
    +
    +
    +
    +
    +

    The database values in the row.

    + +

    Values appear in the same order as they occur as the .1 member +of column-value pairs in self.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValues: LazyMapCollection<Row, DatabaseValue> { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Extracting Records

+

+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the record associated with the given scope.

    + +

    For example:

    +
    let request = Book.including(required: Book.author)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Book(row: row).title)
    +// Prints "Moby-Dick"
    +
    +let author: Author = row["author"]
    +print(author.name)
    +// Prints "Herman Melville"
    +
    + +

    Associated records stored in nested associations are available, too:

    +
    let request = Book.including(required: Book.author.including(required: Author.country))
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Book(row: row).title)
    +// Prints "Moby-Dick"
    +
    +let country: Country = row["country"]
    +print(country.name)
    +// Prints "United States"
    +
    + +

    A fatal error is raised if the scope is not available, or contains only +null values.

    + +

    See https://github.com/groue/GRDB.swift/blob/master/README.md#joined-queries-support +for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript<Record>(scope: String) -> Record where Record : FetchableRecord { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the eventual record associated with the given scope.

    + +

    For example:

    +
    let request = Book.including(optional: Book.author)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Book(row: row).title)
    +// Prints "Moby-Dick"
    +
    +let author: Author? = row["author"]
    +print(author.name)
    +// Prints "Herman Melville"
    +
    + +

    Associated records stored in nested associations are available, too:

    +
    let request = Book.including(optional: Book.author.including(optional: Author.country))
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Book(row: row).title)
    +// Prints "Moby-Dick"
    +
    +let country: Country? = row["country"]
    +print(country.name)
    +// Prints "United States"
    +
    + +

    Nil is returned if the scope is not available, or contains only +null values.

    + +

    See https://github.com/groue/GRDB.swift/blob/master/README.md#joined-queries-support +for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript<Record>(scope: String) -> Record? where Record : FetchableRecord { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the records encoded in the given prefetched rows.

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Author(row: row).name)
    +// Prints "Herman Melville"
    +
    +let books: [Book] = row["books"]
    +print(books[0].title)
    +// Prints "Moby-Dick"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript<Collection>(_ key: String)
    +    -> Collection
    +    where
    +    Collection: RangeReplaceableCollection,
    +    Collection.Element: FetchableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the set of records encoded in the given prefetched rows.

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(Author(row: row).name)
    +// Prints "Herman Melville"
    +
    +let books: Set<Book> = row["books"]
    +print(books.first!.title)
    +// Prints "Moby-Dick"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript<Record>(key: String) -> Set<Record> where Record : FetchableRecord, Record : Hashable { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Scopes

+

+
+
+
    +
  • +
    + + + + scopes + +
    +
    +
    +
    +
    +
    +

    Returns a view on the scopes defined by row adapters.

    + +

    For example:

    +
    // Define a tree of nested scopes
    +let adapter = ScopeAdapter([
    +    "foo": RangeRowAdapter(0..<1),
    +    "bar": RangeRowAdapter(1..<2).addingScopes([
    +        "baz" : RangeRowAdapter(2..<3)])])
    +
    +// Fetch
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
    +
    +row.scopes.count  // 2
    +row.scopes.names  // ["foo", "bar"]
    +
    +row.scopes["foo"] // [foo:1]
    +row.scopes["bar"] // [bar:2]
    +row.scopes["baz"] // nil
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var scopes: ScopesView { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + scopesTree + +
    +
    +
    +
    +
    +
    +

    Returns a view on the scopes tree defined by row adapters.

    + +

    For example:

    +
    // Define a tree of nested scopes
    +let adapter = ScopeAdapter([
    +    "foo": RangeRowAdapter(0..<1),
    +    "bar": RangeRowAdapter(1..<2).addingScopes([
    +        "baz" : RangeRowAdapter(2..<3)])])
    +
    +// Fetch
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
    +
    +row.scopesTree.names  // ["foo", "bar", "baz"]
    +
    +row.scopesTree["foo"] // [foo:1]
    +row.scopesTree["bar"] // [bar:2]
    +row.scopesTree["baz"] // [baz:3]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var scopesTree: ScopesTreeView { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unscoped + +
    +
    +
    +
    +
    +
    +

    Returns a copy of the row, without any scopes.

    + +

    This property can turn out useful when you want to test the content of +adapted rows, such as rows fetched from joined requests.

    +
    let row = ...
    +// Failure because row equality tests for row scopes:
    +XCTAssertEqual(row, ["id": 1, "name": "foo"])
    +// Success:
    +XCTAssertEqual(row.unscoped, ["id": 1, "name": "foo"])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var unscoped: Row { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unadapted + +
    +
    +
    +
    +
    +
    +

    Return the raw row fetched from the database.

    + +

    This property can turn out useful when you debug the consumption of +adapted rows, such as rows fetched from joined requests.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var unadapted: Row { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over rows fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT ...")
    +let rows = try Row.fetchCursor(statement) // RowCursor
    +while let row = try rows.next() { // Row
    +    let id: Int64 = row[0]
    +    let name: String = row[1]
    +}
    +
    + +

    Fetched rows are reused during the cursor iteration: don’t turn a row +cursor into an array with Array(rows) or rows.filter { ... } since +you would not get the distinct rows you expect. Use Row.fetchAll(...) +instead.

    + +

    For the same reason, make sure you make a copy whenever you extract a +row for later use: row.copy().

    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> RowCursor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched rows.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of rows fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT ...")
    +let rows = try Row.fetchAll(statement)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Row]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of rows.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a single row fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT ...")
    +let row = try Row.fetchOne(statement)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> Row?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional row.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over rows fetched from an SQL query.

    +
    let rows = try Row.fetchCursor(db, sql: "SELECT id, name FROM player") // RowCursor
    +while let row = try rows.next() { // Row
    +    let id: Int64 = row[0]
    +    let name: String = row[1]
    +}
    +
    + +

    Fetched rows are reused during the cursor iteration: don’t turn a row +cursor into an array with Array(rows) or rows.filter { ... } since +you would not get the distinct rows you expect. Use Row.fetchAll(...) +instead.

    + +

    For the same reason, make sure you make a copy whenever you extract a +row for later use: row.copy().

    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> RowCursor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched rows.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of rows fetched from an SQL query.

    +
    let rows = try Row.fetchAll(db, sql: "SELECT id, name FROM player") // [Row]
    +for row in rows {
    +    let id: Int64 = row[0]
    +    let name: String = row[1]
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Row]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of rows.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a single row fetched from an SQL query.

    +
    let row = try Row.fetchOne(db, sql: "SELECT id, name FROM player") // Row?
    +if let row = row {
    +    let id: Int64 = row[0]
    +    let name: String = row[1]
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> Row?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional row.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over rows fetched from a fetch request.

    +
    let request = Player.all()
    +let rows = try Row.fetchCursor(db, request) // RowCursor
    +while let row = try rows.next() { // Row
    +    let id: Int64 = row["id"]
    +    let name: String = row["name"]
    +}
    +
    + +

    Fetched rows are reused during the cursor iteration: don’t turn a row +cursor into an array with Array(rows) or rows.filter { ... } since +you would not get the distinct rows you expect. Use Row.fetchAll(...) +instead.

    + +

    For the same reason, make sure you make a copy whenever you extract a +row for later use: row.copy().

    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R>(_ db: Database, _ request: R) throws -> RowCursor where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched rows.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an array of rows fetched from a fetch request.

    +
    let request = Player.all()
    +let rows = try Row.fetchAll(db, request)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Row] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of rows.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns a single row fetched from a fetch request.

    +
    let request = Player.filter(key: 1)
    +let row = try Row.fetchOne(db, request)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<R>(_ db: Database, _ request: R) throws -> Row? where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional row.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

RowCursor

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a row initialized with elements. Column order is preserved, and +duplicated columns names are allowed.

    +
    let row: Row = ["foo": 1, "foo": "bar", "baz": nil]
    +print(row)
    +// Prints [foo:1 foo:"bar" baz:NULL]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(dictionaryLiteral elements: (String, DatabaseValueConvertible?)...)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Row as a Collection of (ColumnName, DatabaseValue) Pairs

+

+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses the (ColumnName, DatabaseValue) pair at given index.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(position: RowIndex) -> (String, DatabaseValue) { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Row.ScopesView

+

+
+
+
    +
  • +
    + + + + ScopesView + +
    +
    +
    +
    +
    +
    +

    A view of the scopes defined by row adapters. It is a collection of +tuples made of a scope name and a scoped row, which behaves like a +dictionary.

    + +

    For example:

    +
    // Define a tree of nested scopes
    +let adapter = ScopeAdapter([
    +    "foo": RangeRowAdapter(0..<1),
    +    "bar": RangeRowAdapter(1..<2).addingScopes([
    +        "baz" : RangeRowAdapter(2..<3)])])
    +
    +// Fetch
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
    +
    +row.scopes.count  // 2
    +row.scopes.names  // ["foo", "bar"]
    +
    +row.scopes["foo"] // [foo:1]
    +row.scopes["bar"] // [bar:2]
    +row.scopes["baz"] // nil
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ScopesView : Collection
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Row.ScopesTreeView

+

+
+
+
    +
  • +
    + + + + ScopesTreeView + +
    +
    +
    +
    +
    +
    +

    A view on the scopes tree defined by row adapters.

    + +

    For example:

    +
    // Define a tree of nested scopes
    +let adapter = ScopeAdapter([
    +    "foo": RangeRowAdapter(0..<1),
    +    "bar": RangeRowAdapter(1..<2).addingScopes([
    +        "baz" : RangeRowAdapter(2..<3)])])
    +
    +// Fetch
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
    +
    +row.scopesTree.names  // ["foo", "bar", "baz"]
    +
    +row.scopesTree["foo"] // [foo:1]
    +row.scopesTree["bar"] // [bar:2]
    +row.scopesTree["baz"] // [baz:3]
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ScopesTreeView
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Row.PrefetchedRowsView

+

+
+
+
    +
  • +
    + + + + PrefetchedRowsView + +
    +
    +
    +
    +
    +
    +

    A view on the prefetched associated rows.

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row)
    +// Prints [id:1 name:"Herman Melville"]
    +
    +let bookRows = row.prefetchedRows["books"]
    +print(bookRows[0])
    +// Prints [id:42 title:"Moby-Dick"]
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct PrefetchedRowsView : Equatable
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row/PrefetchedRowsView.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row/PrefetchedRowsView.html new file mode 100644 index 000000000..72e260e52 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row/PrefetchedRowsView.html @@ -0,0 +1,1205 @@ + + + + PrefetchedRowsView Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PrefetchedRowsView

+
+
+
public struct PrefetchedRowsView : Equatable
+ +
+
+

A view on the prefetched associated rows.

+ +

For example:

+
let request = Author.including(all: Author.books)
+let row = try Row.fetchOne(db, request)!
+
+print(row)
+// Prints [id:1 name:"Herman Melville"]
+
+let bookRows = row.prefetchedRows["books"]
+print(bookRows[0])
+// Prints [id:42 title:"Moby-Dick"]
+
+ +
+
+
+
    +
  • +
    + + + + isEmpty + +
    +
    +
    +
    +
    +
    +

    True if there is no prefetched associated rows.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isEmpty: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + keys + +
    +
    +
    +
    +
    +
    +

    The keys for available prefetched rows

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row.prefetchedRows.keys)
    +// Prints ["books"]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var keys: Set<String> { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the prefetched rows associated with the given key.

    + +

    For example:

    +
    let request = Author.including(all: Author.books)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row)
    +// Prints [id:1 name:"Herman Melville"]
    +
    +let bookRows = row.prefetchedRows["books"]
    +print(bookRows[0])
    +// Prints [id:42 title:"Moby-Dick"]
    +
    + +

    Prefetched rows stored in nested “to-one” associations are +available, too.

    + +

    Nil is returned if the key is not available.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(key: String) -> [Row]? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row/ScopesTreeView.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row/ScopesTreeView.html new file mode 100644 index 000000000..32434cd6c --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row/ScopesTreeView.html @@ -0,0 +1,1182 @@ + + + + ScopesTreeView Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ScopesTreeView

+
+
+
public struct ScopesTreeView
+ +
+
+

A view on the scopes tree defined by row adapters.

+ +

For example:

+
// Define a tree of nested scopes
+let adapter = ScopeAdapter([
+    "foo": RangeRowAdapter(0..<1),
+    "bar": RangeRowAdapter(1..<2).addingScopes([
+        "baz" : RangeRowAdapter(2..<3)])])
+
+// Fetch
+let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
+let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
+
+row.scopesTree.names  // ["foo", "bar", "baz"]
+
+row.scopesTree["foo"] // [foo:1]
+row.scopesTree["bar"] // [bar:2]
+row.scopesTree["baz"] // [baz:3]
+
+ +
+
+
+
    +
  • +
    + + + + names + +
    +
    +
    +
    +
    +
    +

    The scopes defined on this row, recursively.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var names: Set<String> { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the row associated with the given scope.

    + +

    For example:

    +
    let request = Book.including(required: Book.author)
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row)
    +// Prints [id:42 title:"Moby-Dick"]
    +
    +let authorRow = row.scopesTree["author"]
    +print(authorRow)
    +// Prints [id:1 name:"Herman Melville"]
    +
    + +

    Associated rows stored in nested associations are available, too:

    +
    let request = Book.including(required: Book.author.including(required: Author.country))
    +let row = try Row.fetchOne(db, request)!
    +
    +print(row)
    +// Prints [id:42 title:"Moby-Dick"]
    +
    +let countryRow = row.scopesTree["country"]
    +print(countryRow)
    +// Prints [code:"US" name:"United States"]
    +
    + +

    Nil is returned if the scope is not available.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(name: String) -> Row? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row/ScopesView.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row/ScopesView.html new file mode 100644 index 000000000..fc0c84b34 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Row/ScopesView.html @@ -0,0 +1,1189 @@ + + + + ScopesView Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ScopesView

+
+
+
public struct ScopesView : Collection
+ +
+
+

A view of the scopes defined by row adapters. It is a collection of +tuples made of a scope name and a scoped row, which behaves like a +dictionary.

+ +

For example:

+
// Define a tree of nested scopes
+let adapter = ScopeAdapter([
+    "foo": RangeRowAdapter(0..<1),
+    "bar": RangeRowAdapter(1..<2).addingScopes([
+        "baz" : RangeRowAdapter(2..<3)])])
+
+// Fetch
+let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
+let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
+
+row.scopes.count  // 2
+row.scopes.names  // ["foo", "bar"]
+
+row.scopes["foo"] // [foo:1]
+row.scopes["bar"] // [bar:2]
+row.scopes["baz"] // nil
+
+ +
+
+
+
    +
  • +
    + + + + Index + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Index = Dictionary<String, LayoutedRowAdapter>.Index
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + names + +
    +
    +
    +
    +
    +
    +

    The scopes defined on this row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var names: Dictionary<String, LayoutedRowAdapter>.Keys { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the row associated with the given scope, or nil if the +scope is not defined.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(name: String) -> Row? { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/RowCursor.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/RowCursor.html new file mode 100644 index 000000000..7ebb67f61 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/RowCursor.html @@ -0,0 +1,1112 @@ + + + + RowCursor Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

RowCursor

+
+
+
public final class RowCursor : Cursor
+ +
+
+

A cursor of database rows. For example:

+
try dbQueue.read { db in
+    let rows: RowCursor = try Row.fetchCursor(db, sql: "SELECT * FROM player")
+}
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/SelectStatement.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/SelectStatement.html new file mode 100644 index 000000000..0f7753326 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/SelectStatement.html @@ -0,0 +1,1208 @@ + + + + SelectStatement Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SelectStatement

+
+
+
public final class SelectStatement : Statement
+
extension SelectStatement: RowLayout
+ +
+
+

A subclass of Statement that fetches database rows.

+ +

You create SelectStatement with the Database.makeSelectStatement() method:

+
try dbQueue.read { db in
+    let statement = try db.makeSelectStatement(sql: "SELECT COUNT(*) FROM player WHERE score > ?")
+    let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
+    let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
+}
+
+ +
+
+
+
    +
  • +
    + + + + databaseRegion + +
    +
    +
    +
    +
    +
    +

    The database region that the statement looks into.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var databaseRegion: DatabaseRegion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + columnCount + +
    +
    +
    +
    +
    +
    +

    The number of columns in the resulting rows.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var columnCount: Int { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + columnNames + +
    +
    +
    +
    +
    +
    +

    The column names, ordered from left to right.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public lazy var columnNames: [String] { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + index(ofColumn:) + +
    +
    +
    +
    +
    +
    +

    Returns the index of the leftmost column named name, in a +case-insensitive way.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func index(ofColumn name: String) -> Int?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Statement.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Statement.html new file mode 100644 index 000000000..201a36f69 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/Statement.html @@ -0,0 +1,1245 @@ + + + + Statement Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Statement

+
+
+
public class Statement
+ +
+
+

A statement represents an SQL query.

+ +

It is the base class of UpdateStatement that executes update statements, +and SelectStatement that fetches rows.

+ +
+
+
+
    +
  • +
    + + + + sqliteStatement + +
    +
    +
    +
    +
    +
    +

    The raw SQLite statement, suitable for the SQLite C API.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let sqliteStatement: SQLiteStatement
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + sql + +
    +
    +
    +
    +
    +
    +

    The SQL query

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sql: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Arguments

+

+
+
+
    +
  • +
    + + + + arguments + +
    +
    +
    +
    +
    +
    +

    The statement arguments.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var arguments: StatementArguments { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(arguments:) + +
    +
    +
    +
    +
    +
    +

    Throws a DatabaseError of code SQLITE_ERROR if arguments don’t fill all +statement arguments.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func validate(arguments: StatementArguments) throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Set arguments without any validation. Trades safety for performance.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unsafeSetArguments(_ arguments: StatementArguments)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/TableAlias.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/TableAlias.html new file mode 100644 index 000000000..078395d37 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/TableAlias.html @@ -0,0 +1,1172 @@ + + + + TableAlias Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableAlias

+
+
+
public class TableAlias : Hashable
+ +
+
+

Experimental

+ +

A TableAlias identifies a table in a request.

+ +
+
+
+
    +
  • +
    + + + + init(name:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(name: String? = nil)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a qualified value that is able to resolve ambiguities in +joined queries.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(selectable: SQLSelectable) -> SQLSelectable { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a qualified expression that is able to resolve ambiguities in +joined queries.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public subscript(expression: SQLExpression) -> SQLExpression { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/TableAlteration.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/TableAlteration.html new file mode 100644 index 000000000..85b59ceff --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/TableAlteration.html @@ -0,0 +1,1160 @@ + + + + TableAlteration Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableAlteration

+
+
+
public final class TableAlteration
+ +
+
+

The TableAlteration class lets you alter database tables.

+ +

You don’t create instances of this class. Instead, you use the Database +alter(table:) method:

+
try db.alter(table: "player") { t in // t is TableAlteration
+    t.add(column: ...)
+}
+
+ +

See https://www.sqlite.org/lang_altertable.html

+ +
+
+
+
    +
  • +
    + + + + add(column:_:) + +
    +
    +
    +
    +
    +
    +

    Appends a column to the table.

    +
    try db.alter(table: "player") { t in
    +    t.add(column: "url", .text)
    +}
    +
    + +

    See https://www.sqlite.org/lang_altertable.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func add(column name: String, _ type: Database.ColumnType? = nil) -> ColumnDefinition
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    the column name.

    +
    +
    + + type + + +
    +

    the column type.

    +
    +
    +
    +
    +

    Return Value

    +

    An ColumnDefinition that allows you to refine the +column definition.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/TableDefinition.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/TableDefinition.html new file mode 100644 index 000000000..e6c1b2140 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/TableDefinition.html @@ -0,0 +1,1624 @@ + + + + TableDefinition Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableDefinition

+
+
+
public final class TableDefinition
+ +
+
+

The TableDefinition class lets you define table columns and constraints.

+ +

You don’t create instances of this class. Instead, you use the Database +create(table:) method:

+
try db.create(table: "player") { t in // t is TableDefinition
+    t.column(...)
+}
+
+ +

See https://www.sqlite.org/lang_createtable.html

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Defines the auto-incremented primary key.

    +
    try db.create(table: "player") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +}
    +
    + +

    The auto-incremented primary key is an integer primary key that +automatically generates unused values when you do not explicitly +provide one, and prevents the reuse of ids over the lifetime of +the database.

    + +

    It is the preferred way to define a numeric primary key.

    + +

    The fact that an auto-incremented primary key prevents the reuse of +ids is an excellent guard against data races that could happen when your +application processes ids in an asynchronous way. The auto-incremented +primary key provides the guarantee that a given id can’t reference a row +that is different from the one it used to be at the beginning of the +asynchronous process, even if this row gets deleted and a new one is +inserted in between.

    + +

    See https://www.sqlite.org/lang_createtable.html#primkeyconst and +https://www.sqlite.org/lang_createtable.html#rowid

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func autoIncrementedPrimaryKey(
    +    _ name: String,
    +    onConflict conflictResolution: Database.ConflictResolution? = nil)
    +    -> ColumnDefinition
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    +
    +
    +

    Return Value

    +

    Self so that you can further refine the column definition.

    +
    + +
    +
    +
  • +
  • +
    + + + + column(_:_:) + +
    +
    +
    +
    +
    +
    +

    Appends a table column.

    +
    try db.create(table: "player") { t in
    +    t.column("name", .text)
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#tablecoldef

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func column(_ name: String, _ type: Database.ColumnType? = nil) -> ColumnDefinition
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + name + + +
    +

    the column name.

    +
    +
    + + type + + +
    +

    the eventual column type.

    +
    +
    +
    +
    +

    Return Value

    +

    An ColumnDefinition that allows you to refine the +column definition.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Defines the table primary key.

    +
    try db.create(table: "citizenship") { t in
    +    t.column("citizenID", .integer)
    +    t.column("countryCode", .text)
    +    t.primaryKey(["citizenID", "countryCode"])
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#primkeyconst and +https://www.sqlite.org/lang_createtable.html#rowid

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func primaryKey(_ columns: [String], onConflict conflictResolution: Database.ConflictResolution? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + columns + + +
    +

    The primary key columns.

    +
    +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a unique key.

    +
    try db.create(table: "place") { t in
    +    t.column("latitude", .double)
    +    t.column("longitude", .double)
    +    t.uniqueKey(["latitude", "longitude"])
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#uniqueconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func uniqueKey(_ columns: [String], onConflict conflictResolution: Database.ConflictResolution? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + columns + + +
    +

    The unique key columns.

    +
    +
    + + conflictResolution + + +
    +

    An optional conflict resolution +(see https://www.sqlite.org/lang_conflict.html).

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Adds a foreign key.

    +
    try db.create(table: "passport") { t in
    +    t.column("issueDate", .date)
    +    t.column("citizenID", .integer)
    +    t.column("countryCode", .text)
    +    t.foreignKey(["citizenID", "countryCode"], references: "citizenship", onDelete: .cascade)
    +}
    +
    + +

    See https://www.sqlite.org/foreignkeys.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func foreignKey(
    +    _ columns: [String],
    +    references table: String,
    +    columns destinationColumns: [String]? = nil,
    +    onDelete deleteAction: Database.ForeignKeyAction? = nil,
    +    onUpdate updateAction: Database.ForeignKeyAction? = nil,
    +    deferred: Bool = false)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + columns + + +
    +

    The foreign key columns.

    +
    +
    + + table + + +
    +

    The referenced table.

    +
    +
    + + destinationColumns + + +
    +

    The columns in the referenced table. If not +specified, the columns of the primary key of the referenced table +are used.

    +
    +
    + + deleteAction + + +
    +

    Optional action when the referenced row is deleted.

    +
    +
    + + updateAction + + +
    +

    Optional action when the referenced row is updated.

    +
    +
    + + deferred + + +
    +

    If true, defines a deferred foreign key constraint. +See https://www.sqlite.org/foreignkeys.html#fk_deferred.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + check(_:) + +
    +
    +
    +
    +
    +
    +

    Adds a CHECK constraint.

    +
    try db.create(table: "player") { t in
    +    t.column("personalPhone", .text)
    +    t.column("workPhone", .text)
    +    let personalPhone = Column("personalPhone")
    +    let workPhone = Column("workPhone")
    +    t.check(personalPhone != nil || workPhone != nil)
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#ckconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func check(_ condition: SQLExpressible)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + condition + + +
    +

    The checked condition

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + check(sql:) + +
    +
    +
    +
    +
    +
    +

    Adds a CHECK constraint.

    +
    try db.create(table: "player") { t in
    +    t.column("personalPhone", .text)
    +    t.column("workPhone", .text)
    +    t.check(sql: "personalPhone IS NOT NULL OR workPhone IS NOT NULL")
    +}
    +
    + +

    See https://www.sqlite.org/lang_createtable.html#ckconst

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func check(sql: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sql + + +
    +

    An SQL snippet

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/UpdateStatement.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/UpdateStatement.html new file mode 100644 index 000000000..6efd3739a --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Classes/UpdateStatement.html @@ -0,0 +1,1141 @@ + + + + UpdateStatement Class Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UpdateStatement

+
+
+
public final class UpdateStatement : Statement
+ +
+
+

A subclass of Statement that executes SQL queries.

+ +

You create UpdateStatement with the Database.makeUpdateStatement() method:

+
try dbQueue.inTransaction { db in
+    let statement = try db.makeUpdateStatement(sql: "INSERT INTO player (name) VALUES (?)")
+    try statement.execute(arguments: ["Arthur"])
+    try statement.execute(arguments: ["Barbara"])
+    return .commit
+}
+
+ +
+
+
+
    +
  • +
    + + + + execute(arguments:) + +
    +
    +
    +
    +
    +
    +

    Executes the SQL query.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func execute(arguments: StatementArguments? = nil) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums.html new file mode 100644 index 000000000..4de2ac4f9 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums.html @@ -0,0 +1,1474 @@ + + + + Enumerations Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Enumerations

+

The following enumerations are available globally.

+ +
+
+
+
+ + +
+ +

Database events

+

+
+
+
    +
  • +
    + + + + DatabaseEventKind + +
    +
    +
    +
    +
    +
    +

    A kind of database event. See the TransactionObserver protocol for +more information.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DatabaseEventKind
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Logical Operators (AND, OR, NOT)

+

+
+
+ +
+
+
+ + +
+ +

DatabaseDateEncodingStrategy

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    DatabaseDateEncodingStrategy specifies how EncodableRecord types that also +adopt the standard Encodable protocol encode their date properties.

    + +

    For example:

    +
    struct Player: EncodableRecord, Encodable {
    +    static let databaseDateEncodingStrategy: DatabaseDateEncodingStrategy = .timeIntervalSince1970
    +
    +    var name: String
    +    var registrationDate: Date // encoded as an epoch timestamp
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DatabaseDateEncodingStrategy
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseUUIDEncodingStrategy

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    DatabaseUUIDEncodingStrategy specifies how EncodableRecord types that also +adopt the standard Encodable protocol encode their UUID properties.

    + +

    For example:

    +
    struct Player: EncodableProtocol, Encodable {
    +    static let databaseUUIDEncodingStrategy: DatabaseUUIDEncodingStrategy = .string
    +
    +    // encoded in a string like "E621E1F8-C36C-495A-93FC-0C247A3E6E5F"
    +    var uuid: UUID
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DatabaseUUIDEncodingStrategy
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseDateDecodingStrategy

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    DatabaseDateDecodingStrategy specifies how FetchableRecord types that also +adopt the standard Decodable protocol decode their date properties.

    + +

    For example:

    +
    struct Player: FetchableRecord, Decodable {
    +    static let databaseDateDecodingStrategy: DatabaseDateDecodingStrategy = .timeIntervalSince1970
    +
    +    var name: String
    +    var registrationDate: Date // decoded from epoch timestamp
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum DatabaseDateDecodingStrategy
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

UITableView Support

+

+
+
+
    +
  • +
    + + + + FetchedRecordChange + +
    +
    +
    +
    +
    +
    +

    A record change, given by a FetchedRecordsController to its change callback.

    + +

    The move and update events hold a changes dictionary, whose keys are +column names, and values the old values that have been changed.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum FetchedRecordChange
    +
    extension FetchedRecordChange: CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + PersistenceError + +
    +
    +
    +
    +
    +
    +

    An error thrown by a type that adopts PersistableRecord.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum PersistenceError : Error, CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ValueScheduling

+

+
+
+
    +
  • +
    + + + + ValueScheduling + +
    +
    +
    +
    +
    +
    +

    ValueScheduling controls how ValueObservation schedules the notifications +of fresh values to your application.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ValueScheduling
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ValueReducers + +
    +
    +
    +
    +
    +
    +

    A namespace for types related to the ValueReducer protocol.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum ValueReducers
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseDateDecodingStrategy.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseDateDecodingStrategy.html new file mode 100644 index 000000000..e8165c238 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseDateDecodingStrategy.html @@ -0,0 +1,1321 @@ + + + + DatabaseDateDecodingStrategy Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseDateDecodingStrategy

+
+
+
public enum DatabaseDateDecodingStrategy
+ +
+
+

DatabaseDateDecodingStrategy specifies how FetchableRecord types that also +adopt the standard Decodable protocol decode their date properties.

+ +

For example:

+
struct Player: FetchableRecord, Decodable {
+    static let databaseDateDecodingStrategy: DatabaseDateDecodingStrategy = .timeIntervalSince1970
+
+    var name: String
+    var registrationDate: Date // decoded from epoch timestamp
+}
+
+ +
+
+
+
    +
  • +
    + + + + deferredToDate + +
    +
    +
    +
    +
    +
    +

    The strategy that uses formatting from the Date structure.

    + +

    It decodes numeric values as a number of seconds since Epoch +(midnight UTC on January 1st, 1970).

    + +

    It decodes strings in the following formats, assuming UTC time zone. +Missing components are assumed to be zero:

    + +
      +
    • YYYY-MM-DD
    • +
    • YYYY-MM-DD HH:MM
    • +
    • YYYY-MM-DD HH:MM:SS
    • +
    • YYYY-MM-DD HH:MM:SS.SSS
    • +
    • YYYY-MM-DDTHH:MM
    • +
    • YYYY-MM-DDTHH:MM:SS
    • +
    • YYYY-MM-DDTHH:MM:SS.SSS
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deferredToDate
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Decodes numeric values as a number of seconds between the date and +midnight UTC on 1 January 2001

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case timeIntervalSinceReferenceDate
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + timeIntervalSince1970 + +
    +
    +
    +
    +
    +
    +

    Decodes numeric values as a number of seconds between the date and +midnight UTC on 1 January 1970

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case timeIntervalSince1970
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + millisecondsSince1970 + +
    +
    +
    +
    +
    +
    +

    Decodes numeric values as a number of milliseconds between the date and +midnight UTC on 1 January 1970

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case millisecondsSince1970
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + iso8601 + +
    +
    +
    +
    +
    +
    +

    Decodes dates according to the ISO 8601 standards

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case iso8601
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + formatted(_:) + +
    +
    +
    +
    +
    +
    +

    Decodes a String, according to the provided formatter

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case formatted(DateFormatter)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + custom(_:) + +
    +
    +
    +
    +
    +
    +

    Decodes according to the user-provided function.

    + +

    If the database value does not contain a suitable value, the function +must return nil (GRDB will interpret this nil result as a conversion +error, and react accordingly).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case custom((DatabaseValue) -> Date?)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseDateEncodingStrategy.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseDateEncodingStrategy.html new file mode 100644 index 000000000..59b9311c1 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseDateEncodingStrategy.html @@ -0,0 +1,1335 @@ + + + + DatabaseDateEncodingStrategy Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseDateEncodingStrategy

+
+
+
public enum DatabaseDateEncodingStrategy
+ +
+
+

DatabaseDateEncodingStrategy specifies how EncodableRecord types that also +adopt the standard Encodable protocol encode their date properties.

+ +

For example:

+
struct Player: EncodableRecord, Encodable {
+    static let databaseDateEncodingStrategy: DatabaseDateEncodingStrategy = .timeIntervalSince1970
+
+    var name: String
+    var registrationDate: Date // encoded as an epoch timestamp
+}
+
+ +
+
+
+
    +
  • +
    + + + + deferredToDate + +
    +
    +
    +
    +
    +
    +

    The strategy that uses formatting from the Date structure.

    + +

    It encodes dates using the format “YYYY-MM-DD HH:MM:SS.SSS” in the +UTC time zone.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deferredToDate
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Encodes a Double: the number of seconds between the date and +midnight UTC on 1 January 2001

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case timeIntervalSinceReferenceDate
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + timeIntervalSince1970 + +
    +
    +
    +
    +
    +
    +

    Encodes a Double: the number of seconds between the date and +midnight UTC on 1 January 1970

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case timeIntervalSince1970
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + secondsSince1970 + +
    +
    +
    +
    +
    +
    +

    Encodes an Int64: the number of seconds between the date and +midnight UTC on 1 January 1970

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case secondsSince1970
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + millisecondsSince1970 + +
    +
    +
    +
    +
    +
    +

    Encodes an Int64: the number of milliseconds between the date and +midnight UTC on 1 January 1970

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case millisecondsSince1970
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + iso8601 + +
    +
    +
    +
    +
    +
    +

    Encodes dates according to the ISO 8601 and RFC 3339 standards

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case iso8601
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + formatted(_:) + +
    +
    +
    +
    +
    +
    +

    Encodes a String, according to the provided formatter

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case formatted(DateFormatter)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + custom(_:) + +
    +
    +
    +
    +
    +
    +

    Encodes the result of the user-provided function

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case custom((Date) -> DatabaseValueConvertible?)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseEventKind.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseEventKind.html new file mode 100644 index 000000000..411b45f74 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseEventKind.html @@ -0,0 +1,1212 @@ + + + + DatabaseEventKind Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseEventKind

+
+
+
public enum DatabaseEventKind
+ +
+
+

A kind of database event. See the TransactionObserver protocol for +more information.

+ +
+
+
+
    +
  • +
    + + + + insert(tableName:) + +
    +
    +
    +
    +
    +
    +

    The insertion of a row in a database table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case insert(tableName: String)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + delete(tableName:) + +
    +
    +
    +
    +
    +
    +

    The deletion of a row in a database table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case delete(tableName: String)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The update of a set of columns in a database table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case update(tableName: String, columnNames: Set<String>)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database events

+

+
+
+
    +
  • +
    + + + + tableName + +
    +
    +
    +
    +
    +
    +

    The impacted database table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var tableName: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseUUIDEncodingStrategy.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseUUIDEncodingStrategy.html new file mode 100644 index 000000000..9d9cfb202 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/DatabaseUUIDEncodingStrategy.html @@ -0,0 +1,1150 @@ + + + + DatabaseUUIDEncodingStrategy Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseUUIDEncodingStrategy

+
+
+
public enum DatabaseUUIDEncodingStrategy
+ +
+
+

DatabaseUUIDEncodingStrategy specifies how EncodableRecord types that also +adopt the standard Encodable protocol encode their UUID properties.

+ +

For example:

+
struct Player: EncodableProtocol, Encodable {
+    static let databaseUUIDEncodingStrategy: DatabaseUUIDEncodingStrategy = .string
+
+    // encoded in a string like "E621E1F8-C36C-495A-93FC-0C247A3E6E5F"
+    var uuid: UUID
+}
+
+ +
+
+
+
    +
  • +
    + + + + deferredToUUID + +
    +
    +
    +
    +
    +
    +

    The strategy that uses formatting from the UUID type.

    + +

    It encodes UUIDs as 16-bytes data blobs.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deferredToUUID
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + string + +
    +
    +
    +
    +
    +
    +

    Encodes UUIDs as strings such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case string
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/FetchedRecordChange.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/FetchedRecordChange.html new file mode 100644 index 000000000..6fdcb0ea7 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/FetchedRecordChange.html @@ -0,0 +1,1248 @@ + + + + FetchedRecordChange Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FetchedRecordChange

+
+
+
public enum FetchedRecordChange
+
extension FetchedRecordChange: CustomStringConvertible
+ +
+
+

A record change, given by a FetchedRecordsController to its change callback.

+ +

The move and update events hold a changes dictionary, whose keys are +column names, and values the old values that have been changed.

+ +
+
+
+
    +
  • +
    + + + + insertion(indexPath:) + +
    +
    +
    +
    +
    +
    +

    An insertion event, at given indexPath.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case insertion(indexPath: IndexPath)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + deletion(indexPath:) + +
    +
    +
    +
    +
    +
    +

    A deletion event, at given indexPath.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deletion(indexPath: IndexPath)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A move event, from indexPath to newIndexPath. The changes are a +dictionary whose keys are column names, and values the old values that +have been changed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case move(indexPath: IndexPath, newIndexPath: IndexPath, changes: [String : DatabaseValue])
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An update event, at given indexPath. The changes are a dictionary +whose keys are column names, and values the old values that have +been changed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case update(indexPath: IndexPath, changes: [String : DatabaseValue])
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

UITableView Support

+

+
+
+
    +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/PersistenceError.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/PersistenceError.html new file mode 100644 index 000000000..fa8dd1703 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/PersistenceError.html @@ -0,0 +1,1114 @@ + + + + PersistenceError Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PersistenceError

+
+
+
public enum PersistenceError : Error, CustomStringConvertible
+ +
+
+

An error thrown by a type that adopts PersistableRecord.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Thrown by MutablePersistableRecord.update() when no matching row could be +found in the database.

    + +
      +
    • databaseTableName: the table of the unfound record
    • +
    • key: the key of the unfound record (column and values)
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case recordNotFound(databaseTableName: String, key: [String : DatabaseValue])
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/SQLLogicalBinaryOperator.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/SQLLogicalBinaryOperator.html new file mode 100644 index 000000000..693ed1f00 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/SQLLogicalBinaryOperator.html @@ -0,0 +1,1138 @@ + + + + SQLLogicalBinaryOperator Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SQLLogicalBinaryOperator

+
+
+
public enum SQLLogicalBinaryOperator
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + and + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case and
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + or + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case or
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers.html new file mode 100644 index 000000000..910e134af --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers.html @@ -0,0 +1,1417 @@ + + + + ValueReducers Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ValueReducers

+
+
+
public enum ValueReducers
+ +
+
+

A namespace for types related to the ValueReducer protocol.

+ +
+
+
+
+ + +
+ +

Combine 2 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 3 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 4 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 5 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 6 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 7 Reducers

+

+
+
+ +
+
+
+ + +
+ +

Combine 8 Reducers

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine2.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine2.html new file mode 100644 index 000000000..063c7eeec --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine2.html @@ -0,0 +1,1196 @@ + + + + Combine2 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine2

+
+
+
public struct Combine2<
+    R1: ValueReducer,
+    R2: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine3.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine3.html new file mode 100644 index 000000000..4f4395b91 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine3.html @@ -0,0 +1,1197 @@ + + + + Combine3 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine3

+
+
+
public struct Combine3<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine4.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine4.html new file mode 100644 index 000000000..fda1e97eb --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine4.html @@ -0,0 +1,1198 @@ + + + + Combine4 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine4

+
+
+
public struct Combine4<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer,
+    R4: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched, R4.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value, R4.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine5.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine5.html new file mode 100644 index 000000000..3db3d5f91 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine5.html @@ -0,0 +1,1199 @@ + + + + Combine5 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine5

+
+
+
public struct Combine5<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer,
+    R4: ValueReducer,
+    R5: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched, R4.Fetched, R5.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value, R4.Value, R5.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine6.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine6.html new file mode 100644 index 000000000..5636df021 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine6.html @@ -0,0 +1,1200 @@ + + + + Combine6 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine6

+
+
+
public struct Combine6<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer,
+    R4: ValueReducer,
+    R5: ValueReducer,
+    R6: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched, R4.Fetched, R5.Fetched, R6.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value, R4.Value, R5.Value, R6.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine7.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine7.html new file mode 100644 index 000000000..43db3c588 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine7.html @@ -0,0 +1,1201 @@ + + + + Combine7 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine7

+
+
+
public struct Combine7<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer,
+    R4: ValueReducer,
+    R5: ValueReducer,
+    R6: ValueReducer,
+    R7: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched, R4.Fetched, R5.Fetched, R6.Fetched, R7.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value, R4.Value, R5.Value, R6.Value, R7.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine8.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine8.html new file mode 100644 index 000000000..db852b8cf --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueReducers/Combine8.html @@ -0,0 +1,1202 @@ + + + + Combine8 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Combine8

+
+
+
public struct Combine8<
+    R1: ValueReducer,
+    R2: ValueReducer,
+    R3: ValueReducer,
+    R4: ValueReducer,
+    R5: ValueReducer,
+    R6: ValueReducer,
+    R7: ValueReducer,
+    R8: ValueReducer>: ValueReducer
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Fetched = (R1.Fetched, R2.Fetched, R3.Fetched, R4.Fetched, R5.Fetched, R6.Fetched, R7.Fetched, R8.Fetched)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias Value = (R1.Value, R2.Value, R3.Value, R4.Value, R5.Value, R6.Value, R7.Value, R8.Value)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueScheduling.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueScheduling.html new file mode 100644 index 000000000..44f864ad7 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Enums/ValueScheduling.html @@ -0,0 +1,1215 @@ + + + + ValueScheduling Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ValueScheduling

+
+
+
public enum ValueScheduling
+ +
+
+

ValueScheduling controls how ValueObservation schedules the notifications +of fresh values to your application.

+ +
+
+
+
    +
  • +
    + + + + mainQueue + +
    +
    +
    +
    +
    +
    +

    All values are notified on the main queue.

    + +

    If the observation starts on the main queue, an initial value is +notified right upon subscription, synchronously:

    +
    // On main queue
    +let observation = Player.observationForAll()
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("fresh players: \(players)")
    +}
    +// <- here "fresh players" is already printed.
    +
    + +

    If the observation does not start on the main queue, an initial value +is also notified on the main queue, but asynchronously:

    +
    // Not on the main queue: "fresh players" is eventually printed
    +// on the main queue.
    +let observation = Player.observationForAll()
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("fresh players: \(players)")
    +}
    +
    + +

    When the database changes, fresh values are asynchronously notified on +the main queue:

    +
    // Eventually prints "fresh players" on the main queue
    +try dbQueue.write { db in
    +    try Player(...).insert(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case mainQueue
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    All values are asychronously notified on the specified queue.

    + +

    An initial value is fetched and notified if startImmediately +is true.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case async(onQueue: DispatchQueue, startImmediately: Bool)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Values are not all notified on the same dispatch queue.

    + +

    If startImmediately is true, an initial value is notified right upon +subscription, synchronously, on the dispatch queue which starts +the observation.

    +
    // On any queue
    +var observation = Player.observationForAll()
    +observation.scheduling = .unsafe(startImmediately: true)
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("fresh players: \(players)")
    +}
    +// <- here "fresh players" is already printed.
    +
    + +

    When the database changes, other values are notified on +unspecified queues.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unsafe(startImmediately: Bool)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions.html new file mode 100644 index 000000000..8f367676d --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions.html @@ -0,0 +1,2204 @@ + + + + Extensions Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+
+
+ + +
+ +

Array, Sequence, Set extensions

+

+
+
+
    +
  • +
    + + + + Array + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Array
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Sequence + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Sequence
    +
    extension Sequence where Element == SQLLiteral
    +
    extension Sequence where Self.Iterator.Element: SQLExpressible
    +
    extension Sequence where Element == SQLExpression
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Set + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Set
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Database + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseValueConvertible

+

+
+
+
    +
  • +
    + + + + Optional + +
    +
    +
    +
    +
    +
    +

    Swift’s Optional comes with built-in methods that allow to fetch cursors +and arrays of optional DatabaseValueConvertible:

    +
    try Optional<String>.fetchCursor(db, sql: "SELECT name FROM ...", arguments:...) // Cursor of String?
    +try Optional<String>.fetchAll(db, sql: "SELECT name FROM ...", arguments:...)    // [String?]
    +
    +let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +try Optional<String>.fetchCursor(statement, arguments:...) // Cursor of String?
    +try Optional<String>.fetchAll(statement, arguments:...)    // [String?]
    +
    + +

    DatabaseValueConvertible is adopted by Bool, Int, String, etc.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Optional where Wrapped: DatabaseValueConvertible
    +
    extension Optional where Wrapped: DatabaseValueConvertible & StatementColumnConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Collection + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Collection where Element == SQLLiteral
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + CGFloat + +
    +
    +
    +
    +
    +
    +

    CGFloat adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension CGFloat: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Data + +
    +
    +
    +
    +
    +
    +

    Data is convertible to and from DatabaseValue.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Data: DatabaseValueConvertible, StatementColumnConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSDate + +
    +
    +
    +
    +
    +
    +

    NSDate is stored in the database using the format +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSDate: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + Date + +
    +
    +
    +
    +
    +
    +

    Date is stored in the database using the format +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Date: DatabaseValueConvertible
    +
    extension Date: StatementColumnConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSData + +
    +
    +
    +
    +
    +
    +

    NSData is convertible to and from DatabaseValue.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSData: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSNull + +
    +
    +
    +
    +
    +
    +

    NSNull adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSNull: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSNumber + +
    +
    +
    +
    +
    +
    +

    NSNumber adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSNumber: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSString + +
    +
    +
    +
    +
    +
    +

    NSString adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSString: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSURL + +
    +
    +
    +
    +
    +
    +

    NSURL stores its absoluteString in the database.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSURL: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + URL + +
    +
    +
    +
    +
    +
    +

    URL stores its absoluteString in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension URL: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + NSUUID + +
    +
    +
    +
    +
    +
    +

    NSUUID adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension NSUUID: DatabaseValueConvertible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + UUID + +
    +
    +
    +
    +
    +
    +

    UUID adopts DatabaseValueConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension UUID: DatabaseValueConvertible
    +
    extension UUID: StatementColumnConvertible
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Value Types

+

+
+
+ +
+
+
+ + +
+ +

Inclusion Operators (BETWEEN, IN)

+

+
+
+
    +
  • +
    + + + + Range + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension Range where Bound: SQLExpressible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + ClosedRange + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension ClosedRange where Bound: SQLExpressible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + CountableRange + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension CountableRange where Bound: SQLExpressible
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + CountableClosedRange + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension CountableClosedRange where Bound: SQLExpressible
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Array.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Array.html new file mode 100644 index 000000000..0a377addf --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Array.html @@ -0,0 +1,1111 @@ + + + + Array Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Array

+
+
+
extension Array
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates an array containing the elements of a cursor.

    +
    let cursor = try String.fetchCursor(db, sql: "SELECT 'foo' UNION ALL SELECT 'bar'")
    +let strings = try Array(cursor) // ["foo", "bar"]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init<C>(_ cursor: C) throws where Element == C.Element, C : Cursor
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Bool.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Bool.html new file mode 100644 index 000000000..8f1f2a902 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Bool.html @@ -0,0 +1,1200 @@ + + + + Bool Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Bool

+ +

Bool adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a Bool initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Bool?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/CGFloat.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/CGFloat.html new file mode 100644 index 000000000..4d6568379 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/CGFloat.html @@ -0,0 +1,1138 @@ + + + + CGFloat Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

CGFloat

+
+
+
extension CGFloat: DatabaseValueConvertible
+ +
+
+

CGFloat adopts DatabaseValueConvertible

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a CGFloat initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> CGFloat?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/ClosedRange.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/ClosedRange.html new file mode 100644 index 000000000..0fbcf24e1 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/ClosedRange.html @@ -0,0 +1,1152 @@ + + + + ClosedRange Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ClosedRange

+
+
+
extension ClosedRange where Bound: SQLExpressible
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Bound: SQLExpressible

+

+
+
+
    +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // email BETWEEN 'A' AND 'B'
    +("A"..."B").contains(Column("email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // email BETWEEN 'A' AND 'B' COLLATE NOCASE
    +("A"..."B").contains(Column("email").collating(.nocase))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Collection.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Collection.html new file mode 100644 index 000000000..8ec20c5df --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Collection.html @@ -0,0 +1,1124 @@ + + + + Collection Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Collection

+
+
+
extension Collection where Element == SQLLiteral
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Element == SQLLiteral

+

+
+
+
    +
  • +
    + + + + joined(separator:) + +
    +
    +
    +
    +
    +
    +

    Returns the concatenated SQLLiteral of this collection of literals, +inserting the given separator between each element.

    +
    let components: [SQLLiteral] = [
    +    "UPDATE player",
    +    "SET name = \(name)",
    +    "WHERE id = \(id)"
    +]
    +let query = components.joined(separator: " ")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined(separator: String = "") -> SQLLiteral
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Column.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Column.html new file mode 100644 index 000000000..be68d790d --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Column.html @@ -0,0 +1,1090 @@ + + + + Column Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Column

+ +
+
+
+
    +
  • +
    + + + + rank + +
    +
    +
    +
    +
    +
    +

    The FTS5 rank column

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/CountableClosedRange.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/CountableClosedRange.html new file mode 100644 index 000000000..2d44fd6f8 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/CountableClosedRange.html @@ -0,0 +1,1119 @@ + + + + CountableClosedRange Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

CountableClosedRange

+
+
+
extension CountableClosedRange where Bound: SQLExpressible
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Bound: SQLExpressible

+

+
+
+
    +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // id BETWEEN 1 AND 10
    +(1...10).contains(Column("id"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/CountableRange.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/CountableRange.html new file mode 100644 index 000000000..a3625ef8d --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/CountableRange.html @@ -0,0 +1,1119 @@ + + + + CountableRange Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

CountableRange

+
+
+
extension CountableRange where Bound: SQLExpressible
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Bound: SQLExpressible

+

+
+
+
    +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // id BETWEEN 1 AND 9
    +(1..<10).contains(Column("id"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Data.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Data.html new file mode 100644 index 000000000..b972e87a2 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Data.html @@ -0,0 +1,1169 @@ + + + + Data Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Data

+ +

Data is convertible to and from DatabaseValue.

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Database.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Database.html new file mode 100644 index 000000000..04c56bc54 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Database.html @@ -0,0 +1,1238 @@ + + + + Database Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Database

+ +
+
+
+
+ + +
+ +

Encryption

+

+
+
+
    +
  • +
    + + + + usePassphrase(_:) + +
    +
    +
    +
    +
    +
    +

    Sets the passphrase used to crypt and decrypt an SQLCipher database.

    + +

    Call this method from Configuration.prepareDatabase, as in the example below:

    +
    var config = Configuration()
    +config.prepareDatabase = { db in
    +    try db.usePassphrase("secret")
    +}
    +
    + +
    +
    +
    +
  • +
  • +
    + + + + changePassphrase(_:) + +
    +
    +
    +
    +
    +
    +

    Changes the passphrase used by an SQLCipher encrypted database.

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Deletes the synchronization triggers for a synchronized FTS5 table

    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

FTS5

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +db.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern from a raw pattern string; throws DatabaseError on +invalid syntax.

    + +

    The pattern syntax is documented at https://www.sqlite.org/fts5.html#full_text_query_syntax

    +
    try db.makeFTS5Pattern(rawPattern: "and", forTable: "document") // OK
    +try db.makeFTS5Pattern(rawPattern: "AND", forTable: "document") // malformed MATCH expression: [AND]
    +
    + +
    +
    +
    +
  • +
  • +
    + + + + makeTokenizer(_:) + +
    +
    +
    +
    +
    +
    +

    Creates an FTS5 tokenizer, given its descriptor.

    +
    let unicode61 = try db.makeTokenizer(.unicode61())
    +
    + +

    It is a programmer error to use the tokenizer outside of a protected +database queue, or after the database has been closed.

    + +

    Use this method when you implement a custom wrapper tokenizer:

    +
    final class MyTokenizer : FTS5WrapperTokenizer {
    +    var wrappedTokenizer: FTS5Tokenizer
    +
    +    init(db: Database, arguments: [String]) throws {
    +        wrappedTokenizer = try db.makeTokenizer(.unicode61())
    +    }
    +}
    +
    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/DatabaseQueue.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/DatabaseQueue.html new file mode 100644 index 000000000..38002674e --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/DatabaseQueue.html @@ -0,0 +1,1102 @@ + + + + DatabaseQueue Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseQueue

+ +
+
+
+
+ + +
+ +

Custom FTS5 Tokenizers

+

+
+
+
    +
  • +
    + + + + add(tokenizer:) + +
    +
    +
    +
    +
    +
    +

    Add a custom FTS5 tokenizer.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +dbQueue.add(tokenizer: MyTokenizer.self)
    +
    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Date.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Date.html new file mode 100644 index 000000000..d6552fcdf --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Date.html @@ -0,0 +1,1242 @@ + + + + Date Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Date

+
+
+
extension Date: DatabaseValueConvertible
+
extension Date: StatementColumnConvertible
+ +
+
+

Date is stored in the database using the format +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a database value that contains the date encoded as +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a date initialized from dbValue, if possible.

    + +

    If database value contains a number, that number is interpreted as a +timeinterval since 00:00:00 UTC on 1 January 1970.

    + +

    If database value contains a string, that string is interpreted as a +SQLite date in the UTC time +zone. Nil is returned if the date string does not contain at least the +year, month and day components. Other components (minutes, etc.) +are set to zero if missing.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Date?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(julianDay:) + +
    +
    +
    +
    +
    +
    +

    Creates a date from a Julian Day.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(julianDay: Double)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Double.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Double.html new file mode 100644 index 000000000..b920a2c29 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Double.html @@ -0,0 +1,1200 @@ + + + + Double Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Double

+ +

Double adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a Double initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Double?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Float.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Float.html new file mode 100644 index 000000000..ce1ad512d --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Float.html @@ -0,0 +1,1200 @@ + + + + Float Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Float

+ +

Float adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a Float initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Float?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int.html new file mode 100644 index 000000000..c612a1f48 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int.html @@ -0,0 +1,1200 @@ + + + + Int Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Int

+ +

Int adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Int?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int16.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int16.html new file mode 100644 index 000000000..2a239e630 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int16.html @@ -0,0 +1,1200 @@ + + + + Int16 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Int16

+ +

Int16 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int16 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Int16?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int32.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int32.html new file mode 100644 index 000000000..f76cfa4c6 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int32.html @@ -0,0 +1,1200 @@ + + + + Int32 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Int32

+ +

Int32 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int32 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Int32?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int64.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int64.html new file mode 100644 index 000000000..b7e379c30 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int64.html @@ -0,0 +1,1200 @@ + + + + Int64 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Int64

+ +

Int64 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int64 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Int64?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int8.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int8.html new file mode 100644 index 000000000..5f70ae82a --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Int8.html @@ -0,0 +1,1200 @@ + + + + Int8 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Int8

+ +

Int8 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int8 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Int8?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSData.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSData.html new file mode 100644 index 000000000..5880f84c8 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSData.html @@ -0,0 +1,1139 @@ + + + + NSData Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSData

+
+
+
extension NSData: DatabaseValueConvertible
+ +
+
+

NSData is convertible to and from DatabaseValue.

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an NSData initialized from dbValue, if it contains +a Blob.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSDate.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSDate.html new file mode 100644 index 000000000..c71fe86b8 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSDate.html @@ -0,0 +1,1149 @@ + + + + NSDate Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSDate

+
+
+
extension NSDate: DatabaseValueConvertible
+ +
+
+

NSDate is stored in the database using the format +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a database value that contains the date encoded as +“yyyy-MM-dd HH:mm:ss.SSS”, in the UTC time zone.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a date initialized from dbValue, if possible.

    + +

    If database value contains a number, that number is interpreted as a +timeinterval since 00:00:00 UTC on 1 January 1970.

    + +

    If database value contains a string, that string is interpreted as a +SQLite date in the UTC time +zone. Nil is returned if the date string does not contain at least the +year, month and day components. Other components (minutes, etc.) +are set to zero if missing.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSNull.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSNull.html new file mode 100644 index 000000000..f14081b66 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSNull.html @@ -0,0 +1,1138 @@ + + + + NSNull Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSNull

+
+
+
extension NSNull: DatabaseValueConvertible
+ +
+
+

NSNull adopts DatabaseValueConvertible

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns DatabaseValue.null.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSNumber.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSNumber.html new file mode 100644 index 000000000..b9ae19c9f --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSNumber.html @@ -0,0 +1,1138 @@ + + + + NSNumber Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSNumber

+
+
+
extension NSNumber: DatabaseValueConvertible
+ +
+
+

NSNumber adopts DatabaseValueConvertible

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an NSNumber initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSString.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSString.html new file mode 100644 index 000000000..b157882c2 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSString.html @@ -0,0 +1,1138 @@ + + + + NSString Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSString

+
+
+
extension NSString: DatabaseValueConvertible
+ +
+
+

NSString adopts DatabaseValueConvertible

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an NSString initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSURL.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSURL.html new file mode 100644 index 000000000..f44194b5e --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSURL.html @@ -0,0 +1,1139 @@ + + + + NSURL Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSURL

+
+
+
extension NSURL: DatabaseValueConvertible
+ +
+
+

NSURL stores its absoluteString in the database.

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database. +(the URL’s absoluteString).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an NSURL initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSUUID.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSUUID.html new file mode 100644 index 000000000..4c26e89cd --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/NSUUID.html @@ -0,0 +1,1136 @@ + + + + NSUUID Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

NSUUID

+
+
+
extension NSUUID: DatabaseValueConvertible
+ +
+
+

NSUUID adopts DatabaseValueConvertible

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Optional.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Optional.html new file mode 100644 index 000000000..b6d8afa71 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Optional.html @@ -0,0 +1,2265 @@ + + + + Optional Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Optional

+
+
+
extension Optional where Wrapped: DatabaseValueConvertible
+
extension Optional where Wrapped: DatabaseValueConvertible & StatementColumnConvertible
+ +
+
+

Swift’s Optional comes with built-in methods that allow to fetch cursors +and arrays of optional DatabaseValueConvertible:

+
try Optional<String>.fetchCursor(db, sql: "SELECT name FROM ...", arguments:...) // Cursor of String?
+try Optional<String>.fetchAll(db, sql: "SELECT name FROM ...", arguments:...)    // [String?]
+
+let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
+try Optional<String>.fetchCursor(statement, arguments:...) // Cursor of String?
+try Optional<String>.fetchAll(statement, arguments:...)    // [String?]
+
+ +

DatabaseValueConvertible is adopted by Bool, Int, String, etc.

+ +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try Optional<String>.fetchCursor(statement) // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> NullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try Optional<String>.fetchAll(statement)  // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from an SQL query.

    +
    let names = try Optional<String>.fetchCursor(db, sql: "SELECT name FROM ...") // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> NullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from an SQL query.

    +
    let names = try String.fetchAll(db, sql: "SELECT name FROM ...") // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try Optional<String>.fetchCursor(db, request) // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R: FetchRequest>(_ db: Database, _ request: R)
    +    throws -> NullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try Optional<String>.fetchAll(db, request) // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Wrapped?] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try Optional<String>.fetchCursor(statement) // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> FastNullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try Optional<String>.fetchAll(statement)  // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from an SQL query.

    +
    let names = try Optional<String>.fetchCursor(db, sql: "SELECT name FROM ...") // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> FastNullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from an SQL query.

    +
    let names = try String.fetchAll(db, sql: "SELECT name FROM ...") // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over optional values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try Optional<String>.fetchCursor(db, request) // Cursor of String?
    +while let name = try names.next() { // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R: FetchRequest>(_ db: Database, _ request: R)
    +    throws -> FastNullableDatabaseValueCursor<Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched optional values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an array of optional values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try Optional<String>.fetchAll(db, request) // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Wrapped?] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of optional values.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Range.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Range.html new file mode 100644 index 000000000..0a5089de5 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Range.html @@ -0,0 +1,1152 @@ + + + + Range Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Range

+
+
+
extension Range where Bound: SQLExpressible
+ +
+
+ +
+
+
+
+ + +
+ +

Available where Bound: SQLExpressible

+

+
+
+
    +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // email >= 'A' AND email < 'B'
    +("A"..<"B").contains(Column("email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in a range.

    +
    // email >= 'A' COLLATE NOCASE AND email < 'B' COLLATE NOCASE
    +("A"..<"B").contains(Column("email").collating(.nocase))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Sequence.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Sequence.html new file mode 100644 index 000000000..b97bec847 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Sequence.html @@ -0,0 +1,1310 @@ + + + + Sequence Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Sequence

+
+
+
extension Sequence
+
extension Sequence where Element == SQLLiteral
+
extension Sequence where Self.Iterator.Element: SQLExpressible
+
extension Sequence where Element == SQLExpression
+ +
+
+ +
+
+
+
    +
  • +
    + + + + flatMap(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over the concatenated results of mapping transform +over self.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func flatMap<SegmentOfResult: Cursor>(
    +    _ transform: @escaping (Iterator.Element) throws -> SegmentOfResult)
    +    -> FlattenCursor<MapCursor<AnyCursor<Iterator.Element>, SegmentOfResult>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element == SQLLiteral

+

+
+
+
    +
  • +
    + + + + joined(separator:) + +
    +
    +
    +
    +
    +
    +

    Returns the concatenated SQLLiteral of this sequence of literals, +inserting the given separator between each element.

    +
    let components: [SQLLiteral] = [
    +    "UPDATE player",
    +    "SET name = \(name)",
    +    "WHERE id = \(id)"
    +]
    +let query = components.joined(separator: " ")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined(separator: String = "") -> SQLLiteral
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Self.Iterator.Element: SQLExpressible

+

+
+
+
    +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in +a sequence.

    +
    // id IN (1,2,3)
    +[1, 2, 3].contains(Column("id"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the inclusion of an expression in +a sequence.

    +
    // name IN ('A', 'B') COLLATE NOCASE
    +["A", "B"].contains(Column("name").collating(.nocase))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element == SQLExpression

+

+
+
+
    +
  • +
    + + + + joined(operator:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression by joining all elements with an SQL +logical operator.

    + +

    For example:

    +
    // SELECT * FROM player
    +// WHERE (registered
    +//        AND (score >= 1000)
    +//        AND (name IS NOT NULL))
    +let conditions = [
    +    Column("registered"),
    +    Column("score") >= 1000,
    +    Column("name") != nil]
    +Player.filter(conditions.joined(operator: .and))
    +
    + +

    When the sequence is empty, joined(operator: .and) returns true, +and joined(operator: .or) returns false:

    +
    // SELECT * FROM player WHERE 1
    +Player.filter([].joined(operator: .and))
    +
    +// SELECT * FROM player WHERE 0
    +Player.filter([].joined(operator: .or))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined(operator: SQLLogicalBinaryOperator) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Set.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Set.html new file mode 100644 index 000000000..9141230d7 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/Set.html @@ -0,0 +1,1110 @@ + + + + Set Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Set

+
+
+
extension Set
+ +
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a set containing the elements of a cursor.

    +
    let cursor = try String.fetchCursor(db, sql: "SELECT 'foo' UNION ALL SELECT 'foo'")
    +let strings = try Set(cursor) // ["foo"]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<C>(_ cursor: C) throws where Element == C.Element, C : Cursor
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/String.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/String.html new file mode 100644 index 000000000..45d54300e --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/String.html @@ -0,0 +1,1247 @@ + + + + String Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

String

+ +

String adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a String initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> String?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Public

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns the receiver, quoted for safe insertion as an identifier in an +SQL query.

    +
    db.execute(sql: "SELECT * FROM \(tableName.quotedDatabaseIdentifier)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public var quotedDatabaseIdentifier: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/TableRecord.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/TableRecord.html new file mode 100644 index 000000000..beb848578 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/TableRecord.html @@ -0,0 +1,1105 @@ + + + + TableRecord Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableRecord

+ +
+
+
+
+ + +
+ +

Full Text Search

+

+
+
+
    +
  • +
    + + + + matching(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a QueryInterfaceRequest with a matching predicate.

    +
    // SELECT * FROM book WHERE book MATCH '...'
    +var request = Book.matching(pattern)
    +
    + +

    If the search pattern is nil, the request does not match any +database row.

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/TableRequest.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/TableRequest.html new file mode 100644 index 000000000..78226987b --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/TableRequest.html @@ -0,0 +1,1111 @@ + + + + TableRequest Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableRequest

+ +
+
+
+
+ + +
+ +

Full Text Search

+

+
+
+
    +
  • +
    + + + + matching(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request with a full-text predicate added to the eventual +set of already applied predicates.

    +
    // SELECT * FROM book WHERE book MATCH '...'
    +var request = Book.all()
    +request = request.matching(pattern)
    +
    + +

    If the search pattern is nil, the request does not match any +database row.

    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt.html new file mode 100644 index 000000000..769876360 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt.html @@ -0,0 +1,1200 @@ + + + + UInt Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UInt

+ +

UInt adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an Int initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> UInt?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt16.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt16.html new file mode 100644 index 000000000..de713f873 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt16.html @@ -0,0 +1,1200 @@ + + + + UInt16 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UInt16

+ +

UInt16 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an UInt16 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> UInt16?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt32.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt32.html new file mode 100644 index 000000000..baefda08f --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt32.html @@ -0,0 +1,1200 @@ + + + + UInt32 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UInt32

+ +

UInt32 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an UInt32 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> UInt32?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt64.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt64.html new file mode 100644 index 000000000..2e26aef18 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt64.html @@ -0,0 +1,1200 @@ + + + + UInt64 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UInt64

+ +

UInt64 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an UInt64 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> UInt64?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt8.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt8.html new file mode 100644 index 000000000..ade0f042a --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UInt8.html @@ -0,0 +1,1200 @@ + + + + UInt8 Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UInt8

+ +

UInt8 adopts DatabaseValueConvertible and StatementColumnConvertible.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an UInt8 initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> UInt8?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UUID.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UUID.html new file mode 100644 index 000000000..41e65d74b --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Extensions/UUID.html @@ -0,0 +1,1167 @@ + + + + UUID Extension Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

UUID

+
+
+
extension UUID: DatabaseValueConvertible
+
extension UUID: StatementColumnConvertible
+ +
+
+

UUID adopts DatabaseValueConvertible

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Functions.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Functions.html new file mode 100644 index 000000000..28d55e48e --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Functions.html @@ -0,0 +1,5722 @@ + + + + Functions Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Functions

+

The following functions are available globally.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns an array of row adapters that split a row according to the input +number of columns.

    + +

    For example:

    +
    let sql = "SELECT 1, 2,3,4, 5,6, 7,8"
    +//               <.><. . .><. .><. .>
    +let adapters = splittingRowAdapters([1, 3, 2])
    +let adapter = ScopeAdapter([
    +    "a": adapters[0],
    +    "b": adapters[1],
    +    "c": adapters[2],
    +    "d": adapters[3]])
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)
    +row.scopes["a"] // [1]
    +row.scopes["b"] // [2, 3, 4]
    +row.scopes["c"] // [5, 6]
    +row.scopes["d"] // [7, 8]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func splittingRowAdapters(columnCounts: [Int]) -> [RowAdapter]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Logical Operators (AND, OR, NOT)

+

+
+
+ +
+
+
+ + +
+ +

Egality and Identity Operators (=, <>, IS, IS NOT)

+

+
+
+
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the = SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count == Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the = SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count == 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the = SQL operator.

    + +

    For example:

    + +

    Author.having(3 == Author.books.count)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that checks the boolean value of an aggregate.

    + +

    For example:

    +
    Author.having(Author.books.isEmpty == false)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <RowDecoder>(lhs: AssociationAggregate<RowDecoder>, rhs: Bool) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that checks the boolean value of an aggregate.

    + +

    For example:

    +
    Author.having(false == Author.books.isEmpty)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == <RowDecoder>(lhs: Bool, rhs: AssociationAggregate<RowDecoder>) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the <> SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count != Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the <> SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count != 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the <> SQL operator.

    + +

    For example:

    +
    Author.having(3 != Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that checks the boolean value of an aggregate.

    + +

    For example:

    +
    Author.having(Author.books.isEmpty != true)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <RowDecoder>(lhs: AssociationAggregate<RowDecoder>, rhs: Bool) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that checks the boolean value of an aggregate.

    + +

    For example:

    +
    Author.having(true != Author.books.isEmpty)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != <RowDecoder>(lhs: Bool, rhs: AssociationAggregate<RowDecoder>) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the IS SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count === Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the IS SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count === 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the IS SQL operator.

    + +

    For example:

    +
    Author.having(3 === Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the IS NOT SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count !== Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the IS NOT SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count !== 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the IS NOT SQL operator.

    + +

    For example:

    +
    Author.having(3 !== Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Comparison Operators (<, >, <=, >=)

+

+
+
+
    +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the <= SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count <= Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the <= SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count <= 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the <= SQL operator.

    + +

    For example:

    +
    Author.having(3 <= Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the < SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count < Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the < SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count < 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the < SQL operator.

    + +

    For example:

    +
    Author.having(3 < Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the > SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count > Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the > SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count > 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the > SQL operator.

    + +

    For example:

    +
    Author.having(3 > Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares two aggregates with the >= SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count >= Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the >= SQL operator.

    + +

    For example:

    +
    Author.having(Author.books.count >= 3)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that compares an aggregate with the >= SQL operator.

    + +

    For example:

    +
    Author.having(3 >= Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Arithmetic Operators (+, -, *, /)

+

+
+
+
    +
  • +
    + + + + -(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an arithmetically negated aggregate.

    + +

    For example:

    +
    Author.annotated(with: -Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public prefix func - <RowDecoder>(aggregate: AssociationAggregate<RowDecoder>) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that sums two aggregates with the + SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count + Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that sums an aggregate with the + SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count + 1)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that sums an aggregate with the + SQL operator.

    + +

    For example:

    +
    Author.annotated(with: 1 + Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts two aggregates with the - SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count - Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the - SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count - 1)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the - SQL operator.

    + +

    For example:

    +
    Author.annotated(with: 1 - Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that multiplies two aggregates with the * SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count * Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the * SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count * 2)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the * SQL operator.

    + +

    For example:

    +
    Author.annotated(with: 2 * Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that multiplies two aggregates with the / SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count / Author.paintings.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the / SQL operator.

    + +

    For example:

    +
    Author.annotated(with: Author.books.count / 2)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that substracts an aggregate with the / SQL operator.

    + +

    For example:

    +
    Author.annotated(with: 2 / Author.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / <RowDecoder>(
    +    lhs: SQLExpressible,
    +    rhs: AssociationAggregate<RowDecoder>)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

IFNULL(…)

+

+
+
+
    +
  • +
    + + + + ??(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that evaluates the IFNULL SQL function.

    +
    Team.annotated(with: Team.players.min(Column("score")) ?? 0)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ?? <RowDecoder>(
    +    lhs: AssociationAggregate<RowDecoder>,
    +    rhs: SQLExpressible)
    +    -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ColumnAssignment

+

+
+
+
    +
  • +
    + + + + <-(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates an assignment to a value.

    +
    Column("valid") <- true
    +Column("score") <- 0
    +Column("score") <- Column("score") + Column("bonus")
    +
    +try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    try Player.updateAll(db, Column("score") <- 0)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <- (column: ColumnExpression, value: SQLExpressible) -> ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates an assignment that adds a value

    +
    Column("score") += 1
    +Column("score") += Column("bonus")
    +
    +try dbQueue.write { db in
    +    // UPDATE player SET score = score + 1
    +    try Player.updateAll(db, Column("score") += 1)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func += (column: ColumnExpression, value: SQLExpressible) -> ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates an assignment that subtracts a value

    +
    Column("score") -= 1
    +Column("score") -= Column("bonus")
    +
    +try dbQueue.write { db in
    +    // UPDATE player SET score = score - 1
    +    try Player.updateAll(db, Column("score") -= 1)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func -= (column: ColumnExpression, value: SQLExpressible) -> ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates an assignment that multiplies by a value

    +
    Column("score") *= 2
    +Column("score") *= Column("factor")
    +
    +try dbQueue.write { db in
    +    // UPDATE player SET score = score * 2
    +    try Player.updateAll(db, Column("score") *= 2)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func *= (column: ColumnExpression, value: SQLExpressible) -> ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates an assignment that divides by a value

    +
    Column("score") /= 2
    +Column("score") /= Column("factor")
    +
    +try dbQueue.write { db in
    +    // UPDATE player SET score = score / 2
    +    try Player.updateAll(db, Column("score") /= 2)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func /= (column: ColumnExpression, value: SQLExpressible) -> ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ABS(…)

+

+
+
+
    +
  • +
    + + + + abs(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the ABS SQL function.

    +
    // ABS(amount)
    +abs(Column("amount"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func abs(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

AVG(…)

+

+
+
+
    +
  • +
    + + + + average(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the AVG SQL function.

    +
    // AVG(length)
    +average(Column("length"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func average(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

COUNT(…)

+

+
+
+
    +
  • +
    + + + + count(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the COUNT SQL function.

    +
    // COUNT(email)
    +count(Column("email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func count(_ counted: SQLSelectable) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

COUNT(DISTINCT …)

+

+
+
+
    +
  • +
    + + + + count(distinct:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the COUNT(DISTINCT) SQL function.

    +
    // COUNT(DISTINCT email)
    +count(distinct: Column("email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func count(distinct value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

IFNULL(…)

+

+
+
+
    +
  • +
    + + + + ??(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the IFNULL SQL function.

    +
    // IFNULL(name, 'Anonymous')
    +Column("name") ?? "Anonymous"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func ?? (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

LENGTH(…)

+

+
+
+
    +
  • +
    + + + + length(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the LENGTH SQL function.

    +
    // LENGTH(name)
    +length(Column("name"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func length(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

MAX(…)

+

+
+
+
    +
  • +
    + + + + max(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the MAX SQL function.

    +
    // MAX(score)
    +max(Column("score"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func max(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

MIN(…)

+

+
+
+
    +
  • +
    + + + + min(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the MIN SQL function.

    +
    // MIN(score)
    +min(Column("score"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func min(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SUM(…)

+

+
+
+
    +
  • +
    + + + + sum(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an expression that evaluates the SUM SQL function.

    +
    // SUM(amount)
    +sum(Column("amount"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sum(_ value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Egality and Identity Operators (=, <>, IS, IS NOT)

+

+
+
+
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the = SQL operator.

    +
    // name = 'Arthur'
    +Column("name") == "Arthur"
    +
    + +

    When the right operand is nil, IS NULL is used instead.

    +
    // name IS NULL
    +Column("name") == nil
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLSpecificExpressible, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the = SQL operator.

    +
    // name = 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) == "Arthur"
    +
    + +

    When the right operand is nil, IS NULL is used instead.

    +
    // name IS NULL
    +Column("name").collating(.nocase) == nil
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLCollatedExpression, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the boolean value of an expression.

    + +

    The comparison is done with the built-in boolean evaluation of SQLite:

    +
    // validated
    +Column("validated") == true
    +
    +// NOT validated
    +Column("validated") == false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLSpecificExpressible, rhs: Bool) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the = SQL operator.

    +
    // 'Arthur' = name
    +"Arthur" == Column("name")
    +
    + +

    When the left operand is nil, IS NULL is used instead.

    +
    // name IS NULL
    +nil == Column("name")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLExpressible?, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the = SQL operator.

    +
    // 'Arthur' = name COLLATE NOCASE
    +"Arthur" == Column("name").collating(.nocase)
    +
    + +

    When the left operand is nil, IS NULL is used instead.

    +
    // name IS NULL
    +nil == Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLExpressible?, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the boolean value of an expression.

    + +

    The comparison is done with the built-in boolean evaluation of SQLite:

    +
    // validated
    +true == Column("validated")
    +
    +// NOT validated
    +false == Column("validated")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: Bool, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the = SQL operator.

    +
    // email = login
    +Column("email") == Column("login")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func == (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <> SQL operator.

    +
    // name <> 'Arthur'
    +Column("name") != "Arthur"
    +
    + +

    When the right operand is nil, IS NOT NULL is used instead.

    +
    // name IS NOT NULL
    +Column("name") != nil
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLSpecificExpressible, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <> SQL operator.

    +
    // name <> 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) != "Arthur"
    +
    + +

    When the right operand is nil, IS NOT NULL is used instead.

    +
    // name IS NOT NULL
    +Column("name").collating(.nocase) != nil
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLCollatedExpression, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the boolean value of an expression.

    + +

    The comparison is done with the built-in boolean evaluation of SQLite:

    +
    // NOT validated
    +Column("validated") != true
    +
    +// validated
    +Column("validated") != false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLSpecificExpressible, rhs: Bool) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <> SQL operator.

    +
    // 'Arthur' <> name
    +"Arthur" != Column("name")
    +
    + +

    When the left operand is nil, IS NOT NULL is used instead.

    +
    // name IS NOT NULL
    +nil != Column("name")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLExpressible?, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <> SQL operator.

    +
    // 'Arthur' <> name COLLATE NOCASE
    +"Arthur" != Column("name").collating(.nocase)
    +
    + +

    When the left operand is nil, IS NOT NULL is used instead.

    +
    // name IS NOT NULL
    +nil != Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLExpressible?, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that checks the boolean value of an expression.

    + +

    The comparison is done with the built-in boolean evaluation of SQLite:

    +
    // NOT validated
    +true != Column("validated")
    +
    +// validated
    +false != Column("validated")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: Bool, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <> SQL operator.

    +
    // email <> login
    +Column("email") != Column("login")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func != (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS SQL operator.

    +
    // name IS 'Arthur'
    +Column("name") === "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === (lhs: SQLSpecificExpressible, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS SQL operator.

    +
    // name IS 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) === "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === (lhs: SQLCollatedExpression, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS SQL operator.

    +
    // name IS 'Arthur'
    +"Arthur" === Column("name")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === (lhs: SQLExpressible?, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS SQL operator.

    +
    // name IS 'Arthur' COLLATE NOCASE
    +"Arthur" === Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === (lhs: SQLExpressible?, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ===(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS SQL operator.

    +
    // email IS login
    +Column("email") === Column("login")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func === (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS NOT SQL operator.

    +
    // name IS NOT 'Arthur'
    +Column("name") !== "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== (lhs: SQLSpecificExpressible, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS NOT SQL operator.

    +
    // name IS NOT 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) !== "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== (lhs: SQLCollatedExpression, rhs: SQLExpressible?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS NOT SQL operator.

    +
    // name IS NOT 'Arthur'
    +"Arthur" !== Column("name")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== (lhs: SQLExpressible?, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS NOT SQL operator.

    +
    // name IS NOT 'Arthur' COLLATE NOCASE
    +"Arthur" !== Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== (lhs: SQLExpressible?, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !==(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the IS NOT SQL operator.

    +
    // email IS NOT login
    +Column("email") !== Column("login")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func !== (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Comparison Operators (<, >, <=, >=)

+

+
+
+
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the < SQL operator.

    +
    // score < 18
    +Column("score") < 18
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the < SQL operator.

    +
    // name < 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) < "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < (lhs: SQLCollatedExpression, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the < SQL operator.

    +
    // 18 < score
    +18 < Column("score")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the < SQL operator.

    +
    // 'Arthur' < name COLLATE NOCASE
    +"Arthur" < Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < (lhs: SQLExpressible, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the < SQL operator.

    +
    // width < height
    +Column("width") < Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func < (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <= SQL operator.

    +
    // score <= 18
    +Column("score") <= 18
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <= SQL operator.

    +
    // name <= 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) <= "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= (lhs: SQLCollatedExpression, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <= SQL operator.

    +
    // 18 <= score
    +18 <= Column("score")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <= SQL operator.

    +
    // 'Arthur' <= name COLLATE NOCASE
    +"Arthur" <= Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= (lhs: SQLExpressible, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the <= SQL operator.

    +
    // width <= height
    +Column("width") <= Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func <= (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the > SQL operator.

    +
    // score > 18
    +Column("score") > 18
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the > SQL operator.

    +
    // name > 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) > "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > (lhs: SQLCollatedExpression, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the > SQL operator.

    +
    // 18 > score
    +18 > Column("score")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the > SQL operator.

    +
    // 'Arthur' > name COLLATE NOCASE
    +"Arthur" > Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > (lhs: SQLExpressible, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the > SQL operator.

    +
    // width > height
    +Column("width") > Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func > (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the >= SQL operator.

    +
    // score >= 18
    +Column("score") >= 18
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the >= SQL operator.

    +
    // name >= 'Arthur' COLLATE NOCASE
    +Column("name").collating(.nocase) >= "Arthur"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= (lhs: SQLCollatedExpression, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the >= SQL operator.

    +
    // 18 >= score
    +18 >= Column("score")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the >= SQL operator.

    +
    // 'Arthur' >= name COLLATE NOCASE
    +"Arthur" >= Column("name").collating(.nocase)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= (lhs: SQLExpressible, rhs: SQLCollatedExpression) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + >=(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL expression that compares two expressions with the >= SQL operator.

    +
    // width >= height
    +Column("width") >= Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func >= (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Arithmetic Operators (+, -, *, /)

+

+
+
+
    +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic multiplication.

    +
    // width * 2
    +Column("width") * 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic multiplication.

    +
    // 2 * width
    +2 * Column("width")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + *(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic multiplication.

    +
    // width * height
    +Column("width") * Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func * (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic division.

    +
    // width / 2
    +Column("width") / 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic division.

    +
    // 2 / width
    +2 / Column("width")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + /(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic division.

    +
    // width / height
    +Column("width") / Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func / (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic addition.

    +
    // width + 2
    +Column("width") + 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic addition.

    +
    // 2 + width
    +2 + Column("width")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic addition.

    +
    // width + height
    +Column("width") + Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func + (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:) + +
    +
    +
    +
    +
    +
    +

    A negated SQL arithmetic expression.

    +
    // -width
    +-Column("width")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public prefix func - (value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic substraction.

    +
    // width - 2
    +Column("width") - 2
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic substraction.

    +
    // 2 - width
    +2 - Column("width")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + -(_:_:) + +
    +
    +
    +
    +
    +
    +

    An SQL arithmetic substraction.

    +
    // width - height
    +Column("width") - Column("height")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func - (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Logical Operators (AND, OR, NOT)

+

+
+
+
    +
  • +
    + + + + &&(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the AND SQL operator.

    +
    // favorite AND 0
    +Column("favorite") && false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func && (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + &&(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the AND SQL operator.

    +
    // 0 AND favorite
    +false && Column("favorite")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func && (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + &&(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the AND SQL operator.

    +
    // email IS NOT NULL AND favorite
    +Column("email") != nil && Column("favorite")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func && (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the OR SQL operator.

    +
    // favorite OR 1
    +Column("favorite") || true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func || (lhs: SQLSpecificExpressible, rhs: SQLExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the OR SQL operator.

    +
    // 0 OR favorite
    +true || Column("favorite")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func || (lhs: SQLExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ||(_:_:) + +
    +
    +
    +
    +
    +
    +

    A logical SQL expression with the OR SQL operator.

    +
    // email IS NULL OR hidden
    +Column("email") == nil || Column("hidden")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func || (lhs: SQLSpecificExpressible, rhs: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + !(_:) + +
    +
    +
    +
    +
    +
    +

    A negated logical SQL expression with the NOT SQL operator.

    +
    // NOT hidden
    +!Column("hidden")
    +
    + +

    Some expressions may be negated with specific SQL operators:

    +
    // id NOT BETWEEN 1 AND 10
    +!((1...10).contains(Column("id")))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public prefix func ! (value: SQLSpecificExpressible) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Public

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Return as many question marks separated with commas as the count argument.

    +
    databaseQuestionMarks(count: 3) // "?,?,?"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func databaseQuestionMarks(count: Int) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols.html new file mode 100644 index 000000000..20785fa6c --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols.html @@ -0,0 +1,2242 @@ + + + + Protocols Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+
+
+ + +
+ +

Cursor

+

+
+
+
    +
  • +
    + + + + Cursor + +
    +
    +
    +
    +
    +
    +

    A type that supplies the values of some external resource, one at a time.

    +

    Overview

    + +

    The most common way to iterate over the elements of a cursor is to use a +while loop:

    +
    let cursor = ...
    +while let element = try cursor.next() {
    +    ...
    +}
    +
    +

    Relationship with standard Sequence and IteratorProtocol

    + +

    Cursors share traits with lazy sequences and iterators from the Swift +standard library. Differences are:

    + +
      +
    • Cursor types are classes, and have a lifetime.
    • +
    • Cursor iteration may throw errors.
    • +
    • A cursor can not be repeated.
    • +
    + +

    The protocol comes with default implementations for many operations similar +to those defined by Swift’s Sequence protocol: contains, dropFirst, +dropLast, drop(while:), enumerated, filter, first, flatMap, +forEach, joined, joined(separator:), max, max(by:), min, +min(by:), map, prefix, prefix(while:), reduce, reduce(into:), +suffix.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Cursor : AnyObject
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseAggregate + +
    +
    +
    +
    +
    +
    +

    The protocol for custom SQLite aggregates.

    + +

    For example:

    +
    struct MySum : DatabaseAggregate {
    +    var sum: Int = 0
    +
    +    mutating func step(_ dbValues: [DatabaseValue]) {
    +        if let int = Int.fromDatabaseValue(dbValues[0]) {
    +            sum += int
    +        }
    +    }
    +
    +    func finalize() -> DatabaseValueConvertible? {
    +        return sum
    +    }
    +}
    +
    +let dbQueue = DatabaseQueue()
    +let fn = DatabaseFunction("mysum", argumentCount: 1, aggregate: MySum.self)
    +dbQueue.add(function: fn)
    +try dbQueue.write { db in
    +    try db.execute(sql: "CREATE TABLE test(i)")
    +    try db.execute(sql: "INSERT INTO test(i) VALUES (1)")
    +    try db.execute(sql: "INSERT INTO test(i) VALUES (2)")
    +    try Int.fetchOne(db, sql: "SELECT mysum(i) FROM test")! // 3
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DatabaseAggregate
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseReader + +
    +
    +
    +
    +
    +
    +

    The protocol for all types that can fetch values from a database.

    + +

    It is adopted by DatabaseQueue and DatabasePool.

    + +

    The protocol comes with isolation guarantees that describe the behavior of +adopting types in a multithreaded application.

    + +

    Types that adopt the protocol can provide in practice stronger guarantees. +For example, DatabaseQueue provides a stronger isolation level +than DatabasePool.

    + +

    Warning: Isolation guarantees stand as long as there is no external +connection to the database. Should you have to cope with external +connections, protect yourself with transactions, and be ready to setup a +busy handler.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DatabaseReader : AnyObject
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseRegionConvertible

+

+
+
+ +
+
+
+ + +
+ +

DatabaseValueConvertible

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Types that adopt DatabaseValueConvertible can be initialized from +database values.

    + +

    The protocol comes with built-in methods that allow to fetch cursors, +arrays, or single values:

    +
    try String.fetchCursor(db, sql: "SELECT name FROM ...", arguments:...) // Cursor of String
    +try String.fetchAll(db, sql: "SELECT name FROM ...", arguments:...)    // [String]
    +try String.fetchOne(db, sql: "SELECT name FROM ...", arguments:...)    // String?
    +
    +let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +try String.fetchCursor(statement, arguments:...) // Cursor of String
    +try String.fetchAll(statement, arguments:...)    // [String]
    +try String.fetchOne(statement, arguments:...)    // String?
    +
    + +

    DatabaseValueConvertible is adopted by Bool, Int, String, etc.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DatabaseValueConvertible : SQLExpressible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

FetchRequest

+

+
+
+
    +
  • +
    + + + + FetchRequest + +
    +
    +
    +
    +
    +
    +

    The protocol for all requests that fetch database rows, and tell how those +rows should be interpreted.

    +
    struct Player: FetchableRecord { ... }
    +let request: ... // Some FetchRequest that fetches Player
    +try request.fetchCursor(db) // Cursor of Player
    +try request.fetchAll(db)    // [Player]
    +try request.fetchOne(db)    // Player?
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FetchRequest : DatabaseRegionConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseWriter + +
    +
    +
    +
    +
    +
    +

    The protocol for all types that can update a database.

    + +

    It is adopted by DatabaseQueue and DatabasePool.

    + +

    The protocol comes with isolation guarantees that describe the behavior of +adopting types in a multithreaded application.

    + +

    Types that adopt the protocol can in practice provide stronger guarantees. +For example, DatabaseQueue provides a stronger isolation level +than DatabasePool.

    + +

    Warning: Isolation guarantees stand as long as there is no external +connection to the database. Should you have to cope with external +connections, protect yourself with transactions, and be ready to setup a +busy handler.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol DatabaseWriter : DatabaseReader
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RowAdapter + +
    +
    +
    +
    +
    +
    +

    RowAdapter is a protocol that helps two incompatible row interfaces working +together.

    + +

    GRDB ships with four concrete types that adopt the RowAdapter protocol:

    + +
      +
    • ColumnMapping: renames row columns
    • +
    • SuffixRowAdapter: hides the first columns of a row
    • +
    • RangeRowAdapter: only exposes a range of columns
    • +
    • ScopeAdapter: groups several adapters together to define named scopes
    • +
    + +

    To use a row adapter, provide it to any method that fetches:

    +
    let adapter = SuffixRowAdapter(fromIndex: 2)
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +
    +// [baz:3]
    +try Row.fetchOne(db, sql: sql, adapter: adapter)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The StatementColumnConvertible protocol grants access to the low-level C +interface that extracts values from query results: +https://www.sqlite.org/c3ref/column_blob.html. It can bring performance +improvements.

    + +

    To use it, have a value type adopt both StatementColumnConvertible and +DatabaseValueConvertible. GRDB will then automatically apply the +optimization whenever direct access to SQLite is possible:

    +
    let rows = Row.fetchCursor(db, sql: "SELECT ...")
    +while let row = try rows.next() {
    +    let int: Int = row[0]                 // there
    +}
    +let ints = Int.fetchAll(db, sql: "SELECT ...") // there
    +struct Player {
    +    init(row: Row) {
    +        name = row["name"]                // there
    +        score = row["score"]              // there
    +    }
    +}
    +
    + +

    StatementColumnConvertible is already adopted by all Swift integer types, +Float, Double, String, and Bool.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol StatementColumnConvertible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

TransactionObserver

+

+
+
+
    +
  • +
    + + + + TransactionObserver + +
    +
    +
    +
    +
    +
    +

    A transaction observer is notified of all changes and transactions committed +or rollbacked on a database.

    + +

    Adopting types must be a class.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol TransactionObserver : AnyObject
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5CustomTokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for custom FTS5 tokenizers.

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS5Tokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for FTS5 tokenizers

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS5WrapperTokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for custom FTS5 tokenizers that wrap another tokenizer.

    + +

    Types that adopt FTS5WrapperTokenizer don’t have to implement the +low-level FTS5Tokenizer.tokenize(context:flags:pText:nText:tokenCallback:).

    + +

    Instead, they process regular Swift strings.

    + +

    Here is the implementation for a trivial tokenizer that wraps the +built-in ascii tokenizer without any custom processing:

    +
    class TrivialAsciiTokenizer : FTS5WrapperTokenizer {
    +    static let name = "trivial"
    +    let wrappedTokenizer: FTS5Tokenizer
    +
    +    init(db: Database, arguments: [String]) throws {
    +        wrappedTokenizer = try db.makeTokenizer(.ascii())
    +    }
    +
    +    func accept(
    +        token: String,
    +        flags: FTS5TokenFlags,
    +        for tokenization: FTS5Tokenization,
    +        tokenCallback: FTS5WrapperTokenCallback)
    +        throws
    +    {
    +        try tokenCallback(token, flags)
    +    }
    +}
    +
    + + See more +
    +
    +
    +
  • +
  • +
    + + + + TableRecord + +
    +
    +
    +
    +
    +
    +

    Types that adopt TableRecord declare a particular relationship with +a database table.

    + +

    Types that adopt both TableRecord and FetchableRecord are granted with +built-in methods that allow to fetch instances identified by key:

    +
    try Player.fetchOne(db, key: 123)  // Player?
    +try Citizenship.fetchOne(db, key: ["citizenId": 12, "countryId": 45]) // Citizenship?
    +
    + +

    TableRecord is adopted by Record.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol TableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ColumnExpression + +
    +
    +
    +
    +
    +
    +

    Adopt the ColumnExpression protocol when you define a column type.

    + +

    You can, for example, define a String-based column enum:

    +
    enum Columns: String, ColumnExpression {
    +    case id, name, score
    +}
    +let arthur = try Player.filter(Columns.name == "Arthur").fetchOne(db)
    +
    + +

    You can also define a genuine column type:

    +
    struct MyColumn: ColumnExpression {
    +    var name: String
    +    var sqlType: String
    +}
    +let nameColumn = MyColumn(name: "name", sqlType: "VARCHAR")
    +let arthur = try Player.filter(nameColumn == "Arthur").fetchOne(db)
    +
    + +

    See https://github.com/groue/GRDB.swift#the-query-interface

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ColumnExpression : SQLExpression
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Association + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    The base protocol for all associations that define a connection between two +record types.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Association : DerivableRequest
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

AssociationToOne

+

+
+
+ +
+
+
+ + +
+ +

AssociationToMany

+

+
+
+
    +
  • +
    + + + + AssociationToMany + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    The base protocol for all associations that define a one-to-many connection.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol AssociationToMany : Association
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + VirtualTableModule + +
    +
    +
    +
    +
    +
    +

    The protocol for SQLite virtual table modules. It lets you define a DSL for +the Database.create(virtualTable:using:) method:

    +
    let module = ...
    +try db.create(virtualTable: "item", using: module) { t in
    +    ...
    +}
    +
    + +

    GRDB ships with three concrete classes that implement this protocol: FTS3, +FTS4 and FTS5.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol VirtualTableModule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + EncodableRecord + +
    +
    +
    +
    +
    +
    +

    Types that adopt EncodableRecord can be encoded into the database.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol EncodableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FetchableRecord + +
    +
    +
    +
    +
    +
    +

    Types that adopt FetchableRecord can be initialized from a database Row.

    +
    let row = try Row.fetchOne(db, sql: "SELECT ...")!
    +let player = Player(row)
    +
    + +

    The protocol comes with built-in methods that allow to fetch cursors, +arrays, or single records:

    +
    try Player.fetchCursor(db, sql: "SELECT ...", arguments:...) // Cursor of Player
    +try Player.fetchAll(db, sql: "SELECT ...", arguments:...)    // [Player]
    +try Player.fetchOne(db, sql: "SELECT ...", arguments:...)    // Player?
    +
    +let statement = try db.makeSelectStatement(sql: "SELECT ...")
    +try Player.fetchCursor(statement, arguments:...) // Cursor of Player
    +try Player.fetchAll(statement, arguments:...)    // [Player]
    +try Player.fetchOne(statement, arguments:...)    // Player?
    +
    + +

    FetchableRecord is adopted by Record.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FetchableRecord
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Types that adopt MutablePersistableRecord can be inserted, updated, and deleted.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol MutablePersistableRecord : EncodableRecord, TableRecord
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

PersistableRecord

+

+
+
+
    +
  • +
    + + + + PersistableRecord + +
    +
    +
    +
    +
    +
    +

    Types that adopt PersistableRecord can be inserted, updated, and deleted.

    + +

    This protocol is intented for types that don’t have an INTEGER PRIMARY KEY.

    + +

    Unlike MutablePersistableRecord, the insert() and save() methods are not +mutating methods.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol PersistableRecord : MutablePersistableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ValueReducer + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    The ValueReducer protocol supports ValueObservation.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ValueReducer
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5CustomTokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for custom FTS5 tokenizers.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FTS5CustomTokenizer : FTS5Tokenizer
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5Tokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for FTS5 tokenizers

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FTS5Tokenizer : AnyObject
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5WrapperTokenizer + +
    +
    +
    +
    +
    +
    +

    The protocol for custom FTS5 tokenizers that wrap another tokenizer.

    + +

    Types that adopt FTS5WrapperTokenizer don’t have to implement the +low-level FTS5Tokenizer.tokenize(context:flags:pText:nText:tokenCallback:).

    + +

    Instead, they process regular Swift strings.

    + +

    Here is the implementation for a trivial tokenizer that wraps the +built-in ascii tokenizer without any custom processing:

    +
    class TrivialAsciiTokenizer : FTS5WrapperTokenizer {
    +    static let name = "trivial"
    +    let wrappedTokenizer: FTS5Tokenizer
    +
    +    init(db: Database, arguments: [String]) throws {
    +        wrappedTokenizer = try db.makeTokenizer(.ascii())
    +    }
    +
    +    func accept(
    +        token: String,
    +        flags: FTS5TokenFlags,
    +        for tokenization: FTS5Tokenization,
    +        tokenCallback: FTS5WrapperTokenCallback)
    +        throws
    +    {
    +        try tokenCallback(token, flags)
    +    }
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol FTS5WrapperTokenizer : FTS5CustomTokenizer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/Association.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/Association.html new file mode 100644 index 000000000..7ba986bdc --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/Association.html @@ -0,0 +1,1543 @@ + + + + Association Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Association

+
+
+
public protocol Association : DerivableRequest
+ +
+
+

Experimental

+ +

The base protocol for all associations that define a connection between two +record types.

+ +
+
+
+
    +
  • +
    + + + + OriginRowDecoder + +
    +
    +
    +
    +
    +
    +

    The record type at the origin of the association.

    + +

    In the belongsTo association below, it is Book:

    +
    struct Book: TableRecord {
    +    // BelongsToAssociation<Book, Author>
    +    static let author = belongsTo(Author.self)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype OriginRowDecoder : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + forKey(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Creates an association with the given key.

    + +

    This new key impacts how rows fetched from the resulting association +should be consumed:

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// Consume rows:
    +let request = Player.including(required: Player.team.forKey("custom"))
    +for row in Row.fetchAll(db, request) {
    +    let team: Team = row["custom"]
    +}
    +
    + +
    +

    Default Implementation

    +
    +

    Creates an association with the given key.

    + +

    This new key helps Decodable records decode rows fetched from the +resulting association:

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +struct PlayerInfo: FetchableRecord, Decodable {
    +    let player: Player
    +    let team: Team
    +
    +    static func all() -> QueryInterfaceRequest<PlayerInfo> {
    +        return Player
    +            .including(required: Player.team.forKey(CodingKeys.team))
    +            .asRequest(of: PlayerInfo.self)
    +    }
    +}
    +
    +let playerInfos = PlayerInfo.all().fetchAll(db)
    +print(playerInfos.first?.team)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func forKey(_ key: String) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association which selects selection.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.color
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let association = Player.team.select([Column("color")])
    +var request = Player.including(required: association)
    +
    + +

    Any previous selection is replaced:

    +
    // SELECT player.*, team.color
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let association = Player.team
    +    .select([Column("id")])
    +    .select([Column("color")])
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select(_ selection: [SQLSelectable]) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association which appends selection.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.color, team.name
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let association = Player.team
    +    .select([Column("color")])
    +    .annotated(with: [Column("name")])
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func annotated(with selection: [SQLSelectable]) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association with the provided predicate promise added to +the eventual set of already applied predicates.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId AND 1
    +let association = Player.team.filter { db in true }
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func filter(_ predicate: @escaping (Database) throws -> SQLExpressible) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association with the provided orderings promise.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +// ORDER BY team.name
    +let association = Player.team.order { _ in [Column("name")] }
    +var request = Player.including(required: association)
    +
    + +

    Any previous ordering is replaced:

    +
    // SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +// ORDER BY team.name
    +let association = Player.team
    +    .order{ _ in [Column("color")] }
    +    .reversed()
    +    .order{ _ in [Column("name")] }
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func order(_ orderings: @escaping (Database) throws -> [SQLOrderingTerm]) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reversed() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association that reverses applied orderings.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +// ORDER BY team.name DESC
    +let association = Player.team.order(Column("name")).reversed()
    +var request = Player.including(required: association)
    +
    + +

    If no ordering was applied, the returned association is identical.

    +
    // SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let association = Player.team.reversed()
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reversed() -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unordered() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association without any ordering.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let association = Player.team.order(Column("name")).unordered()
    +var request = Player.including(required: association)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unordered() -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + aliased(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an association that allows you to define expressions that target +a specific database table.

    + +

    In the example below, the “team.color = ‘red’” condition in the where +clause could be not achieved without table aliases.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// JOIN team ON ...
    +// WHERE team.color = 'red'
    +let teamAlias = TableAlias()
    +let request = Player
    +    .including(required: Player.team.aliased(teamAlias))
    +    .filter(teamAlias[Column("color")] == "red")
    +
    + +

    When you give a name to a table alias, you can reliably inject sql +snippets in your requests:

    +
    // SELECT player.*, custom.*
    +// JOIN team custom ON ...
    +// WHERE custom.color = 'red'
    +let teamAlias = TableAlias(name: "custom")
    +let request = Player
    +    .including(required: Player.team.aliased(teamAlias))
    +    .filter(sql: "custom.color = ?", arguments: ["red"])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func aliased(_ alias: TableAlias) -> Self
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/AssociationToMany.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/AssociationToMany.html new file mode 100644 index 000000000..b54855604 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/AssociationToMany.html @@ -0,0 +1,1411 @@ + + + + AssociationToMany Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AssociationToMany

+
+
+
public protocol AssociationToMany : Association
+ +
+
+

Experimental

+ +

The base protocol for all associations that define a one-to-many connection.

+ +
+
+
+
+ + +
+ +

AssociationToMany

+

+
+
+
    +
  • +
    + + + + forKey(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func forKey(_ key: String) -> Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + count + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The number of associated records.

    + +

    It has a default name, which is “[key]Count”, where key is the key of +the association. For example:

    + +

    For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var playerCount: Int
    +}
    +let request = Team.annotated(with: Team.players.count())
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.count() > 10).fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var count: AssociationAggregate<OriginRowDecoder> { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isEmpty + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate that is true if there exists no associated records.

    + +

    It has a default name, which is “hasNo[Key]”, where key is the key of +the association. For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var hasNoPlayer: Bool
    +}
    +let request = Team.annotated(with: Team.players.isEmpty())
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.isEmpty()).fetchAll(db)
    +let teams: [Team] = try Team.having(!Team.players.isEmpty())
    +let teams: [Team] = try Team.having(Team.players.isEmpty() == false)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isEmpty: AssociationAggregate<OriginRowDecoder> { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + average(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate which evaluate to the average value of the given +expression in associated records.

    + +

    When the averaged expression is a column, the aggregate has a default +name which is “average[Key][Column]”, where key is the key of the +association. For example:

    + +

    For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var averagePlayerScore: Double
    +}
    +let request = Team.annotated(with: Team.players.average(Column("score")))
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.average(Column("score")) > 100).fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func average(_ expression: SQLExpressible) -> AssociationAggregate<OriginRowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + max(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate which evaluate to the maximum value of the given +expression in associated records.

    + +

    When the maximized expression is a column, the aggregate has a default +name which is “maximum[Key][Column]”, where key is the key of the +association. For example:

    + +

    For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var maxPlayerScore: Double
    +}
    +let request = Team.annotated(with: Team.players.max(Column("score")))
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.max(Column("score")) < 100).fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func max(_ expression: SQLExpressible) -> AssociationAggregate<OriginRowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + min(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate which evaluate to the minimum value of the given +expression in associated records.

    + +

    When the minimized expression is a column, the aggregate has a default +name which is “minimum[Key][Column]”, where key is the key of the +association. For example:

    + +

    For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var minPlayerScore: Double
    +}
    +let request = Team.annotated(with: Team.players.min(Column("score")))
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.min(Column("score")) > 100).fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func min(_ expression: SQLExpressible) -> AssociationAggregate<OriginRowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + sum(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate which evaluate to the sum of the given expression +in associated records.

    + +

    When the summed expression is a column, the aggregate has a default +name which is “[key][Column]Sum”, where key is the key of the +association. For example:

    + +

    For example:

    +
    struct TeamInfo: FetchableRecord, Decodable {
    +    var team: Team
    +    var playerScoreSum: Double
    +}
    +let request = Team.annotated(with: Team.players.sum(Column("score")))
    +let infos: [TeamInfo] = try TeamInfo.fetchAll(db, request)
    +
    +let teams: [Team] = try Team.having(Team.players.sum(Column("score")) > 100).fetchAll(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func sum(_ expression: SQLExpressible) -> AssociationAggregate<OriginRowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/AssociationToOne.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/AssociationToOne.html new file mode 100644 index 000000000..2a31bc2e9 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/AssociationToOne.html @@ -0,0 +1,1121 @@ + + + + AssociationToOne Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AssociationToOne

+
+
+
public protocol AssociationToOne : Association
+ +
+
+

Experimental

+ +

The base protocol for all associations that define a one-to-one connection.

+ +
+
+
+
+ + +
+ +

AssociationToOne

+

+
+
+
    +
  • +
    + + + + forKey(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func forKey(_ key: String) -> Self
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/ColumnExpression.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/ColumnExpression.html new file mode 100644 index 000000000..526b9dc90 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/ColumnExpression.html @@ -0,0 +1,1167 @@ + + + + ColumnExpression Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ColumnExpression

+
+
+
public protocol ColumnExpression : SQLExpression
+ +
+
+

Adopt the ColumnExpression protocol when you define a column type.

+ +

You can, for example, define a String-based column enum:

+
enum Columns: String, ColumnExpression {
+    case id, name, score
+}
+let arthur = try Player.filter(Columns.name == "Arthur").fetchOne(db)
+
+ +

You can also define a genuine column type:

+
struct MyColumn: ColumnExpression {
+    var name: String
+    var sqlType: String
+}
+let nameColumn = MyColumn(name: "name", sqlType: "VARCHAR")
+let arthur = try Player.filter(nameColumn == "Arthur").fetchOne(db)
+
+ +

See https://github.com/groue/GRDB.swift#the-query-interface

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The unqualified name of a database column.

    + +

    “score” is a valid unqualified name. “player.score” is not.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var name: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + match(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A matching SQL expression with the MATCH SQL operator.

    +
    // content MATCH '...'
    +Column("content").match(pattern)
    +
    + +

    If the search pattern is nil, SQLite will evaluate the expression +to false.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func match(_ pattern: FTS3Pattern?) -> SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/Cursor.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/Cursor.html new file mode 100644 index 000000000..aad14b0cc --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/Cursor.html @@ -0,0 +1,2536 @@ + + + + Cursor Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Cursor

+
+
+
public protocol Cursor : AnyObject
+ +
+
+

A type that supplies the values of some external resource, one at a time.

+

Overview

+ +

The most common way to iterate over the elements of a cursor is to use a +while loop:

+
let cursor = ...
+while let element = try cursor.next() {
+    ...
+}
+
+

Relationship with standard Sequence and IteratorProtocol

+ +

Cursors share traits with lazy sequences and iterators from the Swift +standard library. Differences are:

+ +
    +
  • Cursor types are classes, and have a lifetime.
  • +
  • Cursor iteration may throw errors.
  • +
  • A cursor can not be repeated.
  • +
+ +

The protocol comes with default implementations for many operations similar +to those defined by Swift’s Sequence protocol: contains, dropFirst, +dropLast, drop(while:), enumerated, filter, first, flatMap, +forEach, joined, joined(separator:), max, max(by:), min, +min(by:), map, prefix, prefix(while:), reduce, reduce(into:), +suffix.

+ +
+
+
+
    +
  • +
    + + + + Element + +
    +
    +
    +
    +
    +
    +

    The type of element traversed by the cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Element
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + next() + +
    +
    +
    +
    +
    +
    +

    Advances to the next element and returns it, or nil if no next element +exists. Once nil has been returned, all subsequent calls return nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func next() throws -> Element?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Cursor

+

+
+
+
    +
  • +
    + + + + isEmpty() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a Boolean value indicating whether the cursor contains +an element.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isEmpty() throws -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contains(where:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a Boolean value indicating whether the cursor contains an +element that satisfies the given predicate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(where predicate: (Element) throws -> Bool) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + predicate + + +
    +

    A closure that takes an element of the cursor as +its argument and returns a Boolean value that indicates whether the +passed element represents a match.

    +
    +
    +
    +
    +

    Return Value

    +

    true if the cursor contains an element that satisfies +predicate; otherwise, false.

    +
    + +
    +
    +
  • +
  • +
    + + + + enumerated() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor of pairs (n, x), where n represents a consecutive +integer starting at zero, and x represents an element of the cursor.

    +
    let cursor = try String.fetchCursor(db, sql: "SELECT 'foo' UNION ALL SELECT 'bar'")
    +let c = cursor.enumerated()
    +while let (n, x) = c.next() {
    +    print("\(n): \(x)")
    +}
    +// Prints: "0: foo"
    +// Prints: "1: bar"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func enumerated() -> EnumeratedCursor<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the elements of the cursor that satisfy the given predicate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func filter(_ isIncluded: @escaping (Element) throws -> Bool) -> FilterCursor<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + first(where:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the first element of the cursor that satisfies the given +predicate or nil if no such element is found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func first(where predicate: (Element) throws -> Bool) throws -> Element?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compactMap(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over the concatenated non-nil results of mapping +transform over this cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func compactMap<ElementOfResult>(_ transform: @escaping (Element) throws -> ElementOfResult?)
    +    -> MapCursor<FilterCursor<MapCursor<Self, ElementOfResult?>>, ElementOfResult>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + drop(while:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor that skips any initial elements that satisfy +predicate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func drop(while predicate: @escaping (Element) throws -> Bool) -> DropWhileCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + predicate + + +
    +

    A closure that takes an element of the cursir as +its argument and returns true if the element should be skipped or +false otherwise. Once predicate returns false it will not be +called again.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + dropFirst(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor containing all but the given number of initial +elements.

    + +

    If the number of elements to drop exceeds the number of elements in +the cursor, the result is an empty cursor.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.dropFirst(2))
    +// Prints "[3, 4, 5]"
    +try print(numbers.dropFirst(10))
    +// Prints "[]"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropFirst(_ n: Int) -> DropFirstCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + n + + +
    +

    The number of elements to drop from the beginning of +the cursor. n must be greater than or equal to zero.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor starting after the specified number of +elements.

    +
    + +
    +
    +
  • +
  • +
    + + + + dropFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor containing all but the first element of the cursor.

    + +

    The following example drops the first element from a cursor of integers.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.dropFirst())
    +// Prints "[2, 3, 4, 5]"
    +
    + +

    If the cursor has no elements, the result is an empty cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropFirst() -> DropFirstCursor<Self>
    + +
    +
    +
    +

    Return Value

    +

    A cursor starting after the first element of the cursor.

    +
    + +
    +
    +
  • +
  • +
    + + + + dropLast(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array containing all but the given number of final +elements.

    + +

    The cursor must be finite. If the number of elements to drop exceeds +the number of elements in the cursor, the result is an empty array.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.dropLast(2))
    +// Prints "[1, 2, 3]"
    +try print(numbers.dropLast(10))
    +// Prints "[]"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropLast(_ n: Int) throws -> [Element]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + n + + +
    +

    The number of elements to drop off the end of the +cursor. n must be greater than or equal to zero.

    +
    +
    +
    +
    +

    Return Value

    +

    An array leaving off the specified number of elements.

    +
    + +
    +
    +
  • +
  • +
    + + + + dropLast() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array containing all but the last element of the cursor.

    + +

    The following example drops the last element from a cursor of integers.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.dropLast())
    +// Prints "[1, 2, 3, 4]"
    +
    + +

    If the cursor has no elements, the result is an empty cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func dropLast() throws -> [Element]
    + +
    +
    +
    +

    Return Value

    +

    An array leaving off the last element of the cursor.

    +
    + +
    +
    +
  • +
  • +
    + + + + flatMap(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over the concatenated results of mapping transform +over self.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func flatMap<SegmentOfResult>(_ transform: @escaping (Element) throws -> SegmentOfResult)
    +    -> FlattenCursor<MapCursor<Self, AnyCursor<SegmentOfResult.Element>>>
    +    where SegmentOfResult: Sequence
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + flatMap(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over the concatenated results of mapping transform +over self.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func flatMap<SegmentOfResult>(_ transform: @escaping (Element) throws -> SegmentOfResult)
    +    -> FlattenCursor<MapCursor<Self, SegmentOfResult>>
    +    where SegmentOfResult: Cursor
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + forEach(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Calls the given closure on each element in the cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func forEach(_ body: (Element) throws -> Void) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + map(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over the results of the transform function applied to +this cursor’s elements.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func map<T>(_ transform: @escaping (Element) throws -> T) -> MapCursor<Self, T>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + max(by:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the maximum element in the cursor, using the given predicate as +the comparison between elements.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func max(by areInIncreasingOrder: (Element, Element) throws -> Bool) throws -> Element?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + areInIncreasingOrder + + +
    +

    A predicate that returns true +if its first argument should be ordered before its second +argument; otherwise, false.

    +
    +
    +
    +
    +

    Return Value

    +

    The cursor’s maximum element, according to +areInIncreasingOrder. If the cursor has no elements, returns nil.

    +
    + +
    +
    +
  • +
  • +
    + + + + min(by:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the minimum element in the cursor, using the given predicate as +the comparison between elements.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func min(by areInIncreasingOrder: (Element, Element) throws -> Bool) throws -> Element?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + areInIncreasingOrder + + +
    +

    A predicate that returns true +if its first argument should be ordered before its second +argument; otherwise, false.

    +
    +
    +
    +
    +

    Return Value

    +

    The cursor’s minimum element, according to +areInIncreasingOrder. If the cursor has no elements, returns nil.

    +
    + +
    +
    +
  • +
  • +
    + + + + prefix(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor, up to the specified maximum length, containing the +initial elements of the cursor.

    + +

    If the maximum length exceeds the number of elements in the cursor, +the result contains all the elements in the cursor.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.prefix(2))
    +// Prints "[1, 2]"
    +try print(numbers.prefix(10))
    +// Prints "[1, 2, 3, 4, 5]"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func prefix(_ maxLength: Int) -> PrefixCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + maxLength + + +
    +

    The maximum number of elements to return. The +value of maxLength must be greater than or equal to zero.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor starting at the beginning of this cursor +with at most maxLength elements.

    +
    + +
    +
    +
  • +
  • +
    + + + + prefix(while:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor of the initial consecutive elements that satisfy +predicate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func prefix(while predicate: @escaping (Element) throws -> Bool) -> PrefixWhileCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + predicate + + +
    +

    A closure that takes an element of the cursor as +its argument and returns true if the element should be included or +false otherwise. Once predicate returns false it will not be +called again.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + reduce(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the result of calling the given combining closure with each +element of this cursor and an accumulating value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reduce<Result>(
    +    _ initialResult: Result,
    +    _ nextPartialResult: (Result, Element) throws -> Result)
    +    throws -> Result
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reduce(into:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the result of calling the given combining closure with each +element of this cursor and an accumulating value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reduce<Result>(
    +    into initialResult: Result,
    +    _ updateAccumulatingResult: (inout Result, Element) throws -> Void)
    +    throws -> Result
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + suffix(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array, up to the given maximum length, containing the +final elements of the cursor.

    + +

    The cursor must be finite. If the maximum length exceeds the number of +elements in the cursor, the result contains all the elements in the +cursor.

    +
    let numbers = AnyCursor([1, 2, 3, 4, 5])
    +try print(numbers.suffix(2))
    +// Prints "[4, 5]"
    +try print(numbers.suffix(10))
    +// Prints "[1, 2, 3, 4, 5]"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func suffix(_ maxLength: Int) throws -> [Element]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + maxLength + + +
    +

    The maximum number of elements to return. The +value of maxLength must be greater than or equal to zero.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element: Equatable

+

+
+
+
    +
  • +
    + + + + contains(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a Boolean value indicating whether the cursor contains the +given element.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ element: Element) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element: Comparable

+

+
+
+
    +
  • +
    + + + + max() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the maximum element in the cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func max() throws -> Element?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + areInIncreasingOrder + + +
    +

    A predicate that returns true +if its first argument should be ordered before its second +argument; otherwise, false.

    +
    +
    +
    +
    +

    Return Value

    +

    The cursor’s maximum element, according to +areInIncreasingOrder. If the cursor has no elements, returns +nil.

    +
    + +
    +
    +
  • +
  • +
    + + + + min() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the minimum element in the cursor.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func min() throws -> Element?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + areInIncreasingOrder + + +
    +

    A predicate that returns true +if its first argument should be ordered before its second +argument; otherwise, false.

    +
    +
    +
    +
    +

    Return Value

    +

    The cursor’s minimum element, according to +areInIncreasingOrder. If the cursor has no elements, returns +nil.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element: Cursor

+

+
+
+
    +
  • +
    + + + + joined() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the elements of this cursor of cursors, concatenated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined() -> FlattenCursor<Self>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element: Sequence

+

+
+
+
    +
  • +
    + + + + joined() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the elements of this cursor of sequences, concatenated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined() -> FlattenCursor<MapCursor<Self, AnyCursor<Element.Element>>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Element: StringProtocol

+

+
+
+
    +
  • +
    + + + + joined(separator:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the elements of this cursor of sequences, concatenated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func joined(separator: String = "") throws -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseAggregate.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseAggregate.html new file mode 100644 index 000000000..67e8551a0 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseAggregate.html @@ -0,0 +1,1205 @@ + + + + DatabaseAggregate Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseAggregate

+
+
+
public protocol DatabaseAggregate
+ +
+
+

The protocol for custom SQLite aggregates.

+ +

For example:

+
struct MySum : DatabaseAggregate {
+    var sum: Int = 0
+
+    mutating func step(_ dbValues: [DatabaseValue]) {
+        if let int = Int.fromDatabaseValue(dbValues[0]) {
+            sum += int
+        }
+    }
+
+    func finalize() -> DatabaseValueConvertible? {
+        return sum
+    }
+}
+
+let dbQueue = DatabaseQueue()
+let fn = DatabaseFunction("mysum", argumentCount: 1, aggregate: MySum.self)
+dbQueue.add(function: fn)
+try dbQueue.write { db in
+    try db.execute(sql: "CREATE TABLE test(i)")
+    try db.execute(sql: "INSERT INTO test(i) VALUES (1)")
+    try db.execute(sql: "INSERT INTO test(i) VALUES (2)")
+    try Int.fetchOne(db, sql: "SELECT mysum(i) FROM test")! // 3
+}
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates an aggregate.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + step(_:) + +
    +
    +
    +
    +
    +
    +

    This method is called at each step of the aggregation.

    + +

    The dbValues argument contains as many values as given to the SQL +aggregate function.

    + +

    – One value + SELECT maxLength(name) FROM player

    + +

    – Two values + SELECT maxFullNameLength(firstName, lastName) FROM player

    + +

    This method is never called after the finalize() method has been called.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func step(_ dbValues: [DatabaseValue]) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + finalize() + +
    +
    +
    +
    +
    +
    +

    Returns the final result

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func finalize() throws -> DatabaseValueConvertible?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseReader.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseReader.html new file mode 100644 index 000000000..5457e2a3b --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseReader.html @@ -0,0 +1,1879 @@ + + + + DatabaseReader Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseReader

+
+
+
public protocol DatabaseReader : AnyObject
+ +
+
+

The protocol for all types that can fetch values from a database.

+ +

It is adopted by DatabaseQueue and DatabasePool.

+ +

The protocol comes with isolation guarantees that describe the behavior of +adopting types in a multithreaded application.

+ +

Types that adopt the protocol can provide in practice stronger guarantees. +For example, DatabaseQueue provides a stronger isolation level +than DatabasePool.

+ +

Warning: Isolation guarantees stand as long as there is no external +connection to the database. Should you have to cope with external +connections, protect yourself with transactions, and be ready to setup a +busy handler.

+ +
+
+
+
    +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The database configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var configuration: Configuration { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Interrupting Database Operations

+

+
+
+
    +
  • +
    + + + + interrupt() + +
    +
    +
    +
    +
    +
    +

    This method causes any pending database operation to abort and return at +its earliest opportunity.

    + +

    It can be called from any thread.

    + +

    A call to interrupt() that occurs when there are no running SQL +statements is a no-op and has no effect on SQL statements that are +started after interrupt() returns.

    + +

    A database operation that is interrupted will throw a DatabaseError with +code SQLITE_INTERRUPT. If the interrupted SQL operation is an INSERT, +UPDATE, or DELETE that is inside an explicit transaction, then the +entire transaction will be rolled back automatically. If the rolled back +transaction was started by a transaction-wrapping method such as +DatabaseWriter.write or Database.inTransaction, then all database +accesses will throw a DatabaseError with code SQLITE_ABORT until the +wrapping method returns.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    // interrupted:
    +    try Player(...).insert(db)     // throws SQLITE_INTERRUPT
    +    // not executed:
    +    try Player(...).insert(db)
    +}                                  // throws SQLITE_INTERRUPT
    +
    +try dbQueue.write { db in
    +    do {
    +        // interrupted:
    +        try Player(...).insert(db) // throws SQLITE_INTERRUPT
    +    } catch { }
    +    try Player(...).insert(db)     // throws SQLITE_ABORT
    +}                                  // throws SQLITE_ABORT
    +
    +try dbQueue.write { db in
    +    do {
    +        // interrupted:
    +        try Player(...).insert(db) // throws SQLITE_INTERRUPT
    +    } catch { }
    +}                                  // throws SQLITE_ABORT
    +
    + +

    When an application creates transaction without a transaction-wrapping +method, no SQLITE_ABORT error warns of aborted transactions:

    +
    try dbQueue.inDatabase { db in // or dbPool.writeWithoutTransaction
    +    try db.beginTransaction()
    +    do {
    +        // interrupted:
    +        try Player(...).insert(db) // throws SQLITE_INTERRUPT
    +    } catch { }
    +    try Player(...).insert(db)     // success
    +    try db.commit()                // throws SQLITE_ERROR "cannot commit - no transaction is active"
    +}
    +
    + +

    Both SQLITE_ABORT and SQLITE_INTERRUPT errors can be checked with the +DatabaseError.isInterruptionError property.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func interrupt()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Read From Database

+

+
+
+
    +
  • +
    + + + + read(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block that takes a database +connection, and returns its result.

    + +

    Guarantee 1: the block argument is isolated. Eventual concurrent +database updates are not visible inside the block:

    +
    try reader.read { db in
    +    // Those two values are guaranteed to be equal, even if the
    +    // `player` table is modified between the two requests:
    +    let count1 = try Player.fetchCount(db)
    +    let count2 = try Player.fetchCount(db)
    +}
    +
    +try reader.read { db in
    +    // Now this value may be different:
    +    let count = try Player.fetchCount(db)
    +}
    +
    + +

    Guarantee 2: Starting iOS 8.2, OSX 10.10, and with custom SQLite builds +and SQLCipher, attempts to write in the database throw a DatabaseError +whose resultCode is SQLITE_READONLY.

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func read<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + asyncRead(_:) + +
    +
    +
    +
    +
    +
    +

    Asynchronously executes a read-only block that takes a +database connection.

    + +

    Guarantee 1: the block argument is isolated. Eventual concurrent +database updates are not visible inside the block:

    +
    try reader.asyncRead { result in
    +    do (
    +        let db = try result.get()
    +        // Those two values are guaranteed to be equal, even if the
    +        // `player` table is modified between the two requests:
    +        let count1 = try Player.fetchCount(db)
    +        let count2 = try Player.fetchCount(db)
    +    } catch {
    +        // handle error
    +    }
    +}
    +
    + +

    Guarantee 2: Starting iOS 8.2, OSX 10.10, and with custom SQLite builds +and SQLCipher, attempts to write in the database throw a DatabaseError +whose resultCode is SQLITE_READONLY.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func asyncRead(_ block: @escaping (Result<Database, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + unsafeRead(_:) + +
    +
    +
    +
    +
    +
    +

    Synchronously executes a read-only block that takes a database +connection, and returns its result.

    + +

    The two guarantees of the safe read method are lifted:

    + +

    The block argument is not isolated: eventual concurrent database updates +are visible inside the block:

    +
    try reader.unsafeRead { db in
    +    // Those two values may be different because some other thread
    +    // may have inserted or deleted a player between the two requests:
    +    let count1 = try Player.fetchCount(db)
    +    let count2 = try Player.fetchCount(db)
    +}
    +
    + +

    Cursor iterations are isolated, though:

    +
    try reader.unsafeRead { db in
    +    // No concurrent update can mess with this iteration:
    +    let rows = try Row.fetchCursor(db, sql: "SELECT ...")
    +    while let row = try rows.next() { ... }
    +}
    +
    + +

    The block argument is not prevented from writing (DatabaseQueue, in +particular, will accept database modifications in unsafeRead).

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unsafeRead<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes a block that takes a database connection, and +returns its result.

    + +

    The two guarantees of the safe read method are lifted:

    + +

    The block argument is not isolated: eventual concurrent database updates +are visible inside the block:

    +
    try reader.unsafeReentrantRead { db in
    +    // Those two values may be different because some other thread
    +    // may have inserted or deleted a player between the two requests:
    +    let count1 = try Player.fetchCount(db)
    +    let count2 = try Player.fetchCount(db)
    +}
    +
    + +

    Cursor iterations are isolated, though:

    +
    try reader.unsafeReentrantRead { db in
    +    // No concurrent update can mess with this iteration:
    +    let rows = try Row.fetchCursor(db, sql: "SELECT ...")
    +    while let row = try rows.next() { ... }
    +}
    +
    + +

    The block argument is not prevented from writing (DatabaseQueue, in +particular, will accept database modifications in unsafeReentrantRead).

    +
    +

    Throws

    + The error thrown by the block, or any DatabaseError that would +happen while establishing the read access to the database. + +
    + +

    This method is reentrant. It should be avoided because it fosters +dangerous concurrency practices.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unsafeReentrantRead<T>(_ block: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + block + + +
    +

    A block that accesses the database.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Functions

+

+
+
+
    +
  • +
    + + + + add(function:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine an SQL function.

    +
    let fn = DatabaseFunction("succ", argumentCount: 1) { dbValues in
    +    guard let int = Int.fromDatabaseValue(dbValues[0]) else {
    +        return nil
    +    }
    +    return int + 1
    +}
    +reader.add(function: fn)
    +try reader.read { db in
    +    try Int.fetchOne(db, sql: "SELECT succ(1)")! // 2
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func add(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(function:) + +
    +
    +
    +
    +
    +
    +

    Remove an SQL function.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func remove(function: DatabaseFunction)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Collations

+

+
+
+
    +
  • +
    + + + + add(collation:) + +
    +
    +
    +
    +
    +
    +

    Add or redefine a collation.

    +
    let collation = DatabaseCollation("localized_standard") { (string1, string2) in
    +    return (string1 as NSString).localizedStandardCompare(string2)
    +}
    +reader.add(collation: collation)
    +try reader.execute(sql: "SELECT * FROM file ORDER BY name COLLATE localized_standard")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func add(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove(collation:) + +
    +
    +
    +
    +
    +
    +

    Remove a collation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func remove(collation: DatabaseCollation)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Value Observation

+

+
+
+ +
+
+
+ + +
+ +

Backup

+

+
+
+
    +
  • +
    + + + + backup(to:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Copies the database contents into another database.

    + +

    The backup method blocks the current thread until the destination +database contains the same contents as the source database.

    + +

    When the source is a DatabasePool, concurrent writes can happen during +the backup. Those writes may, or may not, be reflected in the backup, +but they won’t trigger any error.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func backup(to writer: DatabaseWriter) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseRegionConvertible.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseRegionConvertible.html new file mode 100644 index 000000000..de2cf5134 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseRegionConvertible.html @@ -0,0 +1,1127 @@ + + + + DatabaseRegionConvertible Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseRegionConvertible

+
+
+
public protocol DatabaseRegionConvertible
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + databaseRegion(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a database region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func databaseRegion(_ db: Database) throws -> DatabaseRegion
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseValueConvertible.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseValueConvertible.html new file mode 100644 index 000000000..f3c5f01fc --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseValueConvertible.html @@ -0,0 +1,3095 @@ + + + + DatabaseValueConvertible Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseValueConvertible

+
+
+
public protocol DatabaseValueConvertible : SQLExpressible
+ +
+
+

Types that adopt DatabaseValueConvertible can be initialized from +database values.

+ +

The protocol comes with built-in methods that allow to fetch cursors, +arrays, or single values:

+
try String.fetchCursor(db, sql: "SELECT name FROM ...", arguments:...) // Cursor of String
+try String.fetchAll(db, sql: "SELECT name FROM ...", arguments:...)    // [String]
+try String.fetchOne(db, sql: "SELECT name FROM ...", arguments:...)    // String?
+
+let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
+try String.fetchCursor(statement, arguments:...) // Cursor of String
+try String.fetchAll(statement, arguments:...)    // [String]
+try String.fetchOne(statement, arguments:...)    // String?
+
+ +

DatabaseValueConvertible is adopted by Bool, Int, String, etc.

+ +
+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a value initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func fromDatabaseValue(_ dbValue: DatabaseValue) -> `Self`?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try String.fetchCursor(statement) // Cursor of String
    +while let name = try names.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> DatabaseValueCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try String.fetchAll(statement)  // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from a prepared statement.

    + +

    The result is nil if the query returns no row, or if no value can be +extracted from the first row.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let name = try String.fetchOne(statement)   // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from an SQL query.

    +
    let names = try String.fetchCursor(db, sql: "SELECT name FROM ...") // Cursor of String
    +while let name = try name.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> DatabaseValueCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from an SQL query.

    +
    let names = try String.fetchAll(db, sql: "SELECT name FROM ...") // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from an SQL query.

    + +

    The result is nil if the query returns no row, or if no value can be +extracted from the first row.

    +
    let name = try String.fetchOne(db, sql: "SELECT name FROM ...") // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try String.fetchCursor(db, request) // Cursor of String
    +while let name = try name.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R>(_ db: Database, _ request: R) throws -> DatabaseValueCursor<Self> where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try String.fetchAll(db, request) // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Self] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from a fetch request.

    + +

    The result is nil if the query returns no row, or if no value can be +extracted from the first row.

    +
    let request = Player.filter(key: 1).select(Column("name"))
    +let name = try String.fetchOne(db, request) // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<R>(_ db: Database, _ request: R) throws -> Self? where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try String.fetchCursor(statement) // Cursor of String
    +while let name = try names.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> FastDatabaseValueCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let names = try String.fetchAll(statement)  // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name FROM ...")
    +let name = try String.fetchOne(statement)   // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from an SQL query.

    +
    let names = try String.fetchCursor(db, sql: "SELECT name FROM ...") // Cursor of String
    +while let name = try names.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> FastDatabaseValueCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from an SQL query.

    +
    let names = try String.fetchAll(db, sql: "SELECT name FROM ...") // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from an SQL query.

    +
    let name = try String.fetchOne(db, sql: "SELECT name FROM ...") // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try String.fetchCursor(db, request) // Cursor of String
    +while let name = try names.next() { // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R: FetchRequest>(_ db: Database, _ request: R)
    +    throws -> FastDatabaseValueCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of values fetched from a fetch request.

    +
    let request = Player.select(Column("name"))
    +let names = try String.fetchAll(db, request) // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Self] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single value fetched from a fetch request.

    +
    let request = Player.filter(key: 1).select(Column("name"))
    +let name = try String.fetchOne(db, request) // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<R>(_ db: Database, _ request: R) throws -> Self? where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Self: ReferenceConvertible, Self.ReferenceType: DatabaseValueConvertible

+

+
+
+
    +
  • +
    + + + + databaseValue + + + Default implementation + +
    +
    +
    +
    +
    +
    + +
    +

    Default Implementation

    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    + +
    +

    Default Implementation

    +
    +

    Returns a value initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Self?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Self: RawRepresentable, Self.RawValue: DatabaseValueConvertible

+

+
+
+
    +
  • +
    + + + + databaseValue + + + Default implementation + +
    +
    +
    +
    +
    +
    + +
    +

    Default Implementation

    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    + +
    +

    Default Implementation

    +
    +

    Returns a value initialized from dbValue, if possible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Self?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseWriter.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseWriter.html new file mode 100644 index 000000000..f4ce91980 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/DatabaseWriter.html @@ -0,0 +1,1701 @@ + + + + DatabaseWriter Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseWriter

+
+
+
public protocol DatabaseWriter : DatabaseReader
+ +
+
+

The protocol for all types that can update a database.

+ +

It is adopted by DatabaseQueue and DatabasePool.

+ +

The protocol comes with isolation guarantees that describe the behavior of +adopting types in a multithreaded application.

+ +

Types that adopt the protocol can in practice provide stronger guarantees. +For example, DatabaseQueue provides a stronger isolation level +than DatabasePool.

+ +

Warning: Isolation guarantees stand as long as there is no external +connection to the database. Should you have to cope with external +connections, protect yourself with transactions, and be ready to setup a +busy handler.

+ +
+
+
+
+ + +
+ +

Writing in Database

+

+
+
+
    +
  • +
    + + + + write(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction, and returns the result.

    + +

    If the updates throw an error, the transaction is rollbacked and the +error is rethrown.

    + +

    Eventual concurrent database updates are postponed until the transaction +has completed.

    + +

    Eventual concurrent reads are guaranteed to not see any partial updates +of the database until the transaction has completed.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates, or by the +wrapping transaction. + +
    + +
    +

    Default Implementation

    +
    +

    Synchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction, and returns the result.

    + +

    If the updates throw an error, the transaction is rollbacked and the +error is rethrown.

    + +

    Eventual concurrent database updates are postponed until the transaction +has completed.

    + +

    Eventual concurrent reads are guaranteed to not see any partial updates +of the database until the transaction has completed.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates, or by the +wrapping transaction. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func write<T>(_ updates: (Database) throws -> T) throws -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    + +

    Eventual concurrent database updates are postponed until the updates +are completed.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func writeWithoutTransaction<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + asyncWrite(_:completion:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Asynchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction.

    + +

    If the updates throw an error, the transaction is rollbacked.

    + +

    The completion closure is always called with the result of the +database updates. Its arguments are a database connection and the +result of the transaction. This result is a failure if the transaction +could not be committed.

    + +

    Eventual concurrent database updates are postponed until the transaction +and the completion closure have completed.

    + +

    Eventual concurrent reads are guaranteed to not see any partial updates +of the database until the transaction has completed.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates, or by the wrapping transaction. + +
    + +
    +

    Default Implementation

    +
    +

    Asynchronously executes database updates in a protected dispatch queue, +wrapped inside a transaction.

    + +

    If the updates throw an error, the transaction is rollbacked.

    + +

    The completion closure is always called with the result of the +database updates. Its arguments are a database connection and the +result of the transaction. This result is a failure if the transaction +could not be committed. The completion closure is executed in a +protected dispatch queue, outside of any transaction.

    + +

    Eventual concurrent database updates are postponed until the transaction +and the completion closure have completed.

    + +

    Eventual concurrent reads are guaranteed to not see any partial updates +of the database until the transaction has completed.

    + +

    This method is not reentrant.

    +
    +

    Throws

    + The error thrown by the updates, or by the wrapping transaction. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func asyncWrite<T>(_ updates: @escaping (Database) throws -> T, completion: @escaping (Database, Result<T, Error>) -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + updates + + +
    +

    The updates to the database.

    +
    +
    + + completion + + +
    +

    A closure that is called with the eventual +transaction error.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Asynchronously executes database updates in a protected dispatch queue, +outside of any transaction.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func asyncWriteWithoutTransaction(_ updates: @escaping (Database) -> Void)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Synchronously executes database updates in a protected dispatch queue, +outside of any transaction, and returns the result.

    + +

    Eventual concurrent database updates are postponed until the updates +are completed.

    + +

    Eventual concurrent reads may see partial updates unless you wrap them +in a transaction.

    + +

    This method is reentrant. It should be avoided because it fosters +dangerous concurrency practices.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func unsafeReentrantWrite<T>(_ updates: (Database) throws -> T) rethrows -> T
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Reading from Database

+

+
+
+
    +
  • +
    + + + + concurrentRead(_:) + +
    +
    +
    +
    +
    +
    +

    Concurrently executes a read-only block in a protected dispatch queue.

    + +

    This method must be called from a writing dispatch queue, outside of any +transaction. You’ll get a fatal error otherwise.

    + +

    The block argument is guaranteed to see the database in the last +committed state at the moment this method is called. Eventual concurrent +database updates are not visible inside the block.

    + +

    To access the fetched results, you call the wait() method of the +returned future, on any dispatch queue.

    + +

    In the example below, the number of players is fetched concurrently with +the player insertion. Yet the future is guaranteed to return zero:

    +
    try writer.writeWithoutTransaction { db in
    +    // Delete all players
    +    try Player.deleteAll()
    +
    +    // Count players concurrently
    +    let future = writer.concurrentRead { db in
    +        return try Player.fetchCount()
    +    }
    +
    +    // Insert a player
    +    try Player(...).insert(db)
    +
    +    // Guaranteed to be zero
    +    let count = try future.wait()
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func concurrentRead<T>(_ block: @escaping (Database) throws -> T) -> DatabaseFuture<T>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Transaction Observers

+

+
+
+
    +
  • +
    + + + + add(transactionObserver:extent:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Add a transaction observer, so that it gets notified of +database changes.

    + +

    To remove the observer, use DatabaseReader.remove(transactionObserver:).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func add(
    +    transactionObserver: TransactionObserver,
    +    extent: Database.TransactionObservationExtent = .observerLifetime)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + transactionObserver + + +
    +

    A transaction observer.

    +
    +
    + + extent + + +
    +

    The duration of the observation. The default is +the observer lifetime (observation lasts until observer +is deallocated).

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Erasing the content of the database

+

+
+
+
    +
  • +
    + + + + erase() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Erases the content of the database.

    +
    +

    Precondition

    + database is not accessed concurrently during the +execution of this method. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func erase() throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Claiming Disk Space

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/EncodableRecord.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/EncodableRecord.html new file mode 100644 index 000000000..c74250782 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/EncodableRecord.html @@ -0,0 +1,1490 @@ + + + + EncodableRecord Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

EncodableRecord

+
+
+
public protocol EncodableRecord
+ +
+
+

Types that adopt EncodableRecord can be encoded into the database.

+ +
+
+
+
    +
  • +
    + + + + encode(to:) + +
    +
    +
    +
    +
    +
    +

    Encodes the record into database values.

    + +

    Store in the container argument all values that should be stored in +the columns of the database table (see databaseTableName()).

    + +

    Primary key columns, if any, must be included.

    +
    struct Player: EncodableRecord {
    +    var id: Int64?
    +    var name: String?
    +
    +    func encode(to container: inout PersistenceContainer) {
    +        container["id"] = id
    +        container["name"] = name
    +    }
    +}
    +
    + +

    It is undefined behavior to set different values for the same column. +Column names are case insensitive, so defining both “name” and “NAME” +is considered undefined behavior.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func encode(to container: inout PersistenceContainer)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Customizing the Format of Database Columns

+

+
+
+
    +
  • +
    + + + + databaseEncodingUserInfo + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the EncodableRecord type also adopts the standard Encodable +protocol, you can use this dictionary to customize the encoding process +into database rows.

    + +

    For example:

    +
    // A key that holds a encoder's name
    +let encoderName = CodingUserInfoKey(rawValue: "encoderName")!
    +
    +struct Player: PersistableRecord, Encodable {
    +    // Customize the encoder name when encoding a database row
    +    static let databaseEncodingUserInfo: [CodingUserInfoKey: Any] = [encoderName: "Database"]
    +
    +    func encode(to encoder: Encoder) throws {
    +        // Print the encoder name
    +        print(encoder.userInfo[encoderName])
    +        ...
    +    }
    +}
    +
    +let player = Player(...)
    +
    +// prints "Database"
    +try player.insert(db)
    +
    +// prints "JSON"
    +let encoder = JSONEncoder()
    +encoder.userInfo = [encoderName: "JSON"]
    +let data = try encoder.encode(player)
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseEncodingUserInfo: [CodingUserInfoKey : Any] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseJSONEncoder(for:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the EncodableRecord type also adopts the standard Encodable +protocol, this method controls the encoding process of nested properties +into JSON database columns.

    + +

    The default implementation returns a JSONEncoder with the +following properties:

    + +
      +
    • dataEncodingStrategy: .base64
    • +
    • dateEncodingStrategy: .millisecondsSince1970
    • +
    • nonConformingFloatEncodingStrategy: .throw
    • +
    • outputFormatting: .sortedKeys (iOS 11.0+, macOS 10.13+, tvOS 11.0+, watchOS 4.0+)
    • +
    + +

    You can override those defaults:

    +
    struct Achievement: Encodable {
    +    var name: String
    +    var date: Date
    +}
    +
    +struct Player: Encodable, PersistableRecord {
    +    // stored in a JSON column
    +    var achievements: [Achievement]
    +
    +    static func databaseJSONEncoder(for column: String) -> JSONEncoder {
    +        let encoder = JSONEncoder()
    +        encoder.dateEncodingStrategy = .iso8601
    +        return encoder
    +    }
    +}
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func databaseJSONEncoder(for column: String) -> JSONEncoder
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseDateEncodingStrategy + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the EncodableRecord type also adopts the standard Encodable +protocol, this property controls the encoding of date properties.

    + +

    Default value is .deferredToDate

    + +

    For example:

    +
    struct Player: PersistableRecord, Encodable {
    +    static let databaseDateEncodingStrategy: DatabaseDateEncodingStrategy = .timeIntervalSince1970
    +
    +    var name: String
    +    var registrationDate: Date // encoded as an epoch timestamp
    +}
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseDateEncodingStrategy: DatabaseDateEncodingStrategy { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseUUIDEncodingStrategy + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the EncodableRecord type also adopts the standard Encodable +protocol, this property controls the encoding of UUID properties.

    + +

    Default value is .deferredToUUID

    + +

    For example:

    +
    struct Player: PersistableProtocol, Encodable {
    +    static let databaseUUIDEncodingStrategy: DatabaseUUIDEncodingStrategy = .string
    +
    +    // encoded in a string like "E621E1F8-C36C-495A-93FC-0C247A3E6E5F"
    +    var uuid: UUID
    +}
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseUUIDEncodingStrategy: DatabaseUUIDEncodingStrategy { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseDictionary + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A dictionary whose keys are the columns encoded in the encode(to:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseDictionary: [String : DatabaseValue] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Record Comparison

+

+
+
+
    +
  • +
    + + + + databaseEquals(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a boolean indicating whether this record and the other record +have the same database representation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func databaseEquals(_ record: Self) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseChanges(from:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A dictionary of values changed from the other record.

    + +

    Its keys are column names. Its values come from the other record.

    + +

    Note that this method is not symmetrical, not only in terms of values, +but also in terms of columns. When the two records don’t define the +same set of columns in their encode(to:) method, only the columns +defined by the receiver record are considered.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func databaseChanges<Record>(from record: Record) -> [String : DatabaseValue] where Record : EncodableRecord
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FTS5CustomTokenizer.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FTS5CustomTokenizer.html new file mode 100644 index 000000000..43f40f741 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FTS5CustomTokenizer.html @@ -0,0 +1,1218 @@ + + + + FTS5CustomTokenizer Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5CustomTokenizer

+
+
+
public protocol FTS5CustomTokenizer : FTS5Tokenizer
+ +
+
+

The protocol for custom FTS5 tokenizers.

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The name of the tokenizer; should uniquely identify your custom +tokenizer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var name: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(db:arguments:) + +
    +
    +
    +
    +
    +
    +

    Creates a custom tokenizer.

    + +

    The arguments parameter is an array of String built from the CREATE +VIRTUAL TABLE statement. In the example below, the arguments will +be ["arg1", "arg2"].

    +
    CREATE VIRTUAL TABLE document USING fts5(
    +    tokenize='custom arg1 arg2'
    +)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(db: Database, arguments: [String]) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A Database connection

    +
    +
    + + arguments + + +
    +

    An array of string arguments

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + tokenizerDescriptor(arguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates an FTS5 tokenizer descriptor.

    +
    class MyTokenizer : FTS5CustomTokenizer { ... }
    +
    +db.create(virtualTable: "book", using: FTS5()) { t in
    +    let tokenizer = MyTokenizer.tokenizerDescriptor(arguments: ["unicode61", "remove_diacritics", "0"])
    +    t.tokenizer = tokenizer
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tokenizerDescriptor(arguments: [String] = []) -> FTS5TokenizerDescriptor
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FTS5Tokenizer.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FTS5Tokenizer.html new file mode 100644 index 000000000..1bfb0e2f6 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FTS5Tokenizer.html @@ -0,0 +1,1181 @@ + + + + FTS5Tokenizer Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5Tokenizer

+
+
+
public protocol FTS5Tokenizer : AnyObject
+ +
+
+

The protocol for FTS5 tokenizers

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Tokenizes the text described by pText and nText, and +notifies found tokens to the tokenCallback function.

    + +

    It matches the xTokenize function documented at https://www.sqlite.org/fts5.html#custom_tokenizers

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func tokenize(context: UnsafeMutableRawPointer?, tokenization: FTS5Tokenization, pText: UnsafePointer<Int8>?, nText: Int32, tokenCallback: @escaping FTS5TokenCallback) -> Int32
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    + + context + + +
    +

    An opaque pointer that is the first argument to +the tokenCallback function

    +
    +
    + + tokenization + + +
    +

    The reason why FTS5 is requesting tokenization.

    +
    +
    + + pText + + +
    +

    The tokenized text bytes. May or may not be +nul-terminated.

    +
    +
    + + nText + + +
    +

    The number of bytes in the tokenized text.

    +
    +
    + + tokenCallback + + +
    +

    The function to call for each found token. +It matches the xToken callback at https://www.sqlite.org/fts5.html#custom_tokenizers

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FTS5WrapperTokenizer.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FTS5WrapperTokenizer.html new file mode 100644 index 000000000..2fea2c261 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FTS5WrapperTokenizer.html @@ -0,0 +1,1284 @@ + + + + FTS5WrapperTokenizer Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5WrapperTokenizer

+
+
+
public protocol FTS5WrapperTokenizer : FTS5CustomTokenizer
+ +
+
+

The protocol for custom FTS5 tokenizers that wrap another tokenizer.

+ +

Types that adopt FTS5WrapperTokenizer don’t have to implement the +low-level FTS5Tokenizer.tokenize(context:flags:pText:nText:tokenCallback:).

+ +

Instead, they process regular Swift strings.

+ +

Here is the implementation for a trivial tokenizer that wraps the +built-in ascii tokenizer without any custom processing:

+
class TrivialAsciiTokenizer : FTS5WrapperTokenizer {
+    static let name = "trivial"
+    let wrappedTokenizer: FTS5Tokenizer
+
+    init(db: Database, arguments: [String]) throws {
+        wrappedTokenizer = try db.makeTokenizer(.ascii())
+    }
+
+    func accept(
+        token: String,
+        flags: FTS5TokenFlags,
+        for tokenization: FTS5Tokenization,
+        tokenCallback: FTS5WrapperTokenCallback)
+        throws
+    {
+        try tokenCallback(token, flags)
+    }
+}
+
+ +
+
+
+
    +
  • +
    + + + + wrappedTokenizer + +
    +
    +
    +
    +
    +
    +

    The wrapped tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var wrappedTokenizer: FTS5Tokenizer { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Given a token produced by the wrapped tokenizer, notifies customized +tokens to the tokenCallback function.

    + +

    For example:

    +
    func accept(
    +    token: String,
    +    flags: FTS5TokenFlags,
    +    for tokenization: FTS5Tokenization,
    +    tokenCallback: FTS5WrapperTokenCallback)
    +    throws
    +{
    +    // pass through:
    +    try tokenCallback(token, flags)
    +}
    +
    + +

    When implementing the accept method, there are a two rules +to observe:

    + +
      +
    1. Errors thrown by the tokenCallback function must not be caught.

    2. +
    3. The input flags should be given unmodified to the tokenCallback +function, unless you union it with the .colocated flag when the +tokenizer produces synonyms (see +https://www.sqlite.org/fts5.html#synonym_support).

    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func accept(token: String, flags: FTS5TokenFlags, for tokenization: FTS5Tokenization, tokenCallback: FTS5WrapperTokenCallback) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + token + + +
    +

    A token produced by the wrapped tokenizer

    +
    +
    + + flags + + +
    +

    Flags that tell SQLite how to register a token.

    +
    +
    + + tokenization + + +
    +

    The reason why FTS5 is requesting tokenization.

    +
    +
    + + tokenCallback + + +
    +

    The function to call for each customized token.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Default implementation

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func tokenize(
    +    context: UnsafeMutableRawPointer?,
    +    tokenization: FTS5Tokenization,
    +    pText: UnsafePointer<Int8>?,
    +    nText: Int32,
    +    tokenCallback: @escaping FTS5TokenCallback)
    +    -> Int32
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FetchRequest.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FetchRequest.html new file mode 100644 index 000000000..e21764e71 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FetchRequest.html @@ -0,0 +1,3158 @@ + + + + FetchRequest Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FetchRequest

+
+
+
public protocol FetchRequest : DatabaseRegionConvertible
+ +
+
+

The protocol for all requests that fetch database rows, and tell how those +rows should be interpreted.

+
struct Player: FetchableRecord { ... }
+let request: ... // Some FetchRequest that fetches Player
+try request.fetchCursor(db) // Cursor of Player
+try request.fetchAll(db)    // [Player]
+try request.fetchOne(db)    // Player?
+
+ +
+
+
+
    +
  • +
    + + + + RowDecoder + +
    +
    +
    +
    +
    +
    +

    The type that tells how fetched database rows should be interpreted.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype RowDecoder
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    This method is deprecated. Use +makePreparedRequest(_:forSingleResult:) instead.

    + +

    Returns a tuple that contains a prepared statement that is ready to be +executed, and an eventual row adapter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func prepare(_ db: Database, forSingleResult singleResult: Bool) throws -> (SelectStatement, RowAdapter?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + singleResult + + +
    +

    A hint that a single result row will be +consumed. Implementations can optionally use this to optimize the +prepared statement.

    +
    +
    +
    +
    +

    Return Value

    +

    A prepared statement and an eventual row adapter.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a PreparedRequest that is ready to be executed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func makePreparedRequest(_ db: Database, forSingleResult singleResult: Bool) throws -> PreparedRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + singleResult + + +
    +

    A hint that a single result row will be +consumed. Implementations can optionally use this to optimize the +prepared statement.

    +
    +
    +
    +
    +

    Return Value

    +

    A prepared request.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchCount(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Returns the number of rows fetched by the request.

    + +

    The default implementation builds a naive SQL query based on the +statement returned by the prepare method: +SELECT COUNT(*) FROM (...).

    + +

    Adopting types can refine this method in order to use more +efficient SQL.

    + +
    +

    Default Implementation

    +
    +

    Returns the number of rows fetched by the request.

    + +

    This default implementation builds a naive SQL query based on the +statement returned by the prepare method: SELECT COUNT(*) FROM (...).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetchCount(_ db: Database) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

FetchRequest

+

+
+
+
    +
  • +
    + + + + adapted(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an adapted request.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func adapted(_ adapter: @escaping (Database) throws -> RowAdapter) -> AdaptedFetchRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseRegion(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the database region that the request looks into.

    + +

    This default implementation returns a region built from the statement +returned by the prepare method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func databaseRegion(_ db: Database) throws -> DatabaseRegion
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Observation

+

+
+
+
    +
  • +
    + + + + observationForCount() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies its +count whenever it is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.all()
    +let observation = request.observationForCount()
    +
    +let observer = try observation.start(in: dbQueue) { count: Int in
    +    print("Number of players has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForCount() ->
    +    ValueObservation<ValueReducers.RemoveDuplicates<ValueReducers.Fetch<Int>>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Values

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched values.

    +
    let request: ... // Some FetchRequest that fetches String
    +let strings = try request.fetchCursor(db) // Cursor of String
    +while let string = try strings.next() {   // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> DatabaseValueCursor<RowDecoder>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched values.

    +
    let request: ... // Some FetchRequest that fetches String
    +let strings = try request.fetchAll(db) // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [RowDecoder]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The first fetched value.

    + +

    The result is nil if the request returns no row, or if no value can be +extracted from the first row.

    +
    let request: ... // Some FetchRequest that fetches String
    +let string = try request.fetchOne(db) // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne(_ db: Database) throws -> RowDecoder?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Optional values

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched optional values.

    +
    let request: ... // Some FetchRequest that fetches Optional<String>
    +let strings = try request.fetchCursor(db) // Cursor of String?
    +while let string = try strings.next() {   // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> NullableDatabaseValueCursor<RowDecoder._Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched optional values.

    +
    let request: ... // Some FetchRequest that fetches Optional<String>
    +let strings = try request.fetchAll(db) // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [RowDecoder._Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Rows

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched rows.

    +
    let request: ... // Some FetchRequest that fetches Row
    +let rows = try request.fetchCursor(db) // RowCursor
    +while let row = try rows.next() {  // Row
    +    let id: Int64 = row[0]
    +    let name: String = row[1]
    +}
    +
    + +

    Fetched rows are reused during the cursor iteration: don’t turn a row +cursor into an array with Array(rows) or rows.filter { ... } since +you would not get the distinct rows you expect. Use Row.fetchAll(...) +instead.

    + +

    For the same reason, make sure you make a copy whenever you extract a +row for later use: row.copy().

    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> RowCursor
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched rows.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched rows.

    +
    let request: ... // Some FetchRequest that fetches Row
    +let rows = try request.fetchAll(db)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [Row]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of fetched rows.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The first fetched row.

    +
    let request: ... // Some FetchRequest that fetches Row
    +let row = try request.fetchOne(db)
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne(_ db: Database) throws -> Row?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional row.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Values

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched values.

    +
    let request: ... // Some FetchRequest that fetches String
    +let strings = try request.fetchCursor(db) // Cursor of String
    +while let string = try strings.next() {   // String
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> FastDatabaseValueCursor<RowDecoder>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched values.

    +
    let request: ... // Some FetchRequest that fetches String
    +let strings = try request.fetchAll(db) // [String]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [RowDecoder]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The first fetched value.

    + +

    The result is nil if the request returns no row, or if no value can be +extracted from the first row.

    +
    let request: ... // Some FetchRequest that fetches String
    +let string = try request.fetchOne(db) // String?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne(_ db: Database) throws -> RowDecoder?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional value.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Optional values

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched optional values.

    +
    let request: ... // Some FetchRequest that fetches Optional<String>
    +let strings = try request.fetchCursor(db) // Cursor of String?
    +while let string = try strings.next() {   // String?
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> FastNullableDatabaseValueCursor<RowDecoder._Wrapped>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched values.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched optional values.

    +
    let request: ... // Some FetchRequest that fetches Optional<String>
    +let strings = try request.fetchAll(db) // [String?]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [RowDecoder._Wrapped?]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of values.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching Records

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over fetched records.

    +
    let request: ... // Some FetchRequest that fetches Player
    +let players = try request.fetchCursor(db) // Cursor of Player
    +while let player = try players.next() {   // Player
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchCursor(_ db: Database) throws -> RecordCursor<RowDecoder>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of fetched records.

    +
    let request: ... // Some FetchRequest that fetches Player
    +let players = try request.fetchAll(db) // [Player]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchAll(_ db: Database) throws -> [RowDecoder]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The first fetched record.

    +
    let request: ... // Some FetchRequest that fetches Player
    +let player = try request.fetchOne(db) // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func fetchOne(_ db: Database) throws -> RowDecoder?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Observation

+

+
+
+
    +
  • +
    + + + + observationForAll() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh values whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.select(Column("name"), as: String.self)
    +let observation = request.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { names: [String] in
    +    print("Player names have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForAll() -> ValueObservation<ValueReducers.AllValues<RowDecoder>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh value whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.select(max(Column("score")), as: Int.self)
    +let observation = request.observationForFirst()
    +
    +let observer = try observation.start(in: dbQueue) { maxScore: Int? in
    +    print("Maximum score has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForFirst() -> ValueObservation<ValueReducers.OneValue<RowDecoder>>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForAll() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh values whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.select(Column("name"), as: Optional<String>.self)
    +let observation = request.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { names: [String?] in
    +    print("Player names have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForAll() -> ValueObservation<ValueReducers.AllOptionalValues<RowDecoder._Wrapped>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh values whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.select(Column("name"), as: Optional<String>.self)
    +let observation = request.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { names: [String?] in
    +    print("Player names have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForFirst() -> ValueObservation<ValueReducers.OneValue<RowDecoder._Wrapped>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForAll() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh records whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.all()
    +let observation = request.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForAll() -> ValueObservation<ValueReducers.AllRecords<RowDecoder>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh record whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.filter(key: 1)
    +let observation = request.observationForFirst()
    +
    +let observer = try observation.start(in: dbQueue) { player: Player? in
    +    print("Player has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForFirst() -> ValueObservation<ValueReducers.OneRecord<RowDecoder>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForAll() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh rows whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = SQLRequest<Row>(sql: "SELECT * FROM player")
    +let observation = request.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { rows: [Row] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForAll() -> ValueObservation<ValueReducers.AllRows>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh row whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = SQLRequest<Row>(sql: "SELECT * FROM player WHERE id = ?", arguments: [1])
    +let observation = request.observationForFirst()
    +
    +let observer = try observation.start(in: dbQueue) { row: Row? in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func observationForFirst() -> ValueObservation<ValueReducers.OneRow>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FetchableRecord.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FetchableRecord.html new file mode 100644 index 000000000..12cdd9111 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/FetchableRecord.html @@ -0,0 +1,2941 @@ + + + + FetchableRecord Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FetchableRecord

+
+
+
public protocol FetchableRecord
+ +
+
+

Types that adopt FetchableRecord can be initialized from a database Row.

+
let row = try Row.fetchOne(db, sql: "SELECT ...")!
+let player = Player(row)
+
+ +

The protocol comes with built-in methods that allow to fetch cursors, +arrays, or single records:

+
try Player.fetchCursor(db, sql: "SELECT ...", arguments:...) // Cursor of Player
+try Player.fetchAll(db, sql: "SELECT ...", arguments:...)    // [Player]
+try Player.fetchOne(db, sql: "SELECT ...", arguments:...)    // Player?
+
+let statement = try db.makeSelectStatement(sql: "SELECT ...")
+try Player.fetchCursor(statement, arguments:...) // Cursor of Player
+try Player.fetchAll(statement, arguments:...)    // [Player]
+try Player.fetchOne(statement, arguments:...)    // Player?
+
+ +

FetchableRecord is adopted by Record.

+ +
+
+
+
+ + +
+ +

Row Decoding

+

+
+
+
    +
  • +
    + + + + init(row:) + +
    +
    +
    +
    +
    +
    +

    Creates a record from row.

    + +

    For performance reasons, the row argument may be reused during the +iteration of a fetch query. If you want to keep the row for later use, +make sure to store a copy: self.row = row.copy().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(row: Row)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Customizing the Format of Database Columns

+

+
+
+
    +
  • +
    + + + + databaseDecodingUserInfo + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the FetchableRecord type also adopts the standard Decodable +protocol, you can use this dictionary to customize the decoding process +from database rows.

    + +

    For example:

    +
    // A key that holds a decoder's name
    +let decoderName = CodingUserInfoKey(rawValue: "decoderName")!
    +
    +// A FetchableRecord + Decodable record
    +struct Player: FetchableRecord, Decodable {
    +    // Customize the decoder name when decoding a database row
    +    static let databaseDecodingUserInfo: [CodingUserInfoKey: Any] = [decoderName: "Database"]
    +
    +    init(from decoder: Decoder) throws {
    +        // Print the decoder name
    +        print(decoder.userInfo[decoderName])
    +        ...
    +    }
    +}
    +
    +// prints "Database"
    +let player = try Player.fetchOne(db, ...)
    +
    +// prints "JSON"
    +let decoder = JSONDecoder()
    +decoder.userInfo = [decoderName: "JSON"]
    +let player = try decoder.decode(Player.self, from: ...)
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseDecodingUserInfo: [CodingUserInfoKey : Any] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseJSONDecoder(for:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the FetchableRecord type also adopts the standard Decodable +protocol, this method controls the decoding process of nested properties +from JSON database columns.

    + +

    The default implementation returns a JSONDecoder with the +following properties:

    + +
      +
    • dataDecodingStrategy: .base64
    • +
    • dateDecodingStrategy: .millisecondsSince1970
    • +
    • nonConformingFloatDecodingStrategy: .throw
    • +
    + +

    You can override those defaults:

    +
    struct Achievement: Decodable {
    +    var name: String
    +    var date: Date
    +}
    +
    +struct Player: Decodable, FetchableRecord {
    +    // stored in a JSON column
    +    var achievements: [Achievement]
    +
    +    static func databaseJSONDecoder(for column: String) -> JSONDecoder {
    +        let decoder = JSONDecoder()
    +        decoder.dateDecodingStrategy = .iso8601
    +        return decoder
    +    }
    +}
    +
    + +
    +

    Default Implementation

    +
    +

    Returns a JSONDecoder with the following properties:

    + +
      +
    • dataDecodingStrategy: .base64
    • +
    • dateDecodingStrategy: .millisecondsSince1970
    • +
    • nonConformingFloatDecodingStrategy: .throw
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func databaseJSONDecoder(for column: String) -> JSONDecoder
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseDateDecodingStrategy + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When the FetchableRecord type also adopts the standard Decodable +protocol, this property controls the decoding of date properties.

    + +

    Default value is .deferredToDate

    + +

    For example:

    +
    struct Player: FetchableRecord, Decodable {
    +    static let databaseDateDecodingStrategy: DatabaseDateDecodingStrategy = .timeIntervalSince1970
    +
    +    var name: String
    +    var registrationDate: Date // decoded from epoch timestamp
    +}
    +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseDateDecodingStrategy: DatabaseDateDecodingStrategy { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SelectStatement

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over records fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT * FROM player")
    +let players = try Player.fetchCursor(statement) // Cursor of Player
    +while let player = try players.next() { // Player
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> RecordCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of records fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT * FROM player")
    +let players = try Player.fetchAll(statement) // [Player]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single record fetched from a prepared statement.

    +
    let statement = try db.makeSelectStatement(sql: "SELECT * FROM player")
    +let player = try Player.fetchOne(statement) // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ statement: SelectStatement,
    +    arguments: StatementArguments? = nil,
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + statement + + +
    +

    The statement to run.

    +
    +
    + + arguments + + +
    +

    Optional statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From SQL

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over records fetched from an SQL query.

    +
    let players = try Player.fetchCursor(db, sql: "SELECT * FROM player") // Cursor of Player
    +while let player = try players.next() { // Player
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> RecordCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of records fetched from an SQL query.

    +
    let players = try Player.fetchAll(db, sql: "SELECT * FROM player") // [Player]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:sql:arguments:adapter:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single record fetched from an SQL query.

    +
    let player = try Player.fetchOne(db, sql: "SELECT * FROM player") // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(
    +    _ db: Database,
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil)
    +    throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching From FetchRequest

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over records fetched from a fetch request.

    +
    let request = try Player.all()
    +let players = try Player.fetchCursor(db, request) // Cursor of Player
    +while let player = try players.next() { // Player
    +    ...
    +}
    +
    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<R>(_ db: Database, _ request: R) throws -> RecordCursor<Self> where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    a FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of records fetched from a fetch request.

    +
    let request = try Player.all()
    +let players = try Player.fetchAll(db, request) // [Player]
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<R>(_ db: Database, _ request: R) throws -> [Self] where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    a FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single record fetched from a fetch request.

    +
    let request = try Player.filter(key: 1)
    +let player = try Player.fetchOne(db, request) // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<R>(_ db: Database, _ request: R) throws -> Self? where R : FetchRequest
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + sql + + +
    +

    a FetchRequest.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching All

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    A cursor over all records fetched from the database.

    +
    // SELECT * FROM player
    +let players = try Player.fetchCursor(db) // Cursor of Player
    +while let player = try players.next() {  // Player
    +    ...
    +}
    +
    + +

    Records are iterated in the natural ordering of the table.

    + +

    If the database is modified during the cursor iteration, the remaining +elements are undefined.

    + +

    The cursor must be iterated in a protected dispath queue.

    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(_ db: Database) throws -> RecordCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    An array of all records fetched from the database.

    +
    // SELECT * FROM player
    +let players = try Player.fetchAll(db) // [Player]
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(_ db: Database) throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The first found record.

    +
    // SELECT * FROM player
    +let player = try Player.fetchOne(db) // Player?
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(_ db: Database) throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching by Single-Column Primary Key

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over records, given their primary keys.

    +
    let players = try Player.fetchCursor(db, keys: [1, 2, 3]) // Cursor of Player
    +while let player = try players.next() { // Player
    +    ...
    +}
    +
    + +

    Records are iterated in unspecified order.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor<Sequence>(_ db: Database, keys: Sequence)
    +    throws -> RecordCursor<Self>
    +    where Sequence: Swift.Sequence, Sequence.Element: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    A sequence of primary keys.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of records, given their primary keys.

    +
    let players = try Player.fetchAll(db, keys: [1, 2, 3]) // [Player]
    +
    + +

    The order of records in the returned array is undefined.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll<Sequence>(_ db: Database, keys: Sequence)
    +    throws -> [Self]
    +    where Sequence: Swift.Sequence, Sequence.Element: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    A sequence of primary keys.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single record given its primary key.

    +
    let player = try Player.fetchOne(db, key: 123) // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne<PrimaryKeyType>(_ db: Database, key: PrimaryKeyType?)
    +    throws -> Self?
    +    where PrimaryKeyType: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + key + + +
    +

    A primary key value.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Fetching by Key

+

+
+
+
    +
  • +
    + + + + fetchCursor(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a cursor over records identified by the provided unique keys +(primary key or any key with a unique index on it).

    +
    // Cursor of Player
    +let players = try Player.fetchCursor(db, keys: [
    +    ["email": "a@example.com"],
    +    ["email": "b@example.com"]])
    +while let player = try players.next() { // Player
    +    ...
    +}
    +
    + +

    Records are iterated in unspecified order.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCursor(_ db: Database, keys: [[String: DatabaseValueConvertible?]])
    +    throws -> RecordCursor<Self>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    An array of key dictionaries.

    +
    +
    +
    +
    +

    Return Value

    +

    A cursor over fetched records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchAll(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an array of records identified by the provided unique keys +(primary key or any key with a unique index on it).

    +
    // [Player]
    +let players = try Player.fetchAll(db, keys: [
    +    ["email": "a@example.com"],
    +    ["email": "b@example.com"]])
    +
    + +

    The order of records in the returned array is undefined.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchAll(_ db: Database, keys: [[String : DatabaseValueConvertible?]]) throws -> [Self]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    An array of key dictionaries.

    +
    +
    +
    +
    +

    Return Value

    +

    An array of records.

    +
    + +
    +
    +
  • +
  • +
    + + + + fetchOne(_:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a single record identified by a unique key (the primary key or +any key with a unique index on it).

    +
    let player = try Player.fetchOne(db, key: ["name": Arthur"]) // Player?
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchOne(_ db: Database, key: [String : DatabaseValueConvertible?]?) throws -> Self?
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + key + + +
    +

    A dictionary of values.

    +
    +
    +
    +
    +

    Return Value

    +

    An optional record.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/MutablePersistableRecord.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/MutablePersistableRecord.html new file mode 100644 index 000000000..8c68a9974 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/MutablePersistableRecord.html @@ -0,0 +1,2861 @@ + + + + MutablePersistableRecord Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

MutablePersistableRecord

+
+
+
public protocol MutablePersistableRecord : EncodableRecord, TableRecord
+ +
+
+

Types that adopt MutablePersistableRecord can be inserted, updated, and deleted.

+ +
+
+
+
    +
  • +
    + + + + persistenceConflictPolicy + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The policy that handles SQLite conflicts when records are inserted +or updated.

    + +

    This property is optional: its default value uses the ABORT policy +for both insertions and updates, and has GRDB generate regular +INSERT and UPDATE queries.

    + +

    If insertions are resolved with .ignore policy, the +didInsert(with:for:) method is not called upon successful insertion, +even if a row was actually inserted without any conflict.

    + +

    See https://www.sqlite.org/lang_conflict.html

    + +
    +

    Default Implementation

    +
    +

    Describes the conflict policy for insertions and updates.

    + +

    The default value specifies ABORT policy for both insertions and +updates, which has GRDB generate regular INSERT and UPDATE queries.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var persistenceConflictPolicy: PersistenceConflictPolicy { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + didInsert(with:for:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies the record that it was succesfully inserted.

    + +

    Do not call this method directly: it is called for you, in a protected +dispatch queue, with the inserted RowID and the eventual +INTEGER PRIMARY KEY column name.

    + +

    This method is optional: the default implementation does nothing.

    +
    struct Player : MutablePersistableRecord {
    +    var id: Int64?
    +    var name: String?
    +
    +    mutating func didInsert(with rowID: Int64, for column: String?) {
    +        self.id = rowID
    +    }
    +}
    +
    + +
    +

    Default Implementation

    +
    +

    Notifies the record that it was succesfully inserted.

    + +

    The default implementation does nothing.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func didInsert(with rowID: Int64, for column: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + rowID + + +
    +

    The inserted rowID.

    +
    +
    + + column + + +
    +

    The name of the eventual INTEGER PRIMARY KEY column.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

CRUD

+

+
+
+
    +
  • +
    + + + + insert(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT statement.

    + +

    This method is guaranteed to have inserted a row in the database if it +returns without error.

    + +

    Upon successful insertion, the didInsert(with:for:) method +is called with the inserted RowID and the eventual INTEGER PRIMARY KEY +column name.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of insert(). In their implementation, it is recommended +that they invoke the performInsert() method.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +

    Default Implementation

    +
    +

    Executes an INSERT statement.

    + +

    The default implementation for insert() invokes performInsert().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func insert(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + update(_:columns:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes an UPDATE statement.

    + +

    This method is guaranteed to have updated a row in the database if it +returns without error.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of update(). In their implementation, it is recommended +that they invoke the performUpdate() method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database. + +
    + +
    +

    Default Implementation

    +
    +

    Executes an UPDATE statement.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func update(_ db: Database, columns: Set<String>) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + columns + + +
    +

    The columns to update.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + save(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT or an UPDATE statement so that self is saved in +the database.

    + +

    If the receiver has a non-nil primary key and a matching row in the +database, this method performs an update.

    + +

    Otherwise, performs an insert.

    + +

    This method is guaranteed to have inserted or updated a row in the +database if it returns without error.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of save(). In their implementation, it is recommended +that they invoke the performSave() method.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs, or errors +thrown by update(). + +
    + +
    +

    Default Implementation

    +
    +

    Executes an INSERT or an UPDATE statement so that self is saved in +the database.

    + +

    The default implementation for save() invokes performSave().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func save(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + delete(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes a DELETE statement.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of delete(). In their implementation, it is recommended +that they invoke the performDelete() method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +

    Default Implementation

    +
    +

    Executes a DELETE statement.

    + +

    The default implementation for delete() invokes performDelete().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +func delete(_ db: Database) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether a database row was deleted.

    +
    + +
    +
    +
  • +
  • +
    + + + + exists(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Returns true if and only if the primary key matches a row in +the database.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of exists(). In their implementation, it is recommended +that they invoke the performExists() method.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +

    Default Implementation

    +
    +

    Returns true if and only if the primary key matches a row in +the database.

    + +

    The default implementation for exists() invokes performExists().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func exists(_ db: Database) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the primary key matches a row in the database.

    +
    + +
    +
    +
  • +
  • +
    + + + + update(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Executes an UPDATE statement that updates all table columns.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func update(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + updateChanges(_:from:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    If the record has any difference from the other record, executes an +UPDATE statement so that those differences and only those difference are +saved in the database.

    + +

    This method is guaranteed to have saved the eventual differences in the +database if it returns without error.

    + +

    For example:

    +
    if let oldPlayer = try Player.fetchOne(db, key: 42) {
    +    var newPlayer = oldPlayer
    +    newPlayer.score += 10
    +    newPlayer.hasAward = true
    +    try newPlayer.updateChanges(db, from: oldRecord)
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database and record could not be updated. + +
    +

    See also

    + updateChanges(_:with:) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func updateChanges<Record>(_ db: Database, from record: Record) throws -> Bool where Record : MutablePersistableRecord
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + record + + +
    +

    The comparison record.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the record had changes.

    +
    + +
    +
    +
  • +
  • +
    + + + + updateChanges(_:with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Mutates the record according to the provided closure, and then, if the +record has any difference from its previous version, executes an +UPDATE statement so that those differences and only those difference are +saved in the database.

    + +

    This method is guaranteed to have saved the eventual differences in the +database if it returns without error.

    + +

    For example:

    +
    if var player = try Player.fetchOne(db, key: 42) {
    +    try player.updateChanges(db) {
    +        $0.score += 10
    +        $0.hasAward = true
    +    }
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database and record could not be updated. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public mutating func updateChanges(_ db: Database, with change: (inout Self) throws -> Void) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + change + + +
    +

    A closure that modifies the record.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the record had changes.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

CRUD Internals

+

+
+
+
    +
  • +
    + + + + performInsert(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt MutablePersistableRecord.

    + +

    performInsert() provides the default implementation for insert(). Types +that adopt MutablePersistableRecord can invoke performInsert() in their +implementation of insert(). They should not provide their own +implementation of performInsert().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public mutating func performInsert(_ db: Database) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + performUpdate(_:columns:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt MutablePersistableRecord.

    + +

    performUpdate() provides the default implementation for update(). Types +that adopt MutablePersistableRecord can invoke performUpdate() in their +implementation of update(). They should not provide their own +implementation of performUpdate().

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func performUpdate(_ db: Database, columns: Set<String>) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + columns + + +
    +

    The columns to update.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + performSave(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt MutablePersistableRecord.

    + +

    performSave() provides the default implementation for save(). Types +that adopt MutablePersistableRecord can invoke performSave() in their +implementation of save(). They should not provide their own +implementation of performSave().

    + +

    This default implementation forwards the job to update or insert.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public mutating func performSave(_ db: Database) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + performDelete(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt MutablePersistableRecord.

    + +

    performDelete() provides the default implementation for deelte(). Types +that adopt MutablePersistableRecord can invoke performDelete() in +their implementation of delete(). They should not provide their own +implementation of performDelete().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func performDelete(_ db: Database) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + performExists(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt MutablePersistableRecord.

    + +

    performExists() provides the default implementation for exists(). Types +that adopt MutablePersistableRecord can invoke performExists() in +their implementation of exists(). They should not provide their own +implementation of performExists().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func performExists(_ db: Database) throws -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Batch Delete

+

+
+
+
    +
  • +
    + + + + deleteAll(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Deletes all records; returns the number of deleted rows.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func deleteAll(_ db: Database) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of deleted rows

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Batch Update

+

+
+
+
    +
  • +
    + + + + updateAll(_:onConflict:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Updates all records; returns the number of updated records.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    try Player.updateAll(db, [Column("score") <- 0])
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func updateAll(
    +    _ db: Database,
    +    onConflict conflictResolution: Database.ConflictResolution? = nil,
    +    _ assignments: [ColumnAssignment])
    +    throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + conflictResolution + + +
    +

    A policy for conflict resolution, +defaulting to the record’s persistenceConflictPolicy.

    +
    +
    + + assignments + + +
    +

    An array of column assignments.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of updated rows.

    +
    + +
    +
    +
  • +
  • +
    + + + + updateAll(_:onConflict:_:_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Updates all records; returns the number of updated records.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    try Player.updateAll(db, Column("score") <- 0)
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func updateAll(
    +    _ db: Database,
    +    onConflict conflictResolution: Database.ConflictResolution? = nil,
    +    _ assignment: ColumnAssignment,
    +    _ otherAssignments: ColumnAssignment...)
    +    throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + conflictResolution + + +
    +

    A policy for conflict resolution, +defaulting to the record’s persistenceConflictPolicy.

    +
    +
    + + assignment + + +
    +

    A column assignment.

    +
    +
    + + otherAssignments + + +
    +

    Eventual other column assignments.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of updated rows.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Deleting by Single-Column Primary Key

+

+
+
+
    +
  • +
    + + + + deleteAll(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Delete records identified by their primary keys; returns the number of +deleted rows.

    +
    // DELETE FROM player WHERE id IN (1, 2, 3)
    +try Player.deleteAll(db, keys: [1, 2, 3])
    +
    +// DELETE FROM country WHERE code IN ('FR', 'US', 'DE')
    +try Country.deleteAll(db, keys: ["FR", "US", "DE"])
    +
    + +

    When the table has no explicit primary key, GRDB uses the hidden +“rowid” column:

    +
    // DELETE FROM document WHERE rowid IN (1, 2, 3)
    +try Document.deleteAll(db, keys: [1, 2, 3])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func deleteAll<Sequence>(_ db: Database, keys: Sequence)
    +    throws -> Int
    +    where Sequence: Swift.Sequence, Sequence.Element: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    A sequence of primary keys.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of deleted rows

    +
    + +
    +
    +
  • +
  • +
    + + + + deleteOne(_:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Delete a record, identified by its primary key; returns whether a +database row was deleted.

    +
    // DELETE FROM player WHERE id = 123
    +try Player.deleteOne(db, key: 123)
    +
    +// DELETE FROM country WHERE code = 'FR'
    +try Country.deleteOne(db, key: "FR")
    +
    + +

    When the table has no explicit primary key, GRDB uses the hidden +“rowid” column:

    +
    // DELETE FROM document WHERE rowid = 1
    +try Document.deleteOne(db, key: 1)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func deleteOne<PrimaryKeyType>(_ db: Database, key: PrimaryKeyType?)
    +    throws -> Bool
    +    where PrimaryKeyType: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + key + + +
    +

    A primary key value.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether a database row was deleted.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Deleting by Key

+

+
+
+
    +
  • +
    + + + + deleteAll(_:keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Delete records identified by the provided unique keys (primary key or +any key with a unique index on it); returns the number of deleted rows.

    +
    try Player.deleteAll(db, keys: [["email": "a@example.com"], ["email": "b@example.com"]])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func deleteAll(_ db: Database, keys: [[String : DatabaseValueConvertible?]]) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + keys + + +
    +

    An array of key dictionaries.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of deleted rows

    +
    + +
    +
    +
  • +
  • +
    + + + + deleteOne(_:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Delete a record, identified by a unique key (the primary key or any key +with a unique index on it); returns whether a database row was deleted.

    +
    Player.deleteOne(db, key: ["name": Arthur"])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public static func deleteOne(_ db: Database, key: [String : DatabaseValueConvertible?]) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + key + + +
    +

    A dictionary of values.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether a database row was deleted.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Record Comparison

+

+
+
+
    +
  • +
    + + + + updateChanges(_:with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Mutates the record according to the provided closure, and then, if the +record has any difference from its previous version, executes an +UPDATE statement so that those differences and only those difference are +saved in the database.

    + +

    This method is guaranteed to have saved the eventual differences in the +database if it returns without error.

    + +

    For example:

    +
    if let player = try Player.fetchOne(db, key: 42) {
    +    try player.updateChanges(db) {
    +        $0.score += 10
    +        $0.hasAward = true
    +    }
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. +PersistenceError.recordNotFound is thrown if the primary key does not +match any row in the database and record could not be updated. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func updateChanges(_ db: Database, with change: (Self) throws -> Void) throws -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + change + + +
    +

    A closure that modifies the record.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the record had changes.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/PersistableRecord.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/PersistableRecord.html new file mode 100644 index 000000000..187c1c41c --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/PersistableRecord.html @@ -0,0 +1,1414 @@ + + + + PersistableRecord Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PersistableRecord

+
+
+
public protocol PersistableRecord : MutablePersistableRecord
+ +
+
+

Types that adopt PersistableRecord can be inserted, updated, and deleted.

+ +

This protocol is intented for types that don’t have an INTEGER PRIMARY KEY.

+ +

Unlike MutablePersistableRecord, the insert() and save() methods are not +mutating methods.

+ +
+
+
+
    +
  • +
    + + + + didInsert(with:for:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies the record that it was succesfully inserted.

    + +

    Do not call this method directly: it is called for you, in a protected +dispatch queue, with the inserted RowID and the eventual +INTEGER PRIMARY KEY column name.

    + +

    This method is optional: the default implementation does nothing.

    + +

    If you need a mutating variant of this method, adopt the +MutablePersistableRecord protocol instead.

    + +
    +

    Default Implementation

    +
    +

    Notifies the record that it was succesfully inserted.

    + +

    The default implementation does nothing.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func didInsert(with rowID: Int64, for column: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + rowID + + +
    +

    The inserted rowID.

    +
    +
    + + column + + +
    +

    The name of the eventual INTEGER PRIMARY KEY column.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + insert(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT statement.

    + +

    This method is guaranteed to have inserted a row in the database if it +returns without error.

    + +

    Upon successful insertion, the didInsert(with:for:) method +is called with the inserted RowID and the eventual INTEGER PRIMARY KEY +column name.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of insert(). In their implementation, it is recommended +that they invoke the performInsert() method.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs. + +
    + +
    +

    Default Implementation

    +
    +

    Executes an INSERT statement.

    + +

    The default implementation for insert() invokes performInsert().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func insert(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + save(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes an INSERT or an UPDATE statement so that self is saved in +the database.

    + +

    If the receiver has a non-nil primary key and a matching row in the +database, this method performs an update.

    + +

    Otherwise, performs an insert.

    + +

    This method is guaranteed to have inserted or updated a row in the +database if it returns without error.

    + +

    This method has a default implementation, so your adopting types don’t +have to implement it. Yet your types can provide their own +implementation of save(). In their implementation, it is recommended +that they invoke the performSave() method.

    +
    +

    Throws

    + A DatabaseError whenever an SQLite error occurs, or errors +thrown by update(). + +
    + +
    +

    Default Implementation

    +
    +

    Executes an INSERT or an UPDATE statement so that self is saved in +the database.

    + +

    The default implementation for save() invokes performSave().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func save(_ db: Database) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Immutable CRUD Internals

+

+
+
+
    +
  • +
    + + + + performInsert(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt PersistableRecord.

    + +

    performInsert() provides the default implementation for insert(). Types +that adopt PersistableRecord can invoke performInsert() in their +implementation of insert(). They should not provide their own +implementation of performInsert().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func performInsert(_ db: Database) throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + performSave(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Don’t invoke this method directly: it is an internal method for types +that adopt PersistableRecord.

    + +

    performSave() provides the default implementation for save(). Types +that adopt PersistableRecord can invoke performSave() in their +implementation of save(). They should not provide their own +implementation of performSave().

    + +

    This default implementation forwards the job to update or insert.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public func performSave(_ db: Database) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/RowAdapter.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/RowAdapter.html new file mode 100644 index 000000000..e9bf16fea --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/RowAdapter.html @@ -0,0 +1,1202 @@ + + + + RowAdapter Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

RowAdapter

+
+
+
public protocol RowAdapter
+ +
+
+

RowAdapter is a protocol that helps two incompatible row interfaces working +together.

+ +

GRDB ships with four concrete types that adopt the RowAdapter protocol:

+ +
    +
  • ColumnMapping: renames row columns
  • +
  • SuffixRowAdapter: hides the first columns of a row
  • +
  • RangeRowAdapter: only exposes a range of columns
  • +
  • ScopeAdapter: groups several adapters together to define named scopes
  • +
+ +

To use a row adapter, provide it to any method that fetches:

+
let adapter = SuffixRowAdapter(fromIndex: 2)
+let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
+
+// [baz:3]
+try Row.fetchOne(db, sql: sql, adapter: adapter)
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Experimental

    + +

    You never call this method directly. It is called for you whenever an +adapter has to be applied.

    + +

    The result is a value that adopts LayoutedRowAdapter, such as +LayoutedColumnMapping.

    + +

    For example:

    +
    // An adapter that turns any row to a row that contains a single
    +// column named "foo" whose value is the leftmost value of the
    +// base row.
    +struct FirstColumnAdapter : RowAdapter {
    +    func layoutedAdapter(from layout: RowLayout) throws -> LayoutedRowAdapter {
    +        return LayoutedColumnMapping(layoutColumns: [(0, "foo")])
    +    }
    +}
    +
    +// [foo:1]
    +try Row.fetchOne(db, sql: "SELECT 1, 2, 3", adapter: FirstColumnAdapter())
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func layoutedAdapter(from layout: RowLayout) throws -> LayoutedRowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + addingScopes(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns an adapter based on self, with added scopes.

    + +

    If self already defines scopes, the added scopes replace +eventual existing scopes with the same name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func addingScopes(_ scopes: [String : RowAdapter]) -> RowAdapter
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + scopes + + +
    +

    A dictionary that maps scope names to +row adapters.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/StatementColumnConvertible.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/StatementColumnConvertible.html new file mode 100644 index 000000000..02378bc81 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/StatementColumnConvertible.html @@ -0,0 +1,1174 @@ + + + + StatementColumnConvertible Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

StatementColumnConvertible

+
+
+
public protocol StatementColumnConvertible
+ +
+
+

The StatementColumnConvertible protocol grants access to the low-level C +interface that extracts values from query results: +https://www.sqlite.org/c3ref/column_blob.html. It can bring performance +improvements.

+ +

To use it, have a value type adopt both StatementColumnConvertible and +DatabaseValueConvertible. GRDB will then automatically apply the +optimization whenever direct access to SQLite is possible:

+
let rows = Row.fetchCursor(db, sql: "SELECT ...")
+while let row = try rows.next() {
+    let int: Int = row[0]                 // there
+}
+let ints = Int.fetchAll(db, sql: "SELECT ...") // there
+struct Player {
+    init(row: Row) {
+        name = row["name"]                // there
+        score = row["score"]              // there
+    }
+}
+
+ +

StatementColumnConvertible is already adopted by all Swift integer types, +Float, Double, String, and Bool.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Initializes a value from a raw SQLite statement pointer.

    + +

    For example, here is the how Int64 adopts StatementColumnConvertible:

    +
    extension Int64: StatementColumnConvertible {
    +    init(sqliteStatement: SQLiteStatement, index: Int32) {
    +        self = sqlite3_column_int64(sqliteStatement, index)
    +    }
    +}
    +
    + +

    This initializer is never called for NULL database values: don’t perform +any extra check.

    + +

    See https://www.sqlite.org/c3ref/column_blob.html for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/TableRecord.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/TableRecord.html new file mode 100644 index 000000000..085010b7b --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/TableRecord.html @@ -0,0 +1,3846 @@ + + + + TableRecord Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TableRecord

+
+
+
public protocol TableRecord
+ +
+
+

Types that adopt TableRecord declare a particular relationship with +a database table.

+ +

Types that adopt both TableRecord and FetchableRecord are granted with +built-in methods that allow to fetch instances identified by key:

+
try Player.fetchOne(db, key: 123)  // Player?
+try Citizenship.fetchOne(db, key: ["citizenId": 12, "countryId": 45]) // Citizenship?
+
+ +

TableRecord is adopted by Record.

+ +
+
+
+
    +
  • +
    + + + + databaseTableName + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The name of the database table used to build requests.

    +
    struct Player : TableRecord {
    +    static var databaseTableName = "player"
    +}
    +
    +// SELECT * FROM player
    +try Player.fetchAll(db)
    +
    + +
    +

    Default Implementation

    +
    +

    The default name of the database table used to build requests.

    + +
      +
    • Player -> “player”
    • +
    • Place -> “place”
    • +
    • PostalAddress -> “postalAddress”
    • +
    • HTTPRequest -> “httpRequest”
    • +
    • TOEFL -> “toefl”
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseTableName: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseSelection + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    The default request selection.

    + +

    Unless said otherwise, requests select all columns:

    +
    // SELECT * FROM player
    +try Player.fetchAll(db)
    +
    + +

    You can provide a custom implementation and provide an explicit list +of columns:

    +
    struct RestrictedPlayer : TableRecord {
    +    static var databaseTableName = "player"
    +    static var databaseSelection = [Column("id"), Column("name")]
    +}
    +
    +// SELECT id, name FROM player
    +try RestrictedPlayer.fetchAll(db)
    +
    + +

    You can also add extra columns such as the rowid column:

    +
    struct ExtendedPlayer : TableRecord {
    +    static var databaseTableName = "player"
    +    static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID]
    +}
    +
    +// SELECT *, rowid FROM player
    +try ExtendedPlayer.fetchAll(db)
    +
    + +
    +

    Default Implementation

    +
    +

    Default value: [AllColumns()].

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var databaseSelection: [SQLSelectable] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Full Text Search

+

+
+
+
    +
  • +
    + + + + matching(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a QueryInterfaceRequest with a matching predicate.

    +
    // SELECT * FROM book WHERE book MATCH '...'
    +var request = Book.matching(pattern)
    +
    + +

    If the search pattern is nil, the request does not match any +database row.

    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func matching(_ pattern: FTS3Pattern?) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + belongsTo(_:key:using:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a “Belongs To” association between Self and the +destination type.

    +
    struct Author: TableRecord { ... }
    +struct Book: TableRecord {
    +    static let author = belongsTo(Author.self)
    +}
    +
    + +

    The association will let you define requests that load both the source +and the destination type:

    +
    // A request for all books with their authors:
    +let request = Book.including(optional: Book.author)
    +
    + +

    To consume those requests, define a type that adopts both the +FetchableRecord and Decodable protocols:

    +
    struct BookInfo: FetchableRecord, Decodable {
    +    var book: Book
    +    var author: Author?
    +}
    +
    +let bookInfos = try dbQueue.read { db in
    +    return try BookInfo.fetchAll(db, request)
    +}
    +for bookInfo in bookInfos {
    +    print("\(bookInfo.book.title) by \(bookInfo.author.name)")
    +}
    +
    + +

    It is recommended that you define, alongside the static association, a +property with the same name:

    +
    struct Book: TableRecord, EncodableRecord {
    +    static let author = belongsTo(Author.self)
    +    var author: QueryInterfaceRequest<Author> {
    +        return request(for: Book.author)
    +    }
    +}
    +
    + +

    This property will let you navigate from the source type to the +destination type:

    +
    try dbQueue.read { db in
    +    let book: Book = ...
    +    let author = try book.author.fetchOne(db) // Author?
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func belongsTo<Destination>(
    +    _ destination: Destination.Type,
    +    key: String? = nil,
    +    using foreignKey: ForeignKey? = nil)
    +    -> BelongsToAssociation<Self, Destination>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + destination + + +
    +

    The record type at the other side of the association.

    +
    +
    + + key + + +
    +

    An eventual decoding key for the association. By default, it +is destination.databaseTableName.

    +
    +
    + + foreignKey + + +
    +

    An eventual foreign key. You need to provide an +explicit foreign key when GRDB can’t infer one from the database +schema. This happens when the schema does not define any foreign +key to the destination table, or when the schema defines several +foreign keys to the destination table.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasMany(_:key:using:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a “Has many” association between Self and the +destination type.

    +
    struct Book: TableRecord { ... }
    +struct Author: TableRecord {
    +    static let books = hasMany(Book.self)
    +}
    +
    + +

    The association will let you define requests that load both the source +and the destination type:

    +
    // A request for all (author, book) pairs:
    +let request = Author.including(required: Author.books)
    +
    + +

    To consume those requests, define a type that adopts both the +FetchableRecord and Decodable protocols:

    +
    struct Authorship: FetchableRecord, Decodable {
    +    var author: Author
    +    var book: Book
    +}
    +
    +let authorships = try dbQueue.read { db in
    +    return try Authorship.fetchAll(db, request)
    +}
    +for authorship in authorships {
    +    print("\(authorship.author.name) wrote \(authorship.book.title)")
    +}
    +
    + +

    It is recommended that you define, alongside the static association, a +property with the same name:

    +
    struct Author: TableRecord, EncodableRecord {
    +    static let books = hasMany(Book.self)
    +    var books: QueryInterfaceRequest<Book> {
    +        return request(for: Author.books)
    +    }
    +}
    +
    + +

    This property will let you navigate from the source type to the +destination type:

    +
    try dbQueue.read { db in
    +    let author: Author = ...
    +    let books = try author.books.fetchAll(db) // [Book]
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasMany<Destination>(
    +    _ destination: Destination.Type,
    +    key: String? = nil,
    +    using foreignKey: ForeignKey? = nil)
    +    -> HasManyAssociation<Self, Destination>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + destination + + +
    +

    The record type at the other side of the association.

    +
    +
    + + key + + +
    +

    An eventual decoding key for the association. By default, it +is destination.databaseTableName.

    +
    +
    + + foreignKey + + +
    +

    An eventual foreign key. You need to provide an +explicit foreign key when GRDB can’t infer one from the database +schema. This happens when the schema does not define any foreign +key from the destination table, or when the schema defines several +foreign keys from the destination table.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasMany(_:through:using:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a “Has Many Through” association between Self and the +destination type.

    +
    struct Country: TableRecord {
    +    static let passports = hasMany(Passport.self)
    +    static let citizens = hasMany(Citizen.self, through: passports, using: Passport.citizen)
    +}
    +
    +struct Passport: TableRecord {
    +    static let citizen = belongsTo(Citizen.self)
    +}
    +
    +struct Citizen: TableRecord { }
    +
    + +

    The association will let you define requests that load both the source +and the destination type:

    +
    // A request for all (country, citizen) pairs:
    +let request = Country.including(required: Coutry.citizens)
    +
    + +

    To consume those requests, define a type that adopts both the +FetchableRecord and Decodable protocols:

    +
    struct Citizenship: FetchableRecord, Decodable {
    +    var country: Country
    +    var citizen: Citizen
    +}
    +
    +let citizenships = try dbQueue.read { db in
    +    return try Citizenship.fetchAll(db, request)
    +}
    +for citizenship in citizenships {
    +    print("\(citizenship.citizen.name) is a citizen of \(citizenship.country.name)")
    +}
    +
    + +

    It is recommended that you define, alongside the static association, a +property with the same name:

    +
    struct Country: TableRecord, EncodableRecord {
    +    static let passports = hasMany(Passport.self)
    +    static let citizens = hasMany(Citizen.self, through: passports, using: Passport.citizen)
    +    var citizens: QueryInterfaceRequest<Citizen> {
    +        return request(for: Country.citizens)
    +    }
    +}
    +
    + +

    This property will let you navigate from the source type to the +destination type:

    +
    try dbQueue.read { db in
    +    let country: Country = ...
    +    let citizens = try country.citizens.fetchAll(db) // [Country]
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasMany<Pivot, Target>(
    +    _ destination: Target.RowDecoder.Type,
    +    through pivot: Pivot,
    +    using target: Target,
    +    key: String? = nil)
    +    -> HasManyThroughAssociation<Self, Target.RowDecoder>
    +    where Pivot: Association,
    +    Target: Association,
    +    Pivot.OriginRowDecoder == Self,
    +    Pivot.RowDecoder == Target.OriginRowDecoder
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + destination + + +
    +

    The record type at the other side of the association.

    +
    +
    + + pivot + + +
    +

    An association from Self to the intermediate type.

    +
    +
    + + target + + +
    +

    A target association from the intermediate type to the +destination type.

    +
    +
    + + key + + +
    +

    An eventual decoding key for the association. By default, it +is the same key as the target.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasOne(_:key:using:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a “Has one” association between Self and the +destination type.

    +
    struct Demographics: TableRecord { ... }
    +struct Country: TableRecord {
    +    static let demographics = hasOne(Demographics.self)
    +}
    +
    + +

    The association will let you define requests that load both the source +and the destination type:

    +
    // A request for all countries with their demographic profile:
    +let request = Country.including(optional: Country.demographics)
    +
    + +

    To consume those requests, define a type that adopts both the +FetchableRecord and Decodable protocols:

    +
    struct CountryInfo: FetchableRecord, Decodable {
    +    var country: Country
    +    var demographics: Demographics?
    +}
    +
    +let countryInfos = try dbQueue.read { db in
    +    return try CountryInfo.fetchAll(db, request)
    +}
    +for countryInfo in countryInfos {
    +    print("\(countryInfo.country.name) has \(countryInfo.demographics.population) citizens")
    +}
    +
    + +

    It is recommended that you define, alongside the static association, a +property with the same name:

    +
    struct Country: TableRecord, EncodableRecord {
    +    static let demographics = hasOne(Demographics.self)
    +    var demographics: QueryInterfaceRequest<Demographics> {
    +        return request(for: Country.demographics)
    +    }
    +}
    +
    + +

    This property will let you navigate from the source type to the +destination type:

    +
    try dbQueue.read { db in
    +    let country: Country = ...
    +    let demographics = try country.demographics.fetchOne(db) // Demographics?
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasOne<Destination>(
    +    _ destination: Destination.Type,
    +    key: String? = nil,
    +    using foreignKey: ForeignKey? = nil)
    +    -> HasOneAssociation<Self, Destination>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + destination + + +
    +

    The record type at the other side of the association.

    +
    +
    + + key + + +
    +

    An eventual decoding key for the association. By default, it +is destination.databaseTableName.

    +
    +
    + + foreignKey + + +
    +

    An eventual foreign key. You need to provide an +explicit foreign key when GRDB can’t infer one from the database +schema. This happens when the schema does not define any foreign +key from the destination table, or when the schema defines several +foreign keys from the destination table.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + hasOne(_:through:using:key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a “Has One Through” association between Self and the +destination type.

    +
    struct Book: TableRecord {
    +    static let library = belongsTo(Library.self)
    +    static let returnAddress = hasOne(Address.self, through: library, using: Library.address)
    +}
    +
    +struct Library: TableRecord {
    +    static let address = hasOne(Address.self)
    +}
    +
    +struct Address: TableRecord { ... }
    +
    + +

    The association will let you define requests that load both the source +and the destination type:

    +
    // A request for all (book, returnAddress) pairs:
    +let request = Book.including(required: Book.returnAddress)
    +
    + +

    To consume those requests, define a type that adopts both the +FetchableRecord and Decodable protocols:

    +
    struct Todo: FetchableRecord, Decodable {
    +    var book: Book
    +    var address: Address
    +}
    +
    +let todos = try dbQueue.read { db in
    +    return try Todo.fetchAll(db, request)
    +}
    +for todo in todos {
    +    print("Please return \(todo.book) to \(todo.address)")
    +}
    +
    + +

    It is recommended that you define, alongside the static association, a +property with the same name:

    +
    struct Book: TableRecord, EncodableRecord {
    +    static let library = belongsTo(Library.self)
    +    static let returnAddress = hasOne(Address.self, through: library, using: library.address)
    +    var returnAddress: QueryInterfaceRequest<Address> {
    +        return request(for: Book.returnAddress)
    +    }
    +}
    +
    + +

    This property will let you navigate from the source type to the +destination type:

    +
    try dbQueue.read { db in
    +    let book: Book = ...
    +    let address = try book.returnAddress.fetchOne(db) // Address?
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasOne<Pivot, Target>(
    +    _ destination: Target.RowDecoder.Type,
    +    through pivot: Pivot,
    +    using target: Target,
    +    key: String? = nil)
    +    -> HasOneThroughAssociation<Self, Target.RowDecoder>
    +    where Pivot: AssociationToOne,
    +    Target: AssociationToOne,
    +    Pivot.OriginRowDecoder == Self,
    +    Pivot.RowDecoder == Target.OriginRowDecoder
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + destination + + +
    +

    The record type at the other side of the association.

    +
    +
    + + pivot + + +
    +

    An association from Self to the intermediate type.

    +
    +
    + + target + + +
    +

    A target association from the intermediate type to the +destination type.

    +
    +
    + + key + + +
    +

    An eventual decoding key for the association. By default, it +is the same key as the target.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Associations

+

+
+
+
    +
  • +
    + + + + including(all:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that prefetches an association.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func including<A: AssociationToMany>(all association: A)
    +    -> QueryInterfaceRequest<Self>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + including(optional:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that includes an association. The columns of the +associated record are selected. The returned association does not +require that the associated database table contains a matching row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func including<A: Association>(optional association: A)
    +    -> QueryInterfaceRequest<Self>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + including(required:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that includes an association. The columns of the +associated record are selected. The returned association requires +that the associated database table contains a matching row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func including<A: Association>(required association: A)
    +    -> QueryInterfaceRequest<Self>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + joining(optional:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that includes an association. The columns of the +associated record are not selected. The returned association does not +require that the associated database table contains a matching row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func joining<A: Association>(optional association: A)
    +    -> QueryInterfaceRequest<Self>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + joining(required:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that includes an association. The columns of the +associated record are not selected. The returned association requires +that the associated database table contains a matching row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func joining<A: Association>(required association: A)
    +    -> QueryInterfaceRequest<Self>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Association Aggregates

+

+
+
+
    +
  • +
    + + + + annotated(with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with aggregates appended to the selection.

    +
    // SELECT player.*, COUNT(DISTINCT book.rowid) AS bookCount
    +// FROM player LEFT JOIN book ...
    +var request = Player.annotated(with: Player.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func annotated(with aggregates: AssociationAggregate<Self>...) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with aggregates appended to the selection.

    +
    // SELECT player.*, COUNT(DISTINCT book.rowid) AS bookCount
    +// FROM player LEFT JOIN book ...
    +var request = Player.annotated(with: [Player.books.count])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func annotated(with aggregates: [AssociationAggregate<Self>]) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + having(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided aggregate predicate.

    +
    // SELECT player.*
    +// FROM player LEFT JOIN book ...
    +// HAVING COUNT(DISTINCT book.rowid) = 0
    +var request = Player.all()
    +request = request.having(Player.books.isEmpty)
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func having(_ predicate: AssociationAggregate<Self>) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Request Derivation

+

+
+
+
    +
  • +
    + + + + all() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which fetches all records.

    +
    // SELECT * FROM player
    +let request = Player.all()
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func all() -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + none() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which fetches no record.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func none() -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection.

    +
    // SELECT id, email FROM player
    +let request = Player.select(Column("id"), Column("email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select(_ selection: SQLSelectable...) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection.

    +
    // SELECT id, email FROM player
    +let request = Player.select([Column("id"), Column("email")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select(_ selection: [SQLSelectable]) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(sql:arguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects sql.

    +
    // SELECT id, email FROM player
    +let request = Player.select(sql: "id, email")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments())
    +    -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(literal:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects an SQL literal.

    +
    // SELECT id, email FROM player
    +let request = Player.select(literal: SQLLiteral(sql: "id, email"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select(literal sqlLiteral: SQLLiteral) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:as:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.select([max(Column("score"))], as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select<RowDecoder>(
    +    _ selection: [SQLSelectable],
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:as:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.select(max(Column("score")), as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select<RowDecoder>(
    +    _ selection: SQLSelectable...,
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(sql:arguments:as:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects sql, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.select(sql: "max(score)", as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select<RowDecoder>(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(literal:as:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects an SQL literal, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.select(literal: SQLLiteral(sql: "max(score)"), as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func select<RowDecoder>(
    +    literal sqlLiteral: SQLLiteral,
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends selection.

    +
    // SELECT id, email, name FROM player
    +le request = Player
    +    .select([Column("id"), Column("email")])
    +    .annotated(with: [Column("name")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func annotated(with selection: [SQLSelectable]) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends selection.

    +
    // SELECT id, email, name FROM player
    +le request = Player
    +    .select([Column("id"), Column("email")])
    +    .annotated(with: Column("name"))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func annotated(with selection: SQLSelectable...) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided predicate.

    +
    // SELECT * FROM player WHERE email = 'arthur@example.com'
    +let request = Player.filter(Column("email") == "arthur@example.com")
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter(_ predicate: SQLExpressible) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided primary key predicate.

    +
    // SELECT * FROM player WHERE id = 1
    +let request = Player.filter(key: 1)
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter<PrimaryKeyType>(key: PrimaryKeyType?)
    +    -> QueryInterfaceRequest<Self>
    +    where PrimaryKeyType: DatabaseValueConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided primary key predicate.

    +
    // SELECT * FROM player WHERE id IN (1, 2, 3)
    +let request = Player.filter(keys: [1, 2, 3])
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter<Sequence>(keys: Sequence)
    +    -> QueryInterfaceRequest<Self>
    +    where Sequence: Swift.Sequence, Sequence.Element: DatabaseValueConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(key:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided primary key predicate.

    +
    // SELECT * FROM passport WHERE personId = 1 AND countryCode = 'FR'
    +let request = Passport.filter(key: ["personId": 1, "countryCode": "FR"])
    +
    + +

    When executed, this request raises a fatal error if there is no unique +index on the key columns.

    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter(key: [String : DatabaseValueConvertible?]?) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(keys:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided primary key predicate.

    +
    // SELECT * FROM passport WHERE (personId = 1 AND countryCode = 'FR') OR ...
    +let request = Passport.filter(keys: [["personId": 1, "countryCode": "FR"], ...])
    +
    + +

    When executed, this request raises a fatal error if there is no unique +index on the key columns.

    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter(keys: [[String : DatabaseValueConvertible?]]) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(sql:arguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided predicate.

    +
    // SELECT * FROM player WHERE email = 'arthur@example.com'
    +let request = Player.filter(sql: "email = ?", arguments: ["arthur@example.com"])
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments())
    +    -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(literal:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided predicate.

    +
    // SELECT * FROM player WHERE email = 'arthur@example.com'
    +let request = Player.filter(literal: SQLLiteral(sql: "email = ?", arguments: ["arthur@example.com"]))
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    let request = Player.filter(literal: "name = \("O'Brien"))
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func filter(literal sqlLiteral: SQLLiteral) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request sorted according to the +provided orderings.

    +
    // SELECT * FROM player ORDER BY name
    +let request = Player.order(Column("name"))
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func order(_ orderings: SQLOrderingTerm...) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request sorted according to the +provided orderings.

    +
    // SELECT * FROM player ORDER BY name
    +let request = Player.order([Column("name")])
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func order(_ orderings: [SQLOrderingTerm]) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + orderByPrimaryKey() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request sorted by primary key.

    +
    // SELECT * FROM player ORDER BY id
    +let request = Player.orderByPrimaryKey()
    +
    +// SELECT * FROM country ORDER BY code
    +let request = Country.orderByPrimaryKey()
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func orderByPrimaryKey() -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(sql:arguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request sorted according to sql.

    +
    // SELECT * FROM player ORDER BY name
    +let request = Player.order(sql: "name")
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func order(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments())
    +    -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(literal:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request sorted according to an SQL literal.

    +
    // SELECT * FROM player ORDER BY name
    +let request = Player.order(literal: SQLLiteral(sql: "name"))
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    // SELECT * FROM player ORDER BY name
    +let request = Player.order(literal: "name"))
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func order(literal sqlLiteral: SQLLiteral) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + limit(_:offset:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request which fetches limit rows, starting at +offset.

    +
    // SELECT * FROM player LIMIT 1
    +let request = Player.limit(1)
    +
    + +

    The selection defaults to all columns. This default can be changed for +all requests by the TableRecord.databaseSelection property, or +for individual requests with the TableRecord.select method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func limit(_ limit: Int, offset: Int? = nil) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + aliased(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that allows you to define expressions that target +a specific database table.

    + +

    In the example below, the “team.avgScore < player.score” condition in +the ON clause could be not achieved without table aliases.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// JOIN team ON ... AND team.avgScore < player.score
    +let playerAlias = TableAlias()
    +let request = Player
    +    .aliased(playerAlias)
    +    .including(required: Player.team.filter(Column("avgScore") < playerAlias[Column("score")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func aliased(_ alias: TableAlias) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Counting All

+

+
+
+
    +
  • +
    + + + + fetchCount(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The number of records.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fetchCount(_ db: Database) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SQL Generation

+

+
+
+
    +
  • +
    + + + + selectionSQL(alias:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The selection as an SQL String.

    + +

    For example:

    +
    struct Player: TableRecord {
    +    static let databaseTableName = "player"
    +}
    +
    +// SELECT "player".* FROM player
    +let sql = "SELECT \(Player.selectionSQL()) FROM player"
    +
    +// SELECT "p".* FROM player AS p
    +let sql = "SELECT \(Player.selectionSQL(alias: "p")) FROM player p"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func selectionSQL(alias: String? = nil) -> String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + numberOfSelectedColumns(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the number of selected columns.

    + +

    For example:

    +
    struct Player: TableRecord {
    +    static let databaseTableName = "player"
    +}
    +
    +try dbQueue.write { db in
    +    try db.create(table: "player") { t in
    +        t.autoIncrementedPrimaryKey("id")
    +        t.column("name", .text)
    +        t.column("score", .integer)
    +    }
    +
    +    // 3
    +    try Player.numberOfSelectedColumns(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func numberOfSelectedColumns(_ db: Database) throws -> Int
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Observation

+

+
+
+
    +
  • +
    + + + + observationForCount() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes the record table, and notifies +its count whenever it is modified by a database transaction.

    + +

    For example:

    +
    let observation = Player.observationForCount()
    +
    +let observer = try observation.start(in: dbQueue) { count: Int in
    +    print("Number of players has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func observationForCount() ->
    +    ValueObservation<ValueReducers.RemoveDuplicates<ValueReducers.Fetch<Int>>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Full Text Search

+

+
+
+
    +
  • +
    + + + + matching(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns a QueryInterfaceRequest with a matching predicate.

    +
    // SELECT * FROM book WHERE book MATCH '...'
    +var request = Book.matching(pattern)
    +
    + +

    If the search pattern is nil, the request does not match any +database row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func matching(_ pattern: FTS5Pattern?) -> QueryInterfaceRequest<Self>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Self: EncodableRecord

+

+
+
+
    +
  • +
    + + + + request(for:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a request that fetches the associated record(s).

    + +

    For example:

    +
    struct Team: TableRecord, EncodableRecord {
    +    static let players = hasMany(Player.self)
    +    var players: QueryInterfaceRequest<Player> {
    +        return request(for: Team.players)
    +    }
    +}
    +
    +let team: Team = ...
    +let players = try team.players.fetchAll(db) // [Player]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func request<A: Association>(for association: A)
    +    -> QueryInterfaceRequest<A.RowDecoder>
    +    where A.OriginRowDecoder == Self
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Observation

+

+
+
+
    +
  • +
    + + + + observationForAll() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes the record table, and notifies +fresh records whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let observation = Player.observationForAll()
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func observationForAll() -> ValueObservation<ValueReducers.AllRecords<Self>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + observationForFirst() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes the table record, and notifies +a fresh record whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let observation = Player.observationForFirst()
    +
    +let observer = try observation.start(in: dbQueue) { player: Player? in
    +    print("Player has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func observationForFirst() -> ValueObservation<ValueReducers.OneRecord<Self>>
    + +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/TransactionObserver.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/TransactionObserver.html new file mode 100644 index 000000000..67357ed2d --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/TransactionObserver.html @@ -0,0 +1,1403 @@ + + + + TransactionObserver Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

TransactionObserver

+
+
+
public protocol TransactionObserver : AnyObject
+ +
+
+

A transaction observer is notified of all changes and transactions committed +or rollbacked on a database.

+ +

Adopting types must be a class.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Filters database changes that should be notified the the +databaseDidChange(with:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Notifies a database change (insert, update, or delete).

    + +

    The change is pending until the current transaction ends. See +databaseWillCommit, databaseDidCommit and databaseDidRollback.

    + +

    This method is called in a protected dispatch queue, serialized will all +database updates.

    + +

    The event is only valid for the duration of this method call. If you +need to keep it longer, store a copy: event.copy()

    + +

    The observer has an opportunity to stop receiving further change events +from the current transaction by calling the +stopObservingDatabaseChangesUntilNextTransaction() method.

    +
    +

    Warning

    + this method must not change the database. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func databaseDidChange(with event: DatabaseEvent)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseWillCommit() + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    When a transaction is about to be committed, the transaction observer +has an opportunity to rollback pending changes by throwing an error.

    + +

    This method is called on the database queue.

    +
    +

    Warning

    +

    this method must not change the database.

    + +
    +

    Throws

    +

    An eventual error that rollbacks pending changes.

    + +
    + +
    +

    Default Implementation

    +
    +

    Default implementation does nothing

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func databaseWillCommit() throws
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseDidCommit(_:) + +
    +
    +
    +
    +
    +
    +

    Database changes have been committed.

    + +

    This method is called on the database queue. It can change the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func databaseDidCommit(_ db: Database)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Database changes have been rollbacked.

    + +

    This method is called on the database queue. It can change the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func databaseDidRollback(_ db: Database)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseWillChange(with:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Notifies before a database change (insert, update, or delete) +with change information (initial / final values for the row’s +columns). (Called before databaseDidChangeWithEvent.)

    + +

    The change is pending until the end of the current transaction, +and you always get a second chance to get basic event information in +the databaseDidChangeWithEvent callback.

    + +

    This callback is mostly useful for calculating detailed change +information for a row, and provides the initial / final values.

    + +

    This method is called in a protected dispatch queue, serialized will all +database updates.

    + +

    The event is only valid for the duration of this method call. If you +need to keep it longer, store a copy: event.copy()

    +
    +

    Warning

    + this method must not change the database. + +
    + +

    Availability Info

    + +

    Requires SQLite 3.13.0 + +Compiled with option SQLITE_ENABLE_PREUPDATE_HOOK

    + +

    As of OSX 10.11.5, and iOS 9.3.2, the built-in SQLite library +does not have this enabled, so you’ll need to compile your own +copy using GRDBCustomSQLite. +See https://github.com/groue/GRDB.swift/blob/master/Documentation/CustomSQLiteBuilds.md

    + +

    The databaseDidChangeWithEvent callback is always available, +and may provide most/all of what you need.

    + +
    +

    Default Implementation

    +
    +

    Default implementation does nothing

    + +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

TransactionObserver

+

+
+
+
    +
  • +
    + + + + stopObservingDatabaseChangesUntilNextTransaction() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    After this method has been called, the databaseDidChange(with:) +method won’t be called until the next transaction.

    + +

    For example:

    +
    class PlayerObserver: TransactionObserver {
    +    var playerTableWasModified = false
    +
    +    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool {
    +        return eventKind.tableName == "player"
    +    }
    +
    +    func databaseDidChange(with event: DatabaseEvent) {
    +        playerTableWasModified = true
    +
    +        // It is pointless to keep on tracking further changes:
    +        stopObservingDatabaseChangesUntilNextTransaction()
    +    }
    +}
    +
    +
    +

    Precondition

    + This method must be called from databaseDidChange(with:). + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func stopObservingDatabaseChangesUntilNextTransaction()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/ValueReducer.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/ValueReducer.html new file mode 100644 index 000000000..7c041749f --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/ValueReducer.html @@ -0,0 +1,1359 @@ + + + + ValueReducer Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ValueReducer

+
+
+
public protocol ValueReducer
+ +
+
+

Experimental

+ +

The ValueReducer protocol supports ValueObservation.

+ +
+
+
+
    +
  • +
    + + + + Fetched + +
    +
    +
    +
    +
    +
    +

    The type of fetched database values

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Value + +
    +
    +
    +
    +
    +
    +

    The type of observed values

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype Value
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fetch(_:) + +
    +
    +
    +
    +
    +
    +

    Feches database values upon changes in an observed database region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func fetch(_ db: Database) throws -> Fetched
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value(_:) + +
    +
    +
    +
    +
    +
    +

    Transforms a fetched value into an eventual observed value. Returns nil +when observer should not be notified.

    + +

    This method runs inside a private dispatch queue.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func value(_ fetched: Fetched) -> Value?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + compactMap(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Returns a reducer which outputs the non-nil results of calling the given +transformation which each element emitted by this reducer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func compactMap<T>(_ transform: @escaping (Value) -> T?) -> ValueReducers.CompactMap<Self, T>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + map(_:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Returns a reducer which outputs the results of calling the given +transformation which each element emitted by this reducer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func map<T>(_ transform: @escaping (Value) -> T) -> ValueReducers.Map<Self, T>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Value: Equatable

+

+
+
+
    +
  • +
    + + + + distinctUntilChanged() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Returns a ValueReducer which filters out consecutive equal values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, renamed: "removeDuplicates")
    +public func distinctUntilChanged() -> ValueReducers.RemoveDuplicates<Self>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + removeDuplicates() + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Returns a ValueReducer which filters out consecutive equal values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeDuplicates() -> ValueReducers.RemoveDuplicates<Self>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/VirtualTableModule.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/VirtualTableModule.html new file mode 100644 index 000000000..85cf3f605 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Protocols/VirtualTableModule.html @@ -0,0 +1,1248 @@ + + + + VirtualTableModule Protocol Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

VirtualTableModule

+
+
+
public protocol VirtualTableModule
+ +
+
+

The protocol for SQLite virtual table modules. It lets you define a DSL for +the Database.create(virtualTable:using:) method:

+
let module = ...
+try db.create(virtualTable: "item", using: module) { t in
+    ...
+}
+
+ +

GRDB ships with three concrete classes that implement this protocol: FTS3, +FTS4 and FTS5.

+ +
+
+
+
    +
  • +
    + + + + TableDefinition + +
    +
    +
    +
    +
    +
    +

    The type of the closure argument in the +Database.create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "item", using: module) { t in
    +    // t is TableDefinition
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + moduleName + +
    +
    +
    +
    +
    +
    +

    The name of the module.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var moduleName: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + makeTableDefinition() + +
    +
    +
    +
    +
    +
    +

    Returns a table definition that is passed as the closure argument in the +Database.create(virtualTable:using:) method:

    +
    try db.create(virtualTable: "item", using: module) { t in
    +    // t is the result of makeTableDefinition()
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func makeTableDefinition() -> TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the module arguments for the CREATE VIRTUAL TABLE query.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func moduleArguments(for definition: TableDefinition, in db: Database) throws -> [String]
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Execute any relevant database statement after the virtual table has +been created.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func database(_ db: Database, didCreate tableName: String, using definition: TableDefinition) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs.html new file mode 100644 index 000000000..dbdf5d612 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs.html @@ -0,0 +1,3800 @@ + + + + Structures Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Structures

+

The following structures are available globally.

+ +
+
+
+
    +
  • +
    + + + + Configuration + +
    +
    +
    +
    +
    +
    +

    Configuration for a DatabaseQueue or DatabasePool.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Configuration
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ColumnInfo + +
    +
    +
    +
    +
    +
    +

    A column of a database table.

    + +

    This type closely matches the information returned by the +table_info pragma.

    +
    > CREATE TABLE player (
    +    id INTEGER PRIMARY KEY,
    +    firstName TEXT,
    +    lastName TEXT)
    +> PRAGMA table_info("player")
    +cid   name   type     notnull   dflt_value  pk
    +----  -----  -------  --------  ----------  ---
    +0     id     INTEGER  0         NULL        1
    +1     name   TEXT     0         NULL        0
    +2     score  INTEGER  0         NULL        0
    +
    + +

    See Database.columns(in:) and https://www.sqlite.org/pragma.html#pragma_table_info

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ColumnInfo : FetchableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + IndexInfo + +
    +
    +
    +
    +
    +
    +

    An index on a database table.

    + +

    See Database.indexes(on:)

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct IndexInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + PrimaryKeyInfo + +
    +
    +
    +
    +
    +
    +

    Primary keys are returned from the Database.primaryKey(_:) method.

    + +

    When the table’s primary key is the rowid:

    +
    // CREATE TABLE item (name TEXT)
    +let pk = try db.primaryKey("item")
    +pk.columns     // ["rowid"]
    +pk.rowIDColumn // nil
    +pk.isRowID     // true
    +
    +// CREATE TABLE citizen (
    +//   id INTEGER PRIMARY KEY,
    +//   name TEXT
    +// )
    +let pk = try db.primaryKey("citizen")!
    +pk.columns     // ["id"]
    +pk.rowIDColumn // "id"
    +pk.isRowID     // true
    +
    + +

    When the table’s primary key is not the rowid:

    +
    // CREATE TABLE country (
    +//   isoCode TEXT NOT NULL PRIMARY KEY
    +//   name TEXT
    +// )
    +let pk = db.primaryKey("country")!
    +pk.columns     // ["isoCode"]
    +pk.rowIDColumn // nil
    +pk.isRowID     // false
    +
    +// CREATE TABLE citizenship (
    +//   citizenID INTEGER NOT NULL REFERENCES citizen(id)
    +//   countryIsoCode TEXT NOT NULL REFERENCES country(isoCode)
    +//   PRIMARY KEY (citizenID, countryIsoCode)
    +// )
    +let pk = db.primaryKey("citizenship")!
    +pk.columns     // ["citizenID", "countryIsoCode"]
    +pk.rowIDColumn // nil
    +pk.isRowID     // false
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct PrimaryKeyInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ForeignKeyInfo + +
    +
    +
    +
    +
    +
    +

    You get foreign keys from table names, with the +foreignKeys(on:) method.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ForeignKeyInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ResultCode + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ResultCode : RawRepresentable, Equatable, CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseError + +
    +
    +
    +
    +
    +
    +

    DatabaseError wraps an SQLite error.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseError : Error, CustomStringConvertible, CustomNSError
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + DatabaseRegion + +
    +
    +
    +
    +
    +
    +

    DatabaseRegion defines a region in the database. DatabaseRegion is dedicated +to help transaction observers recognize impactful database changes in their +observes(eventsOfKind:) and databaseDidChange(with:) methods.

    + +

    A database region is the union of any number of “table regions”, which can +cover a full table, or the combination of columns and rows:

    +
    |Table1 |   |Table2 |   |Table3 |   |Table4 |   |Table5 |
    +|-------|   |-------|   |-------|   |-------|   |-------|
    +|x|x|x|x|   |x| | | |   |x|x|x|x|   |x|x| |x|   | | | | |
    +|x|x|x|x|   |x| | | |   | | | | |   | | | | |   | |x| | |
    +|x|x|x|x|   |x| | | |   | | | | |   |x|x| |x|   | | | | |
    +|x|x|x|x|   |x| | | |   | | | | |   | | | | |   | | | | |
    +
    + +

    To create a database region, you use one of those methods:

    + +
      +
    • DatabaseRegion.fullDatabase: the region that covers all database tables.

    • +
    • DatabaseRegion(): the empty region.

    • +
    • DatabaseRegion(table:): the region that covers one database table.

    • +
    • SelectStatement.databaseRegion:

      +
      let statement = try db.makeSelectStatement(sql: "SELECT name, score FROM player")
      +let region = statement.databaseRegion
      +
    • +
    • FetchRequest.databaseRegion(_:)

      +
      let request = Player.filter(key: 1)
      +let region = try request.databaseRegion(db)
      +
    • +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseRegion : CustomStringConvertible, Equatable
    +
    extension DatabaseRegion: DatabaseRegionConvertible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseRegionConvertible

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    A type-erased DatabaseRegionConvertible

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct AnyDatabaseRegionConvertible : DatabaseRegionConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    DatabaseRegionObservation tracks changes in the results of database +requests, and notifies each database transaction whenever the +database changes.

    + +

    For example:

    +
    let observation = DatabaseRegionObservation(tracking: Player.all)
    +let observer = try observation.start(in: dbQueue) { db: Database in
    +    print("Players have changed.")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseRegionObservation
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseValue

+

+
+
+ +
+
+
+ + +
+ +

PreparedRequest

+

+
+
+
    +
  • +
    + + + + PreparedRequest + +
    +
    +
    +
    +
    +
    +

    A PreparedRequest is a request that is ready to be executed.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct PreparedRequest
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

AdaptedFetchRequest

+

+
+
+ +
+
+
+ + +
+ +

AnyFetchRequest

+

+
+
+
    +
  • +
    + + + + AnyFetchRequest + +
    +
    +
    +
    +
    +
    +

    A type-erased FetchRequest.

    + +

    An AnyFetchRequest forwards its operations to an underlying request, +hiding its specifics.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct AnyFetchRequest<T> : FetchRequest
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

RowIndex

+

+
+
+
    +
  • +
    + + + + RowIndex + +
    +
    +
    +
    +
    +
    +

    Indexes to (ColumnName, DatabaseValue) pairs in a database row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RowIndex : Comparable, Strideable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + EmptyRowAdapter + +
    +
    +
    +
    +
    +
    +

    EmptyRowAdapter is a row adapter that hides all columns.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct EmptyRowAdapter : RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ColumnMapping + +
    +
    +
    +
    +
    +
    +

    ColumnMapping is a row adapter that maps column names.

    +
    let adapter = ColumnMapping(["foo": "bar"])
    +let sql = "SELECT 'foo' AS foo, 'bar' AS bar, 'baz' AS baz"
    +
    +// [foo:"bar"]
    +try Row.fetchOne(db, sql: sql, adapter: adapter)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ColumnMapping : RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SuffixRowAdapter + +
    +
    +
    +
    +
    +
    +

    SuffixRowAdapter is a row adapter that hides the first columns in a row.

    +
    let adapter = SuffixRowAdapter(fromIndex: 2)
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
    +
    +// [baz:3]
    +try Row.fetchOne(db, sql: sql, adapter: adapter)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SuffixRowAdapter : RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RangeRowAdapter + +
    +
    +
    +
    +
    +
    +

    RangeRowAdapter is a row adapter that only exposes a range of columns.

    +
    let adapter = RangeRowAdapter(1..<3)
    +let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz, 4 as qux"
    +
    +// [bar:2 baz:3]
    +try Row.fetchOne(db, sql: sql, adapter: adapter)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RangeRowAdapter : RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ScopeAdapter + +
    +
    +
    +
    +
    +
    +

    ScopeAdapter is a row adapter that lets you define scopes on rows.

    +
    // Two adapters
    +let fooAdapter = ColumnMapping(["value": "foo"])
    +let barAdapter = ColumnMapping(["value": "bar"])
    +
    +// Define scopes
    +let adapter = ScopeAdapter([
    +    "foo": fooAdapter,
    +    "bar": barAdapter])
    +
    +// Fetch
    +let sql = "SELECT 'foo' AS foo, 'bar' AS bar"
    +let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
    +
    +// Scoped rows:
    +if let fooRow = row.scopes["foo"] {
    +    fooRow["value"]    // "foo"
    +}
    +if let barRow = row.scopes["bar"] {
    +    barRow["value"]    // "bar"
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ScopeAdapter : RowAdapter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLLiteral + +
    +
    +
    +
    +
    +
    +

    SQLLiteral is a type which support SQL +Interpolation.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    let name: String = ...
    +    let id: Int64 = ...
    +    let query: SQLLiteral = "UPDATE player SET name = \(name) WHERE id = \(id)"
    +    try db.execute(literal: query)
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SQLLiteral
    +
    extension SQLLiteral: ExpressibleByStringInterpolation
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLRequest + +
    +
    +
    +
    +
    +
    +

    A FetchRequest built from raw SQL.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SQLRequest<T> : FetchRequest
    +
    extension SQLRequest: ExpressibleByStringInterpolation
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

StatementArguments

+

+
+
+
    +
  • +
    + + + + StatementArguments + +
    +
    +
    +
    +
    +
    +

    StatementArguments provide values to argument placeholders in raw +SQL queries.

    + +

    Placeholders can take several forms (see https://www.sqlite.org/lang_expr.html#varparam +for more information):

    + +
      +
    • ?NNN (e.g. ?2): the NNN-th argument (starts at 1)
    • +
    • ?: the N-th argument, where N is one greater than the largest argument +number already assigned
    • +
    • :AAAA (e.g. :name): named argument

    • +
    • $AAAA (e.g. $name): named argument

    • +
    +

    Positional Arguments

    + +

    To fill question marks placeholders, feed StatementArguments with an array:

    +
    db.execute(
    +    sql: "INSERT ... (?, ?)",
    +    arguments: StatementArguments(["Arthur", 41]))
    +
    +// Array literals are automatically converted:
    +db.execute(
    +    sql: "INSERT ... (?, ?)",
    +    arguments: ["Arthur", 41])
    +
    +

    Named Arguments

    + +

    To fill named arguments, feed StatementArguments with a dictionary:

    +
    db.execute(
    +    sql: "INSERT ... (:name, :score)",
    +    arguments: StatementArguments(["name": "Arthur", "score": 41]))
    +
    +// Dictionary literals are automatically converted:
    +db.execute(
    +    sql: "INSERT ... (:name, :score)",
    +    arguments: ["name": "Arthur", "score": 41])
    +
    +

    Concatenating Arguments

    + +

    Several arguments can be concatenated and mixed with the +append(contentsOf:) method and the +, &+, += operators:

    +
    var arguments: StatementArguments = ["Arthur"]
    +arguments += [41]
    +db.execute(sql: "INSERT ... (?, ?)", arguments: arguments)
    +
    + +

    + and += operators consider that overriding named arguments is a +programmer error:

    +
    var arguments: StatementArguments = ["name": "Arthur"]
    +arguments += ["name": "Barbara"]
    +// fatal error: already defined statement argument: name
    +
    + +

    &+ and append(contentsOf:) allow overriding named arguments:

    +
    var arguments: StatementArguments = ["name": "Arthur"]
    +arguments = arguments &+ ["name": "Barbara"]
    +print(arguments)
    +// Prints ["name": "Barbara"]
    +
    +

    Mixed Arguments

    + +

    It is possible to mix named and positional arguments. Yet this is usually +confusing, and it is best to avoid this practice:

    +
    let sql = "SELECT ?2 AS two, :foo AS foo, ?1 AS one, :foo AS foo2, :bar AS bar"
    +var arguments: StatementArguments = [1, 2, "bar"] + ["foo": "foo"]
    +let row = try Row.fetchOne(db, sql: sql, arguments: arguments)!
    +print(row)
    +// Prints [two:2 foo:"foo" one:1 foo2:"foo" bar:"bar"]
    +
    + +

    Mixed arguments exist as a support for requests like the following:

    +
    let players = try Player
    +    .filter(sql: "team = :team", arguments: ["team": "Blue"])
    +    .filter(sql: "score > ?", arguments: [1000])
    +    .fetchAll(db)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct StatementArguments: CustomStringConvertible, Equatable,
    +    ExpressibleByArrayLiteral, ExpressibleByDictionaryLiteral
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    DatabaseDateComponents reads and stores DateComponents in the database.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseDateComponents : DatabaseValueConvertible, StatementColumnConvertible
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database events

+

+
+
+
    +
  • +
    + + + + DatabaseEvent + +
    +
    +
    +
    +
    +
    +

    A database event, notified to TransactionObserver.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseEvent
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS3 + +
    +
    +
    +
    +
    +
    +

    FTS3 lets you define “fts3” virtual tables.

    +
    // CREATE VIRTUAL TABLE document USING fts3(content)
    +try db.create(virtualTable: "document", using: FTS3()) { t in
    +    t.column("content")
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct FTS3 : VirtualTableModule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS3Pattern + +
    +
    +
    +
    +
    +
    +

    A full text pattern that can query FTS3 and FTS4 virtual tables.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct FTS3Pattern
    +
    extension FTS3Pattern: DatabaseValueConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An FTS3 tokenizer, suitable for FTS3 and FTS4 table definitions:

    +
    db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.tokenizer = .simple // FTS3TokenizerDescriptor
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#tokenizer

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct FTS3TokenizerDescriptor
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS4 + +
    +
    +
    +
    +
    +
    +

    FTS4 lets you define “fts4” virtual tables.

    +
    // CREATE VIRTUAL TABLE document USING fts4(content)
    +try db.create(virtualTable: "document", using: FTS4()) { t in
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct FTS4 : VirtualTableModule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5 + +
    +
    +
    +
    +
    +
    +

    FTS5 lets you define “fts5” virtual tables.

    +
    // CREATE VIRTUAL TABLE document USING fts5(content)
    +try db.create(virtualTable: "document", using: FTS5()) { t in
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS5Pattern + +
    +
    +
    +
    +
    +
    +

    A full text pattern that can query FTS5 virtual tables.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    + +
    +
    +
    +
    +
  • +
  • +
    + + + + FTS5Tokenization + +
    +
    +
    +
    +
    +
    +

    The reason why FTS5 is requesting tokenization.

    + +

    See https://www.sqlite.org/fts5.html#custom_tokenizers

    + + See more +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An FTS5 tokenizer, suitable for FTS5 table definitions:

    +
    db.create(virtualTable: "book", using: FTS5()) { t in
    +    t.tokenizer = .unicode61() // FTS5TokenizerDescriptor
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html#tokenizers

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + FTS5TokenFlags + +
    +
    +
    +
    +
    +
    +

    Flags that tell SQLite how to register a token.

    + +

    See https://www.sqlite.org/fts5.html#custom_tokenizers

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + DatabaseMigrator + +
    +
    +
    +
    +
    +
    +

    A DatabaseMigrator registers and applies database migrations.

    + +

    Migrations are named blocks of SQL statements that are guaranteed to be +applied in order, once and only once.

    + +

    When a user upgrades your application, only non-applied migration are run.

    + +

    Usage:

    +
    var migrator = DatabaseMigrator()
    +
    +// 1st migration
    +migrator.registerMigration("createLibrary") { db in
    +    try db.create(table: "author") { t in
    +        t.autoIncrementedPrimaryKey("id")
    +        t.column("creationDate", .datetime)
    +        t.column("name", .text).notNull()
    +    }
    +
    +    try db.create(table: "book") { t in
    +        t.autoIncrementedPrimaryKey("id")
    +        t.column("authorId", .integer)
    +            .notNull()
    +            .references("author", onDelete: .cascade)
    +        t.column("title", .text).notNull()
    +    }
    +}
    +
    +// 2nd migration
    +migrator.registerMigration("AddBirthYearToAuthors") { db in
    +    try db.alter(table: "author") { t
    +        t.add(column: "birthYear", .integer)
    +    }
    +}
    +
    +// Migrations for future versions will be inserted here:
    +//
    +// // 3rd migration
    +// migrator.registerMigration("...") { db in
    +//     ...
    +// }
    +
    +try migrator.migrate(dbQueue)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct DatabaseMigrator
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + AssociationAggregate + +
    +
    +
    +
    +
    +
    +

    An AssociationAggregate is able to compute aggregated values from a +population of associated records.

    + +

    For example:

    +
    struct Author: TableRecord {
    +    static let books = hasMany(Book.self)
    +}
    +
    +let bookCount = Author.books.count // AssociationAggregate<Author>
    +
    + +

    Association aggregates can be used in the annotated(with:) and +having(_:) request methods:

    +
    let request = Author.annotated(with: bookCount)
    +let request = Author.having(bookCount >= 10)
    +
    + +

    The RowDecoder generic type helps the compiler prevent incorrect use +of aggregates:

    +
    // Won't compile because Fruit is not Author.
    +let request = Fruit.annotated(with: bookCount)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + BelongsToAssociation + +
    +
    +
    +
    +
    +
    +

    The BelongsTo association sets up a one-to-one connection from a record +type to another record type, such as each instance of the declaring record +“belongs to” an instance of the other record.

    + +

    For example, if your application includes authors and books, and each book +is assigned its author, you’d declare the association this way:

    +
    struct Author: TableRecord { ... }
    +struct Book: TableRecord {
    +    static let author = belongsTo(Author.self)
    +    ...
    +}
    +
    + +

    A BelongsTo associations should be supported by an SQLite foreign key.

    + +

    Foreign keys are the recommended way to declare relationships between +database tables because not only will SQLite guarantee the integrity of your +data, but GRDB will be able to use those foreign keys to automatically +configure your association.

    + +

    You define the foreign key when you create database tables. For example:

    +
    try db.create(table: "author") { t in
    +    t.autoIncrementedPrimaryKey("id")             // (1)
    +    t.column("name", .text)
    +}
    +try db.create(table: "book") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("authorId", .integer)                // (2)
    +        .notNull()                                // (3)
    +        .indexed()                                // (4)
    +        .references("author", onDelete: .cascade) // (5)
    +    t.column("title", .text)
    +}
    +
    + +
      +
    1. The author table has a primary key.
    2. +
    3. The book.authorId column is used to link a book to the author it +belongs to.
    4. +
    5. Make the book.authorId column not null if you want SQLite to guarantee +that all books have an author.
    6. +
    7. Create an index on the book.authorId column in order to ease the +selection of an author’s books.
    8. +
    9. Create a foreign key from book.authorId column to authors.id, so that +SQLite guarantees that no book refers to a missing author. The +onDelete: .cascade option has SQLite automatically delete all of an +author’s books when that author is deleted. +See https://sqlite.org/foreignkeys.html#fk_actions for more information.
    10. +
    + +

    The example above uses auto-incremented primary keys. But generally +speaking, all primary keys are supported.

    + +

    If the database schema does not define foreign keys between tables, you can +still use BelongsTo associations. But your help is needed to define the +missing foreign key:

    +
    struct Book: FetchableRecord, TableRecord {
    +    static let author = belongsTo(Author.self, using: ForeignKey(...))
    +}
    +
    + +

    See ForeignKey for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct BelongsToAssociation<Origin, Destination> : AssociationToOne where Origin : TableRecord, Destination : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + HasManyAssociation + +
    +
    +
    +
    +
    +
    +

    The HasMany association indicates a one-to-many connection between two +record types, such as each instance of the declaring record “has many” +instances of the other record.

    + +

    For example, if your application includes authors and books, and each author +is assigned zero or more books, you’d declare the association this way:

    +
    struct Book: TableRecord { ... }
    +struct Author: TableRecord {
    +    static let books = hasMany(Book.self)
    +    ...
    +}
    +
    + +

    HasMany associations should be supported by an SQLite foreign key.

    + +

    Foreign keys are the recommended way to declare relationships between +database tables because not only will SQLite guarantee the integrity of your +data, but GRDB will be able to use those foreign keys to automatically +configure your association.

    + +

    You define the foreign key when you create database tables. For example:

    +
    try db.create(table: "author") { t in
    +    t.autoIncrementedPrimaryKey("id")             // (1)
    +    t.column("name", .text)
    +}
    +try db.create(table: "book") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("authorId", .integer)                // (2)
    +        .notNull()                                // (3)
    +        .indexed()                                // (4)
    +        .references("author", onDelete: .cascade) // (5)
    +    t.column("title", .text)
    +}
    +
    + +
      +
    1. The author table has a primary key.
    2. +
    3. The book.authorId column is used to link a book to the author it +belongs to.
    4. +
    5. Make the book.authorId column not null if you want SQLite to guarantee +that all books have an author.
    6. +
    7. Create an index on the book.authorId column in order to ease the +selection of an author’s books.
    8. +
    9. Create a foreign key from book.authorId column to authors.id, so that +SQLite guarantees that no book refers to a missing author. The +onDelete: .cascade option has SQLite automatically delete all of an +author’s books when that author is deleted. +See https://sqlite.org/foreignkeys.html#fk_actions for more information.
    10. +
    + +

    The example above uses auto-incremented primary keys. But generally +speaking, all primary keys are supported.

    + +

    If the database schema does not define foreign keys between tables, you can +still use HasMany associations. But your help is needed to define the +missing foreign key:

    +
    struct Author: TableRecord {
    +    static let books = hasMany(Book.self, using: ForeignKey(...))
    +}
    +
    + +

    See ForeignKey for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct HasManyAssociation<Origin, Destination> : AssociationToMany where Origin : TableRecord, Destination : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The HasManyThrough association is often used to set up a many-to-many +connection with another record. This association indicates that the +declaring record can be matched with zero or more instances of another +record by proceeding through a third record.

    + +

    For example, consider the practice of passport delivery. One coutry +“has many” citizens “through” its passports:

    +
    struct Country: TableRecord {
    +    static let passports = hasMany(Passport.self)
    +    static let citizens = hasMany(Citizen.self, through: passports, using: Passport.citizen)
    +    ...
    +}
    +
    +struct Passport: TableRecord {
    +    static let citizen = belongsTo(Citizen.self)
    +    ...
    +}
    +
    +struct Citizen: TableRecord { ... }
    +
    + +

    The HasManyThrough association is also useful for setting up +“shortcuts” through nested HasMany associations. For example, if a document +has many sections, and a section has many paragraphs, you may sometimes want +to get a simple collection of all paragraphs in the document. You could set +that up this way:

    +
    struct Document: TableRecord {
    +    static let sections = hasMany(Section.self)
    +    static let paragraphs = hasMany(Paragraph.self, through: sections, using: Section.paragraphs)
    +}
    +
    +struct Section: TableRecord {
    +    static let paragraphs = hasMany(Paragraph.self)
    +}
    +
    +struct Paragraph: TableRecord {
    +}
    +
    + +

    As in the examples above, HasManyThrough association is always built from +two other associations: the through: and using: arguments. Those +associations can be any other association (BelongsTo, HasMany, +HasManyThrough, etc).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct HasManyThroughAssociation<Origin, Destination> : AssociationToMany where Origin : TableRecord, Destination : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + HasOneAssociation + +
    +
    +
    +
    +
    +
    +

    The HasOne association indicates a one-to-one connection between two +record types, such as each instance of the declaring record “has one” +instances of the other record.

    + +

    For example, if your application has one database table for countries, and +another for their demographic profiles, you’d declare the association +this way:

    +
    struct Demographics: TableRecord { ... }
    +struct Country: TableRecord {
    +    static let demographics = hasOne(Demographics.self)
    +    ...
    +}
    +
    + +

    HasOne associations should be supported by an SQLite foreign key.

    + +

    Foreign keys are the recommended way to declare relationships between +database tables because not only will SQLite guarantee the integrity of your +data, but GRDB will be able to use those foreign keys to automatically +configure your association.

    + +

    You define the foreign key when you create database tables. For example:

    +
    try db.create(table: "country") { t in
    +    t.column("code", .text).primaryKey()           // (1)
    +    t.column("name", .text)
    +}
    +try db.create(table: "demographics") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("countryCode", .text)                 // (2)
    +        .notNull()                                 // (3)
    +        .unique()                                  // (4)
    +        .references("country", onDelete: .cascade) // (5)
    +    t.column("population", .integer)
    +    t.column("density", .double)
    +}
    +
    + +
      +
    1. The country table has a primary key.
    2. +
    3. The demographics.countryCode column is used to link a demographic +profile to the country it belongs to.
    4. +
    5. Make the demographics.countryCode column not null if you want SQLite to +guarantee that all profiles are linked to a country.
    6. +
    7. Create a unique index on the demographics.countryCode column in order to +guarantee the unicity of any country’s profile.
    8. +
    9. Create a foreign key from demographics.countryCode column to +country.code, so that SQLite guarantees that no profile refers to a +missing country. The onDelete: .cascade option has SQLite automatically +delete a profile when its country is deleted. +See https://sqlite.org/foreignkeys.html#fk_actions for more information.
    10. +
    + +

    The example above uses a string primary for the country table. But generally +speaking, all primary keys are supported.

    + +

    If the database schema does not follow this convention, and does not define +foreign keys between tables, you can still use HasOne associations. But +your help is needed to define the missing foreign key:

    +
    struct Country: FetchableRecord, TableRecord {
    +    static let demographics = hasOne(Demographics.self, using: ForeignKey(...))
    +}
    +
    + +

    See ForeignKey for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct HasOneAssociation<Origin, Destination> : AssociationToOne where Origin : TableRecord, Destination : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A HasOneThrough association sets up a one-to-one connection with +another record. This association indicates that the declaring record can be +matched with one instance of another record by proceeding through a third +record. For example, if each book belongs to a library, and each library has +one address, then one knows where the book should be returned to:

    +
    struct Book: TableRecord {
    +    static let library = belongsTo(Library.self)
    +    static let returnAddress = hasOne(Address.self, through: library, using: Library.address)
    +    ...
    +}
    +
    +struct Library: TableRecord {
    +    static let address = hasOne(Address.self)
    +    ...
    +}
    +
    +struct Address: TableRecord { ... }
    +
    + +

    As in the example above, HasOneThrough association is always built from +two other associations: the through: and using: arguments. Those +associations can be any other association to one (BelongsTo, HasOne, +HasOneThrough).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct HasOneThroughAssociation<Origin, Destination> : AssociationToOne where Origin : TableRecord, Destination : TableRecord
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + QueryInterfaceRequest + +
    +
    +
    +
    +
    +
    +

    QueryInterfaceRequest is a request that generates SQL for you.

    + +

    For example:

    +
    try dbQueue.read { db in
    +    let request = Player
    +        .filter(Column("score") > 1000)
    +        .order(Column("name"))
    +    let players = try request.fetchAll(db) // [Player]
    +}
    +
    + +

    See https://github.com/groue/GRDB.swift#the-query-interface

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct QueryInterfaceRequest<T>
    +
    extension QueryInterfaceRequest: FetchRequest
    +
    extension QueryInterfaceRequest: SelectionRequest
    +
    extension QueryInterfaceRequest: FilteredRequest
    +
    extension QueryInterfaceRequest: OrderedRequest
    +
    extension QueryInterfaceRequest: AggregatingRequest
    +
    extension QueryInterfaceRequest: _JoinableRequest
    +
    extension QueryInterfaceRequest: TableRequest
    +
    extension QueryInterfaceRequest: JoinableRequest where T: TableRecord
    +
    extension QueryInterfaceRequest: DerivableRequest where T: TableRecord
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ColumnAssignment

+

+
+
+
    +
  • +
    + + + + ColumnAssignment + +
    +
    +
    +
    +
    +
    +

    A ColumnAssignment can update rows in the database.

    + +

    You create an assignment from a column and an assignment operator, such as +<- or +=:

    +
    try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    let assignment = Column("score") <- 0
    +    try Player.updateAll(db, assignment)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ColumnAssignment
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Column + +
    +
    +
    +
    +
    +
    +

    A column in a database table.

    + +

    When you need to introduce your own column type, don’t wrap a Column. +Instead, adopt the ColumnExpression protocol.

    + +

    See https://github.com/groue/GRDB.swift#the-query-interface

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Column : ColumnExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SQLExpressionLiteral

+

+
+
+
    +
  • +
    + + + + SQLExpressionLiteral + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    SQLExpressionLiteral is an expression built from a raw SQL snippet.

    +
    SQLExpressionLiteral(sql: "1 + 2")
    +
    + +

    The SQL literal may contain ? and colon-prefixed arguments:

    +
    SQLExpressionLiteral(sql: "? + ?", arguments: [1, 2])
    +SQLExpressionLiteral(sql: ":one + :two", arguments: ["one": 1, "two": 2])
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SQLExpressionLiteral : SQLExpression
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SQLExpressionFunction

+

+
+
+ +
+
+
+ + +
+ +

AllColumns

+

+
+
+
    +
  • +
    + + + + AllColumns + +
    +
    +
    +
    +
    +
    +

    AllColumns is the * in SELECT *.

    + +

    You use AllColumns in your custom implementation of +TableRecord.databaseSelection.

    + +

    For example:

    +
    struct Player : TableRecord {
    +    static var databaseTableName = "player"
    +    static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID]
    +}
    +
    +// SELECT *, rowid FROM player
    +let request = Player.all()
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct AllColumns
    +
    extension AllColumns: SQLSelectable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ForeignKey + +
    +
    +
    +
    +
    +
    +

    A ForeignKey helps building associations when GRDB can’t infer a foreign +key from the database schema.

    + +

    Sometimes the database schema does not define any foreign key between two +tables. And sometimes, there are several foreign keys from a table +to another:

    +
    | Table book   |       | Table person |
    +| ------------ |       | ------------ |
    +| id           |   +-->• id           |
    +| authorId     •---+   | name         |
    +| translatorId •---+
    +| title        |
    +
    + +

    When this happens, associations can’t be automatically inferred from the +database schema. GRDB will complain with a fatal error such as “Ambiguous +foreign key from book to person”, or “Could not infer foreign key from book +to person”.

    + +

    Your help is needed. You have to instruct GRDB which foreign key to use:

    +
    struct Book: TableRecord {
    +    // Define foreign keys
    +    static let authorForeignKey = ForeignKey(["authorId"]))
    +    static let translatorForeignKey = ForeignKey(["translatorId"]))
    +
    +    // Use foreign keys to define associations:
    +    static let author = belongsTo(Person.self, using: authorForeignKey)
    +    static let translator = belongsTo(Person.self, using: translatorForeignKey)
    +}
    +
    + +

    Foreign keys are always defined from the table that contains the columns at +the origin of the foreign key. Person’s symmetric HasMany associations reuse +Book’s foreign keys:

    +
    struct Person: TableRecord {
    +    static let writtenBooks = hasMany(Book.self, using: Book.authorForeignKey)
    +    static let translatedBooks = hasMany(Book.self, using: Book.translatorForeignKey)
    +}
    +
    + +

    Foreign keys can also be defined from query interface columns:

    +
    struct Book: TableRecord {
    +    enum Columns: String, ColumnExpression {
    +        case id, title, authorId, translatorId
    +    }
    +
    +    static let authorForeignKey = ForeignKey([Columns.authorId]))
    +    static let translatorForeignKey = ForeignKey([Columns.translatorId]))
    +}
    +
    + +

    When the destination table of a foreign key does not define any primary key, +you need to provide the full definition of a foreign key:

    +
    struct Book: TableRecord {
    +    static let authorForeignKey = ForeignKey(["authorId"], to: ["id"]))
    +    static let author = belongsTo(Person.self, using: authorForeignKey)
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct ForeignKey
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

PersistenceContainer

+

+
+
+
    +
  • +
    + + + + PersistenceContainer + +
    +
    +
    +
    +
    +
    +

    Use persistence containers in the encode(to:) method of your +encodable records:

    +
    struct Player: EncodableRecord {
    +    var id: Int64?
    +    var name: String?
    +
    +    func encode(to container: inout PersistenceContainer) {
    +        container["id"] = id
    +        container["name"] = name
    +    }
    +}
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct PersistenceContainer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

UITableView Support

+

+
+
+ +
+
+
+ + +
+ +

ValueObservation

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AdaptedFetchRequest.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AdaptedFetchRequest.html new file mode 100644 index 000000000..ae698a0f8 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AdaptedFetchRequest.html @@ -0,0 +1,1107 @@ + + + + AdaptedFetchRequest Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AdaptedFetchRequest

+
+
+
public struct AdaptedFetchRequest<Base> : FetchRequest where Base : FetchRequest
+ +
+
+

An adapted request.

+ +
+
+
+
    +
  • +
    + + + + RowDecoder + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias RowDecoder = Base.RowDecoder
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AllColumns.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AllColumns.html new file mode 100644 index 000000000..3b34b02f8 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AllColumns.html @@ -0,0 +1,1122 @@ + + + + AllColumns Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AllColumns

+
+
+
public struct AllColumns
+
extension AllColumns: SQLSelectable
+ +
+
+

AllColumns is the * in SELECT *.

+ +

You use AllColumns in your custom implementation of +TableRecord.databaseSelection.

+ +

For example:

+
struct Player : TableRecord {
+    static var databaseTableName = "player"
+    static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID]
+}
+
+// SELECT *, rowid FROM player
+let request = Player.all()
+
+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AnyDatabaseRegionConvertible.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AnyDatabaseRegionConvertible.html new file mode 100644 index 000000000..4bb0e8b7b --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AnyDatabaseRegionConvertible.html @@ -0,0 +1,1138 @@ + + + + AnyDatabaseRegionConvertible Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyDatabaseRegionConvertible

+
+
+
public struct AnyDatabaseRegionConvertible : DatabaseRegionConvertible
+ +
+
+

A type-erased DatabaseRegionConvertible

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AnyFetchRequest.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AnyFetchRequest.html new file mode 100644 index 000000000..1aca5f18a --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AnyFetchRequest.html @@ -0,0 +1,1172 @@ + + + + AnyFetchRequest Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyFetchRequest

+
+
+
public struct AnyFetchRequest<T> : FetchRequest
+ +
+
+

A type-erased FetchRequest.

+ +

An AnyFetchRequest forwards its operations to an underlying request, +hiding its specifics.

+ +
+
+
+
    +
  • +
    + + + + RowDecoder + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias RowDecoder = T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request that wraps and forwards operations to request.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Request>(_ request: Request) where Request : FetchRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request whose prepare() method wraps and forwards +operations the argument closure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Define your own FetchRequest type instead.")
    +public init(_ prepare: @escaping (Database, _ singleResult: Bool) throws -> (SelectStatement, RowAdapter?))
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AnyValueReducer.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AnyValueReducer.html new file mode 100644 index 000000000..0fc30b168 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AnyValueReducer.html @@ -0,0 +1,1160 @@ + + + + AnyValueReducer Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AnyValueReducer

+
+
+
public struct AnyValueReducer<Fetched, Value> : ValueReducer
+ +
+
+

Experimental

+ +

A type-erased ValueReducer.

+ +

An AnyValueReducer forwards its operations to an underlying reducer, +hiding its specifics.

+ +
+
+
+
    +
  • +
    + + + + init(fetch:value:) + +
    +
    +
    +
    +
    +
    +

    Creates a reducer whose fetch(_:) and value(_:) methods wrap and +forward operations the argument closures.

    + +

    For example, this reducer counts the number of a times the player table +is modified:

    +
    var count = 0
    +let reducer = AnyValueReducer(
    +    fetch: { _ in },
    +    value: { _ -> Int? in
    +        count += 1
    +        return count
    +})
    +let observer = ValueObservation
    +    .tracking(Player.all(), reducer: reducer)
    +    .start(in: dbQueue) { count: Int in
    +        print("Players have been modified \(count) times.")
    +    }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fetch: @escaping (Database) throws -> Fetched, value: @escaping (Fetched) -> Value?)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a reducer that wraps and forwards operations to reducer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Base>(_ reducer: Base) where Fetched == Base.Fetched, Value == Base.Value, Base : ValueReducer
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AssociationAggregate.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AssociationAggregate.html new file mode 100644 index 000000000..70faabe6d --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/AssociationAggregate.html @@ -0,0 +1,1265 @@ + + + + AssociationAggregate Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

AssociationAggregate

+
+
+
public struct AssociationAggregate<RowDecoder>
+ +
+
+

An AssociationAggregate is able to compute aggregated values from a +population of associated records.

+ +

For example:

+
struct Author: TableRecord {
+    static let books = hasMany(Book.self)
+}
+
+let bookCount = Author.books.count // AssociationAggregate<Author>
+
+ +

Association aggregates can be used in the annotated(with:) and +having(_:) request methods:

+
let request = Author.annotated(with: bookCount)
+let request = Author.having(bookCount >= 10)
+
+ +

The RowDecoder generic type helps the compiler prevent incorrect use +of aggregates:

+
// Won't compile because Fruit is not Author.
+let request = Fruit.annotated(with: bookCount)
+
+ +
+
+
+
    +
  • +
    + + + + aliased(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that is selected in a column with the given name.

    + +

    For example:

    +
    let aggregate = Author.books.count.aliased("numberOfBooks")
    +let request = Author.annotated(with: aggregate)
    +if let row = try Row.fetchOne(db, request) {
    +    let numberOfBooks: Int = row["numberOfBooks"]
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, renamed: "forKey(_:﹚")
    +public func aliased(_ name: String) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + forKey(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that is selected in a column with the given name.

    + +

    For example:

    +
    let aggregate = Author.books.count.forKey("numberOfBooks")
    +let request = Author.annotated(with: aggregate)
    +if let row = try Row.fetchOne(db, request) {
    +    let numberOfBooks: Int = row["numberOfBooks"]
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func forKey(_ key: String) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + aliased(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that is selected in a column named like the given +coding key.

    + +

    For example:

    +
    struct AuthorInfo: Decodable, FetchableRecord {
    +    var author: Author
    +    var numberOfBooks: Int
    +
    +    static func fetchAll(_ db: Database) throws -> [AuthorInfo] {
    +        let aggregate = Author.books.count.aliased(CodingKeys.numberOfBooks)
    +        let request = Author.annotated(with: aggregate)
    +        return try AuthorInfo.fetchAll(db, request)
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, renamed: "forKey(_:﹚")
    +public func aliased(_ key: CodingKey) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + forKey(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an aggregate that is selected in a column named like the given +coding key.

    + +

    For example:

    +
    struct AuthorInfo: Decodable, FetchableRecord {
    +    var author: Author
    +    var numberOfBooks: Int
    +
    +    static func fetchAll(_ db: Database) throws -> [AuthorInfo] {
    +        let aggregate = Author.books.count.forKey(CodingKeys.numberOfBooks)
    +        let request = Author.annotated(with: aggregate)
    +        return try AuthorInfo.fetchAll(db, request)
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func forKey(_ key: CodingKey) -> AssociationAggregate<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/Column.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/Column.html new file mode 100644 index 000000000..0e1b1bd09 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/Column.html @@ -0,0 +1,1233 @@ + + + + Column Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Column

+
+
+
public struct Column : ColumnExpression
+ +
+
+

A column in a database table.

+ +

When you need to introduce your own column type, don’t wrap a Column. +Instead, adopt the ColumnExpression protocol.

+ +

See https://github.com/groue/GRDB.swift#the-query-interface

+ +
+
+
+
    +
  • +
    + + + + rowID + +
    +
    +
    +
    +
    +
    +

    The hidden rowID column

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let rowID: Column
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The name of the column

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a column given its name.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ name: String)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a column given a CodingKey.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ codingKey: CodingKey)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rank + +
    +
    +
    +
    +
    +
    +

    The FTS5 rank column

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let rank: Column
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ColumnInfo.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ColumnInfo.html new file mode 100644 index 000000000..2879dc138 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ColumnInfo.html @@ -0,0 +1,1279 @@ + + + + ColumnInfo Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ColumnInfo

+
+
+
public struct ColumnInfo : FetchableRecord
+ +
+
+

A column of a database table.

+ +

This type closely matches the information returned by the +table_info pragma.

+
> CREATE TABLE player (
+    id INTEGER PRIMARY KEY,
+    firstName TEXT,
+    lastName TEXT)
+> PRAGMA table_info("player")
+cid   name   type     notnull   dflt_value  pk
+----  -----  -------  --------  ----------  ---
+0     id     INTEGER  0         NULL        1
+1     name   TEXT     0         NULL        0
+2     score  INTEGER  0         NULL        0
+
+ +

See Database.columns(in:) and https://www.sqlite.org/pragma.html#pragma_table_info

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The column name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + type + +
    +
    +
    +
    +
    +
    +

    The column data type

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let type: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isNotNull + +
    +
    +
    +
    +
    +
    +

    True if and only if the column is constrained to be not null.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isNotNull: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + defaultValueSQL + +
    +
    +
    +
    +
    +
    +

    The SQL snippet that defines the default value, if any.

    + +

    When nil, the column has no default value.

    + +

    When not nil, it contains an SQL string that defines an expression. That +expression may be a literal, as 1, or 'foo'. It may also contain a +non-constant expression such as CURRENT_TIMESTAMP.

    + +

    For example:

    +
    try db.execute(sql: """
    +    CREATE TABLE player(
    +        id INTEGER PRIMARY KEY,
    +        name TEXT DEFAULT 'Anonymous',
    +        score INT DEFAULT 0,
    +        creationDate DATE DEFAULT CURRENT_TIMESTAMP
    +    )
    +    """)
    +let columnInfos = try db.columns(in: "player")
    +columnInfos[0].defaultValueSQL // nil
    +columnInfos[1].defaultValueSQL // "'Anoynymous'"
    +columnInfos[2].defaultValueSQL // "0"
    +columnInfos[3].defaultValueSQL // "CURRENT_TIMESTAMP"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let defaultValueSQL: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + primaryKeyIndex + +
    +
    +
    +
    +
    +
    +

    Zero for columns that are not part of the primary key.

    + +

    Before SQLite 3.7.16, it is 1 for columns that are part of the +primary key.

    + +

    Starting from SQLite 3.7.16, it is the one-based index of the column in +the primary key for columns that are part of the primary key.

    + +

    References:

    + + + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let primaryKeyIndex: Int
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ColumnMapping.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ColumnMapping.html new file mode 100644 index 000000000..b3b5a87eb --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ColumnMapping.html @@ -0,0 +1,1115 @@ + + + + ColumnMapping Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ColumnMapping

+
+
+
public struct ColumnMapping : RowAdapter
+ +
+
+

ColumnMapping is a row adapter that maps column names.

+
let adapter = ColumnMapping(["foo": "bar"])
+let sql = "SELECT 'foo' AS foo, 'bar' AS bar, 'baz' AS baz"
+
+// [foo:"bar"]
+try Row.fetchOne(db, sql: sql, adapter: adapter)
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ColumnMapping with a dictionary from mapped column names to +column names in a base row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ mapping: [String : String])
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/Configuration.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/Configuration.html new file mode 100644 index 000000000..c25ec0414 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/Configuration.html @@ -0,0 +1,1752 @@ + + + + Configuration Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Configuration

+
+
+
public struct Configuration
+ +
+
+

Configuration for a DatabaseQueue or DatabasePool.

+ +
+
+
+
+ + +
+ +

Misc options

+

+
+
+
    +
  • +
    + + + + foreignKeysEnabled + +
    +
    +
    +
    +
    +
    +

    If true, foreign key constraints are checked.

    + +

    Default: true

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var foreignKeysEnabled: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + readonly + +
    +
    +
    +
    +
    +
    +

    If true, database modifications are disallowed.

    + +

    Default: false

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var readonly: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + label + +
    +
    +
    +
    +
    +
    +

    The database label.

    + +

    You can query this label at runtime:

    +
    var configuration = Configuration()
    +configuration.label = "MyDatabase"
    +let dbQueue = try DatabaseQueue(path: ..., configuration: configuration)
    +
    +try dbQueue.read { db in
    +    print(db.configuration.label) // Prints "MyDatabase"
    +}
    +
    + +

    The database label is also used to name the various dispatch queues +created by GRDB, visible in debugging sessions and crash logs. However +those dispatch queue labels are intended for debugging only. Their +format may change between GRDB releases. Applications should not depend +on the GRDB dispatch queue labels.

    + +

    If the database label is nil, the current GRDB implementation uses the +following dispatch queue labels:

    + +
      +
    • GRDB.DatabaseQueue: the (unique) dispatch queue of a DatabaseQueue
    • +
    • GRDB.DatabasePool.writer: the (unique) writer dispatch queue of +a DatabasePool
    • +
    • GRDB.DatabasePool.reader.N, where N is 1, 2, …: one of the reader +dispatch queue(s) of a DatabasePool. N grows with the number of SQLite +connections: it may get bigger than the maximum number of concurrent +readers, as SQLite connections get closed and new ones are opened.
    • +
    • GRDB.DatabasePool.snapshot.N: the dispatch queue of a +DatabaseSnapshot. N grows with the number of snapshots.
    • +
    + +

    If the database label is not nil, for example “MyDatabase”, the current +GRDB implementation uses the following dispatch queue labels:

    + +
      +
    • MyDatabase: the (unique) dispatch queue of a DatabaseQueue
    • +
    • MyDatabase.writer: the (unique) writer dispatch queue of +a DatabasePool
    • +
    • MyDatabase.reader.N, where N is 1, 2, …: one of the reader +dispatch queue(s) of a DatabasePool. N grows with the number of SQLite +connections: it may get bigger than the maximum number of concurrent +readers, as SQLite connections get closed and new ones are opened.
    • +
    • MyDatabase.snapshot.N: the dispatch queue of a +DatabaseSnapshot. N grows with the number of snapshots.
    • +
    + +

    The default label is nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var label: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + trace + +
    +
    +
    +
    +
    +
    +

    A function that is called on every statement executed by the database.

    + +

    Default: nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var trace: TraceFunction?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    If false, SQLite from version 3.29.0 will not interpret a double-quoted +string as a string literal if it does not match any valid identifier.

    + +

    For example:

    +
    // Error: no such column: foo
    +let name = try String.fetchOne(db, sql: """
    +    SELECT "foo" FROM "player"
    +    """)
    +
    + +

    When true, or before version 3.29.0, such strings are interpreted as +string literals, as in the example below. This is a well known SQLite +misfeature.

    +
    // Success: "foo"
    +let name = try String.fetchOne(db, sql: """
    +    SELECT "foo" FROM "player"
    +    """)
    +
    +
      +
    • Default value: false
    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var acceptsDoubleQuotedStringLiterals: Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    When true, the Database.suspendNotification and +Database.resumeNotification suspend and resume the database. Database +suspension helps avoiding the 0xdead10cc +exception.

    + +

    During suspension, all database accesses but reads in WAL mode may throw +a DatabaseError of code SQLITE_INTERRUPT, or SQLITE_ABORT. You can +check for those error codes with the +DatabaseError.isInterruptionError property.

    + +

    Experimental

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var observesSuspensionNotifications: Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Managing SQLite Connections

+

+
+
+
    +
  • +
    + + + + prepareDatabase + +
    +
    +
    +
    +
    +
    +

    A function that is run when an SQLite connection is opened, before the +connection is made available for database access methods.

    + +

    For example:

    +
    var config = Configuration()
    +config.prepareDatabase = { db in
    +    try db.execute(sql: "PRAGMA kdf_iter = 10000")
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var prepareDatabase: ((Database) throws -> Void)?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Transactions

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    The default kind of transaction.

    + +

    Default: deferred

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var defaultTransactionKind: Database.TransactionKind
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    If false, it is a programmer error to leave a transaction opened at the +end of a database access block.

    + +

    For example:

    +
    let dbQueue = DatabaseQueue()
    +
    +// fatal error: A transaction has been left opened at the end of a database access
    +try dbQueue.inDatabase { db in
    +    try db.beginTransaction()
    +}
    +
    + +

    If true, one can leave opened transaction at the end of database access +blocks:

    +
    var config = Configuration()
    +config.allowsUnsafeTransactions = true
    +let dbQueue = DatabaseQueue(configuration: config)
    +
    +try dbQueue.inDatabase { db in
    +    try db.beginTransaction()
    +}
    +
    +try dbQueue.inDatabase { db in
    +    try db.commit()
    +}
    +
    + +

    This configuration flag has no effect on DatabasePool readers: those +never allow leaving a transaction opened at the end of a read access.

    + +

    Default: false

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var allowsUnsafeTransactions: Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Concurrency

+

+
+
+
    +
  • +
    + + + + busyMode + +
    +
    +
    +
    +
    +
    +

    The behavior in case of SQLITE_BUSY error. See https://www.sqlite.org/rescode.html#busy

    + +

    Default: immediateError

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var busyMode: Database.BusyMode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + maximumReaderCount + +
    +
    +
    +
    +
    +
    +

    The maximum number of concurrent readers (applies to database +pools only).

    + +

    Default: 5

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var maximumReaderCount: Int
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + qos + +
    +
    +
    +
    +
    +
    +

    The quality of service class for the work performed by the database.

    + +

    The quality of service is ignored if you supply a target queue.

    + +

    Default: .default (.unspecified on macOS < 10.10)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var qos: DispatchQoS
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + targetQueue + +
    +
    +
    +
    +
    +
    +

    The target queue for all database accesses.

    + +

    When you use a database pool, make sure the queue is concurrent. If +it is serial, no concurrent database access can happen, and you may +experience deadlocks.

    + +

    If the queue is nil, all database accesses happen in unspecified +dispatch queues whose quality of service and label are determined by the +qos and label Configuration properties.

    + +

    Default: nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var targetQueue: DispatchQueue?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Factory Configuration

+

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a factory configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Encryption

+

+
+
+
    +
  • +
    + + + + passphrase + +
    +
    +
    +
    +
    +
    +

    The passphrase for the encrypted database.

    + +

    Default: nil

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use Database.usePassphrase(_:﹚ in Configuration.prepareDatabase instead.")
    +public var passphrase: String? { get set }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseDateComponents.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseDateComponents.html new file mode 100644 index 000000000..358dc72d1 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseDateComponents.html @@ -0,0 +1,1392 @@ + + + + DatabaseDateComponents Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseDateComponents

+
+
+
public struct DatabaseDateComponents : DatabaseValueConvertible, StatementColumnConvertible
+ +
+
+

DatabaseDateComponents reads and stores DateComponents in the database.

+ +
+
+
+
    +
  • +
    + + + + Format + +
    +
    +
    +
    +
    +
    +

    The available formats for reading and storing date components.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Format : String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

NSDateComponents conversion

+

+
+
+
    +
  • +
    + + + + dateComponents + +
    +
    +
    +
    +
    +
    +

    The date components

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let dateComponents: DateComponents
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + format + +
    +
    +
    +
    +
    +
    +

    The database format

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let format: Format
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:format:) + +
    +
    +
    +
    +
    +
    +

    Creates a DatabaseDateComponents from a DateComponents and a format.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ dateComponents: DateComponents, format: Format)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + dateComponents + + +
    +

    An optional DateComponents.

    +
    +
    + + format + + +
    +

    The format used for storing the date components in +the database.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

StatementColumnConvertible adoption

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a value initialized from a raw SQLite statement pointer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(sqliteStatement: SQLiteStatement, index: Int32)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + sqliteStatement + + +
    +

    A pointer to an SQLite statement.

    +
    +
    + + index + + +
    +

    The column index.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseValueConvertible adoption

+

+
+
+
    +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a DatabaseDateComponents if dbValue contains a +valid date.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> DatabaseDateComponents?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseDateComponents/Format.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseDateComponents/Format.html new file mode 100644 index 000000000..393a5607f --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseDateComponents/Format.html @@ -0,0 +1,1294 @@ + + + + Format Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Format

+
+
+
public enum Format : String
+ +
+
+

The available formats for reading and storing date components.

+ +
+
+
+
    +
  • +
    + + + + YMD + +
    +
    +
    +
    +
    +
    +

    The format “yyyy-MM-dd”.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case YMD = "yyyy-MM-dd"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + YMD_HM + +
    +
    +
    +
    +
    +
    +

    The format “yyyy-MM-dd HH:mm”.

    + +

    This format is lexically comparable with SQLite’s CURRENT_TIMESTAMP.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case YMD_HM = "yyyy-MM-dd HH:mm"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + YMD_HMS + +
    +
    +
    +
    +
    +
    +

    The format “yyyy-MM-dd HH:mm:ss”.

    + +

    This format is lexically comparable with SQLite’s CURRENT_TIMESTAMP.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case YMD_HMS = "yyyy-MM-dd HH:mm:ss"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + YMD_HMSS + +
    +
    +
    +
    +
    +
    +

    The format “yyyy-MM-dd HH:mm:ss.SSS”.

    + +

    This format is lexically comparable with SQLite’s CURRENT_TIMESTAMP.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case YMD_HMSS = "yyyy-MM-dd HH:mm:ss.SSS"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + HM + +
    +
    +
    +
    +
    +
    +

    The format “HH:mm”.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case HM = "HH:mm"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + HMS + +
    +
    +
    +
    +
    +
    +

    The format “HH:mm:ss”.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case HMS = "HH:mm:ss"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + HMSS + +
    +
    +
    +
    +
    +
    +

    The format “HH:mm:ss.SSS”.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case HMSS = "HH:mm:ss.SSS"
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseError.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseError.html new file mode 100644 index 000000000..bd6e532ee --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseError.html @@ -0,0 +1,1290 @@ + + + + DatabaseError Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseError

+
+
+
public struct DatabaseError : Error, CustomStringConvertible, CustomNSError
+ +
+
+

DatabaseError wraps an SQLite error.

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseEvent.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseEvent.html new file mode 100644 index 000000000..af8d9316f --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseEvent.html @@ -0,0 +1,1266 @@ + + + + DatabaseEvent Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseEvent

+
+
+
public struct DatabaseEvent
+ +
+
+

A database event, notified to TransactionObserver.

+ +
+
+
+
    +
  • +
    + + + + Kind + +
    +
    +
    +
    +
    +
    +

    An event kind

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Kind : Int32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    The event kind

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: Kind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseName + +
    +
    +
    +
    +
    +
    +

    The database name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseName: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + tableName + +
    +
    +
    +
    +
    +
    +

    The table name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var tableName: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rowID + +
    +
    +
    +
    +
    +
    +

    The rowID of the changed row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rowID: Int64
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + copy() + +
    +
    +
    +
    +
    +
    +

    Returns an event that can be stored:

    +
    class MyObserver: TransactionObserver {
    +    var events: [DatabaseEvent]
    +    func databaseDidChange(with event: DatabaseEvent) {
    +        events.append(event.copy())
    +    }
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func copy() -> DatabaseEvent
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseEvent/Kind.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseEvent/Kind.html new file mode 100644 index 000000000..b45e825ea --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseEvent/Kind.html @@ -0,0 +1,1168 @@ + + + + Kind Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Kind

+
+
+
public enum Kind : Int32
+ +
+
+

An event kind

+ +
+
+
+
    +
  • +
    + + + + insert + +
    +
    +
    +
    +
    +
    +

    SQLITE_INSERT

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case insert = 18
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + delete + +
    +
    +
    +
    +
    +
    +

    SQLITE_DELETE

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case delete = 9
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + update + +
    +
    +
    +
    +
    +
    +

    SQLITE_UPDATE

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case update = 23
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseMigrator.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseMigrator.html new file mode 100644 index 000000000..91fece8f3 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseMigrator.html @@ -0,0 +1,1457 @@ + + + + DatabaseMigrator Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseMigrator

+
+
+
public struct DatabaseMigrator
+ +
+
+

A DatabaseMigrator registers and applies database migrations.

+ +

Migrations are named blocks of SQL statements that are guaranteed to be +applied in order, once and only once.

+ +

When a user upgrades your application, only non-applied migration are run.

+ +

Usage:

+
var migrator = DatabaseMigrator()
+
+// 1st migration
+migrator.registerMigration("createLibrary") { db in
+    try db.create(table: "author") { t in
+        t.autoIncrementedPrimaryKey("id")
+        t.column("creationDate", .datetime)
+        t.column("name", .text).notNull()
+    }
+
+    try db.create(table: "book") { t in
+        t.autoIncrementedPrimaryKey("id")
+        t.column("authorId", .integer)
+            .notNull()
+            .references("author", onDelete: .cascade)
+        t.column("title", .text).notNull()
+    }
+}
+
+// 2nd migration
+migrator.registerMigration("AddBirthYearToAuthors") { db in
+    try db.alter(table: "author") { t
+        t.add(column: "birthYear", .integer)
+    }
+}
+
+// Migrations for future versions will be inserted here:
+//
+// // 3rd migration
+// migrator.registerMigration("...") { db in
+//     ...
+// }
+
+try migrator.migrate(dbQueue)
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    When the eraseDatabaseOnSchemaChange flag is true, the migrator will +automatically wipe out the full database content, and recreate the whole +database from scratch, if it detects that a migration has changed its +definition.

    + +

    This flag can destroy your precious users’ data!

    + +

    But it may be useful in two situations:

    + +
      +
    1. During application development, as you are still designing +migrations, and the schema changes often.

      + +

      In this case, it is recommended that you make sure this flag does +not ship in the distributed application, in order to avoid undesired +data loss:

      +
      var migrator = DatabaseMigrator()
      +#if DEBUG
      +// Speed up development by nuking the database when migrations change
      +migrator.eraseDatabaseOnSchemaChange = true
      +#endif
      +
    2. +
    3. When the database content can easily be recreated, such as a cache +for some downloaded data.

    4. +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var eraseDatabaseOnSchemaChange: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    A new migrator.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Registers a migration.

    +
    migrator.registerMigration("createAuthors") { db in
    +    try db.create(table: "author") { t in
    +        t.autoIncrementedPrimaryKey("id")
    +        t.column("creationDate", .datetime)
    +        t.column("name", .text).notNull()
    +    }
    +}
    +
    +
    +

    Precondition

    + No migration with the same same as already been registered. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func registerMigration(_ identifier: String, migrate: @escaping (Database) throws -> Void)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + identifier + + +
    +

    The migration identifier.

    +
    +
    + + block + + +
    +

    The migration block that performs SQL statements.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func registerMigrationWithDeferredForeignKeyCheck(
    +    _ identifier: String,
    +    migrate: @escaping (Database) throws -> Void)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + migrate(_:) + +
    +
    +
    +
    +
    +
    +

    Iterate migrations in the same order as they were registered. If a +migration has not yet been applied, its block is executed in +a transaction.

    +
    +

    Throws

    + An eventual error thrown by the registered migration blocks. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func migrate(_ writer: DatabaseWriter) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A DatabaseWriter (DatabaseQueue or DatabasePool) where +migrations should apply.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + migrate(_:upTo:) + +
    +
    +
    +
    +
    +
    +

    Iterate migrations in the same order as they were registered, up to the +provided target. If a migration has not yet been applied, its block is +executed in a transaction.

    + +
      +
    • targetIdentifier: The identifier of a registered migration.
    • +
    +

    Throws

    + An eventual error thrown by the registered migration blocks. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func migrate(_ writer: DatabaseWriter, upTo targetIdentifier: String) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A DatabaseWriter (DatabaseQueue or DatabasePool) where +migrations should apply.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the set of applied migration identifiers.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func appliedMigrations(in reader: DatabaseReader) throws -> Set<String>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabasePreUpdateEvent.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabasePreUpdateEvent.html new file mode 100644 index 000000000..b1b0b3886 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabasePreUpdateEvent.html @@ -0,0 +1,1348 @@ + + + + DatabasePreUpdateEvent Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabasePreUpdateEvent

+ +
+
+
+
    +
  • +
    + + + + Kind + +
    +
    +
    +
    +
    +
    +

    An event kind

    + + See more +
    +
    +
    +
  • +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    The event kind

    + +
    +
    +
    +
  • +
  • +
    + + + + databaseName + +
    +
    +
    +
    +
    +
    +

    The database name

    + +
    +
    +
    +
  • +
  • +
    + + + + tableName + +
    +
    +
    +
    +
    +
    +

    The table name

    + +
    +
    +
    +
  • +
  • +
    + + + + count + +
    +
    +
    +
    +
    +
    +

    The number of columns in the row that is being inserted, updated, or deleted.

    + +
    +
    +
    +
  • +
  • +
    + + + + depth + +
    +
    +
    +
    +
    +
    +

    1 for inserts, updates, or deletes invoked by top-level triggers; +2 for changes resulting from triggers called by top-level triggers; +… and so forth

    + +
    +
    +
    +
  • +
  • +
    + + + + initialRowID + +
    +
    +
    +
    +
    +
    +

    The initial rowID of the row being changed for .Update and .Delete changes, +and nil for .Insert changes.

    + +
    +
    +
    +
  • +
  • +
    + + + + finalRowID + +
    +
    +
    +
    +
    +
    +

    The final rowID of the row being changed for .Update and .Insert changes, +and nil for .Delete changes.

    + +
    +
    +
    +
  • +
  • +
    + + + + initialDatabaseValues + +
    +
    +
    +
    +
    +
    +

    The initial database values in the row.

    + +

    Values appear in the same order as the columns in the table.

    + +

    The result is nil if the event is an .Insert event.

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the initial DatabaseValue at given index.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    The result is nil if the event is an .Insert event.

    + +
    +
    +
    +
  • +
  • +
    + + + + finalDatabaseValues + +
    +
    +
    +
    +
    +
    +

    The final database values in the row.

    + +

    Values appear in the same order as the columns in the table.

    + +

    The result is nil if the event is a .Delete event.

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the final DatabaseValue at given index.

    + +

    Indexes span from 0 for the leftmost column to (row.count - 1) for the +righmost column.

    + +

    The result is nil if the event is a .Delete event.

    + +
    +
    +
    +
  • +
  • +
    + + + + copy() + +
    +
    +
    +
    +
    +
    +

    Returns an event that can be stored:

    +
    class MyObserver: TransactionObserver {
    +    var events: [DatabasePreUpdateEvent]
    +    func databaseWillChange(with event: DatabasePreUpdateEvent) {
    +        events.append(event.copy())
    +    }
    +}
    +
    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabasePreUpdateEvent/Kind.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabasePreUpdateEvent/Kind.html new file mode 100644 index 000000000..b1e62a104 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabasePreUpdateEvent/Kind.html @@ -0,0 +1,1129 @@ + + + + Kind Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Kind

+

An event kind

+ +
+
+
+
    +
  • +
    + + + + insert + +
    +
    +
    +
    +
    +
    +

    SQLITE_INSERT

    + +
    +
    +
    +
  • +
  • +
    + + + + delete + +
    +
    +
    +
    +
    +
    +

    SQLITE_DELETE

    + +
    +
    +
    +
  • +
  • +
    + + + + update + +
    +
    +
    +
    +
    +
    +

    SQLITE_UPDATE

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseRegion.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseRegion.html new file mode 100644 index 000000000..4765b0b39 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseRegion.html @@ -0,0 +1,1388 @@ + + + + DatabaseRegion Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseRegion

+
+
+
public struct DatabaseRegion : CustomStringConvertible, Equatable
+
extension DatabaseRegion: DatabaseRegionConvertible
+ +
+
+

DatabaseRegion defines a region in the database. DatabaseRegion is dedicated +to help transaction observers recognize impactful database changes in their +observes(eventsOfKind:) and databaseDidChange(with:) methods.

+ +

A database region is the union of any number of “table regions”, which can +cover a full table, or the combination of columns and rows:

+
|Table1 |   |Table2 |   |Table3 |   |Table4 |   |Table5 |
+|-------|   |-------|   |-------|   |-------|   |-------|
+|x|x|x|x|   |x| | | |   |x|x|x|x|   |x|x| |x|   | | | | |
+|x|x|x|x|   |x| | | |   | | | | |   | | | | |   | |x| | |
+|x|x|x|x|   |x| | | |   | | | | |   |x|x| |x|   | | | | |
+|x|x|x|x|   |x| | | |   | | | | |   | | | | |   | | | | |
+
+ +

To create a database region, you use one of those methods:

+ +
    +
  • DatabaseRegion.fullDatabase: the region that covers all database tables.

  • +
  • DatabaseRegion(): the empty region.

  • +
  • DatabaseRegion(table:): the region that covers one database table.

  • +
  • SelectStatement.databaseRegion:

    +
    let statement = try db.makeSelectStatement(sql: "SELECT name, score FROM player")
    +let region = statement.databaseRegion
    +
  • +
  • FetchRequest.databaseRegion(_:)

    +
    let request = Player.filter(key: 1)
    +let region = try request.databaseRegion(db)
    +
  • +
+ +
+
+
+
    +
  • +
    + + + + isEmpty + +
    +
    +
    +
    +
    +
    +

    Returns whether the region is empty.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isEmpty: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fullDatabase + +
    +
    +
    +
    +
    +
    +

    The region that covers the full database: all columns and all rows +from all tables.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let fullDatabase: DatabaseRegion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates an empty database region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(table:) + +
    +
    +
    +
    +
    +
    +

    Creates a region that spans all rows and columns of a database table.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(table: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + table + + +
    +

    A table name.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + union(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the union of this region and the given one.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func union(_ other: DatabaseRegion) -> DatabaseRegion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + formUnion(_:) + +
    +
    +
    +
    +
    +
    +

    Inserts the given region into this region

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func formUnion(_ other: DatabaseRegion)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Database Events

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns whether the content in the region would be impacted if the +database were modified by an event of this kind.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isModified(byEventsOfKind eventKind: DatabaseEventKind) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isModified(by:) + +
    +
    +
    +
    +
    +
    +

    Returns whether the content in the region is impacted by this event.

    +
    +

    Precondition

    + event has been filtered by the same region +in the TransactionObserver.observes(eventsOfKind:) method, by calling +region.isModified(byEventsOfKind:) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isModified(by event: DatabaseEvent) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseRegionObservation.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseRegionObservation.html new file mode 100644 index 000000000..41185a7ba --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseRegionObservation.html @@ -0,0 +1,1320 @@ + + + + DatabaseRegionObservation Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseRegionObservation

+
+
+
public struct DatabaseRegionObservation
+ +
+
+

DatabaseRegionObservation tracks changes in the results of database +requests, and notifies each database transaction whenever the +database changes.

+ +

For example:

+
let observation = DatabaseRegionObservation(tracking: Player.all)
+let observer = try observation.start(in: dbQueue) { db: Database in
+    print("Players have changed.")
+}
+
+ +
+
+
+
    +
  • +
    + + + + extent + +
    +
    +
    +
    +
    +
    +

    The extent of the database observation. The default is +.observerLifetime: the observation lasts until the +observer returned by the start(in:onChange:) method +is deallocated.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var extent: Database.TransactionObservationExtent
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(tracking:) + +
    +
    +
    +
    +
    +
    +

    Creates a DatabaseRegionObservation which observes regions, and +notifies whenever one of the observed regions is modified by a +database transaction.

    + +

    For example, this sample code counts the number of a times the player +table is modified:

    +
    let observation = DatabaseRegionObservation(tracking: Player.all())
    +
    +var count = 0
    +let observer = observation.start(in: dbQueue) { _ in
    +    count += 1
    +    print("Players have been modified \(count) times.")
    +}
    +
    + +

    The observation lasts until the observer returned by start is +deallocated. See the extent property for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(tracking regions: DatabaseRegionConvertible...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(tracking:) + +
    +
    +
    +
    +
    +
    +

    Creates a DatabaseRegionObservation which observes regions, and +notifies whenever one of the observed regions is modified by a +database transaction.

    + +

    For example, this sample code counts the number of a times the player +table is modified:

    +
    let observation = DatabaseRegionObservation(tracking: [Player.all()])
    +
    +var count = 0
    +let observer = observation.start(in: dbQueue) { _ in
    +    count += 1
    +    print("Players have been modified \(count) times.")
    +}
    +
    + +

    The observation lasts until the observer returned by start is +deallocated. See the extent property for more information.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(tracking regions: [DatabaseRegionConvertible])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + start(in:onChange:) + +
    +
    +
    +
    +
    +
    +

    Starts the observation in the provided database writer (such as +a database queue or database pool), and returns a transaction observer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func start(
    +    in dbWriter: DatabaseWriter,
    +    onChange: @escaping (Database) -> Void)
    +    throws -> TransactionObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + reader + + +
    +

    A DatabaseWriter.

    +
    +
    + + onChange + + +
    +

    A closure that is provided a database connection +with write access each time the observed region has been modified.

    +
    +
    +
    +
    +

    Return Value

    +

    a TransactionObserver

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseValue.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseValue.html new file mode 100644 index 000000000..b4d08fc0a --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseValue.html @@ -0,0 +1,1363 @@ + + + + DatabaseValue Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

DatabaseValue

+
+
+
public struct DatabaseValue : Hashable, CustomStringConvertible, DatabaseValueConvertible, SQLExpression
+ +
+
+

DatabaseValue is the intermediate type between SQLite and your values.

+ +

See https://www.sqlite.org/datatype3.html

+ +
+
+
+
    +
  • +
    + + + + storage + +
    +
    +
    +
    +
    +
    +

    The SQLite storage

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let storage: Storage
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + null + +
    +
    +
    +
    +
    +
    +

    The NULL DatabaseValue.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let null: DatabaseValue
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Storage + +
    +
    +
    +
    +
    +
    +

    An SQLite storage (NULL, INTEGER, REAL, TEXT, BLOB).

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Storage : Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(value:) + +
    +
    +
    +
    +
    +
    +

    Creates a DatabaseValue from Any.

    + +

    The result is nil unless object adopts DatabaseValueConvertible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(value: Any)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Extracting Value

+

+
+
+
    +
  • +
    + + + + isNull + +
    +
    +
    +
    +
    +
    +

    Returns true if databaseValue is NULL.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isNull: Bool { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Hashable & Equatable

+

+
+
+
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns whether two DatabaseValues are equal.

    +
    1.databaseValue == "foo".databaseValue // false
    +1.databaseValue == 1.databaseValue     // true
    +
    + +

    When comparing integers and doubles, the result is true if and only +values are equal, and if converting one type to the other does +not lose information:

    +
    1.databaseValue == 1.0.databaseValue   // true
    +
    + +

    For a comparison that distinguishes integer and doubles, compare +storages instead:

    +
    1.databaseValue.storage == 1.0.databaseValue.storage // false
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: DatabaseValue, rhs: DatabaseValue) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns self

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns the database value

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> DatabaseValue?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseValue/Storage.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseValue/Storage.html new file mode 100644 index 000000000..b71501a07 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/DatabaseValue/Storage.html @@ -0,0 +1,1292 @@ + + + + Storage Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Storage

+
+
+
public enum Storage : Equatable
+ +
+
+

An SQLite storage (NULL, INTEGER, REAL, TEXT, BLOB).

+ +
+
+
+
    +
  • +
    + + + + null + +
    +
    +
    +
    +
    +
    +

    The NULL storage class.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case null
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + int64(_:) + +
    +
    +
    +
    +
    +
    +

    The INTEGER storage class, wrapping an Int64.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case int64(Int64)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + double(_:) + +
    +
    +
    +
    +
    +
    +

    The REAL storage class, wrapping a Double.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case double(Double)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + string(_:) + +
    +
    +
    +
    +
    +
    +

    The TEXT storage class, wrapping a String.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case string(String)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + blob(_:) + +
    +
    +
    +
    +
    +
    +

    The BLOB storage class, wrapping Data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case blob(Data)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    Returns Int64, Double, String, Data or nil.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var value: DatabaseValueConvertible? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    +

    Return true if the storages are identical.

    + +

    Unlike DatabaseValue equality that considers the integer 1 to be +equal to the 1.0 double (as SQLite does), int64 and double storages +are never equal.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: Storage, rhs: Storage) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/EmptyRowAdapter.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/EmptyRowAdapter.html new file mode 100644 index 000000000..56031e9ef --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/EmptyRowAdapter.html @@ -0,0 +1,1108 @@ + + + + EmptyRowAdapter Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

EmptyRowAdapter

+
+
+
public struct EmptyRowAdapter : RowAdapter
+ +
+
+

EmptyRowAdapter is a row adapter that hides all columns.

+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates an EmptyRowAdapter

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3.html new file mode 100644 index 000000000..c06f8d8c2 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3.html @@ -0,0 +1,1292 @@ + + + + FTS3 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS3

+
+
+
public struct FTS3 : VirtualTableModule
+ +
+
+

FTS3 lets you define “fts3” virtual tables.

+
// CREATE VIRTUAL TABLE document USING fts3(content)
+try db.create(virtualTable: "document", using: FTS3()) { t in
+    t.column("content")
+}
+
+ +
+
+
+
    +
  • +
    + + + + Diacritics + +
    +
    +
    +
    +
    +
    +

    Options for Latin script characters. Matches the raw “remove_diacritics” +tokenizer argument.

    + +

    See https://www.sqlite.org/fts3.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Diacritics
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a FTS3 module suitable for the Database +create(virtualTable:using:) method.

    +
    // CREATE VIRTUAL TABLE document USING fts3(content)
    +try db.create(virtualTable: "document", using: FTS3()) { t in
    +    t.column("content")
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

VirtualTableModule Adoption

+

+
+
+
    +
  • +
    + + + + moduleName + +
    +
    +
    +
    +
    +
    +

    The virtual table module name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let moduleName: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + makeTableDefinition() + +
    +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeTableDefinition() -> FTS3TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func moduleArguments(for definition: FTS3TableDefinition, in db: Database) -> [String]
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func database(_ db: Database, didCreate tableName: String, using definition: FTS3TableDefinition)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3/Diacritics.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3/Diacritics.html new file mode 100644 index 000000000..2a2da23c8 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3/Diacritics.html @@ -0,0 +1,1164 @@ + + + + Diacritics Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Diacritics

+
+
+
public enum Diacritics
+ +
+
+

Options for Latin script characters. Matches the raw “remove_diacritics” +tokenizer argument.

+ +

See https://www.sqlite.org/fts3.html

+ +
+
+
+
    +
  • +
    + + + + keep + +
    +
    +
    +
    +
    +
    +

    Do not remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=0” tokenizer argument.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case keep
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + removeLegacy + +
    +
    +
    +
    +
    +
    +

    Remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=1” tokenizer argument.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case removeLegacy
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove + +
    +
    +
    +
    +
    +
    +

    Remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=2” tokenizer argument, +available from SQLite 3.27.0

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3Pattern.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3Pattern.html new file mode 100644 index 000000000..51dc4f9ad --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3Pattern.html @@ -0,0 +1,1437 @@ + + + + FTS3Pattern Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS3Pattern

+
+
+
public struct FTS3Pattern
+
extension FTS3Pattern: DatabaseValueConvertible
+ +
+
+

A full text pattern that can query FTS3 and FTS4 virtual tables.

+ +
+
+
+
    +
  • +
    + + + + rawPattern + +
    +
    +
    +
    +
    +
    +

    The raw pattern string. Guaranteed to be a valid FTS3/4 pattern.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawPattern: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawPattern:) + +
    +
    +
    +
    +
    +
    +

    Creates a pattern from a raw pattern string; throws DatabaseError on +invalid syntax.

    + +

    The pattern syntax is documented at https://www.sqlite.org/fts3.html#full_text_index_queries

    +
    try FTS3Pattern(rawPattern: "and") // OK
    +try FTS3Pattern(rawPattern: "AND") // malformed MATCH expression: [AND]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawPattern: String) throws
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches any token found in the input string; +returns nil if no pattern could be built.

    +
    FTS3Pattern(matchingAnyTokenIn: "")        // nil
    +FTS3Pattern(matchingAnyTokenIn: "foo bar") // foo OR bar
    +
    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches all tokens found in the input string; +returns nil if no pattern could be built.

    +
    FTS3Pattern(matchingAllTokensIn: "")        // nil
    +FTS3Pattern(matchingAllTokensIn: "foo bar") // foo bar
    +
    + +
    +
    +
    +
  • +
  • +
    + + + + init(matchingPhrase:) + +
    +
    +
    +
    +
    +
    +

    Creates a pattern that matches a contiguous string; returns nil if no +pattern could be built.

    +
    FTS3Pattern(matchingPhrase: "")        // nil
    +FTS3Pattern(matchingPhrase: "foo bar") // "foo bar"
    +
    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches any token found in the input string; +returns nil if no pattern could be built.

    +
    FTS3Pattern(matchingAnyTokenIn: "")        // nil
    +FTS3Pattern(matchingAnyTokenIn: "foo bar") // foo OR bar
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public init?(matchingAnyTokenIn string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS3 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches all tokens found in the input string; +returns nil if no pattern could be built.

    +
    FTS3Pattern(matchingAllTokensIn: "")        // nil
    +FTS3Pattern(matchingAllTokensIn: "foo bar") // foo bar
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public init?(matchingAllTokensIn string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS3 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(matchingPhrase:) + +
    +
    +
    +
    +
    +
    +

    Creates a pattern that matches a contiguous string; returns nil if no +pattern could be built.

    +
    FTS3Pattern(matchingPhrase: "")        // nil
    +FTS3Pattern(matchingPhrase: "foo bar") // "foo bar"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public init?(matchingPhrase string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS3 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an FTS3Pattern initialized from dbValue, if it contains +a suitable value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> FTS3Pattern?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3TokenizerDescriptor.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3TokenizerDescriptor.html new file mode 100644 index 000000000..6ccaea909 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS3TokenizerDescriptor.html @@ -0,0 +1,1268 @@ + + + + FTS3TokenizerDescriptor Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS3TokenizerDescriptor

+
+
+
public struct FTS3TokenizerDescriptor
+ +
+
+

An FTS3 tokenizer, suitable for FTS3 and FTS4 table definitions:

+
db.create(virtualTable: "book", using: FTS4()) { t in
+    t.tokenizer = .simple // FTS3TokenizerDescriptor
+}
+
+ +

See https://www.sqlite.org/fts3.html#tokenizer

+ +
+
+
+
    +
  • +
    + + + + simple + +
    +
    +
    +
    +
    +
    +

    The “simple” tokenizer.

    +
    db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.tokenizer = .simple
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let simple: FTS3TokenizerDescriptor
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + porter + +
    +
    +
    +
    +
    +
    +

    The “porter” tokenizer.

    +
    db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.tokenizer = .porter
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let porter: FTS3TokenizerDescriptor
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The “unicode61” tokenizer.

    +
    db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.tokenizer = .unicode61()
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#tokenizer

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The “unicode61” tokenizer.

    +
    db.create(virtualTable: "book", using: FTS4()) { t in
    +    t.tokenizer = .unicode61()
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html#tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(OSX 10.10, *)
    +public static func unicode61(
    +    diacritics: FTS3.Diacritics = .removeLegacy,
    +    separators: Set<Character> = [],
    +    tokenCharacters: Set<Character> = [])
    +    -> FTS3TokenizerDescriptor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + diacritics + + +
    +

    By default SQLite will strip diacritics from +latin characters.

    +
    +
    + + separators + + +
    +

    Unless empty (the default), SQLite will consider these +characters as token separators.

    +
    +
    + + tokenCharacters + + +
    +

    Unless empty (the default), SQLite will consider +these characters as token characters.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS4.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS4.html new file mode 100644 index 000000000..f35cffe42 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS4.html @@ -0,0 +1,1262 @@ + + + + FTS4 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS4

+
+
+
public struct FTS4 : VirtualTableModule
+ +
+
+

FTS4 lets you define “fts4” virtual tables.

+
// CREATE VIRTUAL TABLE document USING fts4(content)
+try db.create(virtualTable: "document", using: FTS4()) { t in
+    t.column("content")
+}
+
+ +

See https://www.sqlite.org/fts3.html

+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a FTS4 module suitable for the Database +create(virtualTable:using:) method.

    +
    // CREATE VIRTUAL TABLE document USING fts4(content)
    +try db.create(virtualTable: "document", using: FTS4()) { t in
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts3.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

VirtualTableModule Adoption

+

+
+
+
    +
  • +
    + + + + moduleName + +
    +
    +
    +
    +
    +
    +

    The virtual table module name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let moduleName: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + makeTableDefinition() + +
    +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func makeTableDefinition() -> FTS4TableDefinition
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func moduleArguments(for definition: FTS4TableDefinition, in db: Database) -> [String]
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Reserved; part of the VirtualTableModule protocol.

    + +

    See Database.create(virtualTable:using:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func database(_ db: Database, didCreate tableName: String, using definition: FTS4TableDefinition) throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5.html new file mode 100644 index 000000000..ba65f008a --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5.html @@ -0,0 +1,1292 @@ + + + + FTS5 Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5

+
+
+
public struct FTS5 : VirtualTableModule
+ +
+
+

FTS5 lets you define “fts5” virtual tables.

+
// CREATE VIRTUAL TABLE document USING fts5(content)
+try db.create(virtualTable: "document", using: FTS5()) { t in
+    t.column("content")
+}
+
+ +

See https://www.sqlite.org/fts5.html

+ +
+
+
+
    +
  • +
    + + + + Diacritics + +
    +
    +
    +
    +
    +
    +

    Options for Latin script characters. Matches the raw “remove_diacritics” +tokenizer argument.

    + +

    See https://www.sqlite.org/fts5.html

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Diacritics
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a FTS5 module suitable for the Database +create(virtualTable:using:) method.

    +
    // CREATE VIRTUAL TABLE document USING fts5(content)
    +try db.create(virtualTable: "document", using: FTS5()) { t in
    +    t.column("content")
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

VirtualTableModule Adoption

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5/Diacritics.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5/Diacritics.html new file mode 100644 index 000000000..8cf6c38e9 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5/Diacritics.html @@ -0,0 +1,1164 @@ + + + + Diacritics Enumeration Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Diacritics

+
+
+
public enum Diacritics
+ +
+
+

Options for Latin script characters. Matches the raw “remove_diacritics” +tokenizer argument.

+ +

See https://www.sqlite.org/fts5.html

+ +
+
+
+
    +
  • +
    + + + + keep + +
    +
    +
    +
    +
    +
    +

    Do not remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=0” tokenizer argument.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case keep
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + removeLegacy + +
    +
    +
    +
    +
    +
    +

    Remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=1” tokenizer argument.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case removeLegacy
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + remove + +
    +
    +
    +
    +
    +
    +

    Remove diacritics from Latin script characters. This +option matches the raw “remove_diacritics=2” tokenizer argument, +available from SQLite 3.27.0

    + +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5Pattern.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5Pattern.html new file mode 100644 index 000000000..b3293c6b6 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5Pattern.html @@ -0,0 +1,1382 @@ + + + + FTS5Pattern Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5Pattern

+
+
+
public struct FTS5Pattern
+
extension FTS5Pattern: DatabaseValueConvertible
+ +
+
+

A full text pattern that can query FTS5 virtual tables.

+ +
+
+
+
    +
  • +
    + + + + rawPattern + +
    +
    +
    +
    +
    +
    +

    The raw pattern string. Guaranteed to be a valid FTS5 pattern.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawPattern: String
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches any token found in the input string; +returns nil if no pattern could be built.

    +
    FTS5Pattern(matchingAnyTokenIn: "")        // nil
    +FTS5Pattern(matchingAnyTokenIn: "foo bar") // foo OR bar
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(matchingAnyTokenIn string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS5 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches all tokens found in the input string; +returns nil if no pattern could be built.

    +
    FTS5Pattern(matchingAllTokensIn: "")        // nil
    +FTS5Pattern(matchingAllTokensIn: "foo bar") // foo bar
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(matchingAllTokensIn string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS5 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(matchingPhrase:) + +
    +
    +
    +
    +
    +
    +

    Creates a pattern that matches a contiguous string; returns nil if no +pattern could be built.

    +
    FTS5Pattern(matchingPhrase: "")        // nil
    +FTS5Pattern(matchingPhrase: "foo bar") // "foo bar"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(matchingPhrase string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS5 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a pattern that matches a contiguous string prefix; returns +nil if no pattern could be built.

    +
    FTS5Pattern(matchingPrefixPhrase: "")        // nil
    +FTS5Pattern(matchingPrefixPhrase: "foo bar") // ^"foo bar"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(matchingPrefixPhrase string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    The string to turn into an FTS5 pattern

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + databaseValue + +
    +
    +
    +
    +
    +
    +

    Returns a value that can be stored in the database.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var databaseValue: DatabaseValue { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fromDatabaseValue(_:) + +
    +
    +
    +
    +
    +
    +

    Returns an FTS5Pattern initialized from dbValue, if it +contains a suitable value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> FTS5Pattern?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5TokenFlags.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5TokenFlags.html new file mode 100644 index 000000000..95a551686 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5TokenFlags.html @@ -0,0 +1,1168 @@ + + + + FTS5TokenFlags Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5TokenFlags

+
+
+
public struct FTS5TokenFlags : OptionSet
+ +
+
+

Flags that tell SQLite how to register a token.

+ +

See https://www.sqlite.org/fts5.html#custom_tokenizers

+ +
+
+
+
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: Int32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: Int32)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + colocated + +
    +
    +
    +
    +
    +
    +

    FTS5_TOKEN_COLOCATED

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let colocated: FTS5TokenFlags
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5Tokenization.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5Tokenization.html new file mode 100644 index 000000000..636d38b19 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5Tokenization.html @@ -0,0 +1,1258 @@ + + + + FTS5Tokenization Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5Tokenization

+
+
+
public struct FTS5Tokenization : OptionSet
+ +
+
+

The reason why FTS5 is requesting tokenization.

+ +

See https://www.sqlite.org/fts5.html#custom_tokenizers

+ +
+
+
+
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: Int32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: Int32)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + query + +
    +
    +
    +
    +
    +
    +

    FTS5_TOKENIZE_QUERY

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let query: FTS5Tokenization
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + prefix + +
    +
    +
    +
    +
    +
    +

    FTS5_TOKENIZE_PREFIX

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let prefix: FTS5Tokenization
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + document + +
    +
    +
    +
    +
    +
    +

    FTS5_TOKENIZE_DOCUMENT

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let document: FTS5Tokenization
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + aux + +
    +
    +
    +
    +
    +
    +

    FTS5_TOKENIZE_AUX

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let aux: FTS5Tokenization
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5TokenizerDescriptor.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5TokenizerDescriptor.html new file mode 100644 index 000000000..3f4d03532 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FTS5TokenizerDescriptor.html @@ -0,0 +1,1332 @@ + + + + FTS5TokenizerDescriptor Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FTS5TokenizerDescriptor

+
+
+
public struct FTS5TokenizerDescriptor
+ +
+
+

An FTS5 tokenizer, suitable for FTS5 table definitions:

+
db.create(virtualTable: "book", using: FTS5()) { t in
+    t.tokenizer = .unicode61() // FTS5TokenizerDescriptor
+}
+
+ +

See https://www.sqlite.org/fts5.html#tokenizers

+ +
+
+
+
    +
  • +
    + + + + components + +
    +
    +
    +
    +
    +
    +

    The tokenizer components

    +
    // ["unicode61"]
    +FTS5TokenizerDescriptor.unicode61().components
    +
    +// ["unicode61", "remove_diacritics", "0"]
    +FTS5TokenizerDescriptor.unicode61(removeDiacritics: false)).components
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let components: [String]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(components:) + +
    +
    +
    +
    +
    +
    +

    Creates an FTS5 tokenizer descriptor.

    +
    db.create(virtualTable: "book", using: FTS5()) { t in
    +    let tokenizer = FTS5TokenizerDescriptor(components: ["porter", "unicode61", "remove_diacritics", "0"])
    +    t.tokenizer = tokenizer
    +}
    +
    +
    +

    Precondition

    + Components is not empty + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(components: [String])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ascii(separators:) + +
    +
    +
    +
    +
    +
    +

    The “ascii” tokenizer

    +
    db.create(virtualTable: "book", using: FTS5()) { t in
    +    t.tokenizer = .ascii()
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html#ascii_tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ascii(separators: Set<Character> = []) -> FTS5TokenizerDescriptor
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + separators + + +
    +

    Unless empty (the default), SQLite will consider +these characters as token separators.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + porter(wrapping:) + +
    +
    +
    +
    +
    + +
    +

    Declaration

    +
    +

    Swift

    +
    public static func porter(wrapping base: FTS5TokenizerDescriptor? = nil) -> FTS5TokenizerDescriptor
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    An “unicode61” tokenizer

    +
    db.create(virtualTable: "book", using: FTS5()) { t in
    +    t.tokenizer = .unicode61()
    +}
    +
    + +

    See https://www.sqlite.org/fts5.html#unicode61_tokenizer

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func unicode61(
    +    diacritics: FTS5.Diacritics = .removeLegacy,
    +    separators: Set<Character> = [],
    +    tokenCharacters: Set<Character> = [])
    +    -> FTS5TokenizerDescriptor
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + diacritics + + +
    +

    By default SQLite will strip diacritics from +latin characters.

    +
    +
    + + separators + + +
    +

    Unless empty (the default), SQLite will consider +these characters as token separators.

    +
    +
    + + tokenCharacters + + +
    +

    Unless empty (the default), SQLite will +consider these characters as token characters.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FetchedRecordsSectionInfo.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FetchedRecordsSectionInfo.html new file mode 100644 index 000000000..126d6ea76 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/FetchedRecordsSectionInfo.html @@ -0,0 +1,1138 @@ + + + + FetchedRecordsSectionInfo Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

FetchedRecordsSectionInfo

+
+
+
public struct FetchedRecordsSectionInfo<Record> where Record : FetchableRecord
+ +
+
+

A section given by a FetchedRecordsController.

+ +
+
+
+
    +
  • +
    + + + + numberOfRecords + +
    +
    +
    +
    +
    +
    +

    The number of records (rows) in the section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var numberOfRecords: Int { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + records + +
    +
    +
    +
    +
    +
    +

    The array of records in the section.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var records: [Record] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ForeignKey.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ForeignKey.html new file mode 100644 index 000000000..740503964 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ForeignKey.html @@ -0,0 +1,1286 @@ + + + + ForeignKey Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ForeignKey

+
+
+
public struct ForeignKey
+ +
+
+

A ForeignKey helps building associations when GRDB can’t infer a foreign +key from the database schema.

+ +

Sometimes the database schema does not define any foreign key between two +tables. And sometimes, there are several foreign keys from a table +to another:

+
| Table book   |       | Table person |
+| ------------ |       | ------------ |
+| id           |   +-->• id           |
+| authorId     •---+   | name         |
+| translatorId •---+
+| title        |
+
+ +

When this happens, associations can’t be automatically inferred from the +database schema. GRDB will complain with a fatal error such as “Ambiguous +foreign key from book to person”, or “Could not infer foreign key from book +to person”.

+ +

Your help is needed. You have to instruct GRDB which foreign key to use:

+
struct Book: TableRecord {
+    // Define foreign keys
+    static let authorForeignKey = ForeignKey(["authorId"]))
+    static let translatorForeignKey = ForeignKey(["translatorId"]))
+
+    // Use foreign keys to define associations:
+    static let author = belongsTo(Person.self, using: authorForeignKey)
+    static let translator = belongsTo(Person.self, using: translatorForeignKey)
+}
+
+ +

Foreign keys are always defined from the table that contains the columns at +the origin of the foreign key. Person’s symmetric HasMany associations reuse +Book’s foreign keys:

+
struct Person: TableRecord {
+    static let writtenBooks = hasMany(Book.self, using: Book.authorForeignKey)
+    static let translatedBooks = hasMany(Book.self, using: Book.translatorForeignKey)
+}
+
+ +

Foreign keys can also be defined from query interface columns:

+
struct Book: TableRecord {
+    enum Columns: String, ColumnExpression {
+        case id, title, authorId, translatorId
+    }
+
+    static let authorForeignKey = ForeignKey([Columns.authorId]))
+    static let translatorForeignKey = ForeignKey([Columns.translatorId]))
+}
+
+ +

When the destination table of a foreign key does not define any primary key, +you need to provide the full definition of a foreign key:

+
struct Book: TableRecord {
+    static let authorForeignKey = ForeignKey(["authorId"], to: ["id"]))
+    static let author = belongsTo(Person.self, using: authorForeignKey)
+}
+
+ +
+
+
+
    +
  • +
    + + + + init(_:to:) + +
    +
    +
    +
    +
    +
    +

    Creates a ForeignKey intended to define a record association.

    +
    struct Book: TableRecord {
    +    // Define foreign keys
    +    static let authorForeignKey = ForeignKey(["authorId"]))
    +    static let translatorForeignKey = ForeignKey(["translatorId"]))
    +
    +    // Use foreign keys to define associations:
    +    static let author = belongsTo(Person.self, using: authorForeignKey)
    +    static let translator = belongsTo(Person.self, using: translatorForeignKey)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ originColumns: [String], to destinationColumns: [String]? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + originColumns + + +
    +

    The columns at the origin of the foreign key.

    +
    +
    + + destinationColumns + + +
    +

    The columns at the destination of the +foreign key. When nil (the default), GRDB automatically uses the +primary key.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:to:) + +
    +
    +
    +
    +
    +
    +

    Creates a ForeignKey intended to define a record association.

    +
    struct Book: TableRecord {
    +    // Define columns
    +    enum Columns: String, ColumnExpression {
    +        case id, title, authorId, translatorId
    +    }
    +
    +    // Define foreign keys
    +    static let authorForeignKey = ForeignKey([Columns.authorId]))
    +    static let translatorForeignKey = ForeignKey([Columns.translatorId]))
    +
    +    // Use foreign keys to define associations:
    +    static let author = belongsTo(Person.self, using: authorForeignKey)
    +    static let translator = belongsTo(Person.self, using: translatorForeignKey)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ originColumns: [ColumnExpression], to destinationColumns: [ColumnExpression]? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + originColumns + + +
    +

    The columns at the origin of the foreign key.

    +
    +
    + + destinationColumns + + +
    +

    The columns at the destination of the +foreign key. When nil (the default), GRDB automatically uses the +primary key.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ForeignKeyInfo.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ForeignKeyInfo.html new file mode 100644 index 000000000..da6493a0a --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ForeignKeyInfo.html @@ -0,0 +1,1199 @@ + + + + ForeignKeyInfo Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ForeignKeyInfo

+
+
+
public struct ForeignKeyInfo
+ +
+
+

You get foreign keys from table names, with the +foreignKeys(on:) method.

+ +
+
+
+
    +
  • +
    + + + + destinationTable + +
    +
    +
    +
    +
    +
    +

    The name of the destination table

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let destinationTable: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + mapping + +
    +
    +
    +
    +
    +
    +

    The column to column mapping

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let mapping: [(origin: String, destination: String)]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + originColumns + +
    +
    +
    +
    +
    +
    +

    The origin columns

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var originColumns: [String] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + destinationColumns + +
    +
    +
    +
    +
    +
    +

    The destination columns

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var destinationColumns: [String] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/IndexInfo.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/IndexInfo.html new file mode 100644 index 000000000..5574d6cb9 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/IndexInfo.html @@ -0,0 +1,1170 @@ + + + + IndexInfo Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

IndexInfo

+
+
+
public struct IndexInfo
+ +
+
+

An index on a database table.

+ +

See Database.indexes(on:)

+ +
+
+
+
    +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The name of the index

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + columns + +
    +
    +
    +
    +
    +
    +

    The indexed columns

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let columns: [String]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isUnique + +
    +
    +
    +
    +
    +
    +

    True if the index is unique

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let isUnique: Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/Inflections.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/Inflections.html new file mode 100644 index 000000000..15d450464 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/Inflections.html @@ -0,0 +1,1502 @@ + + + + Inflections Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Inflections

+
+
+
public struct Inflections
+ +
+
+

Experimental

+ +

A type that controls GRDB string inflections.

+ +
+
+
+
+ + +
+ +

Initialization

+

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Configuration

+

+
+
+
    +
  • +
    + + + + plural(_:options:_:) + +
    +
    +
    +
    +
    +
    +

    Appends a pluralization rule.

    +
    var inflections = Inflections()
    +inflections.plural("$", "s")
    +inflections.pluralize("player") // "players"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func plural(
    +    _ pattern: String,
    +    options: NSRegularExpression.Options = [.caseInsensitive],
    +    _ template: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + pattern + + +
    +

    A regular expression pattern.

    +
    +
    + + options + + +
    +

    Regular expression options (defaults to +[.caseInsensitive]).

    +
    +
    + + template + + +
    +

    A replacement template string.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Appends a singularization rule.

    +
    var inflections = Inflections()
    +inflections.singular("s$", "")
    +inflections.singularize("players") // "player"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func singular(
    +    _ pattern: String,
    +    options: NSRegularExpression.Options = [.caseInsensitive],
    +    _ template: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + pattern + + +
    +

    A regular expression pattern.

    +
    +
    + + options + + +
    +

    Regular expression options (defaults to +[.caseInsensitive]).

    +
    +
    + + template + + +
    +

    A replacement template string.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + uncountableWords(_:) + +
    +
    +
    +
    +
    +
    +

    Appends uncountable words.

    +
    var inflections = Inflections()
    +inflections.plural("$", "s")
    +inflections.uncountableWords(["foo"])
    +inflections.pluralize("foo") // "foo"
    +inflections.pluralize("bar") // "bars"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func uncountableWords(_ words: [String])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + irregularSuffix(_:_:) + +
    +
    +
    +
    +
    +
    +

    Appends an irregular singular/plural pair.

    +
    var inflections = Inflections()
    +inflections.plural("$", "s")
    +inflections.irregularSuffix("man", "men")
    +inflections.pluralize("man")      // "men"
    +inflections.singularizes("women") // "woman"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func irregularSuffix(_ singular: String, _ plural: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + singular + + +
    +

    The singular form.

    +
    +
    + + plural + + +
    +

    The plural form.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Inflections

+

+
+
+
    +
  • +
    + + + + pluralize(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a pluralized string.

    +
    Inflections.default.pluralize("player") // "players"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func pluralize(_ string: String) -> String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + singularize(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a singularized string.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func singularize(_ string: String) -> String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + default + +
    +
    +
    +
    +
    +
    +

    The default inflections

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var `default`: Inflections
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PersistenceConflictPolicy.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PersistenceConflictPolicy.html new file mode 100644 index 000000000..a63ecfa57 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PersistenceConflictPolicy.html @@ -0,0 +1,1173 @@ + + + + PersistenceConflictPolicy Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PersistenceConflictPolicy

+
+
+
public struct PersistenceConflictPolicy
+ +
+
+

The MutablePersistableRecord protocol uses this type in order to handle SQLite +conflicts when records are inserted or updated.

+ +

See MutablePersistableRecord.persistenceConflictPolicy.

+ +

See https://www.sqlite.org/lang_conflict.html

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PersistenceContainer.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PersistenceContainer.html new file mode 100644 index 000000000..0399ee7cd --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PersistenceContainer.html @@ -0,0 +1,1159 @@ + + + + PersistenceContainer Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PersistenceContainer

+
+
+
public struct PersistenceContainer
+ +
+
+

Use persistence containers in the encode(to:) method of your +encodable records:

+
struct Player: EncodableRecord {
+    var id: Int64?
+    var name: String?
+
+    func encode(to container: inout PersistenceContainer) {
+        container["id"] = id
+        container["name"] = name
+    }
+}
+
+ +
+
+
+
    +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses the value associated with the given column.

    + +

    It is undefined behavior to set different values for the same column. +Column names are case insensitive, so defining both “name” and “NAME” +is considered undefined behavior.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript(column: String) -> DatabaseValueConvertible? { get set }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + subscript(_:) + +
    +
    +
    +
    +
    +
    +

    Accesses the value associated with the given column.

    + +

    It is undefined behavior to set different values for the same column. +Column names are case insensitive, so defining both “name” and “NAME” +is considered undefined behavior.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @inlinable
    +public subscript<Column>(column: Column) -> DatabaseValueConvertible? where Column : ColumnExpression { get set }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PreparedRequest.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PreparedRequest.html new file mode 100644 index 000000000..92215cdf3 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PreparedRequest.html @@ -0,0 +1,1203 @@ + + + + PreparedRequest Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PreparedRequest

+
+
+
public struct PreparedRequest
+ +
+
+

A PreparedRequest is a request that is ready to be executed.

+ +
+
+
+
    +
  • +
    + + + + statement + +
    +
    +
    +
    +
    +
    +

    A prepared statement

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var statement: SelectStatement
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + adapter + +
    +
    +
    +
    +
    +
    +

    An eventual adapter for rows fetched by the select statement

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var adapter: RowAdapter?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a PreparedRequest.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    statement: SelectStatement,
    +    adapter: RowAdapter? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + statement + + +
    +

    A prepared statement that is ready to +be executed.

    +
    +
    + + adapter + + +
    +

    An eventual adapter for rows fetched by the +select statement.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PrimaryKeyInfo.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PrimaryKeyInfo.html new file mode 100644 index 000000000..73be5fe87 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/PrimaryKeyInfo.html @@ -0,0 +1,1206 @@ + + + + PrimaryKeyInfo Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

PrimaryKeyInfo

+
+
+
public struct PrimaryKeyInfo
+ +
+
+

Primary keys are returned from the Database.primaryKey(_:) method.

+ +

When the table’s primary key is the rowid:

+
// CREATE TABLE item (name TEXT)
+let pk = try db.primaryKey("item")
+pk.columns     // ["rowid"]
+pk.rowIDColumn // nil
+pk.isRowID     // true
+
+// CREATE TABLE citizen (
+//   id INTEGER PRIMARY KEY,
+//   name TEXT
+// )
+let pk = try db.primaryKey("citizen")!
+pk.columns     // ["id"]
+pk.rowIDColumn // "id"
+pk.isRowID     // true
+
+ +

When the table’s primary key is not the rowid:

+
// CREATE TABLE country (
+//   isoCode TEXT NOT NULL PRIMARY KEY
+//   name TEXT
+// )
+let pk = db.primaryKey("country")!
+pk.columns     // ["isoCode"]
+pk.rowIDColumn // nil
+pk.isRowID     // false
+
+// CREATE TABLE citizenship (
+//   citizenID INTEGER NOT NULL REFERENCES citizen(id)
+//   countryIsoCode TEXT NOT NULL REFERENCES country(isoCode)
+//   PRIMARY KEY (citizenID, countryIsoCode)
+// )
+let pk = db.primaryKey("citizenship")!
+pk.columns     // ["citizenID", "countryIsoCode"]
+pk.rowIDColumn // nil
+pk.isRowID     // false
+
+ +
+
+
+
    +
  • +
    + + + + columns + +
    +
    +
    +
    +
    +
    +

    The columns in the primary key; this array is never empty.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var columns: [String] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rowIDColumn + +
    +
    +
    +
    +
    +
    +

    When not nil, the name of the column that contains the INTEGER PRIMARY KEY.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var rowIDColumn: String? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRowID + +
    +
    +
    +
    +
    +
    +

    When true, the primary key is the rowid:

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isRowID: Bool { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/QueryInterfaceRequest.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/QueryInterfaceRequest.html new file mode 100644 index 000000000..99bc1907b --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/QueryInterfaceRequest.html @@ -0,0 +1,2194 @@ + + + + QueryInterfaceRequest Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

QueryInterfaceRequest

+
+
+
public struct QueryInterfaceRequest<T>
+
extension QueryInterfaceRequest: FetchRequest
+
extension QueryInterfaceRequest: SelectionRequest
+
extension QueryInterfaceRequest: FilteredRequest
+
extension QueryInterfaceRequest: OrderedRequest
+
extension QueryInterfaceRequest: AggregatingRequest
+
extension QueryInterfaceRequest: _JoinableRequest
+
extension QueryInterfaceRequest: TableRequest
+
extension QueryInterfaceRequest: JoinableRequest where T: TableRecord
+
extension QueryInterfaceRequest: DerivableRequest where T: TableRecord
+ +
+
+

QueryInterfaceRequest is a request that generates SQL for you.

+ +

For example:

+
try dbQueue.read { db in
+    let request = Player
+        .filter(Column("score") > 1000)
+        .order(Column("name"))
+    let players = try request.fetchAll(db) // [Player]
+}
+
+ +

See https://github.com/groue/GRDB.swift#the-query-interface

+ +
+
+
+
    +
  • +
    + + + + RowDecoder + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias RowDecoder = T
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Request Derivation

+

+
+
+
    +
  • +
    + + + + select(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection.

    +
    // SELECT id, email FROM player
    +var request = Player.all()
    +request = request.select([Column("id"), Column("email")])
    +
    + +

    Any previous selection is replaced:

    +
    // SELECT email FROM player
    +request
    +    .select([Column("id")])
    +    .select([Column("email")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select(_ selection: [SQLSelectable]) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:as:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.all().select([max(Column("score"))], as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<RowDecoder>(_ selection: [SQLSelectable], as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(_:as:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects selection, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.all().select(max(Column("score")), as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<RowDecoder>(_ selection: SQLSelectable..., as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a request which selects sql, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT max(score) FROM player
    +    let request = Player.all().select(sql: "max(score)", as: Int.self)
    +    let maxScore: Int? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<RowDecoder>(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + select(literal:as:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which selects an SQL literal, and fetches values of +type type.

    +
    try dbQueue.read { db in
    +    // SELECT IFNULL(name, 'Anonymous') FROM player WHERE id = 42
    +    let request = Player.
    +        .filter(primaryKey: 42)
    +        .select(
    +            SQLLiteral(
    +                sql: "IFNULL(name, ?)",
    +                arguments: ["Anonymous"]),
    +            as: String.self)
    +    let name: String? = try request.fetchOne(db)
    +}
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    try dbQueue.read { db in
    +    // SELECT IFNULL(name, 'Anonymous') FROM player WHERE id = 42
    +    let request = Player.
    +        .filter(primaryKey: 42)
    +        .select(
    +            literal: "IFNULL(name, \("Anonymous"))",
    +            as: String.self)
    +    let name: String? = try request.fetchOne(db)
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func select<RowDecoder>(
    +    literal sqlLiteral: SQLLiteral,
    +    as type: RowDecoder.Type = RowDecoder.self)
    +    -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends selection.

    +
    // SELECT id, email, name FROM player
    +var request = Player.all()
    +request = request
    +    .select([Column("id"), Column("email")])
    +    .annotated(with: [Column("name")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func annotated(with selection: [SQLSelectable]) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + filter(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided predicate promise added to the +eventual set of already applied predicates.

    +
    // SELECT * FROM player WHERE 1
    +var request = Player.all()
    +request = request.filter { db in true }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func filter(_ predicate: @escaping (Database) throws -> SQLExpressible) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + order(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided orderings promise.

    +
    // SELECT * FROM player ORDER BY name
    +var request = Player.all()
    +request = request.order { _ in [Column("name")] }
    +
    + +

    Any previous ordering is replaced:

    +
    // SELECT * FROM player ORDER BY name
    +request
    +    .order{ _ in [Column("email")] }
    +    .reversed()
    +    .order{ _ in [Column("name")] }
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func order(_ orderings: @escaping (Database) throws -> [SQLOrderingTerm]) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reversed() + +
    +
    +
    +
    +
    +
    +

    Creates a request that reverses applied orderings.

    +
    // SELECT * FROM player ORDER BY name DESC
    +var request = Player.all().order(Column("name"))
    +request = request.reversed()
    +
    + +

    If no ordering was applied, the returned request is identical.

    +
    // SELECT * FROM player
    +var request = Player.all()
    +request = request.reversed()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reversed() -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + unordered() + +
    +
    +
    +
    +
    +
    +

    Creates a request without any ordering.

    +
    // SELECT * FROM player
    +var request = Player.all().order(Column("name"))
    +request = request.unordered()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func unordered() -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + group(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request grouped according to expressions promise.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func group(_ expressions: @escaping (Database) throws -> [SQLExpressible]) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + having(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request with the provided predicate added to the +eventual set of already applied predicates.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func having(_ predicate: SQLExpressible) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + distinct() + +
    +
    +
    +
    +
    +
    +

    Creates a request which returns distinct rows.

    +
    // SELECT DISTINCT * FROM player
    +var request = Player.all()
    +request = request.distinct()
    +
    +// SELECT DISTINCT name FROM player
    +var request = Player.select(Column("name"))
    +request = request.distinct()
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func distinct() -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + limit(_:offset:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which fetches limit rows, starting at offset.

    +
    // SELECT * FROM player LIMIT 1
    +var request = Player.all()
    +request = request.limit(1)
    +
    + +

    Any previous limit is replaced.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func limit(_ limit: Int, offset: Int? = nil) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + aliased(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request that allows you to define expressions that target +a specific database table.

    + +

    In the example below, the “team.avgScore < player.score” condition in +the ON clause could be not achieved without table aliases.

    +
    struct Player: TableRecord {
    +    static let team = belongsTo(Team.self)
    +}
    +
    +// SELECT player.*, team.*
    +// JOIN team ON ... AND team.avgScore < player.score
    +let playerAlias = TableAlias()
    +let request = Player
    +    .all()
    +    .aliased(playerAlias)
    +    .including(required: Player.team.filter(Column("avgScore") < playerAlias[Column("score")])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func aliased(_ alias: TableAlias) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + asRequest(of:) + +
    +
    +
    +
    +
    +
    +

    Creates a request bound to type Target.

    + +

    The returned request can fetch if the type Target is fetchable (Row, +value, record).

    +
    // Int?
    +let maxScore = try Player
    +    .select(max(scoreColumn))
    +    .asRequest(of: Int.self)    // <--
    +    .fetchOne(db)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func asRequest<RowDecoder>(of type: RowDecoder.Type) -> QueryInterfaceRequest<RowDecoder>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + type + + +
    +

    The fetched type Target

    +
    +
    +
    +
    +

    Return Value

    +

    A typed request bound to type Target.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Association Aggregates

+

+
+
+
    +
  • +
    + + + + annotated(with:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends aggregates to the current selection.

    +
    // SELECT player.*, COUNT(DISTINCT book.rowid) AS bookCount
    +// FROM player LEFT JOIN book ...
    +var request = Player.all()
    +request = request.annotated(with: Player.books.count)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func annotated(with aggregates: AssociationAggregate<RowDecoder>...) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + annotated(with:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends aggregates to the current selection.

    +
    // SELECT player.*, COUNT(DISTINCT book.rowid) AS bookCount
    +// FROM player LEFT JOIN book ...
    +var request = Player.all()
    +request = request.annotated(with: [Player.books.count])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func annotated(with aggregates: [AssociationAggregate<RowDecoder>]) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + having(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a request which appends the provided aggregate predicate to +the eventual set of already applied predicates.

    +
    // SELECT player.*
    +// FROM player LEFT JOIN book ...
    +// HAVING COUNT(DISTINCT book.rowid) = 0
    +var request = Player.all()
    +request = request.having(Player.books.isEmpty)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func having(_ predicate: AssociationAggregate<RowDecoder>) -> QueryInterfaceRequest
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Batch Delete

+

+
+
+
    +
  • +
    + + + + deleteAll(_:) + +
    +
    +
    +
    +
    +
    +

    Deletes matching rows; returns the number of deleted rows.

    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func deleteAll(_ db: Database) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of deleted rows

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Batch Update

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Updates matching rows; returns the number of updated rows.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    try Player.all().updateAll(db, [Column("score") <- 0])
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func updateAll(
    +    _ db: Database,
    +    onConflict conflictResolution: Database.ConflictResolution? = nil,
    +    _ assignments: [ColumnAssignment]) throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + conflictResolution + + +
    +

    A policy for conflict resolution, +defaulting to the record’s persistenceConflictPolicy.

    +
    +
    + + assignments + + +
    +

    An array of column assignments.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of updated rows.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Updates matching rows; returns the number of updated rows.

    + +

    For example:

    +
    try dbQueue.write { db in
    +    // UPDATE player SET score = 0
    +    try Player.all().updateAll(db, Column("score") <- 0)
    +}
    +
    +
    +

    Throws

    + A DatabaseError is thrown whenever an SQLite error occurs. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @discardableResult
    +public func updateAll(
    +    _ db: Database,
    +    onConflict conflictResolution: Database.ConflictResolution? = nil,
    +    _ assignment: ColumnAssignment,
    +    _ otherAssignments: ColumnAssignment...)
    +    throws -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + conflictResolution + + +
    +

    A policy for conflict resolution, +defaulting to the record’s persistenceConflictPolicy.

    +
    +
    + + assignment + + +
    +

    A column assignment.

    +
    +
    + + otherAssignments + + +
    +

    Eventual other column assignments.

    +
    +
    +
    +
    +

    Return Value

    +

    The number of updated rows.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/RangeRowAdapter.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/RangeRowAdapter.html new file mode 100644 index 000000000..066919481 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/RangeRowAdapter.html @@ -0,0 +1,1144 @@ + + + + RangeRowAdapter Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

RangeRowAdapter

+
+
+
public struct RangeRowAdapter : RowAdapter
+ +
+
+

RangeRowAdapter is a row adapter that only exposes a range of columns.

+
let adapter = RangeRowAdapter(1..<3)
+let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz, 4 as qux"
+
+// [bar:2 baz:3]
+try Row.fetchOne(db, sql: sql, adapter: adapter)
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a RangeRowAdapter that only exposes a range of columns.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ range: CountableRange<Int>)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a RangeRowAdapter that only exposes a range of columns.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ range: CountableClosedRange<Int>)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ResultCode.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ResultCode.html new file mode 100644 index 000000000..01f41eeb7 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ResultCode.html @@ -0,0 +1,4149 @@ + + + + ResultCode Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ResultCode

+
+
+
public struct ResultCode : RawRepresentable, Equatable, CustomStringConvertible
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + rawValue + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let rawValue: Int32
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rawValue:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rawValue: Int32)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + primaryResultCode + +
    +
    +
    +
    +
    +
    +

    A result code limited to the least significant 8 bits of the receiver. +See https://www.sqlite.org/rescode.html for more information.

    +
    let resultCode = .SQLITE_CONSTRAINT_FOREIGNKEY
    +resultCode.primaryResultCode == .SQLITE_CONSTRAINT // true
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var primaryResultCode: ResultCode { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ~=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns true if the code on the left matches the code on the right.

    + +

    Primary result codes match themselves and their extended result codes, +while extended result codes match only themselves:

    +
    switch error.extendedResultCode {
    +case .SQLITE_CONSTRAINT_FOREIGNKEY: // foreign key constraint error
    +case .SQLITE_CONSTRAINT:            // any other constraint error
    +default:                            // any other database error
    +}
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func ~= (pattern: ResultCode, code: ResultCode) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_OK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_OK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ERROR + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ERROR: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_INTERNAL + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_INTERNAL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_PERM + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_PERM: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ABORT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ABORT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_BUSY + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_BUSY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_LOCKED + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_LOCKED: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_NOMEM + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOMEM: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_READONLY + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_INTERRUPT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_INTERRUPT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_CORRUPT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CORRUPT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_NOTFOUND + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOTFOUND: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_FULL + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_FULL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_CANTOPEN + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_PROTOCOL + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_PROTOCOL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_EMPTY + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_EMPTY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_SCHEMA + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_SCHEMA: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_TOOBIG + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_TOOBIG: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_CONSTRAINT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_MISMATCH + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_MISMATCH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_MISUSE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_MISUSE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_NOLFS + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOLFS: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_AUTH + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_AUTH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_FORMAT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_FORMAT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_RANGE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_RANGE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_NOTADB + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOTADB: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_NOTICE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOTICE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_WARNING + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_WARNING: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ROW + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ROW: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_DONE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_DONE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ERROR_MISSING_COLLSEQ: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ERROR_RETRY + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ERROR_RETRY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ERROR_SNAPSHOT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ERROR_SNAPSHOT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_READ + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_READ: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SHORT_READ: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_WRITE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_WRITE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_FSYNC + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_FSYNC: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_DIR_FSYNC: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_TRUNCATE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_TRUNCATE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_FSTAT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_FSTAT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_UNLOCK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_UNLOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_RDLOCK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_RDLOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_DELETE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_DELETE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_BLOCKED + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_BLOCKED: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_NOMEM + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_NOMEM: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_ACCESS + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_ACCESS: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_CHECKRESERVEDLOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_LOCK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_LOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_CLOSE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_CLOSE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_DIR_CLOSE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_SHMOPEN + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SHMOPEN: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_SHMSIZE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SHMSIZE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_SHMLOCK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SHMLOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_SHMMAP + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SHMMAP: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_SEEK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_SEEK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_DELETE_NOENT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_MMAP + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_MMAP: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_GETTEMPPATH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_CONVPATH + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_CONVPATH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_VNODE + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_VNODE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_IOERR_AUTH + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_AUTH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_BEGIN_ATOMIC: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_COMMIT_ATOMIC: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_IOERR_ROLLBACK_ATOMIC: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_LOCKED_SHAREDCACHE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_LOCKED_VTAB + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_LOCKED_VTAB: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_BUSY_RECOVERY + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_BUSY_RECOVERY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_BUSY_SNAPSHOT + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_BUSY_SNAPSHOT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN_NOTEMPDIR: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_CANTOPEN_ISDIR + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN_ISDIR: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN_FULLPATH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN_CONVPATH: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CANTOPEN_DIRTYWAL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_CORRUPT_VTAB + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CORRUPT_VTAB: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CORRUPT_SEQUENCE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_RECOVERY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_CANTLOCK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_ROLLBACK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_DBMOVED: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_CANTINIT: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_READONLY_DIRECTORY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_ABORT_ROLLBACK + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_ABORT_ROLLBACK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_CHECK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_COMMITHOOK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_FOREIGNKEY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_FUNCTION: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_NOTNULL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_PRIMARYKEY: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_TRIGGER: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_UNIQUE: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_VTAB: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_CONSTRAINT_ROWID: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOTICE_RECOVER_WAL: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_NOTICE_RECOVER_ROLLBACK: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_WARNING_AUTOINDEX: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLITE_AUTH_USER + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_AUTH_USER: ResultCode
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let SQLITE_OK_LOAD_PERMANENTLY: ResultCode
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLExpressionLiteral.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLExpressionLiteral.html new file mode 100644 index 000000000..c7a1b8fd1 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLExpressionLiteral.html @@ -0,0 +1,1224 @@ + + + + SQLExpressionLiteral Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SQLExpressionLiteral

+
+
+
public struct SQLExpressionLiteral : SQLExpression
+ +
+
+

Experimental

+ +

SQLExpressionLiteral is an expression built from a raw SQL snippet.

+
SQLExpressionLiteral(sql: "1 + 2")
+
+ +

The SQL literal may contain ? and colon-prefixed arguments:

+
SQLExpressionLiteral(sql: "? + ?", arguments: [1, 2])
+SQLExpressionLiteral(sql: ":one + :two", arguments: ["one": 1, "two": 2])
+
+ +
+
+
+
    +
  • +
    + + + + sql + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sql: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + arguments + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var arguments: StatementArguments { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(sql:arguments:) + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Creates an SQL literal expression.

    +
    SQLExpressionLiteral(sql: "1 + 2")
    +SQLExpressionLiteral(sql: "? + ?", arguments: [1, 2])
    +SQLExpressionLiteral(sql: ":one + :two", arguments: ["one": 1, "two": 2])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(sql: String, arguments: StatementArguments = StatementArguments())
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(literal:) + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Creates an SQL literal expression.

    +
    SQLExpressionLiteral(literal: SQLLiteral(sql: "1 + 2")
    +SQLExpressionLiteral(literal: SQLLiteral(sql: "? + ?", arguments: [1, 2]))
    +SQLExpressionLiteral(literal: SQLLiteral(sql: ":one + :two", arguments: ["one": 1, "two": 2]))
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    SQLExpressionLiteral(literal: "\(1) + \(2)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(literal sqlLiteral: SQLLiteral)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLFunctionName.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLFunctionName.html new file mode 100644 index 000000000..853ce1eb6 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLFunctionName.html @@ -0,0 +1,1377 @@ + + + + SQLFunctionName Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SQLFunctionName

+
+
+
public struct SQLFunctionName : Hashable
+ +
+
+

Experimental

+ +

SQLFunctionName is an SQL function name.

+ +
+
+
+
+ + +
+ +

ABS(…)

+

+
+
+
    +
  • +
    + + + + abs + +
    +
    +
    +
    +
    +
    +

    The ABS function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let abs: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

AVG(…)

+

+
+
+
    +
  • +
    + + + + avg + +
    +
    +
    +
    +
    +
    +

    The AVG function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let avg: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

IFNULL(…)

+

+
+
+
    +
  • +
    + + + + ifNull + +
    +
    +
    +
    +
    +
    +

    The IFNULL function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let ifNull: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

LENGTH(…)

+

+
+
+
    +
  • +
    + + + + length + +
    +
    +
    +
    +
    +
    +

    The LENGTH function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let length: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

MAX(…)

+

+
+
+
    +
  • +
    + + + + max + +
    +
    +
    +
    +
    +
    +

    The MAX function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let max: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

MIN(…)

+

+
+
+
    +
  • +
    + + + + min + +
    +
    +
    +
    +
    +
    +

    The MIN function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let min: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

SUM(…)

+

+
+
+
    +
  • +
    + + + + sum + +
    +
    +
    +
    +
    +
    +

    The SUM function name

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let sum: SQLFunctionName
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLLiteral.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLLiteral.html new file mode 100644 index 000000000..10efb77fe --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLLiteral.html @@ -0,0 +1,1395 @@ + + + + SQLLiteral Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SQLLiteral

+
+
+
public struct SQLLiteral
+
extension SQLLiteral: ExpressibleByStringInterpolation
+ +
+
+

SQLLiteral is a type which support SQL +Interpolation.

+ +

For example:

+
try dbQueue.write { db in
+    let name: String = ...
+    let id: Int64 = ...
+    let query: SQLLiteral = "UPDATE player SET name = \(name) WHERE id = \(id)"
+    try db.execute(literal: query)
+}
+
+ +
+
+
+
    +
  • +
    + + + + sql + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var sql: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + arguments + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var arguments: StatementArguments
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(sql:arguments:) + +
    +
    +
    +
    +
    +
    +

    Creates an SQLLiteral from a plain SQL string, and eventual arguments.

    + +

    For example:

    +
    let query = SQLLiteral(
    +    sql: "UPDATE player SET name = ? WHERE id = ?",
    +    arguments: [name, id])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(sql: String, arguments: StatementArguments = StatementArguments())
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + mapSQL(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a literal whose SQL is transformed by the given closure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func mapSQL(_ transform: (String) throws -> String) rethrows -> SQLLiteral
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Returns the SQLLiteral produced by the concatenation of two literals.

    +
    let name = "O'Brien"
    +let selection: SQLLiteral = "SELECT * FROM player "
    +let condition: SQLLiteral = "WHERE name = \(name)"
    +let query = selection + condition
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func + (lhs: SQLLiteral, rhs: SQLLiteral) -> SQLLiteral
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Appends an SQLLiteral to the receiver.

    +
    let name = "O'Brien"
    +var query: SQLLiteral = "SELECT * FROM player "
    +query += "WHERE name = \(name)"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func += (lhs: inout SQLLiteral, rhs: SQLLiteral)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + append(literal:) + +
    +
    +
    +
    +
    +
    +

    Appends an SQLLiteral to the receiver.

    +
    let name = "O'Brien"
    +var query: SQLLiteral = "SELECT * FROM player "
    +query.append(literal: "WHERE name = \(name)")
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func append(literal sqlLiteral: SQLLiteral)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Appends a plain SQL string to the receiver, and eventual arguments.

    +
    let name = "O'Brien"
    +var query: SQLLiteral = "SELECT * FROM player "
    +query.append(sql: "WHERE name = ?", arguments: [name])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func append(sql: String, arguments: StatementArguments = StatementArguments())
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ExpressibleByStringInterpolation

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLRequest.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLRequest.html new file mode 100644 index 000000000..d99df0d43 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SQLRequest.html @@ -0,0 +1,1513 @@ + + + + SQLRequest Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SQLRequest

+
+
+
public struct SQLRequest<T> : FetchRequest
+
extension SQLRequest: ExpressibleByStringInterpolation
+ +
+
+

A FetchRequest built from raw SQL.

+ +
+
+
+
    +
  • +
    + + + + RowDecoder + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias RowDecoder = T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + sql + +
    +
    +
    +
    +
    +
    +

    The raw SQL query

    +
    let id = 42
    +let request: SQLRequest<Player> = "SELECT * FROM player WHERE id = \(id)"
    +request.sql // "SELECT * FROM player WHERE id = ?"
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var sql: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + arguments + +
    +
    +
    +
    +
    +
    +

    The request argument

    +
    let id = 42
    +let request: SQLRequest<Player> = "SELECT * FROM player WHERE id = \(id)"
    +request.arguments // [42]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var arguments: StatementArguments { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + adapter + +
    +
    +
    +
    +
    +
    +

    The request adapter

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var adapter: RowAdapter?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a request from an SQL string, optional arguments, and +optional row adapter.

    +
    let request = SQLRequest<String>(sql: """
    +    SELECT name FROM player
    +    """)
    +let request = SQLRequest<Player>(sql: """
    +    SELECT * FROM player WHERE id = ?
    +    """, arguments: [1])
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    sql: String,
    +    arguments: StatementArguments = StatementArguments(),
    +    adapter: RowAdapter? = nil,
    +    cached: Bool = false)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + sql + + +
    +

    An SQL query.

    +
    +
    + + arguments + + +
    +

    Statement arguments.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter.

    +
    +
    + + cached + + +
    +

    Defaults to false. If true, the request reuses a cached +prepared statement.

    +
    +
    +
    +
    +

    Return Value

    +

    A SQLRequest

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a request from an SQLLiteral, and optional row adapter.

    +
    let request = SQLRequest<String>(literal: SQLLiteral(sql: """
    +    SELECT name FROM player
    +    """))
    +let request = SQLRequest<Player>(literal: SQLLiteral(sql: """
    +    SELECT * FROM player WHERE name = ?
    +    """, arguments: ["O'Brien"]))
    +
    + +

    With Swift 5, you can safely embed raw values in your SQL queries, +without any risk of syntax errors or SQL injection:

    +
    let request = SQLRequest<Player>(literal: """
    +    SELECT * FROM player WHERE name = \("O'brien")
    +    """)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(literal sqlLiteral: SQLLiteral, adapter: RowAdapter? = nil, cached: Bool = false)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + sqlLiteral + + +
    +

    An SQLLiteral.

    +
    +
    + + adapter + + +
    +

    Optional RowAdapter.

    +
    +
    + + cached + + +
    +

    Defaults to false. If true, the request reuses a cached +prepared statement.

    +
    +
    +
    +
    +

    Return Value

    +

    A SQLRequest

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates an SQL request from any other fetch request.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Request>(
    +    _ db: Database,
    +    request: Request,
    +    cached: Bool = false)
    +    throws
    +    where Request: FetchRequest, Request.RowDecoder == RowDecoder
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + db + + +
    +

    A database connection.

    +
    +
    + + request + + +
    +

    A request.

    +
    +
    + + cached + + +
    +

    Defaults to false. If true, the request reuses a cached +prepared statement.

    +
    +
    +
    +
    +

    Return Value

    +

    An SQLRequest

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    :nodoc

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(unicodeScalarLiteral: String)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ScopeAdapter.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ScopeAdapter.html new file mode 100644 index 000000000..badf3d93e --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ScopeAdapter.html @@ -0,0 +1,1232 @@ + + + + ScopeAdapter Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ScopeAdapter

+
+
+
public struct ScopeAdapter : RowAdapter
+ +
+
+

ScopeAdapter is a row adapter that lets you define scopes on rows.

+
// Two adapters
+let fooAdapter = ColumnMapping(["value": "foo"])
+let barAdapter = ColumnMapping(["value": "bar"])
+
+// Define scopes
+let adapter = ScopeAdapter([
+    "foo": fooAdapter,
+    "bar": barAdapter])
+
+// Fetch
+let sql = "SELECT 'foo' AS foo, 'bar' AS bar"
+let row = try Row.fetchOne(db, sql: sql, adapter: adapter)!
+
+// Scoped rows:
+if let fooRow = row.scopes["foo"] {
+    fooRow["value"]    // "foo"
+}
+if let barRow = row.scopes["bar"] {
+    barRow["value"]    // "bar"
+}
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates an adapter that preserves row contents and add scoped rows.

    + +

    For example:

    +
    let adapter = ScopeAdapter(["suffix": SuffixRowAdapter(fromIndex: 1)])
    +let row = try Row.fetchOne(db, sql: "SELECT 1, 2, 3", adapter: adapter)!
    +row                  // [1, 2, 3]
    +row.scopes["suffix"] // [2, 3]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ scopes: [String : RowAdapter])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + scopes + + +
    +

    A dictionary that maps scope names to +row adapters.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(base:scopes:) + +
    +
    +
    +
    +
    +
    +

    Creates an adapter based on the base adapter, and add scoped rows.

    + +

    For example:

    +
    let baseAdapter = RangeRowAdapter(0..<1)
    +let adapter = ScopeAdapter(base: baseAdapter, scopes: ["suffix": SuffixRowAdapter(fromIndex: 1)])
    +let row = try Row.fetchOne(db, sql: "SELECT 1, 2, 3", adapter: adapter)!
    +row                   // [1]
    +row.scopes["initial"] // [2, 3]
    +
    + +

    If the base adapter already defines scopes, the given scopes replace +eventual existing scopes with the same name.

    + +

    This initializer is equivalent to baseAdapter.addingScopes(scopes).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(base: RowAdapter, scopes: [String : RowAdapter])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + base + + +
    +

    A dictionary that maps scope names to +row adapters.

    +
    +
    + + scopes + + +
    +

    A dictionary that maps scope names to +row adapters.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/StatementArguments.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/StatementArguments.html new file mode 100644 index 000000000..9a10e42eb --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/StatementArguments.html @@ -0,0 +1,1925 @@ + + + + StatementArguments Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

StatementArguments

+
+
+
public struct StatementArguments: CustomStringConvertible, Equatable,
+    ExpressibleByArrayLiteral, ExpressibleByDictionaryLiteral
+ +
+
+

StatementArguments provide values to argument placeholders in raw +SQL queries.

+ +

Placeholders can take several forms (see https://www.sqlite.org/lang_expr.html#varparam +for more information):

+ +
    +
  • ?NNN (e.g. ?2): the NNN-th argument (starts at 1)
  • +
  • ?: the N-th argument, where N is one greater than the largest argument +number already assigned
  • +
  • :AAAA (e.g. :name): named argument

  • +
  • $AAAA (e.g. $name): named argument

  • +
+

Positional Arguments

+ +

To fill question marks placeholders, feed StatementArguments with an array:

+
db.execute(
+    sql: "INSERT ... (?, ?)",
+    arguments: StatementArguments(["Arthur", 41]))
+
+// Array literals are automatically converted:
+db.execute(
+    sql: "INSERT ... (?, ?)",
+    arguments: ["Arthur", 41])
+
+

Named Arguments

+ +

To fill named arguments, feed StatementArguments with a dictionary:

+
db.execute(
+    sql: "INSERT ... (:name, :score)",
+    arguments: StatementArguments(["name": "Arthur", "score": 41]))
+
+// Dictionary literals are automatically converted:
+db.execute(
+    sql: "INSERT ... (:name, :score)",
+    arguments: ["name": "Arthur", "score": 41])
+
+

Concatenating Arguments

+ +

Several arguments can be concatenated and mixed with the +append(contentsOf:) method and the +, &+, += operators:

+
var arguments: StatementArguments = ["Arthur"]
+arguments += [41]
+db.execute(sql: "INSERT ... (?, ?)", arguments: arguments)
+
+ +

+ and += operators consider that overriding named arguments is a +programmer error:

+
var arguments: StatementArguments = ["name": "Arthur"]
+arguments += ["name": "Barbara"]
+// fatal error: already defined statement argument: name
+
+ +

&+ and append(contentsOf:) allow overriding named arguments:

+
var arguments: StatementArguments = ["name": "Arthur"]
+arguments = arguments &+ ["name": "Barbara"]
+print(arguments)
+// Prints ["name": "Barbara"]
+
+

Mixed Arguments

+ +

It is possible to mix named and positional arguments. Yet this is usually +confusing, and it is best to avoid this practice:

+
let sql = "SELECT ?2 AS two, :foo AS foo, ?1 AS one, :foo AS foo2, :bar AS bar"
+var arguments: StatementArguments = [1, 2, "bar"] + ["foo": "foo"]
+let row = try Row.fetchOne(db, sql: sql, arguments: arguments)!
+print(row)
+// Prints [two:2 foo:"foo" one:1 foo2:"foo" bar:"bar"]
+
+ +

Mixed arguments exist as a support for requests like the following:

+
let players = try Player
+    .filter(sql: "team = :team", arguments: ["team": "Blue"])
+    .filter(sql: "score > ?", arguments: [1000])
+    .fetchAll(db)
+
+ +
+
+
+
    +
  • +
    + + + + isEmpty + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isEmpty: Bool { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Empty Arguments

+

+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates empty StatementArguments.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Positional Arguments

+

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from a sequence of optional values.

    +
    let values: [DatabaseValueConvertible?] = ["foo", 1, nil]
    +db.execute(sql: "INSERT ... (?,?,?)", arguments: StatementArguments(values))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Sequence>(_ sequence: Sequence) where Sequence : Sequence, Sequence.Element == DatabaseValueConvertible?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sequence + + +
    +

    A sequence of DatabaseValueConvertible values.

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from a sequence of optional values.

    +
    let values: [String] = ["foo", "bar"]
    +db.execute(sql: "INSERT ... (?,?)", arguments: StatementArguments(values))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Sequence>(_ sequence: Sequence) where Sequence : Sequence, Sequence.Element : DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sequence + + +
    +

    A sequence of DatabaseValueConvertible values.

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from any array. The result is nil unless all +array elements adopt DatabaseValueConvertible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(_ array: [Any])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + array + + +
    +

    An array

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Named Arguments

+

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from a sequence of (key, value) dictionary, +such as a dictionary.

    +
    let values: [String: DatabaseValueConvertible?] = ["firstName": nil, "lastName": "Miller"]
    +db.execute(sql: "INSERT ... (:firstName, :lastName)", arguments: StatementArguments(values))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ dictionary: [String : DatabaseValueConvertible?])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sequence + + +
    +

    A sequence of (key, value) pairs

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from a sequence of (key, value) pairs, such +as a dictionary.

    +
    let values: [String: DatabaseValueConvertible?] = ["firstName": nil, "lastName": "Miller"]
    +db.execute(sql: "INSERT ... (:firstName, :lastName)", arguments: StatementArguments(values))
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init<Sequence>(_ sequence: Sequence)
    +    where Sequence: Swift.Sequence, Sequence.Element == (String, DatabaseValueConvertible?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + sequence + + +
    +

    A sequence of (key, value) pairs

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates statement arguments from [AnyHashable: Any].

    + +

    The result is nil unless all dictionary keys are strings, and values +adopt DatabaseValueConvertible.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(_ dictionary: [AnyHashable : Any])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + dictionary + + +
    +

    A dictionary.

    +
    +
    +
    +
    +

    Return Value

    +

    A StatementArguments.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Adding arguments

+

+
+
+
    +
  • +
    + + + + append(contentsOf:) + +
    +
    +
    +
    +
    +
    +

    Extends statement arguments with other arguments.

    + +

    Positional arguments (provided as arrays) are concatenated:

    +
    var arguments: StatementArguments = [1]
    +arguments.append(contentsOf: [2, 3])
    +print(arguments)
    +// Prints [1, 2, 3]
    +
    + +

    Named arguments (provided as dictionaries) are updated:

    +
    var arguments: StatementArguments = ["foo": 1]
    +arguments.append(contentsOf: ["bar": 2])
    +print(arguments)
    +// Prints ["foo": 1, "bar": 2]
    +
    + +

    Arguments that were replaced, if any, are returned:

    +
    var arguments: StatementArguments = ["foo": 1, "bar": 2]
    +let replacedValues = arguments.append(contentsOf: ["foo": 3])
    +print(arguments)
    +// Prints ["foo": 3, "bar": 2]
    +print(replacedValues)
    +// Prints ["foo": 1]
    +
    + +

    You can mix named and positional arguments (see documentation of +the StatementArguments type for more information about mixed arguments):

    +
    var arguments: StatementArguments = ["foo": 1]
    +arguments.append(contentsOf: [2, 3])
    +print(arguments)
    +// Prints ["foo": 1, 2, 3]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public mutating func append(contentsOf arguments: StatementArguments) -> [String : DatabaseValue]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new StatementArguments by extending the left-hand size +arguments with the right-hand side arguments.

    + +

    Positional arguments (provided as arrays) are concatenated:

    +
    let arguments: StatementArguments = [1] + [2, 3]
    +print(arguments)
    +// Prints [1, 2, 3]
    +
    + +

    Named arguments (provided as dictionaries) are updated:

    +
    let arguments: StatementArguments = ["foo": 1] + ["bar": 2]
    +print(arguments)
    +// Prints ["foo": 1, "bar": 2]
    +
    + +

    You can mix named and positional arguments (see documentation of +the StatementArguments type for more information about mixed arguments):

    +
    let arguments: StatementArguments = ["foo": 1] + [2, 3]
    +print(arguments)
    +// Prints ["foo": 1, 2, 3]
    +
    + +

    If the arguments on the right-hand side has named parameters that are +already defined on the left, a fatal error is raised:

    +
    let arguments: StatementArguments = ["foo": 1] + ["foo": 2]
    +// fatal error: already defined statement argument: foo
    +
    + +

    This fatal error can be avoided with the &+ operator, or the +append(contentsOf:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func + (lhs: StatementArguments, rhs: StatementArguments) -> StatementArguments
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + &+(_:_:) + +
    +
    +
    +
    +
    +
    +

    Creates a new StatementArguments by extending the left-hand size +arguments with the right-hand side arguments.

    + +

    Positional arguments (provided as arrays) are concatenated:

    +
    let arguments: StatementArguments = [1] &+ [2, 3]
    +print(arguments)
    +// Prints [1, 2, 3]
    +
    + +

    Named arguments (provided as dictionaries) are updated:

    +
    let arguments: StatementArguments = ["foo": 1] &+ ["bar": 2]
    +print(arguments)
    +// Prints ["foo": 1, "bar": 2]
    +
    + +

    You can mix named and positional arguments (see documentation of +the StatementArguments type for more information about mixed arguments):

    +
    let arguments: StatementArguments = ["foo": 1] &+ [2, 3]
    +print(arguments)
    +// Prints ["foo": 1, 2, 3]
    +
    + +

    If a named arguments is defined in both arguments, the right-hand +side wins:

    +
    let arguments: StatementArguments = ["foo": 1] &+ ["foo": 2]
    +print(arguments)
    +// Prints ["foo": 2]
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func &+ (lhs: StatementArguments, rhs: StatementArguments) -> StatementArguments
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + +=(_:_:) + +
    +
    +
    +
    +
    +
    +

    Extends the left-hand size arguments with the right-hand side arguments.

    + +

    Positional arguments (provided as arrays) are concatenated:

    +
    var arguments: StatementArguments = [1]
    +arguments += [2, 3]
    +print(arguments)
    +// Prints [1, 2, 3]
    +
    + +

    Named arguments (provided as dictionaries) are updated:

    +
    var arguments: StatementArguments = ["foo": 1]
    +arguments += ["bar": 2]
    +print(arguments)
    +// Prints ["foo": 1, "bar": 2]
    +
    + +

    You can mix named and positional arguments (see documentation of +the StatementArguments type for more information about mixed arguments):

    +
    var arguments: StatementArguments = ["foo": 1]
    +arguments.append(contentsOf: [2, 3])
    +print(arguments)
    +// Prints ["foo": 1, 2, 3]
    +
    + +

    If the arguments on the right-hand side has named parameters that are +already defined on the left, a fatal error is raised:

    +
    var arguments: StatementArguments = ["foo": 1]
    +arguments += ["foo": 2]
    +// fatal error: already defined statement argument: foo
    +
    + +

    This fatal error can be avoided with the &+ operator, or the +append(contentsOf:) method.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func += (lhs: inout StatementArguments, rhs: StatementArguments)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

StatementArguments

+

+
+
+
    +
  • +
    + + + + init(arrayLiteral:) + +
    +
    +
    +
    +
    +
    +

    Returns a StatementArguments from an array literal:

    +
    let arguments: StatementArguments = ["Arthur", 41]
    +try db.execute(
    +    sql: "INSERT INTO player (name, score) VALUES (?, ?)"
    +    arguments: arguments)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(arrayLiteral elements: DatabaseValueConvertible?...)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a StatementArguments from a dictionary literal:

    +
    let arguments: StatementArguments = ["name": "Arthur", "score": 41]
    +try db.execute(
    +    sql: "INSERT INTO player (name, score) VALUES (:name, :score)"
    +    arguments: arguments)
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(dictionaryLiteral elements: (String, DatabaseValueConvertible?)...)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SuffixRowAdapter.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SuffixRowAdapter.html new file mode 100644 index 000000000..72b9eeb8a --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/SuffixRowAdapter.html @@ -0,0 +1,1117 @@ + + + + SuffixRowAdapter Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

SuffixRowAdapter

+
+
+
public struct SuffixRowAdapter : RowAdapter
+ +
+
+

SuffixRowAdapter is a row adapter that hides the first columns in a row.

+
let adapter = SuffixRowAdapter(fromIndex: 2)
+let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
+
+// [baz:3]
+try Row.fetchOne(db, sql: sql, adapter: adapter)
+
+ +
+
+
+
    +
  • +
    + + + + init(fromIndex:) + +
    +
    +
    +
    +
    +
    +

    Creates a SuffixRowAdapter that hides all columns before the +provided index.

    + +

    If index is 0, the layout row is identical to the base row.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(fromIndex index: Int)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ValueObservation.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ValueObservation.html new file mode 100644 index 000000000..7a1ba9753 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Structs/ValueObservation.html @@ -0,0 +1,3245 @@ + + + + ValueObservation Structure Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

ValueObservation

+
+
+
public struct ValueObservation<Reducer>
+ +
+
+

ValueObservation tracks changes in the results of database requests, and +notifies fresh values whenever the database changes.

+ +

For example:

+
let observation = Player.observationForAll()
+let observer = try observation.start(in: dbQueue) { players: [Player] in
+    print("Players have changed.")
+}
+
+ +
+
+
+
    +
  • +
    + + + + requiresWriteAccess + +
    +
    +
    +
    +
    +
    +

    Default is false. Set this property to true when the observation +requires write access in order to fetch fresh values. Fetches are then +wrapped inside a savepoint.

    + +

    Don’t set this flag to true unless you really need it. A read/write +observation is less efficient than a read-only observation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var requiresWriteAccess: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + scheduling + +
    +
    +
    +
    +
    +
    +

    scheduling controls how fresh values are notified. Default +is .mainQueue.

    + +
      +
    • .mainQueue: all values are notified on the main queue.

      + +

      If the observation starts on the main queue, an initial value is +notified right upon subscription, synchronously::

      +
      // On main queue
      +let observation = Player.observationForAll()
      +let observer = try observation.start(in: dbQueue) { players: [Player] in
      +    print("fresh players: \(players)")
      +}
      +// <- here "fresh players" is already printed.
      +
      + +

      If the observation does not start on the main queue, an initial +value is also notified on the main queue, but asynchronously:

      +
      // Not on the main queue: "fresh players" is eventually printed
      +// on the main queue.
      +let observation = Player.observationForAll()
      +let observer = try observation.start(in: dbQueue) { players: [Player] in
      +    print("fresh players: \(players)")
      +}
      +
      + +

      When the database changes, fresh values are asynchronously notified:

      +
      // Eventually prints "fresh players" on the main queue
      +try dbQueue.write { db in
      +    try Player(...).insert(db)
      +}
      +
    • +
    • .onQueue(_:startImmediately:): all values are asychronously notified +on the specified queue.

      + +

      An initial value is fetched and notified if startImmediately +is true.

    • +
    • unsafe(startImmediately:): values are not all notified on the same +dispatch queue.

      + +

      If startImmediately is true, an initial value is notified right +upon subscription, synchronously, on the dispatch queue which starts +the observation.

      +
      // On any queue
      +var observation = Player.observationForAll()
      +observation.scheduling = .unsafe(startImmediately: true)
      +let observer = try observation.start(in: dbQueue) { players: [Player] in
      +    print("fresh players: \(players)")
      +}
      +// <- here "fresh players" is already printed.
      +
      + +

      When the database changes, other values are notified on +unspecified queues.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var scheduling: ValueScheduling
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + mapReducer(_:) + +
    +
    +
    +
    +
    +
    +

    Experimental

    + +

    Returns a ValueObservation with a transformed reducer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func mapReducer<R>(_ transform: @escaping (Database, Reducer) throws -> R) -> ValueObservation<R>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Count Observation

+

+
+
+
    +
  • +
    + + + + trackingCount(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies its +count whenever it is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.all()
    +let observation = ValueObservation.trackingCount(request)
    +
    +let observer = try observation.start(in: dbQueue) { count: Int in
    +    print("Number of players has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForCount(﹚ instead")
    +public static func trackingCount<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<ValueReducers.RemoveDuplicates<ValueReducers.Fetch<Int>>>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

DatabaseValueConvertible Observation

+

+
+
+
    +
  • +
    + + + + trackingAll(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh values whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.select(Column("name"), as: String.self)
    +let observation = ValueObservation.trackingAll(request)
    +
    +let observer = try observation.start(in: dbQueue) { names: [String] in
    +    print("Player names have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForAll(﹚ instead")
    +public static func trackingAll<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<DatabaseValuesReducer<Request.RowDecoder>>
    +    where Request.RowDecoder: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + trackingOne(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh value whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.select(max(Column("score")), as: Int.self)
    +let observation = ValueObservation.trackingOne(request)
    +
    +let observer = try observation.start(in: dbQueue) { maxScore: Int? in
    +    print("Maximum score has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForFirst(﹚ instead")
    +public static func trackingOne<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<DatabaseValueReducer<Request.RowDecoder>>
    +    where Request.RowDecoder: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + trackingAll(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh values whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.select(Column("name"), as: Optional<String>.self)
    +let observation = ValueObservation.trackingAll(request)
    +
    +let observer = try observation.start(in: dbQueue) { names: [String?] in
    +    print("Player names have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForAll(﹚ instead")
    +public static func trackingAll<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<OptionalDatabaseValuesReducer<Request.RowDecoder._Wrapped>>
    +    where Request.RowDecoder: _OptionalProtocol,
    +    Request.RowDecoder._Wrapped: DatabaseValueConvertible
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

FetchableRecord Observation

+

+
+
+
    +
  • +
    + + + + trackingAll(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh records whenever the request is modified by a +database transaction.

    + +

    For example:

    +
    let request = Player.all()
    +let observation = ValueObservation.trackingAll(request)
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForAll(﹚ instead")
    +public static func trackingAll<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<FetchableRecordsReducer<Request.RowDecoder>>
    +    where Request.RowDecoder: FetchableRecord
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + trackingOne(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh record whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = Player.filter(key: 1)
    +let observation = ValueObservation.trackingOne(request)
    +
    +let observer = try observation.start(in: dbQueue) { player: Player? in
    +    print("Player has changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForFirst(﹚ instead")
    +public static func trackingOne<Request: FetchRequest>(_ request: Request) ->
    +    ValueObservation<FetchableRecordReducer<Request.RowDecoder>>
    +    where Request.RowDecoder: FetchableRecord
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Row Observation

+

+
+
+
    +
  • +
    + + + + trackingAll(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies +fresh rows whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = SQLRequest<Row>(sql: "SELECT * FROM player")
    +let observation = ValueObservation.trackingAll(request)
    +
    +let observer = try observation.start(in: dbQueue) { rows: [Row] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForAll(﹚ instead")
    +public static func trackingAll<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<RowsReducer>
    +    where Request.RowDecoder == Row
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
  • +
    + + + + trackingOne(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes request, and notifies a +fresh row whenever the request is modified by a database transaction.

    + +

    For example:

    +
    let request = SQLRequest<Row>(sql: "SELECT * FROM player WHERE id = ?", arguments: [1])
    +let observation = ValueObservation.trackingOne(request)
    +
    +let observer = try observation.start(in: dbQueue) { row: Row? in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, message: "Use request.observationForFirst(﹚ instead")
    +public static func trackingOne<Request: FetchRequest>(_ request: Request)
    +    -> ValueObservation<RowReducer>
    +    where Request.RowDecoder == Row
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + request + + +
    +

    the observed request.

    +
    +
    +
    +
    +

    Return Value

    +

    a ValueObservation.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Starting Observation

+

+
+
+
    +
  • +
    + + + + start(in:onChange:) + +
    +
    +
    +
    +
    +
    +

    Starts the value observation in the provided database reader (such as +a database queue or database pool), and returns a transaction observer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func start(
    +    in reader: DatabaseReader,
    +    onChange: @escaping (Reducer.Value) -> Void) throws -> TransactionObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + reader + + +
    +

    A DatabaseReader.

    +
    +
    + + onChange + + +
    +

    A closure that is provided fresh values

    +
    +
    +
    +
    +

    Return Value

    +

    a TransactionObserver

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Starts the value observation in the provided database reader (such as +a database queue or database pool), and returns a transaction observer.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func start(
    +    in reader: DatabaseReader,
    +    onError: @escaping (Error) -> Void,
    +    onChange: @escaping (Reducer.Value) -> Void) -> TransactionObserver
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + reader + + +
    +

    A DatabaseReader.

    +
    +
    + + onError + + +
    +

    A closure that is provided eventual errors that +happen during observation

    +
    +
    + + onChange + + +
    +

    A closure that is provided fresh values

    +
    +
    +
    +
    +

    Return Value

    +

    a TransactionObserver

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Creating ValueObservation from ValueReducer

+

+
+
+
    +
  • +
    + + + + tracking(_:reducer:) + +
    +
    +
    +
    +
    +
    +

    Returns a ValueObservation which observes regions, and notifies the +values returned by the reducer whenever one of the observed +regions is modified by a database transaction.

    + +

    This method is the most fundamental way to create a ValueObservation.

    + +

    For example, this observation counts the number of a times the player +table is modified:

    +
    var count = 0
    +let reducer = AnyValueReducer(
    +    fetch: { _ in /* don't fetch anything */ },
    +    value: { _ -> Int? in
    +        defer { count += 1 }
    +        return count })
    +let observation = ValueObservation.tracking(Player.all(), reducer: { db in reducer })
    +let observer = observation.start(in: dbQueue) { count: Int in
    +    print("Players have been modified \(count) times.")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tracking(
    +    _ regions: DatabaseRegionConvertible...,
    +    reducer: @escaping (Database) throws -> Reducer)
    +    -> ValueObservation
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    + + reducer + + +
    +

    A reducer that turns database changes in the +modified regions into fresh values. Currently only reducers that adopt +the ValueReducer protocol are supported.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + tracking(_:reducer:) + +
    +
    +
    +
    +
    +
    +

    Returns a ValueObservation which observes regions, and notifies the +values returned by the reducer whenever one of the observed +regions is modified by a database transaction.

    + +

    This method is the most fundamental way to create a ValueObservation.

    + +

    For example, this observation counts the number of a times the player +table is modified:

    +
    var count = 0
    +let reducer = AnyValueReducer(
    +    fetch: { _ in /* don't fetch anything */ },
    +    value: { _ -> Int? in
    +        defer { count += 1 }
    +        return count })
    +let observation = ValueObservation.tracking([Player.all()], reducer: { db in reducer })
    +let observer = observation.start(in: dbQueue) { count: Int in
    +    print("Players have been modified \(count) times.")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tracking(
    +    _ regions: [DatabaseRegionConvertible],
    +    reducer: @escaping (Database) throws -> Reducer)
    +    -> ValueObservation
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    + + reducer + + +
    +

    A reducer that turns database changes in the +modified regions into fresh values. Currently only reducers that adopt +the ValueReducer protocol are supported.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Creating ValueObservation from Fetch Closures

+

+
+
+
    +
  • +
    + + + + tracking(value:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which notifies the values returned by the +fetch closure whenever a database transaction changes them.

    + +

    For example:

    +
    let observation = ValueObservation.tracking { db in
    +    try Player.fetchAll(db)
    +}
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tracking<Value>(
    +    value: @escaping (Database) throws -> Value)
    +    -> ValueObservation<ValueReducers.Fetch<Value>>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    A closure that fetches a value.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + tracking(_:fetch:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes regions, and notifies the +values returned by the fetch closure whenever one of the observed +regions is modified by a database transaction.

    + +

    For example:

    +
    let observation = ValueObservation.tracking(
    +    Player.all(),
    +    fetch: { db in return try Player.fetchAll(db) })
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tracking<Value>(
    +    _ regions: DatabaseRegionConvertible...,
    +    fetch: @escaping (Database) throws -> Value)
    +    -> ValueObservation<ValueReducers.Fetch<Value>>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    + + fetch + + +
    +

    A closure that fetches a value.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + tracking(_:fetch:) + +
    +
    +
    +
    +
    +
    +

    Creates a ValueObservation which observes regions, and notifies the +values returned by the fetch closure whenever one of the observed +regions is modified by a database transaction.

    + +

    For example:

    +
    let observation = ValueObservation.tracking(
    +    [Player.all()],
    +    fetch: { db in return try Player.fetchAll(db) })
    +
    +let observer = try observation.start(in: dbQueue) { players: [Player] in
    +    print("Players have changed")
    +}
    +
    + +

    The returned observation has the default configuration:

    + +
      +
    • When started with the start(in:onError:onChange:) method, a fresh +value is immediately notified on the main queue.
    • +
    • Upon subsequent database changes, fresh values are notified on the +main queue.
    • +
    • The observation lasts until the observer returned by +start is deallocated.

    • +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func tracking<Value>(
    +    _ regions: [DatabaseRegionConvertible],
    +    fetch: @escaping (Database) throws -> Value)
    +    -> ValueObservation<ValueReducers.Fetch<Value>>
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + regions + + +
    +

    A list of observed regions.

    +
    +
    + + fetch + + +
    +

    A closure that fetches a value.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer == Void

+

+
+
+ +
+
+
+ + +
+ +

Available where Reducer: ValueReducer

+

+
+
+
    +
  • +
    + + + + combine(_:_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combine<
    +    R1: ValueReducer,
    +    Combined>(
    +    _ other: ValueObservation<R1>,
    +    _ transform: @escaping (Reducer.Value, R1.Value) -> Combined)
    +    -> ValueObservation<ValueReducers.Map<ValueReducers.Combine2<Reducer, R1>, Combined>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer == Void

+

+
+
+ +
+
+
+ + +
+ +

Available where Reducer: ValueReducer

+

+
+
+
    +
  • +
    + + + + combine(_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combine<
    +    R1: ValueReducer,
    +    R2: ValueReducer,
    +    Combined>(
    +    _ observation1: ValueObservation<R1>,
    +    _ observation2: ValueObservation<R2>,
    +    _ transform: @escaping (Reducer.Value, R1.Value, R2.Value) -> Combined)
    +    -> ValueObservation<ValueReducers.Map<ValueReducers.Combine3<Reducer, R1, R2>, Combined>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer == Void

+

+
+
+ +
+
+
+ + +
+ +

Available where Reducer: ValueReducer

+

+
+
+
    +
  • +
    + + + + combine(_:_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combine<
    +    R1: ValueReducer,
    +    R2: ValueReducer,
    +    R3: ValueReducer,
    +    Combined>(
    +    _ observation1: ValueObservation<R1>,
    +    _ observation2: ValueObservation<R2>,
    +    _ observation3: ValueObservation<R3>,
    +    _ transform: @escaping (Reducer.Value, R1.Value, R2.Value, R3.Value) -> Combined)
    +    -> ValueObservation<ValueReducers.Map<ValueReducers.Combine4<Reducer, R1, R2, R3>, Combined>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer == Void

+

+
+
+ +
+
+
+ + +
+ +

Available where Reducer: ValueReducer

+

+
+
+
    +
  • +
    + + + + combine(_:_:_:_:_:) + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func combine<
    +    R1: ValueReducer,
    +    R2: ValueReducer,
    +    R3: ValueReducer,
    +    R4: ValueReducer,
    +    Combined>(
    +    _ observation1: ValueObservation<R1>,
    +    _ observation2: ValueObservation<R2>,
    +    _ observation3: ValueObservation<R3>,
    +    _ observation4: ValueObservation<R4>,
    +    _ transform: @escaping (Reducer.Value, R1.Value, R2.Value, R3.Value, R4.Value) -> Combined)
    +    -> ValueObservation<ValueReducers.Map<ValueReducers.Combine5<Reducer, R1, R2, R3, R4>, Combined>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer == Void

+

+
+
+ +
+
+
+ + +
+ +

Available where Reducer: ValueReducer

+

+
+
+
    +
  • +
    + + + + compactMap(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a ValueObservation which notifies the non-nil results of calling +the given transformation which each element notified by this +value observation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func compactMap<T>(_ transform: @escaping (Reducer.Value) -> T?)
    +    -> ValueObservation<ValueReducers.CompactMap<Reducer, T>>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + map(_:) + +
    +
    +
    +
    +
    +
    +

    Returns a ValueObservation which notifies the results of calling the +given transformation which each element notified by this +value observation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func map<T>(_ transform: @escaping (Reducer.Value) -> T)
    +    -> ValueObservation<ValueReducers.Map<Reducer, T>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Available where Reducer: ValueReducer, Reducer.Value: Equatable

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a ValueObservation which filters out consecutive equal values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    @available(*, deprecated, renamed: "removeDuplicates")
    +public func distinctUntilChanged()
    +    -> ValueObservation<ValueReducers.RemoveDuplicates<Reducer>>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + removeDuplicates() + +
    +
    +
    +
    +
    +
    +

    Returns a ValueObservation which filters out consecutive equal values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func removeDuplicates()
    +    -> ValueObservation<ValueReducers.RemoveDuplicates<Reducer>>
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Typealiases.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Typealiases.html new file mode 100644 index 000000000..a08aff5d2 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/Typealiases.html @@ -0,0 +1,1268 @@ + + + + Type Aliases Reference + + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+

Type Aliases

+

The following type aliases are available globally.

+ +
+
+
+
    +
  • +
    + + + + TraceFunction + +
    +
    +
    +
    +
    +
    +

    A tracing function that takes an SQL string.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias TraceFunction = (String) -> Void
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLiteConnection + +
    +
    +
    +
    +
    +
    +

    A raw SQLite connection, suitable for the SQLite C API.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias SQLiteConnection = OpaquePointer
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SQLiteStatement + +
    +
    +
    +
    +
    +
    +

    A raw SQLite statement, suitable for the SQLite C API.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias SQLiteStatement = OpaquePointer
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + FTS5TokenCallback + +
    +
    +
    +
    +
    +
    +

    A low-level SQLite function that lets FTS5Tokenizer notify tokens.

    + +

    See FTS5Tokenizer.tokenize(context:flags:pText:nText:tokenCallback:)

    + +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A function that lets FTS5WrapperTokenizer notify tokens.

    + +

    See FTS5WrapperTokenizer.accept(token:flags:tokenCallback:)

    + +
    +
    +
    +
  • +
  • +
    + + + + FTS5TokenCallback + +
    +
    +
    +
    +
    +
    +

    A low-level SQLite function that lets FTS5Tokenizer notify tokens.

    + +

    See FTS5Tokenizer.tokenize(context:flags:pText:nText:tokenCallback:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias FTS5TokenCallback = @convention(c) (_ context: UnsafeMutableRawPointer?, _ flags: Int32, _ pToken: UnsafePointer<Int8>?, _ nToken: Int32, _ iStart: Int32, _ iEnd: Int32) -> Int32
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A function that lets FTS5WrapperTokenizer notify tokens.

    + +

    See FTS5WrapperTokenizer.accept(token:flags:tokenCallback:)

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public typealias FTS5WrapperTokenCallback = (_ token: String, _ flags: FTS5TokenFlags) throws -> Void
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/css/highlight.css b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/css/highlight.css new file mode 100644 index 000000000..d0db0e13b --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/css/highlight.css @@ -0,0 +1,200 @@ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight { + /* Comment */ + /* Error */ + /* Keyword */ + /* Operator */ + /* Comment.Multiline */ + /* Comment.Preproc */ + /* Comment.Single */ + /* Comment.Special */ + /* Generic.Deleted */ + /* Generic.Deleted.Specific */ + /* Generic.Emph */ + /* Generic.Error */ + /* Generic.Heading */ + /* Generic.Inserted */ + /* Generic.Inserted.Specific */ + /* Generic.Output */ + /* Generic.Prompt */ + /* Generic.Strong */ + /* Generic.Subheading */ + /* Generic.Traceback */ + /* Keyword.Constant */ + /* Keyword.Declaration */ + /* Keyword.Pseudo */ + /* Keyword.Reserved */ + /* Keyword.Type */ + /* Literal.Number */ + /* Literal.String */ + /* Name.Attribute */ + /* Name.Builtin */ + /* Name.Class */ + /* Name.Constant */ + /* Name.Entity */ + /* Name.Exception */ + /* Name.Function */ + /* Name.Namespace */ + /* Name.Tag */ + /* Name.Variable */ + /* Operator.Word */ + /* Text.Whitespace */ + /* Literal.Number.Float */ + /* Literal.Number.Hex */ + /* Literal.Number.Integer */ + /* Literal.Number.Oct */ + /* Literal.String.Backtick */ + /* Literal.String.Char */ + /* Literal.String.Doc */ + /* Literal.String.Double */ + /* Literal.String.Escape */ + /* Literal.String.Heredoc */ + /* Literal.String.Interpol */ + /* Literal.String.Other */ + /* Literal.String.Regex */ + /* Literal.String.Single */ + /* Literal.String.Symbol */ + /* Name.Builtin.Pseudo */ + /* Name.Variable.Class */ + /* Name.Variable.Global */ + /* Name.Variable.Instance */ + /* Literal.Number.Integer.Long */ } + .highlight .c { + color: #999988; + font-style: italic; } + .highlight .err { + color: #a61717; + background-color: #e3d2d2; } + .highlight .k { + color: #000000; + font-weight: bold; } + .highlight .o { + color: #000000; + font-weight: bold; } + .highlight .cm { + color: #999988; + font-style: italic; } + .highlight .cp { + color: #999999; + font-weight: bold; } + .highlight .c1 { + color: #999988; + font-style: italic; } + .highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + .highlight .gd { + color: #000000; + background-color: #ffdddd; } + .highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + .highlight .ge { + color: #000000; + font-style: italic; } + .highlight .gr { + color: #aa0000; } + .highlight .gh { + color: #999999; } + .highlight .gi { + color: #000000; + background-color: #ddffdd; } + .highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + .highlight .go { + color: #888888; } + .highlight .gp { + color: #555555; } + .highlight .gs { + font-weight: bold; } + .highlight .gu { + color: #aaaaaa; } + .highlight .gt { + color: #aa0000; } + .highlight .kc { + color: #000000; + font-weight: bold; } + .highlight .kd { + color: #000000; + font-weight: bold; } + .highlight .kp { + color: #000000; + font-weight: bold; } + .highlight .kr { + color: #000000; + font-weight: bold; } + .highlight .kt { + color: #445588; } + .highlight .m { + color: #009999; } + .highlight .s { + color: #d14; } + .highlight .na { + color: #008080; } + .highlight .nb { + color: #0086B3; } + .highlight .nc { + color: #445588; + font-weight: bold; } + .highlight .no { + color: #008080; } + .highlight .ni { + color: #800080; } + .highlight .ne { + color: #990000; + font-weight: bold; } + .highlight .nf { + color: #990000; } + .highlight .nn { + color: #555555; } + .highlight .nt { + color: #000080; } + .highlight .nv { + color: #008080; } + .highlight .ow { + color: #000000; + font-weight: bold; } + .highlight .w { + color: #bbbbbb; } + .highlight .mf { + color: #009999; } + .highlight .mh { + color: #009999; } + .highlight .mi { + color: #009999; } + .highlight .mo { + color: #009999; } + .highlight .sb { + color: #d14; } + .highlight .sc { + color: #d14; } + .highlight .sd { + color: #d14; } + .highlight .s2 { + color: #d14; } + .highlight .se { + color: #d14; } + .highlight .sh { + color: #d14; } + .highlight .si { + color: #d14; } + .highlight .sx { + color: #d14; } + .highlight .sr { + color: #009926; } + .highlight .s1 { + color: #d14; } + .highlight .ss { + color: #990073; } + .highlight .bp { + color: #999999; } + .highlight .vc { + color: #008080; } + .highlight .vg { + color: #008080; } + .highlight .vi { + color: #008080; } + .highlight .il { + color: #009999; } diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/css/jazzy.css b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/css/jazzy.css new file mode 100644 index 000000000..2d5656d5b --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/css/jazzy.css @@ -0,0 +1,372 @@ +html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { + background: transparent; + border: 0; + margin: 0; + outline: 0; + padding: 0; + vertical-align: baseline; } + +body { + background-color: #f2f2f2; + font-family: Helvetica, freesans, Arial, sans-serif; + font-size: 14px; + -webkit-font-smoothing: subpixel-antialiased; + word-wrap: break-word; } + +h1, h2, h3 { + margin-top: 0.8em; + margin-bottom: 0.3em; + font-weight: 100; + color: black; } + +h1 { + font-size: 2.5em; } + +h2 { + font-size: 2em; + border-bottom: 1px solid #e2e2e2; } + +h4 { + font-size: 13px; + line-height: 1.5; + margin-top: 21px; } + +h5 { + font-size: 1.1em; } + +h6 { + font-size: 1.1em; + color: #777; } + +.section-name { + color: gray; + display: block; + font-family: Helvetica; + font-size: 22px; + font-weight: 100; + margin-bottom: 15px; } + +pre, code { + font: 0.95em Menlo, monospace; + color: #777; + word-wrap: normal; } + +p code, li code { + background-color: #eee; + padding: 2px 4px; + border-radius: 4px; } + +a { + color: #0088cc; + text-decoration: none; } + +ul { + padding-left: 15px; } + +li { + line-height: 1.8em; } + +img { + max-width: 100%; } + +blockquote { + margin-left: 0; + padding: 0 10px; + border-left: 4px solid #ccc; } + +.content-wrapper { + margin: 0 auto; + width: 980px; } + +header { + font-size: 0.85em; + line-height: 26px; + background-color: #414141; + position: fixed; + width: 100%; + z-index: 2; } + header img { + padding-right: 6px; + vertical-align: -4px; + height: 16px; } + header a { + color: #fff; } + header p { + float: left; + color: #999; } + header .header-right { + float: right; + margin-left: 16px; } + +#breadcrumbs { + background-color: #f2f2f2; + height: 27px; + padding-top: 17px; + position: fixed; + width: 100%; + z-index: 2; + margin-top: 26px; } + #breadcrumbs #carat { + height: 10px; + margin: 0 5px; } + +.sidebar { + background-color: #f9f9f9; + border: 1px solid #e2e2e2; + overflow-y: auto; + overflow-x: hidden; + position: fixed; + top: 70px; + bottom: 0; + width: 230px; + word-wrap: normal; } + +.nav-groups { + list-style-type: none; + background: #fff; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #e2e2e2; + font-size: 1.1em; + font-weight: 100; + padding: 15px 0 15px 20px; } + .nav-group-name > a { + color: #333; } + +.nav-group-tasks { + margin-top: 5px; } + +.nav-group-task { + font-size: 0.9em; + list-style-type: none; + white-space: nowrap; } + .nav-group-task a { + color: #888; } + +.main-content { + background-color: #fff; + border: 1px solid #e2e2e2; + margin-left: 246px; + position: absolute; + overflow: hidden; + padding-bottom: 20px; + top: 70px; + width: 734px; } + .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { + margin-bottom: 1em; } + .main-content p { + line-height: 1.8em; } + .main-content section .section:first-child { + margin-top: 0; + padding-top: 0; } + .main-content section .task-group-section .task-group:first-of-type { + padding-top: 10px; } + .main-content section .task-group-section .task-group:first-of-type .section-name { + padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + .main-content .section-name p { + margin-bottom: inherit; + line-height: inherit; } + .main-content .section-name code { + background-color: inherit; + padding: inherit; + color: inherit; } + +.section { + padding: 0 25px; } + +.highlight { + background-color: #eee; + padding: 10px 12px; + border: 1px solid #e2e2e2; + border-radius: 4px; + overflow-x: auto; } + +.declaration .highlight { + overflow-x: initial; + padding: 0 40px 40px 0; + margin-bottom: -25px; + background-color: transparent; + border: none; } + +.section-name { + margin: 0; + margin-left: 18px; } + +.task-group-section { + padding-left: 6px; + border-top: 1px solid #e2e2e2; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + +.section-name-container { + position: relative; + display: inline-block; } + .section-name-container .section-name-link { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin-bottom: 0; } + .section-name-container .section-name { + position: relative; + pointer-events: none; + z-index: 1; } + .section-name-container .section-name a { + pointer-events: auto; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + .item code { + background-color: transparent; + padding: 0; } + .item .token, .item .direct-link { + padding-left: 3px; + margin-left: 15px; + font-size: 11.9px; + transition: all 300ms; } + .item .token-open { + margin-left: 0px; } + .item .discouraged { + text-decoration: line-through; } + .item .declaration-note { + font-size: .85em; + color: gray; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #e2e2e2; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + background: #f9f9f9; + border-left: 1px solid #e2e2e2; + border-top: 1px solid #e2e2e2; + height: 12px; + left: 21px; + top: -7px; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); + position: absolute; + width: 12px; } + +.height-container { + display: none; + left: -25px; + padding: 0 25px; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #f9f9f9; + border-bottom: 1px solid #e2e2e2; + left: -25px; + position: relative; + width: 100%; + padding-top: 10px; + padding-bottom: 5px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4b8afb; } + +.aside-warning, .aside-deprecated, .aside-unavailable { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #e2e2e2; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +#footer { + position: relative; + top: 10px; + bottom: 0px; + margin-left: 25px; } + #footer p { + margin: 0; + color: #aaa; + font-size: 0.8em; } + +html.dash header, html.dash #breadcrumbs, html.dash .sidebar { + display: none; } + +html.dash .main-content { + width: 980px; + margin-left: 0; + border: none; + width: 100%; + top: 0; + padding-bottom: 0; } + +html.dash .height-container { + display: block; } + +html.dash .item .token { + margin-left: 0; } + +html.dash .content-wrapper { + width: auto; } + +html.dash #footer { + position: static; } diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/img/carat.png b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/img/carat.png new file mode 100755 index 000000000..29d2f7fd4 Binary files /dev/null and b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/img/carat.png differ diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/img/dash.png b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/img/dash.png new file mode 100755 index 000000000..6f694c7a0 Binary files /dev/null and b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/img/dash.png differ diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/img/gh.png b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/img/gh.png new file mode 100755 index 000000000..628da97c7 Binary files /dev/null and b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/img/gh.png differ diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/index.html b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/index.html new file mode 100644 index 000000000..5455cefdc --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/index.html @@ -0,0 +1,8650 @@ + + + + GRDB Reference + + + + + + + + + +
+
+

GRDB 4.8.0 Docs (90% documented)

+

View on GitHub

+

Install in Dash

+
+
+
+ +
+
+ +
+
+
+ +

GRDB: A toolkit for SQLite databases, with a focus on application development

+ +

A toolkit for SQLite databases, with a focus on application development

+ +

+ Swift 4.2 + Swift 5 + Platforms + License + Build Status +

+ +
+ +

Latest release: January 8, 2020 • version 4.8.0 • CHANGELOG • Migrating From GRDB 3 to GRDB 4

+ +

Requirements: iOS 9.0+ / macOS 10.9+ / tvOS 9.0+ / watchOS 2.0+ • Swift 4.2+ / Xcode 10.0+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Swift versionGRDB version
Swift 5v4.8.0
Swift 4.2v4.8.0
Swift 4.1v3.7.0
Swift 4v2.10.0
Swift 3.2v1.3.0
Swift 3.1v1.3.0
Swift 3v1.0
Swift 2.3v0.81.2
Swift 2.2v0.80.2
+ +

Contact:

+ + +

What is this?

+ +

GRDB provides raw access to SQL and advanced SQLite features, because one sometimes enjoys a sharp tool. It has robust concurrency primitives, so that multi-threaded applications can efficiently use their databases. It grants your application models with persistence and fetching methods, so that you don’t have to deal with SQL and raw database rows when you don’t want to.

+ +

Compared to SQLite.swift or FMDB, GRDB can spare you a lot of glue code. Compared to Core Data or Realm, it can simplify your multi-threaded applications.

+ +

It comes with up-to-date documentation, general guides, and it is fast.

+ +

See Why Adopt GRDB? if you are looking for your favorite database library.

+ +
+ +

+ Features • + Usage • + Installation • + Documentation • + Demo Application • + FAQ +

+ +
+

Features

+ +

GRDB ships with:

+ + + +

Companion libraries that enhance and extend GRDB:

+ + +

Usage

+ +
+ Connect to an SQLite database + +“`swift +import GRDB + +// Simple database connection +let dbQueue = try DatabaseQueue(path: ”/path/to/database.sqlite") + +// Enhanced multithreading based on SQLite’s WAL mode +let dbPool = try DatabasePool(path: “/path/to/database.sqlite”) +“` + +See [Database Connections](#database-connections) + +
+ +
+ Execute SQL statements + +”`swift +try dbQueue.write { db in + try db.execute(sql: “”“ + CREATE TABLE place ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + title TEXT NOT NULL, + favorite BOOLEAN NOT NULL DEFAULT 0, + latitude DOUBLE NOT NULL, + longitude DOUBLE NOT NULL) + ”“”) + + try db.execute(sql: “”“ + INSERT INTO place (title, favorite, latitude, longitude) + VALUES (?, ?, ?, ?) + ”“”, arguments: [“Paris”, true, 48.85341, 2.3488]) + + let parisId = db.lastInsertedRowID + + // Swift 5 only + try db.execute(literal: “”“ + INSERT INTO place (title, favorite, latitude, longitude) + VALUES (\("Madrid”), \(true), \(40.41678), \(-3.70379)) + “”“) +} +”` + +See [Executing Updates](#executing-updates) + +
+ +
+ Fetch database rows and values + +“`swift +try dbQueue.read { db in + // Fetch database rows + let rows = try Row.fetchCursor(db, sql: "SELECT * FROM place”) + while let row = try rows.next() { + let title: String = row[“title”] + let isFavorite: Bool = row[“favorite”] + let coordinate = CLLocationCoordinate2D( + latitude: row[“latitude”], + longitude: row[“longitude”]) + } + + // Fetch values + let placeCount = try Int.fetchOne(db, sql: “SELECT COUNT(*) FROM place”)! // Int + let placeTitles = try String.fetchAll(db, sql: “SELECT title FROM place”) // [String] +} + +let placeCount = try dbQueue.read { db in + try Int.fetchOne(db, sql: “SELECT COUNT(*) FROM place”)! +} +“` + +See [Fetch Queries](#fetch-queries) + +
+ +
+ Store custom models aka "records” + +“`swift +struct Place { + var id: Int64? + var title: String + var isFavorite: Bool + var coordinate: CLLocationCoordinate2D +} + +// snip: turn Place into a "record” by adopting the protocols that +// provide fetching and persistence methods. + +try dbQueue.write { db in + // Create database table + try db.create(table: “place”) { t in + t.autoIncrementedPrimaryKey(“id”) + t.column(“title”, .text).notNull() + t.column(“favorite”, .boolean).notNull().defaults(to: false) + t.column(“longitude”, .double).notNull() + t.column(“latitude”, .double).notNull() + } + + var berlin = Place( + id: nil, + title: “Berlin”, + isFavorite: false, + coordinate: CLLocationCoordinate2D(latitude: 52.52437, longitude: 13.41053)) + + try berlin.insert(db) + berlin.id // some value + + berlin.isFavorite = true + try berlin.update(db) +} +“` + +See [Records](#records) + +
+ +
+ Fetch records and values with the Swift query interface + +”`swift +try dbQueue.read { db in + // Place? + let paris = try Place.fetchOne(db, key: 1) + + // Place? + let berlin = try Place.filter(Column(“title”) == “Berlin”).fetchOne(db) + + // [Place] + let favoritePlaces = try Place + .filter(Column(“favorite”) == true) + .order(Column(“title”)) + .fetchAll(db) + + // Int + let favoriteCount = try Place.filter(Column(“favorite”)).fetchCount(db) + + // SQL is always welcome + let places = try Place.fetchAll(db, sql: “SELECT * FROM place”) +} +“` + +See the [Query Interface](#the-query-interface) + +
+ +
+ Be notified of database changes + +”`swift +let observation = ValueObservation.tracking { db in + try Place.fetchAll(db) +} +observation.start( + in: dbQueue, + onError: { error in + print(“fresh places could not be fetched”) + } + onChange: { (places: [Place]) in + print(“Places have changed.”) + }) +“` + +See [Database Changes Observation](#database-changes-observation) + +
+

Documentation

+ +

GRDB runs on top of SQLite: you should get familiar with the SQLite FAQ. For general and detailed information, jump to the SQLite Documentation.

+

Reference

+ + +

Getting Started

+ + +

SQLite and SQL

+ + +

Records and the Query Interface

+ + +

Application Tools

+ + +

Good to Know

+ + +

General Guides & Good Practices

+ + + +

FAQ

+ +

Sample Code

+

Installation

+ +

The installation procedures below have GRDB use the version of SQLite that ships with the target operating system.

+ +

See Encryption for the installation procedure of GRDB with SQLCipher.

+ +

See Custom SQLite builds for the installation procedure of GRDB with a customized build of SQLite 3.28.0.

+ +

See Enabling FTS5 Support for the installation procedure of GRDB with support for the FTS5 full-text engine.

+

CocoaPods

+ +

CocoaPods is a dependency manager for Xcode projects. To use GRDB with CocoaPods (version 1.2 or higher), specify in your Podfile:

+
pod 'GRDB.swift'
+
+ +

GRDB can be installed as a framework, or a static library.

+

Swift Package Manager

+ +

The Swift Package Manager automates the distribution of Swift code. To use GRDB with SPM, add a dependency to your Package.swift file:

+
let package = Package(
+    dependencies: [
+        .package(url: "https://github.com/groue/GRDB.swift.git", ...)
+    ]
+)
+
+ +

Note that Linux is not currently supported.

+

Carthage

+ +

Carthage is unsupported. For some context about this decision, see #433.

+

Manually

+ +
    +
  1. Download a copy of GRDB, or clone its repository and make sure you checkout the latest tagged version.

  2. +
  3. Embed the GRDB.xcodeproj project in your own project.

  4. +
  5. Add the GRDBOSX, GRDBiOS, GRDBtvOS, or GRDBWatchOS target in the Target Dependencies section of the Build Phases tab of your application target (extension target for WatchOS).

  6. +
  7. Add the GRDB.framework from the targetted platform to the Embedded Binaries section of the General tab of your application target (extension target for WatchOS).

  8. +
+ +
+

:bulb: Tip: see the Demo Application for an example of such integration.

+
+

Demo Application

+ +

The repository comes with a Demo Application that shows you:

+ + +

Database Connections

+ +

GRDB provides two classes for accessing SQLite databases: DatabaseQueue and DatabasePool:

+
import GRDB
+
+// Pick one:
+let dbQueue = try DatabaseQueue(path: "/path/to/database.sqlite")
+let dbPool = try DatabasePool(path: "/path/to/database.sqlite")
+
+ +

The differences are:

+ +
    +
  • Database pools allow concurrent database accesses (this can improve the performance of multithreaded applications).
  • +
  • Database pools open your SQLite database in the WAL mode (unless read-only).
  • +
  • Database queues support in-memory databases.
  • +
+ +

If you are not sure, choose DatabaseQueue. You will always be able to switch to DatabasePool later.

+ + +

Database Queues

+ +

Open a database queue with the path to a database file:

+
import GRDB
+
+let dbQueue = try DatabaseQueue(path: "/path/to/database.sqlite")
+let inMemoryDBQueue = DatabaseQueue()
+
+ +

SQLite creates the database file if it does not already exist. The connection is closed when the database queue gets deallocated.

+ +

A database queue can be used from any thread. The write and read methods are synchronous, and block the current thread until your database statements are executed in a protected dispatch queue:

+
// Modify the database:
+try dbQueue.write { db in
+    try db.create(table: "place") { ... }
+    try Place(...).insert(db)
+}
+
+// Read values:
+try dbQueue.read { db in
+    let places = try Place.fetchAll(db)
+    let placeCount = try Place.fetchCount(db)
+}
+
+ +

Database access methods can return values:

+
let placeCount = try dbQueue.read { db in
+    try Place.fetchCount(db)
+}
+
+let newPlaceCount = try dbQueue.write { db -> Int in
+    try Place(...).insert(db)
+    return try Place.fetchCount(db)
+}
+
+ +

A database queue serializes accesses to the database, which means that there is never more than one thread that uses the database.

+ +
    +
  • When you don’t need to modify the database, prefer the read method. It prevents any modification to the database.

  • +
  • The write method wraps your database statements in a transaction that commits if and only if no error occurs. On the first unhandled error, all changes are reverted, the whole transaction is rollbacked, and the error is rethrown.

    + +

    When precise transaction handling is required, see Transactions and Savepoints.

  • +
+ +

A database queue needs your application to follow rules in order to deliver its safety guarantees. Please refer to the Concurrency chapter.

+ +
+

:bulb: Tip: see the Demo Application for a sample code that sets up a database queue on iOS.

+
+

DatabaseQueue Configuration

+
var config = Configuration()
+config.readonly = true
+config.foreignKeysEnabled = true // Default is already true
+config.trace = { print($0) }     // Prints all SQL statements
+config.label = "MyDatabase"      // Useful when your app opens multiple databases
+
+let dbQueue = try DatabaseQueue(
+    path: "/path/to/database.sqlite",
+    configuration: config)
+
+ +

See Configuration for more details.

+

Database Pools

+ +

A database pool allows concurrent database accesses.

+
import GRDB
+let dbPool = try DatabasePool(path: "/path/to/database.sqlite")
+
+ +

SQLite creates the database file if it does not already exist. The connection is closed when the database pool gets deallocated.

+ +
+

:point_up: Note: unless read-only, a database pool opens your database in the SQLite “WAL mode”. The WAL mode does not fit all situations. Please have a look at https://www.sqlite.org/wal.html.

+
+ +

A database pool can be used from any thread. The write and read methods are synchronous, and block the current thread until your database statements are executed in a protected dispatch queue:

+
// Modify the database:
+try dbPool.write { db in
+    try db.create(table: "place") { ... }
+    try Place(...).insert(db)
+}
+
+// Read values:
+try dbPool.read { db in
+    let places = try Place.fetchAll(db)
+    let placeCount = try Place.fetchCount(db)
+}
+
+ +

Database access methods can return values:

+
let placeCount = try dbPool.read { db in
+    try Place.fetchCount(db)
+}
+
+let newPlaceCount = try dbPool.write { db -> Int in
+    try Place(...).insert(db)
+    return try Place.fetchCount(db)
+}
+
+ +

Database pools allow several threads to access the database at the same time:

+ +
    +
  • When you don’t need to modify the database, prefer the read method, because several threads can perform reads in parallel.

    + +

    Reads are generally non-blocking, unless the maximum number of concurrent reads has been reached. In this case, a read has to wait for another read to complete. That maximum number can be configured.

  • +
  • Reads are guaranteed an immutable view of the last committed state of the database, regardless of concurrent writes. This kind of isolation is called snapshot isolation.

  • +
  • Unlike reads, writes are serialized. There is never more than a single thread that is writing into the database.

  • +
  • The write method wraps your database statements in a transaction that commits if and only if no error occurs. On the first unhandled error, all changes are reverted, the whole transaction is rollbacked, and the error is rethrown.

    + +

    When precise transaction handling is required, see Transactions and Savepoints.

  • +
  • Database pools can take snapshots of the database.

  • +
+ +

A database pool needs your application to follow rules in order to deliver its safety guarantees. See the Concurrency chapter for more details about database pools, how they differ from database queues, and advanced use cases.

+ +
+

:bulb: Tip: see the Demo Application for a sample code that sets up a database queue on iOS, and just replace DatabaseQueue with DatabasePool.

+
+

DatabasePool Configuration

+
var config = Configuration()
+config.readonly = true
+config.foreignKeysEnabled = true // Default is already true
+config.trace = { print($0) }     // Prints all SQL statements
+config.label = "MyDatabase"      // Useful when your app opens multiple databases
+config.maximumReaderCount = 10   // The default is 5
+
+let dbPool = try DatabasePool(
+    path: "/path/to/database.sqlite",
+    configuration: config)
+
+ +

See Configuration for more details.

+ +

Database pools are more memory-hungry than database queues. See Memory Management for more information.

+

SQLite API

+ +

In this section of the documentation, we will talk SQL. Jump to the query interface if SQL is not your cup of tea.

+ + + +

Advanced topics:

+ + +

Executing Updates

+ +

Once granted with a database connection, the execute method executes the SQL statements that do not return any database row, such as CREATE TABLE, INSERT, DELETE, ALTER, etc.

+ +

For example:

+
try dbQueue.write { db in
+    try db.execute(sql: """
+        CREATE TABLE player (
+            id INTEGER PRIMARY KEY AUTOINCREMENT,
+            name TEXT NOT NULL,
+            score INT)
+        """)
+
+    try db.execute(
+        sql: "INSERT INTO player (name, score) VALUES (?, ?)",
+        arguments: ["Barbara", 1000])
+
+    try db.execute(
+        sql: "UPDATE player SET score = :score WHERE id = :id",
+        arguments: ["score": 1000, "id": 1])
+    }
+}
+
+ +

The ? and colon-prefixed keys like :score in the SQL query are the statements arguments. You pass arguments with arrays or dictionaries, as in the example above. See Values for more information on supported arguments types (Bool, Int, String, Date, Swift enums, etc.), and StatementArguments for a detailed documentation of SQLite arguments.

+ +

In Swift 5, you can embed query arguments right into your SQL queries, with the literal argument label, as in the example below. See SQL Interpolation for more details.

+
// Swift 5
+try dbQueue.write { db in
+    try db.execute(literal: """
+        INSERT INTO player (name, score)
+        VALUES (\("O'Brien"), \(550))
+        """)
+}
+
+ +

Never ever embed values directly in your raw SQL strings. See Avoiding SQL Injection for more information:

+
// WRONG: don't embed values in raw SQL strings
+let id = 123
+let name = textField.text
+try db.execute(
+    sql: "UPDATE player SET name = '\(name)' WHERE id = \(id)")
+
+// CORRECT: use SQL Interpolation (Swift 5)
+try db.execute(
+    literal: "UPDATE player SET name = \(name) WHERE id = \(id)")
+
+// CORRECT: use arguments dictionary
+try db.execute(
+    sql: "UPDATE player SET name = :name WHERE id = :id",
+    arguments: ["name": name, "id": id])
+
+// CORRECT: use arguments array
+try db.execute(
+    sql: "UPDATE player SET name = ? WHERE id = ?",
+    arguments: [name, id])
+
+ +

Join multiple statements with a semicolon:

+
try db.execute(sql: """
+    INSERT INTO player (name, score) VALUES (?, ?);
+    INSERT INTO player (name, score) VALUES (?, ?);
+    """, arguments: ["Arthur", 750, "Barbara", 1000])
+
+// Swift 5
+try db.execute(literal: """
+    INSERT INTO player (name, score) VALUES (\("Arthur"), \(750));
+    INSERT INTO player (name, score) VALUES (\("Barbara"), \(1000));
+    """)
+
+ +

When you want to make sure that a single statement is executed, use Prepared Statements.

+ +

After an INSERT statement, you can get the row ID of the inserted row:

+
try db.execute(
+    sql: "INSERT INTO player (name, score) VALUES (?, ?)",
+    arguments: ["Arthur", 1000])
+let playerId = db.lastInsertedRowID
+
+ +

Don’t miss Records, that provide classic persistence methods:

+
var player = Player(name: "Arthur", score: 1000)
+try player.insert(db)
+let playerId = player.id
+
+

Fetch Queries

+ +

Database connections let you fetch database rows, plain values, and custom models aka “records”.

+ +

Rows are the raw results of SQL queries:

+
try dbQueue.read { db in
+    if let row = try Row.fetchOne(db, sql: "SELECT * FROM wine WHERE id = ?", arguments: [1]) {
+        let name: String = row["name"]
+        let color: Color = row["color"]
+        print(name, color)
+    }
+}
+
+ +

Values are the Bool, Int, String, Date, Swift enums, etc. stored in row columns:

+
try dbQueue.read { db in
+    let urls = try URL.fetchCursor(db, sql: "SELECT url FROM wine")
+    while let url = try urls.next() {
+        print(url)
+    }
+}
+
+ +

Records are your application objects that can initialize themselves from rows:

+
let wines = try dbQueue.read { db in
+    try Wine.fetchAll(db, sql: "SELECT * FROM wine")
+}
+
+ + +

Fetching Methods

+ +

Throughout GRDB, you can always fetch cursors, arrays, or single values of any fetchable type (database row, simple value, or custom record):

+
try Row.fetchCursor(...) // A Cursor of Row
+try Row.fetchAll(...)    // [Row]
+try Row.fetchOne(...)    // Row?
+
+ +
    +
  • fetchCursor returns a cursor over fetched values:

    +
    let rows = try Row.fetchCursor(db, sql: "SELECT ...") // A Cursor of Row
    +
  • +
  • fetchAll returns an array:

    +
    let players = try Player.fetchAll(db, sql: "SELECT ...") // [Player]
    +
  • +
  • fetchOne returns a single optional value, and consumes a single database row (if any).

    +
    let count = try Int.fetchOne(db, sql: "SELECT COUNT(*) ...") // Int?
    +
  • +
+

Cursors

+ +

Whenever you consume several rows from the database, you can fetch an Array, or a Cursor.

+ +

The fetchAll() method returns a regular Swift array, that you iterate like all other arrays:

+
try dbQueue.read { db in
+    // [Player]
+    let players = try Player.fetchAll(db, sql: "SELECT ...")
+    for player in players {
+        // use player
+    }
+}
+
+ +

Unlike arrays, cursors returned by fetchCursor() load their results step after step:

+
try dbQueue.read { db in
+    // Cursor of Player
+    let players = try Player.fetchCursor(db, sql: "SELECT ...")
+    while let player = try players.next() {
+        // use player
+    }
+}
+
+ +

Both arrays and cursors can iterate over database results. How do you choose one or the other? Look at the differences:

+ +
    +
  • Cursors can not be used on any thread: you must consume a cursor on the dispatch queue it was created in. Particularly, don’t extract a cursor out of a database access method:

    +
    // Wrong
    +let cursor = try dbQueue.read { db in
    +    try Player.fetchCursor(db, ...)
    +}
    +while let player = try cursor.next() { ... }
    +
    + +

    Conversely, arrays may be consumed on any thread:

    +
    // OK
    +let array = try dbQueue.read { db in
    +    try Player.fetchAll(db, ...)
    +}
    +for player in array { ... }
    +
  • +
  • Cursors can be iterated only one time. Arrays can be iterated many times.

  • +
  • Cursors iterate database results in a lazy fashion, and don’t consume much memory. Arrays contain copies of database values, and may take a lot of memory when there are many fetched results.

  • +
  • Cursors are granted with direct access to SQLite, unlike arrays that have to take the time to copy database values. If you look after extra performance, you may prefer cursors over arrays.

  • +
  • Cursors adopt the Cursor protocol, which looks a lot like standard lazy sequences of Swift. As such, cursors come with many convenience methods: compactMap, contains, dropFirst, dropLast, drop(while:), enumerated, filter, first, flatMap, forEach, joined, joined(separator:), max, max(by:), min, min(by:), map, prefix, prefix(while:), reduce, reduce(into:), suffix:

    +
    // Prints all Github links
    +try URL
    +    .fetchCursor(db, sql: "SELECT url FROM link")
    +    .filter { url in url.host == "github.com" }
    +    .forEach { url in print(url) }
    +
    +// An efficient cursor of coordinates:
    +let locations = try Row.
    +    .fetchCursor(db, sql: "SELECT latitude, longitude FROM place")
    +    .map { row in
    +        CLLocationCoordinate2D(latitude: row[0], longitude: row[1])
    +    }
    +
    +// Turn cursors into arrays or sets:
    +let array = try Array(cursor)
    +let set = try Set(cursor)
    +
  • +
  • Cursors are not Swift sequences. That’s because Swift sequences can’t handle iteration errors, when reading SQLite results may fail at any time. SQL functions may throw errors. On iOS, data protection may block access to the database file in the background. On macOS, your application users may mess with the file system.

  • +
  • Cursors require a little care:

    + +
      +
    • Don’t modify the results during a cursor iteration:

      +
      // Undefined behavior
      +while let player = try players.next() {
      +    try db.execute(sql: "DELETE ...")
      +}
      +
    • +
    • Don’t turn a cursor of Row into an array. You would not get the distinct rows you expect. To get a array of rows, use Row.fetchAll(...). Generally speaking, make sure you copy a row whenever you extract it from a cursor for later use: row.copy().

    • +
  • +
+ +

If you don’t see, or don’t care about the difference, use arrays. If you care about memory and performance, use cursors when appropriate.

+

Row Queries

+ + +

Fetching Rows

+ +

Fetch cursors of rows, arrays, or single rows (see fetching methods):

+
try dbQueue.read { db in
+    try Row.fetchCursor(db, sql: "SELECT ...", arguments: ...) // A Cursor of Row
+    try Row.fetchAll(db, sql: "SELECT ...", arguments: ...)    // [Row]
+    try Row.fetchOne(db, sql: "SELECT ...", arguments: ...)    // Row?
+
+    let rows = try Row.fetchCursor(db, sql: "SELECT * FROM wine")
+    while let row = try rows.next() {
+        let name: String = row["name"]
+        let color: Color = row["color"]
+        print(name, color)
+    }
+}
+
+let rows = try dbQueue.read { db in
+    try Row.fetchAll(db, sql: "SELECT * FROM player")
+}
+
+ +

Arguments are optional arrays or dictionaries that fill the positional ? and colon-prefixed keys like :name in the query:

+
let rows = try Row.fetchAll(db,
+    sql: "SELECT * FROM player WHERE name = ?",
+    arguments: ["Arthur"])
+
+let rows = try Row.fetchAll(db,
+    sql: "SELECT * FROM player WHERE name = :name",
+    arguments: ["name": "Arthur"])
+
+ +

See Values for more information on supported arguments types (Bool, Int, String, Date, Swift enums, etc.), and StatementArguments for a detailed documentation of SQLite arguments.

+ +

Unlike row arrays that contain copies of the database rows, row cursors are close to the SQLite metal, and require a little care:

+ +
+

:point_up: Don’t turn a cursor of Row into an array. You would not get the distinct rows you expect. To get a array of rows, use Row.fetchAll(...). Generally speaking, make sure you copy a row whenever you extract it from a cursor for later use: row.copy().

+
+

Column Values

+ +

Read column values by index or column name:

+
let name: String = row[0]      // 0 is the leftmost column
+let name: String = row["name"] // Leftmost matching column - lookup is case-insensitive
+let name: String = row[Column("name")] // Using query interface's Column
+
+ +

Make sure to ask for an optional when the value may be NULL:

+
let name: String? = row["name"]
+
+ +

The row[] subscript returns the type you ask for. See Values for more information on supported value types:

+
let bookCount: Int     = row["bookCount"]
+let bookCount64: Int64 = row["bookCount"]
+let hasBooks: Bool     = row["bookCount"] // false when 0
+
+let string: String     = row["date"]      // "2015-09-11 18:14:15.123"
+let date: Date         = row["date"]      // Date
+self.date = row["date"] // Depends on the type of the property.
+
+ +

You can also use the as type casting operator:

+
row[...] as Int
+row[...] as Int?
+
+ +
+

:warning: Warning: avoid the as! and as? operators:

+
if let int = row[...] as? Int { ... } // BAD - doesn't work
+if let int = row[...] as Int? { ... } // GOOD
+
+
+ +

Generally speaking, you can extract the type you need, provided it can be converted from the underlying SQLite value:

+ +
    +
  • Successful conversions include:

    + +
      +
    • All numeric SQLite values to all numeric Swift types, and Bool (zero is the only false boolean).
    • +
    • Text SQLite values to Swift String.
    • +
    • Blob SQLite values to Foundation Data.
    • +
    + +

    See Values for more information on supported types (Bool, Int, String, Date, Swift enums, etc.)

  • +
  • NULL returns nil.

    +
    let row = try Row.fetchOne(db, sql: "SELECT NULL")!
    +row[0] as Int? // nil
    +row[0] as Int  // fatal error: could not convert NULL to Int.
    +
    + +

    There is one exception, though: the DatabaseValue type:

    +
    row[0] as DatabaseValue // DatabaseValue.null
    +
  • +
  • Missing columns return nil.

    +
    let row = try Row.fetchOne(db, sql: "SELECT 'foo' AS foo")!
    +row["missing"] as String? // nil
    +row["missing"] as String  // fatal error: no such column: missing
    +
    + +

    You can explicitly check for a column presence with the hasColumn method.

  • +
  • Invalid conversions throw a fatal error.

    +
    let row = try Row.fetchOne(db, sql: "SELECT 'Mom’s birthday'")!
    +row[0] as String // "Mom’s birthday"
    +row[0] as Date?  // fatal error: could not convert "Mom’s birthday" to Date.
    +row[0] as Date   // fatal error: could not convert "Mom’s birthday" to Date.
    +
    +let row = try Row.fetchOne(db, sql: "SELECT 256")!
    +row[0] as Int    // 256
    +row[0] as UInt8? // fatal error: could not convert 256 to UInt8.
    +row[0] as UInt8  // fatal error: could not convert 256 to UInt8.
    +
    + +

    Those conversion fatal errors can be avoided with the DatabaseValue type:

    +
    let row = try Row.fetchOne(db, sql: "SELECT 'Mom’s birthday'")!
    +let dbValue: DatabaseValue = row[0]
    +if dbValue.isNull {
    +    // Handle NULL
    +} else if let date = Date.fromDatabaseValue(dbValue) {
    +    // Handle valid date
    +} else {
    +    // Handle invalid date
    +}
    +
    + +

    This extra verbosity is the consequence of having to deal with an untrusted database: you may consider fixing the content of your database instead. See Fatal Errors for more information.

  • +
  • SQLite has a weak type system, and provides convenience conversions that can turn String to Int, Double to Blob, etc.

    + +

    GRDB will sometimes let those conversions go through:

    +
    let rows = try Row.fetchCursor(db, sql: "SELECT '20 small cigars'")
    +while let row = try rows.next() {
    +    row[0] as Int   // 20
    +}
    +
    + +

    Don’t freak out: those conversions did not prevent SQLite from becoming the immensely successful database engine you want to use. And GRDB adds safety checks described just above. You can also prevent those convenience conversions altogether by using the DatabaseValue type.

  • +
+

DatabaseValue

+ +

DatabaseValue is an intermediate type between SQLite and your values, which gives information about the raw value stored in the database.

+ +

You get DatabaseValue just like other value types:

+
let dbValue: DatabaseValue = row[0]
+let dbValue: DatabaseValue? = row["name"] // nil if and only if column does not exist
+
+// Check for NULL:
+dbValue.isNull // Bool
+
+// The stored value:
+dbValue.storage.value // Int64, Double, String, Data, or nil
+
+// All the five storage classes supported by SQLite:
+switch dbValue.storage {
+case .null:                 print("NULL")
+case .int64(let int64):     print("Int64: \(int64)")
+case .double(let double):   print("Double: \(double)")
+case .string(let string):   print("String: \(string)")
+case .blob(let data):       print("Data: \(data)")
+}
+
+ +

You can extract regular values (Bool, Int, String, Date, Swift enums, etc.) from DatabaseValue with the DatabaseValueConvertible.fromDatabaseValue() method:

+
let dbValue: DatabaseValue = row["bookCount"]
+let bookCount   = Int.fromDatabaseValue(dbValue)   // Int?
+let bookCount64 = Int64.fromDatabaseValue(dbValue) // Int64?
+let hasBooks    = Bool.fromDatabaseValue(dbValue)  // Bool?, false when 0
+
+let dbValue: DatabaseValue = row["date"]
+let string = String.fromDatabaseValue(dbValue)     // "2015-09-11 18:14:15.123"
+let date   = Date.fromDatabaseValue(dbValue)       // Date?
+
+ +

fromDatabaseValue returns nil for invalid conversions:

+
let row = try Row.fetchOne(db, sql: "SELECT 'Mom’s birthday'")!
+let dbValue: DatabaseValue = row[0]
+let string = String.fromDatabaseValue(dbValue) // "Mom’s birthday"
+let int    = Int.fromDatabaseValue(dbValue)    // nil
+let date   = Date.fromDatabaseValue(dbValue)   // nil
+
+

Rows as Dictionaries

+ +

Row adopts the standard RandomAccessCollection protocol, and can be seen as a dictionary of DatabaseValue:

+
// All the (columnName, dbValue) tuples, from left to right:
+for (columnName, dbValue) in row {
+    ...
+}
+
+ +

You can build rows from dictionaries (standard Swift dictionaries and NSDictionary). See Values for more information on supported types:

+
let row: Row = ["name": "foo", "date": nil]
+let row = Row(["name": "foo", "date": nil])
+let row = Row(/* [AnyHashable: Any] */) // nil if invalid dictionary
+
+ +

Yet rows are not real dictionaries: they may contain duplicate columns:

+
let row = try Row.fetchOne(db, sql: "SELECT 1 AS foo, 2 AS foo")!
+row.columnNames    // ["foo", "foo"]
+row.databaseValues // [1, 2]
+row["foo"]         // 1 (leftmost matching column)
+for (columnName, dbValue) in row { ... } // ("foo", 1), ("foo", 2)
+
+ +

When you build a dictionary from a row, you have to disambiguate identical columns, and choose how to present database values. For example:

+ +
    +
  • A [String: DatabaseValue] dictionary that keeps leftmost value in case of duplicated column name:

    +
    let dict = Dictionary(row, uniquingKeysWith: { (left, _) in left })
    +
  • +
  • A [String: AnyObject] dictionary which keeps rightmost value in case of duplicated column name. This dictionary is identical to FMResultSet’s resultDictionary from FMDB. It contains NSNull values for null columns, and can be shared with Objective-C:

    +
    let dict = Dictionary(
    +    row.map { (column, dbValue) in
    +        (column, dbValue.storage.value as AnyObject)
    +    },
    +    uniquingKeysWith: { (_, right) in right })
    +
  • +
  • A [String: Any] dictionary that can feed, for example, JSONSerialization:

    +
    let dict = Dictionary(
    +    row.map { (column, dbValue) in
    +        (column, dbValue.storage.value)
    +    },
    +    uniquingKeysWith: { (left, _) in left })
    +
  • +
+ +

See the documentation of Dictionary.init(_:uniquingKeysWith:) for more information.

+

Value Queries

+ +

Instead of rows, you can directly fetch values. Like rows, fetch them as cursors, arrays, or single values (see fetching methods). Values are extracted from the leftmost column of the SQL queries:

+
try dbQueue.read { db in
+    try Int.fetchCursor(db, sql: "SELECT ...", arguments: ...) // A Cursor of Int
+    try Int.fetchAll(db, sql: "SELECT ...", arguments: ...)    // [Int]
+    try Int.fetchOne(db, sql: "SELECT ...", arguments: ...)    // Int?
+
+    // When database may contain NULL:
+    try Optional<Int>.fetchCursor(db, sql: "SELECT ...", arguments: ...) // A Cursor of Int?
+    try Optional<Int>.fetchAll(db, sql: "SELECT ...", arguments: ...)    // [Int?]
+}
+
+let playerCount = try dbQueue.read { db in
+    try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM player")!
+}
+
+ +

fetchOne returns an optional value which is nil in two cases: either the SELECT statement yielded no row, or one row with a NULL value.

+ +

There are many supported value types (Bool, Int, String, Date, Swift enums, etc.). See Values for more information:

+
let count = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM player")! // Int
+let urls = try URL.fetchAll(db, sql: "SELECT url FROM link")          // [URL]
+
+

Values

+ +

GRDB ships with built-in support for the following value types:

+ + + +

Values can be used as statement arguments:

+
let url: URL = ...
+let verified: Bool = ...
+try db.execute(
+    sql: "INSERT INTO link (url, verified) VALUES (?, ?)",
+    arguments: [url, verified])
+
+ +

Values can be extracted from rows:

+
let rows = try Row.fetchCursor(db, sql: "SELECT * FROM link")
+while let row = try rows.next() {
+    let url: URL = row["url"]
+    let verified: Bool = row["verified"]
+}
+
+ +

Values can be directly fetched:

+
let urls = try URL.fetchAll(db, sql: "SELECT url FROM link")  // [URL]
+
+ +

Use values in Records:

+
struct Link: FetchableRecord {
+    var url: URL
+    var isVerified: Bool
+
+    init(row: Row) {
+        url = row["url"]
+        isVerified = row["verified"]
+    }
+}
+
+ +

Use values in the query interface:

+
let url: URL = ...
+let link = try Link.filter(Column("url") == url).fetchOne(db)
+
+

Data (and Memory Savings)

+ +

Data suits the BLOB SQLite columns. It can be stored and fetched from the database just like other values:

+
let rows = try Row.fetchCursor(db, sql: "SELECT data, ...")
+while let row = try rows.next() {
+    let data: Data = row["data"]
+}
+
+ +

At each step of the request iteration, the row[] subscript creates two copies of the database bytes: one fetched by SQLite, and another, stored in the Swift Data value.

+ +

You have the opportunity to save memory by not copying the data fetched by SQLite:

+
while let row = try rows.next() {
+    let data = row.dataNoCopy(named: "data") // Data?
+}
+
+ +

The non-copied data does not live longer than the iteration step: make sure that you do not use it past this point.

+

Date and DateComponents

+ +

Date and DateComponents can be stored and fetched from the database.

+ +

Here is how GRDB supports the various date formats supported by SQLite:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SQLite formatDateDateComponents
YYYY-MM-DDRead ¹Read/Write
YYYY-MM-DD HH:MMRead ¹Read/Write
YYYY-MM-DD HH:MM:SSRead ¹Read/Write
YYYY-MM-DD HH:MM:SS.SSSRead/Write ¹Read/Write
YYYY-MM-DD*T*HH:MMRead ¹Read
YYYY-MM-DD*T*HH:MM:SSRead ¹Read
YYYY-MM-DD*T*HH:MM:SS.SSSRead ¹Read
HH:MMRead/Write
HH:MM:SSRead/Write
HH:MM:SS.SSSRead/Write
Timestamps since unix epochRead ²
now
+ +

¹ Dates are stored and read in the UTC time zone. Missing components are assumed to be zero.

+ +

² GRDB 2+ interprets numerical values as timestamps that fuel Date(timeIntervalSince1970:). Previous GRDB versions used to interpret numbers as julian days. Julian days are still supported, with the Date(julianDay:) initializer.

+

Date

+ +

Date can be stored and fetched from the database just like other values:

+
try db.execute(
+    sql: "INSERT INTO player (creationDate, ...) VALUES (?, ...)",
+    arguments: [Date(), ...])
+
+let row = try Row.fetchOne(db, ...)!
+let creationDate: Date = row["creationDate"]
+
+ +

Dates are stored using the format “YYYY-MM-DD HH:MM:SS.SSS” in the UTC time zone. It is precise to the millisecond.

+ +
+

:point_up: Note: this format was chosen because it is the only format that is:

+ +
    +
  • Comparable (ORDER BY date works)
  • +
  • Comparable with the SQLite keyword CURRENT_TIMESTAMP (WHERE date > CURRENT_TIMESTAMP works)
  • +
  • Able to feed SQLite date & time functions
  • +
  • Precise enough
  • +
+
+ +

When the default format does not fit your needs, customize date conversions. For example:

+
try db.execute(
+    sql: "INSERT INTO player (creationDate, ...) VALUES (?, ...)",
+    arguments: [Date().timeIntervalSinceReferenceDate, ...])
+
+let row = try Row.fetchOne(db, ...)!
+let creationDate = Date(timeIntervalSinceReferenceDate: row["creationDate"])
+
+ +

See Codable Records for more date customization options.

+

DateComponents

+ +

DateComponents is indirectly supported, through the DatabaseDateComponents helper type.

+ +

DatabaseDateComponents reads date components from all date formats supported by SQLite, and stores them in the format of your choice, from HH:MM to YYYY-MM-DD HH:MM:SS.SSS.

+ +

DatabaseDateComponents can be stored and fetched from the database just like other values:

+
let components = DateComponents()
+components.year = 1973
+components.month = 9
+components.day = 18
+
+// Store "1973-09-18"
+let dbComponents = DatabaseDateComponents(components, format: .YMD)
+try db.execute(
+    sql: "INSERT INTO player (birthDate, ...) VALUES (?, ...)",
+    arguments: [dbComponents, ...])
+
+// Read "1973-09-18"
+let row = try Row.fetchOne(db, sql: "SELECT birthDate ...")!
+let dbComponents: DatabaseDateComponents = row["birthDate"]
+dbComponents.format         // .YMD (the actual format found in the database)
+dbComponents.dateComponents // DateComponents
+
+

NSNumber and NSDecimalNumber

+ +

NSNumber can be stored and fetched from the database just like other values. Floating point NSNumbers are stored as Double. Integer and boolean, as Int64. Integers that don’t fit Int64 won’t be stored: you’ll get a fatal error instead. Be cautious when an NSNumber contains an UInt64, for example.

+ +

NSDecimalNumber deserves a longer discussion:

+ +

SQLite has no support for decimal numbers. Given the table below, SQLite will actually store integers or doubles:

+
CREATE TABLE transfer (
+    amount DECIMAL(10,5) -- will store integer or double, actually
+)
+
+ +

This means that computations will not be exact:

+
try db.execute(sql: "INSERT INTO transfer (amount) VALUES (0.1)")
+try db.execute(sql: "INSERT INTO transfer (amount) VALUES (0.2)")
+let sum = try NSDecimalNumber.fetchOne(db, sql: "SELECT SUM(amount) FROM transfer")!
+
+// Yikes! 0.3000000000000000512
+print(sum)
+
+ +

Don’t blame SQLite or GRDB, and instead store your decimal numbers differently.

+ +

A classic technique is to store integers instead, since SQLite performs exact computations of integers. For example, don’t store Euros, but store cents instead:

+
// Write
+let amount = NSDecimalNumber(string: "0.10")
+let integerAmount = amount.multiplying(byPowerOf10: 2).int64Value
+try db.execute(sql: "INSERT INTO transfer (amount) VALUES (?)", arguments: [integerAmount])
+
+// Read
+let integerAmount = try Int64.fetchOne(db, sql: "SELECT SUM(amount) FROM transfer")!
+let amount = NSDecimalNumber(value: integerAmount).multiplying(byPowerOf10: -2) // 0.10
+
+

UUID

+ +

UUID can be stored and fetched from the database just like other values.

+ +

GRDB stores uuids as 16-bytes data blobs, and decodes them from both 16-bytes data blobs and strings such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”.

+

Swift Enums

+ +

Swift enums and generally all types that adopt the RawRepresentable protocol can be stored and fetched from the database just like their raw values:

+
enum Color : Int {
+    case red, white, rose
+}
+
+enum Grape : String {
+    case chardonnay, merlot, riesling
+}
+
+// Declare empty DatabaseValueConvertible adoption
+extension Color : DatabaseValueConvertible { }
+extension Grape : DatabaseValueConvertible { }
+
+// Store
+try db.execute(
+    sql: "INSERT INTO wine (grape, color) VALUES (?, ?)",
+    arguments: [Grape.merlot, Color.red])
+
+// Read
+let rows = try Row.fetchCursor(db, sql: "SELECT * FROM wine")
+while let row = try rows.next() {
+    let grape: Grape = row["grape"]
+    let color: Color = row["color"]
+}
+
+ +

When a database value does not match any enum case, you get a fatal error. This fatal error can be avoided with the DatabaseValue type:

+
let row = try Row.fetchOne(db, sql: "SELECT 'syrah'")!
+
+row[0] as String  // "syrah"
+row[0] as Grape?  // fatal error: could not convert "syrah" to Grape.
+row[0] as Grape   // fatal error: could not convert "syrah" to Grape.
+
+let dbValue: DatabaseValue = row[0]
+if dbValue.isNull {
+    // Handle NULL
+} else if let grape = Grape.fromDatabaseValue(dbValue) {
+    // Handle valid grape
+} else {
+    // Handle unknown grape
+}
+
+

Custom Value Types

+ +

Conversion to and from the database is based on the DatabaseValueConvertible protocol:

+
protocol DatabaseValueConvertible {
+    /// Returns a value that can be stored in the database.
+    var databaseValue: DatabaseValue { get }
+
+    /// Returns a value initialized from dbValue, if possible.
+    static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Self?
+}
+
+ +

All types that adopt this protocol can be used like all other values (Bool, Int, String, Date, Swift enums, etc.)

+ +

The databaseValue property returns DatabaseValue, a type that wraps the five values supported by SQLite: NULL, Int64, Double, String and Data. Since DatabaseValue has no public initializer, use DatabaseValue.null, or another type that already adopts the protocol: 1.databaseValue, "foo".databaseValue, etc. Conversion to DatabaseValue must not fail.

+ +

The fromDatabaseValue() factory method returns an instance of your custom type if the database value contains a suitable value. If the database value does not contain a suitable value, such as “foo” for Date, fromDatabaseValue must return nil (GRDB will interpret this nil result as a conversion error, and react accordingly).

+

Transactions and Savepoints

+ + +

Transactions and Safety

+ +

A transaction is a fundamental tool of SQLite that guarantees data consistency as well as proper isolation between application threads and database connections.

+ +

GRDB generally opens transactions for you, as a way to enforce its concurrency guarantees, and provide maximal security for both your application data and application logic:

+
// BEGIN TRANSACTION
+// INSERT INTO credit ...
+// INSERT INTO debit ...
+// COMMIT
+try dbQueue.write { db in
+    try Credit(destinationAccount, amount).insert(db)
+    try Debit(sourceAccount, amount).insert(db)
+}
+
+// BEGIN TRANSACTION
+// INSERT INTO credit ...
+// INSERT INTO debit ...
+// COMMIT
+try dbPool.write { db in
+    try Credit(destinationAccount, amount).insert(db)
+    try Debit(sourceAccount, amount).insert(db)
+}
+
+ +

Yet you may need to exactly control when transactions take place:

+

Explicit Transactions

+ +

DatabaseQueue.inDatabase() and DatabasePool.writeWithoutTransaction() execute your database statements outside of any transaction:

+
// INSERT INTO credit ...
+// INSERT INTO debit ...
+try dbQueue.inDatabase { db in
+    try Credit(destinationAccount, amount).insert(db)
+    try Debit(sourceAccount, amount).insert(db)
+}
+
+// INSERT INTO credit ...
+// INSERT INTO debit ...
+try dbPool.writeWithoutTransaction { db in
+    try Credit(destinationAccount, amount).insert(db)
+    try Debit(sourceAccount, amount).insert(db)
+}
+
+ +

Writing outside of any transaction is dangerous, for two reasons:

+ +
    +
  • In our credit/debit example, you may successfully insert a credit, but fail inserting the debit, and end up with unbalanced accounts (oops).

    +
    // UNSAFE DATABASE INTEGRITY
    +try dbQueue.inDatabase { db in // or dbPool.writeWithoutTransaction
    +    try Credit(destinationAccount, amount).insert(db) // may succeed
    +    try Debit(sourceAccount, amount).insert(db)      // may fail
    +}
    +
    + +

    Transactions avoid this kind of bug.

  • +
  • Database pool concurrent reads can see an inconsistent state of the database:

    +
    // UNSAFE CONCURRENCY
    +try dbPool.writeWithoutTransaction { db in
    +    try Credit(destinationAccount, amount).insert(db)
    +    // <- Concurrent dbPool.read sees a partial db update here
    +    try Debit(sourceAccount, amount).insert(db)
    +}
    +
    + +

    Transactions avoid this kind of bug, too.

  • +
+ +

To open explicit transactions, use one of the Database.inTransaction, DatabaseQueue.inTransaction, or DatabasePool.writeInTransaction methods:

+
// BEGIN TRANSACTION
+// INSERT INTO credit ...
+// INSERT INTO debit ...
+// COMMIT
+try dbQueue.inDatabase { db in  // or dbPool.writeWithoutTransaction
+    try db.inTransaction {
+        try Credit(destinationAccount, amount).insert(db)
+        try Debit(sourceAccount, amount).insert(db)
+        return .commit
+    }
+}
+
+// BEGIN TRANSACTION
+// INSERT INTO credit ...
+// INSERT INTO debit ...
+// COMMIT
+try dbQueue.inTransaction { db in  // or dbPool.writeInTransaction
+    try Credit(destinationAccount, amount).insert(db)
+    try Debit(sourceAccount, amount).insert(db)
+    return .commit
+}
+
+ +

If an error is thrown from the transaction block, the transaction is rollbacked and the error is rethrown by the inTransaction method. If you return .rollback instead of .commit, the transaction is also rollbacked, but no error is thrown.

+ +

You can also perform manual transaction management:

+
try dbQueue.inDatabase { db in  // or dbPool.writeWithoutTransaction
+    try db.beginTransaction()
+    ...
+    try db.commit()
+
+    try db.execute(sql: "BEGIN TRANSACTION")
+    ...
+    try db.execute(sql: "ROLLBACK")
+}
+
+ +

Transactions can’t be left opened unless you set the allowsUnsafeTransactions configuration flag:

+
// fatal error: A transaction has been left opened at the end of a database access
+try dbQueue.inDatabase { db in
+    try db.execute(sql: "BEGIN TRANSACTION")
+    // <- no commit or rollback
+}
+
+ +

You can ask if a transaction is currently opened:

+
func myCriticalMethod(_ db: Database) throws {
+    precondition(db.isInsideTransaction, "This method requires a transaction")
+    try ...
+}
+
+ +

Yet, you have a better option than checking for transactions: critical database sections should use savepoints, described below:

+
func myCriticalMethod(_ db: Database) throws {
+    try db.inSavepoint {
+        // Here the database is guaranteed to be inside a transaction.
+        try ...
+    }
+}
+
+

Savepoints

+ +

Statements grouped in a savepoint can be rollbacked without invalidating a whole transaction:

+
try dbQueue.write { db in
+    // Makes sure both inserts succeed, or none:
+    try db.inSavepoint {
+        try Credit(destinationAccount, amount).insert(db)
+        try Debit(sourceAccount, amount).insert(db)
+        return .commit
+    }
+
+    // Other savepoints, etc...
+}
+
+ +

If an error is thrown from the savepoint block, the savepoint is rollbacked and the error is rethrown by the inSavepoint method. If you return .rollback instead of .commit, the savepoint is also rollbacked, but no error is thrown.

+ +

Unlike transactions, savepoints can be nested. They implicitly open a transaction if no one was opened when the savepoint begins. As such, they behave just like nested transactions. Yet the database changes are only written to disk when the outermost transaction is committed:

+
try dbQueue.inDatabase { db in
+    try db.inSavepoint {
+        ...
+        try db.inSavepoint {
+            ...
+            return .commit
+        }
+        ...
+        return .commit  // writes changes to disk
+    }
+}
+
+ +

SQLite savepoints are more than nested transactions, though. For advanced uses, use SQLite savepoint documentation.

+

Transaction Kinds

+ +

SQLite supports three kinds of transactions: deferred (the default), immediate, and exclusive.

+ +

The transaction kind can be changed in the database configuration, or for each transaction:

+
// 1) Default configuration:
+let dbQueue = try DatabaseQueue(path: "...")
+
+// BEGIN DEFERED TRANSACTION ...
+dbQueue.write { db in ... }
+
+// BEGIN EXCLUSIVE TRANSACTION ...
+dbQueue.inTransaction(.exclusive) { db in ... }
+
+// 2) Customized default transaction kind:
+var config = Configuration()
+config.defaultTransactionKind = .immediate
+let dbQueue = try DatabaseQueue(path: "...", configuration: config)
+
+// BEGIN IMMEDIATE TRANSACTION ...
+dbQueue.write { db in ... }
+
+// BEGIN EXCLUSIVE TRANSACTION ...
+dbQueue.inTransaction(.exclusive) { db in ... }
+
+

Prepared Statements

+ +

Prepared Statements let you prepare an SQL query and execute it later, several times if you need, with different arguments.

+ +

There are two kinds of prepared statements: select statements, and update statements:

+
try dbQueue.write { db in
+    let updateSQL = "INSERT INTO player (name, score) VALUES (:name, :score)"
+    let updateStatement = try db.makeUpdateStatement(sql: updateSQL)
+
+    let selectSQL = "SELECT * FROM player WHERE name = ?"
+    let selectStatement = try db.makeSelectStatement(sql: selectSQL)
+}
+
+ +

The ? and colon-prefixed keys like :name in the SQL query are the statement arguments. You set them with arrays or dictionaries (arguments are actually of type StatementArguments, which happens to adopt the ExpressibleByArrayLiteral and ExpressibleByDictionaryLiteral protocols).

+
updateStatement.arguments = ["name": "Arthur", "score": 1000]
+selectStatement.arguments = ["Arthur"]
+
+ +

After arguments are set, you can execute the prepared statement:

+
try updateStatement.execute()
+
+ +

Select statements can be used wherever a raw SQL query string would fit (see fetch queries):

+
let rows = try Row.fetchCursor(selectStatement)    // A Cursor of Row
+let players = try Player.fetchAll(selectStatement) // [Player]
+let player = try Player.fetchOne(selectStatement)  // Player?
+
+ +

You can set the arguments at the moment of the statement execution:

+
try updateStatement.execute(arguments: ["name": "Arthur", "score": 1000])
+let player = try Player.fetchOne(selectStatement, arguments: ["Arthur"])
+
+ +
+

:point_up: Note: it is a programmer error to reuse a prepared statement that has failed: GRDB may crash if you do so.

+
+ +

See row queries, value queries, and Records for more information.

+

Prepared Statements Cache

+ +

When the same query will be used several times in the lifetime of your application, you may feel a natural desire to cache prepared statements.

+ +

Don’t cache statements yourself.

+ +
+

:point_up: Note: This is because you don’t have the necessary tools. Statements are tied to specific SQLite connections and dispatch queues which you don’t manage yourself, especially when you use database pools. A change in the database schema may, or may not invalidate a statement. On systems earlier than OSX 10.10 that don’t have the sqlite3_close_v2 function, SQLite connections won’t close properly if statements have been kept alive.

+
+ +

Instead, use the cachedUpdateStatement and cachedSelectStatement methods. GRDB does all the hard caching and memory management stuff for you:

+
let updateStatement = try db.cachedUpdateStatement(sql: sql)
+let selectStatement = try db.cachedSelectStatement(sql: sql)
+
+ +

Should a cached prepared statement throw an error, don’t reuse it (it is a programmer error). Instead, reload it from the cache.

+

Custom SQL Functions and Aggregates

+ +

SQLite lets you define SQL functions and aggregates.

+ +

A custom SQL function or aggregate extends SQLite:

+
SELECT reverse(name) FROM player;   -- custom function
+SELECT maxLength(name) FROM player; -- custom aggregate
+
+ + +

Custom SQL Functions

+
let reverse = DatabaseFunction("reverse", argumentCount: 1, pure: true) { (values: [DatabaseValue]) in
+    // Extract string value, if any...
+    guard let string = String.fromDatabaseValue(values[0]) else {
+        return nil
+    }
+    // ... and return reversed string:
+    return String(string.reversed())
+}
+dbQueue.add(function: reverse)   // Or dbPool.add(function: ...)
+
+try dbQueue.read { db in
+    // "oof"
+    try String.fetchOne(db, sql: "SELECT reverse('foo')")!
+}
+
+ +

The function argument takes an array of DatabaseValue, and returns any valid value (Bool, Int, String, Date, Swift enums, etc.) The number of database values is guaranteed to be argumentCount.

+ +

SQLite has the opportunity to perform additional optimizations when functions are “pure”, which means that their result only depends on their arguments. So make sure to set the pure argument to true when possible.

+ +

Functions can take a variable number of arguments:

+ +

When you don’t provide any explicit argumentCount, the function can take any number of arguments:

+
let averageOf = DatabaseFunction("averageOf", pure: true) { (values: [DatabaseValue]) in
+    let doubles = values.compactMap { Double.fromDatabaseValue($0) }
+    return doubles.reduce(0, +) / Double(doubles.count)
+}
+dbQueue.add(function: averageOf)
+
+try dbQueue.read { db in
+    // 2.0
+    try Double.fetchOne(db, sql: "SELECT averageOf(1, 2, 3)")!
+}
+
+ +

Functions can throw:

+
let sqrt = DatabaseFunction("sqrt", argumentCount: 1, pure: true) { (values: [DatabaseValue]) in
+    guard let double = Double.fromDatabaseValue(values[0]) else {
+        return nil
+    }
+    guard double >= 0 else {
+        throw DatabaseError(message: "invalid negative number")
+    }
+    return sqrt(double)
+}
+dbQueue.add(function: sqrt)
+
+// SQLite error 1 with statement `SELECT sqrt(-1)`: invalid negative number
+try dbQueue.read { db in
+    try Double.fetchOne(db, sql: "SELECT sqrt(-1)")!
+}
+
+ +

Use custom functions in the query interface:

+
// SELECT reverseString("name") FROM player
+Player.select(reverseString.apply(nameColumn))
+
+ +

GRDB ships with built-in SQL functions that perform unicode-aware string transformations. See Unicode.

+

Custom Aggregates

+ +

Before registering a custom aggregate, you need to define a type that adopts the DatabaseAggregate protocol:

+
protocol DatabaseAggregate {
+    // Initializes an aggregate
+    init()
+
+    // Called at each step of the aggregation
+    mutating func step(_ dbValues: [DatabaseValue]) throws
+
+    // Returns the final result
+    func finalize() throws -> DatabaseValueConvertible?
+}
+
+ +

For example:

+
struct MaxLength : DatabaseAggregate {
+    var maxLength: Int = 0
+
+    mutating func step(_ dbValues: [DatabaseValue]) {
+        // At each step, extract string value, if any...
+        guard let string = String.fromDatabaseValue(dbValues[0]) else {
+            return
+        }
+        // ... and update the result
+        let length = string.count
+        if length > maxLength {
+            maxLength = length
+        }
+    }
+
+    func finalize() -> DatabaseValueConvertible? {
+        return maxLength
+    }
+}
+
+let maxLength = DatabaseFunction(
+    "maxLength",
+    argumentCount: 1,
+    pure: true,
+    aggregate: MaxLength.self)
+
+dbQueue.add(function: maxLength)   // Or dbPool.add(function: ...)
+
+try dbQueue.read { db in
+    // Some Int
+    try Int.fetchOne(db, sql: "SELECT maxLength(name) FROM player")!
+}
+
+ +

The step method of the aggregate takes an array of DatabaseValue. This array contains as many values as the argumentCount parameter (or any number of values, when argumentCount is omitted).

+ +

The finalize method of the aggregate returns the final aggregated value (Bool, Int, String, Date, Swift enums, etc.).

+ +

SQLite has the opportunity to perform additional optimizations when aggregates are “pure”, which means that their result only depends on their inputs. So make sure to set the pure argument to true when possible.

+ +

Use custom aggregates in the query interface:

+
// SELECT maxLength("name") FROM player
+let request = Player.select(maxLength.apply(nameColumn))
+try Int.fetchOne(db, request) // Int?
+
+

Database Schema Introspection

+ +

GRDB comes with a set of schema introspection methods:

+
try dbQueue.read { db in
+    // Bool, true if the table exists
+    try db.tableExists("player")
+
+    // [ColumnInfo], the columns in the table
+    try db.columns(in: "player")
+
+    // PrimaryKeyInfo
+    try db.primaryKey("player")
+
+    // [ForeignKeyInfo], the foreign keys defined on the table
+    try db.foreignKeys(on: "player")
+
+    // [IndexInfo], the indexes defined on the table
+    try db.indexes(on: "player")
+
+    // Bool, true if column(s) is a unique key (primary key or unique index)
+    try db.table("player", hasUniqueKey: ["email"])
+}
+
+// Bool, true if argument is the name of an internal SQLite table
+Database.isSQLiteInternalTable(...)
+
+// Bool, true if argument is the name of an internal GRDB table
+Database.isGRDBInternalTable(...)
+
+

Row Adapters

+ +

Row adapters let you present database rows in the way expected by the row consumers.

+ +

They basically help two incompatible row interfaces to work together. For example, a row consumer expects a column named “consumed”, but the produced row has a column named “produced”.

+ +

In this case, the ColumnMapping row adapter comes in handy:

+
// Fetch a 'produced' column, and consume a 'consumed' column:
+let adapter = ColumnMapping(["consumed": "produced"])
+let row = try Row.fetchOne(db, sql: "SELECT 'Hello' AS produced", adapter: adapter)!
+row["consumed"] // "Hello"
+row["produced"] // nil
+
+ +

Row adapters are values that adopt the RowAdapter protocol. You can implement your own custom adapters (:fire: EXPERIMENTAL), or use one of the four built-in adapters, described below.

+ +

To see how row adapters can be used, see Joined Queries Support.

+

ColumnMapping

+ +

ColumnMapping renames columns. Build one with a dictionary whose keys are adapted column names, and values the column names in the raw row:

+
// [newName:"Hello"]
+let adapter = ColumnMapping(["newName": "oldName"])
+let row = try Row.fetchOne(db, sql: "SELECT 'Hello' AS oldName", adapter: adapter)!
+
+

SuffixRowAdapter

+ +

SuffixRowAdapter hides the first columns in a row:

+
// [b:1 c:2]
+let adapter = SuffixRowAdapter(fromIndex: 1)
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c", adapter: adapter)!
+
+

RangeRowAdapter

+ +

RangeRowAdapter only exposes a range of columns.

+
// [b:1]
+let adapter = RangeRowAdapter(1..<2)
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c", adapter: adapter)!
+
+

EmptyRowAdapter

+ +

EmptyRowAdapter hides all columns.

+
let adapter = EmptyRowAdapter()
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c", adapter: adapter)!
+row.isEmpty // true
+
+ +

This limit adapter may turn out useful in some narrow use cases. You’ll be happy to find it when you need it.

+

ScopeAdapter

+ +

ScopeAdapter defines row scopes:

+
let adapter = ScopeAdapter([
+    "left": RangeRowAdapter(0..<2),
+    "right": RangeRowAdapter(2..<4)])
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c, 3 AS d", adapter: adapter)!
+
+ +

ScopeAdapter does not change the columns and values of the fetched row. Instead, it defines scopes, which you access through the Row.scopes property:

+
row                   // [a:0 b:1 c:2 d:3]
+row.scopes["left"]    // [a:0 b:1]
+row.scopes["right"]   // [c:2 d:3]
+row.scopes["missing"] // nil
+
+ +

Scopes can be nested:

+
let adapter = ScopeAdapter([
+    "left": ScopeAdapter([
+        "left": RangeRowAdapter(0..<1),
+        "right": RangeRowAdapter(1..<2)]),
+    "right": ScopeAdapter([
+        "left": RangeRowAdapter(2..<3),
+        "right": RangeRowAdapter(3..<4)])
+    ])
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c, 3 AS d", adapter: adapter)!
+
+let leftRow = row.scopes["left"]!
+leftRow.scopes["left"]  // [a:0]
+leftRow.scopes["right"] // [b:1]
+
+let rightRow = row.scopes["right"]!
+rightRow.scopes["left"]  // [c:2]
+rightRow.scopes["right"] // [d:3]
+
+ +

Any adapter can be extended with scopes:

+
let baseAdapter = RangeRowAdapter(0..<2)
+let adapter = ScopeAdapter(base: baseAdapter, scopes: [
+    "remainder": SuffixRowAdapter(fromIndex: 2)])
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c, 3 AS d", adapter: adapter)!
+
+row // [a:0 b:1]
+row.scopes["remainder"] // [c:2 d:3]
+
+

Raw SQLite Pointers

+ +

If not all SQLite APIs are exposed in GRDB, you can still use the SQLite C Interface and call SQLite C functions.

+ +

Those functions are embedded right into the GRDBCustom module. Otherwise, you’ll need to import SQLite3, SQLCipher, or CSQLite, depending on the GRDB flavor you are using:

+
// Swift Package Manager
+import CSQLite
+
+// SQLCipher
+import SQLCipher
+
+// System SQLite
+import SQLite3
+
+let sqliteVersion = String(cString: sqlite3_libversion())
+
+ +

Raw pointers to database connections and statements are available through the Database.sqliteConnection and Statement.sqliteStatement properties:

+
try dbQueue.read { db in
+    // The raw pointer to a database connection:
+    let sqliteConnection = db.sqliteConnection
+
+    // The raw pointer to a statement:
+    let statement = try db.makeSelectStatement(sql: "SELECT ...")
+    let sqliteStatement = statement.sqliteStatement
+}
+
+ +
+

:point_up: Notes

+ +
    +
  • Those pointers are owned by GRDB: don’t close connections or finalize statements created by GRDB.
  • +
  • GRDB opens SQLite connections in the “multi-thread mode”, which (oddly) means that they are not thread-safe. Make sure you touch raw databases and statements inside their dedicated dispatch queues.
  • +
  • Use the raw SQLite C Interface at your own risk. GRDB won’t prevent you from shooting yourself in the foot.
  • +
+
+

Records

+ +

On top of the SQLite API, GRDB provides protocols and a class that help manipulating database rows as regular objects named “records”:

+
try dbQueue.write { db in
+    if var place = try Place.fetchOne(db, key: 1) {
+        place.isFavorite = true
+        try place.update(db)
+    }
+}
+
+ +

Of course, you need to open a database connection, and create database tables first.

+ +

To define your custom records, you subclass the ready-made Record class, or you extend your structs and classes with protocols that come with focused sets of features: fetching methods, persistence methods, record comparison…

+ +

Extending structs with record protocols is more “swifty”. Subclassing the Record class is more “classic”. You can choose either way. See some examples of record definitions, and the list of record methods for an overview.

+ +
+

:point_up: Note: if you are familiar with Core Data’s NSManagedObject or Realm’s Object, you may experience a cultural shock: GRDB records are not uniqued, do not auto-update, and do not lazy-load. This is both a purpose, and a consequence of protocol-oriented programming. You should read How to build an iOS application with SQLite and GRDB.swift for a general introduction.

+ +

:bulb: Tip: after you have read this chapter, check the Good Practices for Designing Record Types Guide.

+ +

:bulb: Tip: see the Demo Application for a sample app that uses records.

+
+ +

Overview

+ + + +

Protocols and the Record Class

+ + + +

Records in a Glance

+ + +

Inserting Records

+ +

To insert a record in the database, call the insert method:

+
let player = Player(name: "Arthur", email: "arthur@example.com")
+try player.insert(db)
+
+ +

:point_right: insert is available for subclasses of the Record class, and types that adopt the PersistableRecord protocol.

+

Fetching Records

+ +

To fetch records from the database, call a fetching method:

+
let arthur = try Player.fetchOne(db,            // Player?
+    sql: "SELECT * FROM players WHERE name = ?",
+    arguments: ["Arthur"])
+
+let bestPlayers = try Player                    // [Player]
+    .order(Column("score").desc)
+    .limit(10)
+    .fetchAll(db)
+
+let spain = try Country.fetchOne(db, key: "ES") // Country?
+
+ +

:point_right: Fetching from raw SQL is available for subclasses of the Record class, and types that adopt the FetchableRecord protocol.

+ +

:point_right: Fetching without SQL, using the query interface, is available for subclasses of the Record class, and types that adopt both FetchableRecord and TableRecord protocol.

+

Updating Records

+ +

To update a record in the database, call the update method:

+
if let player = try Player.fetchOne(db, key: 1) 
+    player.score = 1000
+    try player.update(db)
+}
+
+ +

It is possible to avoid useless updates:

+
if var player = try Player.fetchOne(db, key: 1) {
+    // does not hit the database if score has not changed
+    try player.updateChanges(db) {
+        $0.score = 1000
+    }
+}
+
+ +

For batch updates, execute an SQL query, or see the query interface:

+
try db.execute(sql: "UPDATE player SET score = score + 1 WHERE team = 'red'")
+try Player
+    .filter(Column("team") == "red")
+    .updateAll(db, scoreColumn += 1)
+
+ +

:point_right: update methods are available for subclasses of the Record class, and types that adopt the PersistableRecord protocol.

+

Deleting Records

+ +

To delete a record in the database, call the delete method:

+
if let player = try Player.fetchOne(db, key: 1) {
+    try player.delete(db)
+}
+
+ +

You can also delete by primary key, or any unique index:

+
try Player.deleteOne(db, key: 1)
+try Player.deleteOne(db, key: ["email": "arthur@example.com"])
+try Country.deleteAll(db, keys: ["FR", "US"])
+
+ +

For batch deletes, execute an SQL query, or see the query interface:

+
try db.execute(sql: "DELETE player WHERE email IS NULL")
+try Player
+    .filter(Column("email") == nil)
+    .deleteAll(db)
+
+ +

:point_right: delete methods are available for subclasses of the Record class, and types that adopt the PersistableRecord protocol.

+

Counting Records

+ +

To count records, call the fetchCount method:

+
let playerCount: Int = try Player.fetchCount(db)
+
+let playerWithEmailCount: Int = try Player
+    .filter(Column("email") == nil)
+    .fetchCount(db)
+
+ +

:point_right: fetchCount is available for subclasses of the Record class, and types that adopt the TableRecord protocol.

+ +

Details follow:

+ + +

Record Protocols Overview

+ +

GRDB ships with three record protocols. Your own types will adopt one or several of them, according to the abilities you want to extend your types with.

+ +
    +
  • FetchableRecord is able to decode database rows.

    + +

    It is always possible to decode rows without this protocol:

    +
    struct Place { ... }
    +try dbQueue.read { db in
    +    let rows = try Row.fetchAll(db, sql: "SELECT * FROM place")
    +    let places: [Place] = rows.map { row in
    +        return Place(
    +            id: row["id"],
    +            title: row["title"],
    +            coordinate: CLLocationCoordinate2D(
    +                latitude: row["latitude"],
    +                longitude: row["longitude"]))
    +        )
    +    }
    +}
    +
    + +

    But FetchableRecord lets you write code that is easier to read, and more efficient as well, both in terms of performance and memory usage:

    +
    struct Place: FetchableRecord { ... }
    +try dbQueue.read { db in
    +    let places = try Place.fetchAll(db, sql: "SELECT * FROM place")
    +}
    +
    + +
    +

    :bulb: Tip: FetchableRecord can derive its implementation from the standard Decodable protocol. See Codable Records for more information.

    +
    + +

    FetchableRecord can decode database rows, but it is not able to build SQL requests for you. For that, you also need TableRecord:

  • +
  • TableRecord is able to generate SQL queries:

    +
    struct Place: TableRecord { ... }
    +// SELECT * FROM place ORDER BY title
    +let request = Place.order(Column("title"))
    +
    + +

    When a type adopts both TableRecord and FetchableRecord, it can load from those requests:

    +
    struct Place: TableRecord, FetchableRecord { ... }
    +try dbQueue.read { db in
    +    let places = try Place.order(Column("title")).fetchAll(db)
    +    let paris = try Place.fetchOne(key: 1)
    +}
    +
  • +
  • PersistableRecord is able to write: it can create, update, and delete rows in the database:

    +
    struct Place : PersistableRecord { ... }
    +try dbQueue.write { db in
    +    try Place.delete(db, key: 1)
    +    try Place(...).insert(db)
    +}
    +
    + +

    A persistable record can also compare itself against other records, and avoid useless database updates.

    + +
    +

    :bulb: Tip: PersistableRecord can derive its implementation from the standard Encodable protocol. See Codable Records for more information.

    +
  • +
+

FetchableRecord Protocol

+ +

The FetchableRecord protocol grants fetching methods to any type that can be built from a database row:

+
protocol FetchableRecord {
+    /// Row initializer
+    init(row: Row)
+}
+
+ +

To use FetchableRecord, subclass the Record class, or adopt it explicitly. For example:

+
struct Place {
+    var id: Int64?
+    var title: String
+    var coordinate: CLLocationCoordinate2D
+}
+
+extension Place : FetchableRecord {
+    init(row: Row) {
+        id = row["id"]
+        title = row["title"]
+        coordinate = CLLocationCoordinate2D(
+            latitude: row["latitude"],
+            longitude: row["longitude"])
+    }
+}
+
+ +

Rows also accept column enums:

+
extension Place : FetchableRecord {
+    enum Columns: String, ColumnExpression {
+        case id, title, latitude, longitude
+    }
+
+    init(row: Row) {
+        id = row[Columns.id]
+        title = row[Columns.title]
+        coordinate = CLLocationCoordinate2D(
+            latitude: row[Columns.latitude],
+            longitude: row[Columns.longitude])
+    }
+}
+
+ +

See column values for more information about the row[] subscript.

+ +

When your record type adopts the standard Decodable protocol, you don’t have to provide the implementation for init(row:). See Codable Records for more information:

+
// That's all
+struct Player: Decodable, FetchableRecord {
+    var id: Int64
+    var name: String
+    var score: Int
+}
+
+ +

FetchableRecord allows adopting types to be fetched from SQL queries:

+
try Place.fetchCursor(db, sql: "SELECT ...", arguments:...) // A Cursor of Place
+try Place.fetchAll(db, sql: "SELECT ...", arguments:...)    // [Place]
+try Place.fetchOne(db, sql: "SELECT ...", arguments:...)    // Place?
+
+ +

See fetching methods for information about the fetchCursor, fetchAll and fetchOne methods. See StatementArguments for more information about the query arguments.

+ +
+

:point_up: Note: for performance reasons, the same row argument to init(row:) is reused during the iteration of a fetch query. If you want to keep the row for later use, make sure to store a copy: self.row = row.copy().

+ +

:point_up: Note: The FetchableRecord.init(row:) initializer fits the needs of most applications. But some application are more demanding than others. When FetchableRecord does not exactly provide the support you need, have a look at the Beyond FetchableRecord chapter.

+
+

TableRecord Protocol

+ +

The TableRecord protocol generates SQL for you. To use TableRecord, subclass the Record class, or adopt it explicitly:

+
protocol TableRecord {
+    static var databaseTableName: String { get }
+    static var databaseSelection: [SQLSelectable] { get }
+}
+
+ +

The databaseSelection type property is optional, and documented in the Columns Selected by a Request chapter.

+ +

The databaseTableName type property is the name of a database table. By default, it is derived from the type name:

+
struct Place: TableRecord { }
+print(Place.databaseTableName) // prints "place"
+
+ +

For example:

+ +
    +
  • Place: place
  • +
  • Country: country
  • +
  • PostalAddress: postalAddress
  • +
  • HTTPRequest: httpRequest
  • +
  • TOEFL: toefl
  • +
+ +

You can still provide a custom table name:

+
struct Place: TableRecord {
+    static let databaseTableName = "location"
+}
+print(Place.databaseTableName) // prints "location"
+
+ +

Subclasses of the Record class must always override their superclass’s databaseTableName property:

+
class Place: Record {
+    override class var databaseTableName: String {
+        return "place"
+    }
+}
+print(Place.databaseTableName) // prints "place"
+
+ +

When a type adopts both TableRecord and FetchableRecord, it can be fetched using the query interface:

+
// SELECT * FROM place WHERE name = 'Paris'
+let paris = try Place.filter(nameColumn == "Paris").fetchOne(db)
+
+ +

TableRecord can also fetch records by primary key:

+
try Player.fetchOne(db, key: 1)              // Player?
+try Player.fetchAll(db, keys: [1, 2, 3])     // [Player]
+
+try Country.fetchOne(db, key: "FR")          // Country?
+try Country.fetchAll(db, keys: ["FR", "US"]) // [Country]
+
+ +

When the table has no explicit primary key, GRDB uses the hidden “rowid” column:

+
// SELECT * FROM document WHERE rowid = 1
+try Document.fetchOne(db, key: 1)            // Document?
+
+ +

For multiple-column primary keys and unique keys defined by unique indexes, provide a dictionary:

+
// SELECT * FROM citizenship WHERE citizenId = 1 AND countryCode = 'FR'
+try Citizenship.fetchOne(db, key: ["citizenId": 1, "countryCode": "FR"]) // Citizenship?
+
+

PersistableRecord Protocol

+ +

GRDB record types can create, update, and delete rows in the database.

+ +

Those abilities are granted by three protocols:

+
// Defines how a record encodes itself into the database
+protocol EncodableRecord {
+    /// Defines the values persisted in the database
+    func encode(to container: inout PersistenceContainer)
+}
+
+// Adds persistence methods
+protocol MutablePersistableRecord: TableRecord, EncodableRecord {
+    /// Optional method that lets your adopting type store its rowID upon
+    /// successful insertion. Don't call it directly: it is called for you.
+    mutating func didInsert(with rowID: Int64, for column: String?)
+}
+
+// Adds immutability
+protocol PersistableRecord: MutablePersistableRecord {
+    /// Non-mutating version of the optional didInsert(with:for:)
+    func didInsert(with rowID: Int64, for column: String?)
+}
+
+ +

Yes, three protocols instead of one. Here is how you pick one or the other:

+ +
    +
  • If your type is a class, choose PersistableRecord. On top of that, implement didInsert(with:for:) if the database table has an auto-incremented primary key.

  • +
  • If your type is a struct, and the database table has an auto-incremented primary key, choose MutablePersistableRecord, and implement didInsert(with:for:).

  • +
  • Otherwise, choose PersistableRecord, and ignore didInsert(with:for:).

  • +
+ +

The encode(to:) method defines which values (Bool, Int, String, Date, Swift enums, etc.) are assigned to database columns.

+ +

The optional didInsert method lets the adopting type store its rowID after successful insertion, and is only useful for tables that have an auto-incremented primary key. It is called from a protected dispatch queue, and serialized with all database updates.

+ +

To use the persistable protocols, subclass the Record class, or adopt one of them explicitly. For example:

+
extension Place : MutablePersistableRecord {
+    /// The values persisted in the database
+    func encode(to container: inout PersistenceContainer) {
+        container["id"] = id
+        container["title"] = title
+        container["latitude"] = coordinate.latitude
+        container["longitude"] = coordinate.longitude
+    }
+
+    // Update auto-incremented id upon successful insertion
+    mutating func didInsert(with rowID: Int64, for column: String?) {
+        id = rowID
+    }
+}
+
+var paris = Place(
+    id: nil,
+    title: "Paris",
+    coordinate: CLLocationCoordinate2D(latitude: 48.8534100, longitude: 2.3488000))
+
+try paris.insert(db)
+paris.id   // some value
+
+ +

Persistence containers also accept column enums:

+
extension Place : MutablePersistableRecord {
+    enum Columns: String, ColumnExpression {
+        case id, title, latitude, longitude
+    }
+
+    func encode(to container: inout PersistenceContainer) {
+        container[Columns.id] = id
+        container[Columns.title] = title
+        container[Columns.latitude] = coordinate.latitude
+        container[Columns.longitude] = coordinate.longitude
+    }
+}
+
+ +

When your record type adopts the standard Encodable protocol, you don’t have to provide the implementation for encode(to:). See Codable Records for more information:

+
// That's all
+struct Player: Encodable, MutablePersistableRecord {
+    var id: Int64?
+    var name: String
+    var score: Int
+
+    // Update auto-incremented id upon successful insertion
+    mutating func didInsert(with rowID: Int64, for column: String?) {
+        id = rowID
+    }
+}
+
+

Persistence Methods

+ +

Record subclasses and types that adopt PersistableRecord are given default implementations for methods that insert, update, and delete:

+
// Instance methods
+try place.save(db)                     // INSERT or UPDATE
+try place.insert(db)                   // INSERT
+try place.update(db)                   // UPDATE
+try place.update(db, columns: ...)     // UPDATE
+try place.updateChanges(db, from: ...) // Maybe UPDATE
+try place.updateChanges(db) { ... }    // Maybe UPDATE
+try place.updateChanges(db)            // Maybe UPDATE (Record class only)
+try place.delete(db)                   // DELETE
+try place.exists(db)
+
+// Type methods
+try Place.updateAll(db, ...)               // UPDATE
+try Place.deleteAll(db)                    // DELETE
+try Place.deleteAll(db, keys:...)          // DELETE
+try Place.deleteOne(db, key:...)           // DELETE
+
+ +
    +
  • insert, update, save and delete can throw a DatabaseError.

  • +
  • update and updateChanges can also throw a PersistenceError, should the update fail because there is no matching row in the database.

    + +

    When saving an object that may or may not already exist in the database, prefer the save method:

  • +
  • updateAll performs a batch update. See Update Requests.

  • +
  • save makes sure your values are stored in the database.

    + +

    It performs an UPDATE if the record has a non-null primary key, and then, if no row was modified, an INSERT. It directly perfoms an INSERT if the record has no primary key, or a null primary key.

    + +

    Despite the fact that it may execute two SQL statements, save behaves as an atomic operation: GRDB won’t allow any concurrent thread to sneak in (see concurrency).

  • +
  • delete returns whether a database row was deleted or not.

  • +
+ +

All primary keys are supported, including composite primary keys that span several columns, and the implicit rowid primary key.

+

Customizing the Persistence Methods

+ +

Your custom type may want to perform extra work when the persistence methods are invoked.

+ +

For example, it may want to have its UUID automatically set before inserting. Or it may want to validate its values before saving.

+ +

When you subclass Record, you simply have to override the customized method, and call super:

+
class Player : Record {
+    var uuid: UUID?
+
+    override func insert(_ db: Database) throws {
+        if uuid == nil {
+            uuid = UUID()
+        }
+        try super.insert(db)
+    }
+}
+
+ +

If you use the raw PersistableRecord protocol, use one of the special methods performInsert, performUpdate, performSave, performDelete, or performExists:

+
struct Link : PersistableRecord {
+    var url: URL
+
+    func insert(_ db: Database) throws {
+        try validate()
+        try performInsert(db)
+    }
+
+    func update(_ db: Database, columns: Set<String>) throws {
+        try validate()
+        try performUpdate(db, columns: columns)
+    }
+
+    func validate() throws {
+        if url.host == nil {
+            throw ValidationError("url must be absolute.")
+        }
+    }
+}
+
+ +
+

:point_up: Note: the special methods performInsert, performUpdate, etc. are reserved for your custom implementations. Do not use them elsewhere. Do not provide another implementation for those methods.

+ +

:point_up: Note: it is recommended that you do not implement your own version of the save method. Its default implementation forwards the job to update or insert: these are the methods that may need customization, not save.

+
+

Codable Records

+ +

Record types that adopt an archival protocol (Codable, Encodable or Decodable) get free database support just by declaring conformance to the desired record protocols:

+
// Declare a record...
+struct Player: Codable, FetchableRecord, PersistableRecord {
+    var name: String
+    var score: Int
+}
+
+// ...and there you go:
+try dbQueue.write { db in
+    try Player(name: "Arthur", score: 100).insert(db)
+    let players = try Player.fetchAll(db)
+}
+
+ +

Codable records encode and decode their properties according to their own implementation of the Encodable and Decodable protocols. Yet databases have specific requirements:

+ +
    +
  • Properties are always coded according to their preferred database representation, when they have one (all values that adopt the DatabaseValueConvertible protocol).
  • +
  • You can customize the encoding and decoding of dates and uuids.
  • +
  • Complex properties (arrays, dictionaries, nested structs, etc.) are stored as JSON.
  • +
+ +

For more information about Codable records, see:

+ + + +
+

:bulb: Tip: see the Demo Application for a sample app that uses Codable records.

+
+

JSON Columns

+ +

When a Codable record contains a property that is not a simple value (Bool, Int, String, Date, Swift enums, etc.), that value is encoded and decoded as a JSON string. For example:

+
enum AchievementColor: String, Codable {
+    case bronze, silver, gold
+}
+
+struct Achievement: Codable {
+    var name: String
+    var color: AchievementColor
+}
+
+struct Player: Codable, FetchableRecord, PersistableRecord {
+    var name: String
+    var score: Int
+    var achievements: [Achievement] // stored in a JSON column
+}
+
+try! dbQueue.write { db in
+    // INSERT INTO player (name, score, achievements)
+    // VALUES (
+    //   'Arthur',
+    //   100,
+    //   '[{"color":"gold","name":"Use Codable Records"}]')
+    let achievement = Achievement(name: "Use Codable Records", color: .gold)
+    let player = Player(name: "Arthur", score: 100, achievements: [achievement])
+    try player.insert(db)
+}
+
+ +

GRDB uses the standard JSONDecoder and JSONEncoder from Foundation. By default, Data values are handled with the .base64 strategy, Date with the .millisecondsSince1970 strategy, and non conforming floats with the .throw strategy.

+ +

You can customize the JSON format by implementing those methods:

+
protocol FetchableRecord {
+    static func databaseJSONDecoder(for column: String) -> JSONDecoder
+}
+
+protocol EncodableRecord {
+    static func databaseJSONEncoder(for column: String) -> JSONEncoder
+}
+
+ +
+

:bulb: Tip: Make sure you set the JSONEncoder sortedKeys option, available from iOS 11.0+, macOS 10.13+, tvOS 9.0+ and watchOS 4.0+. This option makes sure that the JSON output is stable. This stability is required for Record Comparison to work as expected, and database observation tools such as ValueObservation to accurately recognize changed records.

+
+

Date and UUID Coding Strategies

+ +

By default, Codable Records encode and decode their Date and UUID properties as described in the general Date and DateComponents and UUID chapters.

+ +

To sum up: dates encode themselves in the “YYYY-MM-DD HH:MM:SS.SSS” format, in the UTC time zone, and decode a variety of date formats and timestamps. UUIDs encode themselves as 16-bytes data blobs, and decode both 16-bytes data blobs and strings such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”.

+ +

Those behaviors can be overridden:

+
protocol FetchableRecord {
+    static var databaseDateDecodingStrategy: DatabaseDateDecodingStrategy { get }
+}
+
+protocol EncodableRecord {
+    static var databaseDateEncodingStrategy: DatabaseDateEncodingStrategy { get }
+    static var databaseUUIDEncodingStrategy: DatabaseUUIDEncodingStrategy { get }
+}
+
+ +

See DatabaseDateDecodingStrategy, DatabaseDateEncodingStrategy, and DatabaseUUIDEncodingStrategy to learn about all available strategies.

+ +
+

:point_up: Note: there is no customization of uuid decoding, because UUID can already decode all its encoded variants (16-bytes blobs, and uuid strings).

+
+

The userInfo Dictionary

+ +

Your Codable Records can be stored in the database, but they may also have other purposes. In this case, you may need to customize their implementations of Decodable.init(from:) and Encodable.encode(to:), depending on the context.

+ +

The standard way to provide such context is the userInfo dictionary. Implement those properties:

+
protocol FetchableRecord {
+    static var databaseDecodingUserInfo: [CodingUserInfoKey: Any] { get }
+}
+
+protocol EncodableRecord {
+    static var databaseEncodingUserInfo: [CodingUserInfoKey: Any] { get }
+}
+
+ +

For example, here is a Player type that customizes its decoding:

+
// A key that holds a decoder's name
+let decoderName = CodingUserInfoKey(rawValue: "decoderName")!
+
+struct Player: FetchableRecord, Decodable {
+    init(from decoder: Decoder) throws {
+        // Print the decoder name
+        let decoderName = decoder.userInfo[decoderName] as? String
+        print("Decoded from \(decoderName ?? "unknown decoder")")
+        ...
+    }
+}
+
+ +

You can have a specific decoding from JSON…

+
// prints "Decoded from JSON"
+let decoder = JSONDecoder()
+decoder.userInfo = [decoderName: "JSON"]
+let player = try decoder.decode(Player.self, from: jsonData)
+
+ +

… and another one from database rows:

+
extension Player: FetchableRecord {
+    static let databaseDecodingUserInfo: [CodingUserInfoKey: Any] = [decoderName: "database row"]
+}
+
+// prints "Decoded from database row"
+let player = try Player.fetchOne(db, ...)
+
+ +
+

:point_up: Note: make sure the databaseDecodingUserInfo and databaseEncodingUserInfo properties are explicitly declared as [CodingUserInfoKey: Any]. If they are not, the Swift compiler may silently miss the protocol requirement, resulting in sticky empty userInfo.

+
+

Tip: Derive Columns from Coding Keys

+ +

Codable types are granted with a CodingKeys enum. You can use them to safely define database columns:

+
struct Player: Codable {
+    var id: Int64
+    var name: String
+    var score: Int
+}
+
+extension Player: FetchableRecord, PersistableRecord {
+    enum Columns {
+        static let id = Column(CodingKeys.id)
+        static let name = Column(CodingKeys.name)
+        static let score = Column(CodingKeys.score)
+    }
+}
+
+ +

See the query interface and Good Practices for Designing Record Types for further information.

+

Record Class

+ +

Record is a class that is designed to be subclassed. It inherits its features from the FetchableRecord, TableRecord, and PersistableRecord protocols. On top of that, Record instances can compare against previous versions of themselves in order to avoid useless updates.

+ +

Record subclasses define their custom database relationship by overriding database methods. For example:

+
class Place: Record {
+    var id: Int64?
+    var title: String
+    var isFavorite: Bool
+    var coordinate: CLLocationCoordinate2D
+
+    init(id: Int64?, title: String, isFavorite: Bool, coordinate: CLLocationCoordinate2D) {
+        self.id = id
+        self.title = title
+        self.isFavorite = isFavorite
+        self.coordinate = coordinate
+        super.init()
+    }
+
+    /// The table name
+    override class var databaseTableName: String {
+        return "place"
+    }
+
+    /// The table columns
+    enum Columns: String, ColumnExpression {
+        case id, title, favorite, latitude, longitude
+    }
+
+    /// Creates a record from a database row
+    required init(row: Row) {
+        id = row[Columns.id]
+        title = row[Columns.title]
+        isFavorite = row[Columns.favorite]
+        coordinate = CLLocationCoordinate2D(
+            latitude: row[Columns.latitude],
+            longitude: row[Columns.longitude])
+        super.init(row: row)
+    }
+
+    /// The values persisted in the database
+    override func encode(to container: inout PersistenceContainer) {
+        container[Columns.id] = id
+        container[Columns.title] = title
+        container[Columns.favorite] = isFavorite
+        container[Columns.latitude] = coordinate.latitude
+        container[Columns.longitude] = coordinate.longitude
+    }
+
+    /// Update record ID after a successful insertion
+    override func didInsert(with rowID: Int64, for column: String?) {
+        id = rowID
+    }
+}
+
+

Record Comparison

+ +

Records that adopt the EncodableRecord protocol can compare against other records, or against previous versions of themselves.

+ +

This helps avoiding costly UPDATE statements when a record has not been edited.

+ + +

The updateChanges Methods

+ +

The updateChanges methods perform a database update of the changed columns only (and does nothing if record has no change).

+ +
    +
  • updateChanges(_:from:)

    + +

    This method lets you compare two records:

    +
    if let oldPlayer = try Player.fetchOne(db, key: 42) {
    +    var newPlayer = oldPlayer
    +    newPlayer.score = 100
    +    if try newPlayer.updateChanges(db, from: oldPlayer) {
    +        print("player was modified, and updated in the database")
    +    } else {
    +        print("player was not modified, and database was not hit")
    +    }
    +}
    +
  • +
  • updateChanges(_:with:)

    + +

    This method lets you update a record in place:

    +
    if var player = try Player.fetchOne(db, key: 42) {
    +    let modified = try player.updateChanges(db) {
    +        $0.score = 100
    +    }
    +    if modified {
    +        print("player was modified, and updated in the database")
    +    } else {
    +        print("player was not modified, and database was not hit")
    +    }
    +}
    +
  • +
  • updateChanges(_:) (Record class only)

    + +

    Instances of the Record class are able to compare against themselves, and know if they have changes that have not been saved since the last fetch or saving:

    +
    // Record class only
    +if let player = try Player.fetchOne(db, key: 42) {
    +    player.score = 100
    +    if try player.updateChanges(db) {
    +        print("player was modified, and updated in the database")
    +    } else {
    +        print("player was not modified, and database was not hit")
    +    }
    +}
    +
  • +
+

The databaseEquals Method

+ +

This method returns whether two records have the same database representation:

+
let oldPlayer: Player = ...
+var newPlayer: Player = ...
+if newPlayer.databaseEquals(oldPlayer) == false {
+    try newPlayer.save(db)
+}
+
+ +
+

:point_up: Note: The comparison is performed on the database representation of records. As long as your record type adopts the EncodableRecord protocol, you don’t need to care about Equatable.

+
+

The databaseChanges and hasDatabaseChanges Methods

+ +

databaseChanges(from:) returns a dictionary of differences between two records:

+
let oldPlayer = Player(id: 1, name: "Arthur", score: 100)
+let newPlayer = Player(id: 1, name: "Arthur", score: 1000)
+for (column, oldValue) in newPlayer.databaseChanges(from: oldPlayer) {
+    print("\(column) was \(oldValue)")
+}
+// prints "score was 100"
+
+ +

The Record class is able to compare against itself:

+
// Record class only
+let player = Player(id: 1, name: "Arthur", score: 100)
+try player.insert(db)
+player.score = 1000
+for (column, oldValue) in player.databaseChanges {
+    print("\(column) was \(oldValue)")
+}
+// prints "score was 100"
+
+ +

Record instances also have a hasDatabaseChanges property:

+
// Record class only
+player.score = 1000
+if player.hasDatabaseChanges {
+    try player.save(db)
+}
+
+ +

Record.hasDatabaseChanges is false after a Record instance has been fetched or saved into the database. Subsequent modifications may set it, or not: hasDatabaseChanges is based on value comparison. Setting a property to the same value does not set the changed flag:

+
let player = Player(name: "Barbara", score: 750)
+player.hasDatabaseChanges // true
+
+try player.insert(db)
+player.hasDatabaseChanges // false
+
+player.name = "Barbara"
+player.hasDatabaseChanges // false
+
+player.score = 1000
+player.hasDatabaseChanges // true
+player.databaseChanges    // ["score": 750]
+
+ +

For an efficient algorithm which synchronizes the content of a database table with a JSON payload, check JSONSynchronization.playground.

+

Record Customization Options

+ +

GRDB records come with many default behaviors, that are designed to fit most situations. Many of those defaults can be customized for your specific needs:

+ + + +

Codable Records have a few extra options:

+ + +

Conflict Resolution

+ +

Insertions and updates can create conflicts: for example, a query may attempt to insert a duplicate row that violates a unique index.

+ +

Those conflicts normally end with an error. Yet SQLite let you alter the default behavior, and handle conflicts with specific policies. For example, the INSERT OR REPLACE statement handles conflicts with the “replace” policy which replaces the conflicting row instead of throwing an error.

+ +

The five different policies are: abort (the default), replace, rollback, fail, and ignore.

+ +

SQLite let you specify conflict policies at two different places:

+ +
    +
  • In the definition of the database table:

    +
    // CREATE TABLE player (
    +//     id INTEGER PRIMARY KEY AUTOINCREMENT,
    +//     email TEXT UNIQUE ON CONFLICT REPLACE
    +// )
    +try db.create(table: "player") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("email", .text).unique(onConflict: .replace) // <--
    +}
    +
    +// Despite the unique index on email, both inserts succeed.
    +// The second insert replaces the first row:
    +try db.execute(sql: "INSERT INTO player (email) VALUES (?)", arguments: ["arthur@example.com"])
    +try db.execute(sql: "INSERT INTO player (email) VALUES (?)", arguments: ["arthur@example.com"])
    +
  • +
  • In each modification query:

    +
    // CREATE TABLE player (
    +//     id INTEGER PRIMARY KEY AUTOINCREMENT,
    +//     email TEXT UNIQUE
    +// )
    +try db.create(table: "player") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("email", .text).unique()
    +}
    +
    +// Again, despite the unique index on email, both inserts succeed.
    +try db.execute(sql: "INSERT OR REPLACE INTO player (email) VALUES (?)", arguments: ["arthur@example.com"])
    +try db.execute(sql: "INSERT OR REPLACE INTO player (email) VALUES (?)", arguments: ["arthur@example.com"])
    +
  • +
+ +

When you want to handle conflicts at the query level, specify a custom persistenceConflictPolicy in your type that adopts the PersistableRecord protocol. It will alter the INSERT and UPDATE queries run by the insert, update and save persistence methods:

+
protocol MutablePersistableRecord {
+    /// The policy that handles SQLite conflicts when records are
+    /// inserted or updated.
+    ///
+    /// This property is optional: its default value uses the ABORT
+    /// policy for both insertions and updates, so that GRDB generate
+    /// regular INSERT and UPDATE queries.
+    static var persistenceConflictPolicy: PersistenceConflictPolicy { get }
+}
+
+struct Player : MutablePersistableRecord {
+    static let persistenceConflictPolicy = PersistenceConflictPolicy(
+        insert: .replace,
+        update: .replace)
+}
+
+// INSERT OR REPLACE INTO player (...) VALUES (...)
+try player.insert(db)
+
+ +
+

:point_up: Note: the ignore policy does not play well at all with the didInsert method which notifies the rowID of inserted records. Choose your poison:

+ +
    +
  • if you specify the ignore policy in the database table definition, don’t implement the didInsert method: it will be called with some random id in case of failed insert.
  • +
  • if you specify the ignore policy at the query level, the didInsert method is never called.
  • +
+ +

:point_up: Note: The replace policy may have to delete rows so that inserts and updates can succeed. Those deletions are not reported to transaction observers (this might change in a future release of SQLite).

+
+

The Implicit RowID Primary Key

+ +

All SQLite tables have a primary key. Even when the primary key is not explicit:

+
// No explicit primary key
+try db.create(table: "event") { t in
+    t.column("message", .text)
+    t.column("date", .datetime)
+}
+
+// No way to define an explicit primary key
+try db.create(virtualTable: "book", using: FTS4()) { t in
+    t.column("title")
+    t.column("author")
+    t.column("body")
+}
+
+ +

The implicit primary key is stored in the hidden column rowid. Hidden means that SELECT * does not select it, and yet it can be selected and queried: SELECT *, rowid ... WHERE rowid = 1.

+ +

Some GRDB methods will automatically use this hidden column when a table has no explicit primary key:

+
// SELECT * FROM event WHERE rowid = 1
+let event = try Event.fetchOne(db, key: 1)
+
+// DELETE FROM book WHERE rowid = 1
+try Book.deleteOne(db, key: 1)
+
+

Exposing the RowID Column

+ +

By default, a record type that wraps a table without any explicit primary key doesn’t know about the hidden rowid column.

+ +

Without primary key, records don’t have any identity, and the persistence method can behave in undesired fashion: update() throws errors, save() always performs insertions and may break constraints, exists() is always false.

+ +

When SQLite won’t let you provide an explicit primary key (as in full-text tables, for example), you may want to make your record type fully aware of the hidden rowid column:

+ +
    +
  1. Have the databaseSelection static property (from the TableRecord protocol) return the hidden rowid column:

    +
    struct Event : TableRecord {
    +    static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID]
    +}
    +
    +// When you subclass Record, you need an override:
    +class Book : Record {
    +    override class var databaseSelection: [SQLSelectable] {
    +        return [AllColums(), Column.rowID]
    +    }
    +}
    +
    + +

    GRDB will then select the rowid column by default:

    +
    // SELECT *, rowid FROM event
    +let events = try Event.fetchAll(db)
    +
  2. +
  3. Have init(row:) from the FetchableRecord protocol consume the “rowid” column:

    +
    struct Event : FetchableRecord {
    +    var id: Int64?
    +
    +    init(row: Row) {
    +        id = row[Column.rowID]
    +    }
    +}
    +
    + +

    Your fetched records will then know their ids:

    +
    let event = try Event.fetchOne(db)!
    +event.id // some value
    +
  4. +
  5. Encode the rowid in encode(to:), and keep it in the didInsert(with:for:) method (both from the PersistableRecord and MutablePersistableRecord protocols):

    +
    struct Event : MutablePersistableRecord {
    +    var id: Int64?
    +
    +    func encode(to container: inout PersistenceContainer) {
    +        container[Column.rowID] = id
    +        container["message"] = message
    +        container["date"] = date
    +    }
    +
    +    // Update auto-incremented id upon successful insertion
    +    mutating func didInsert(with rowID: Int64, for column: String?) {
    +        id = rowID
    +    }
    +}
    +
    + +

    You will then be able to track your record ids, update them, or check for their existence:

    +
    let event = Event(message: "foo", date: Date())
    +
    +// Insertion sets the record id:
    +try event.insert(db)
    +event.id // some value
    +
    +// Record can be updated:
    +event.message = "bar"
    +try event.update(db)
    +
    +// Record knows if it exists:
    +event.exists(db) // true
    +
  6. +
+

Beyond FetchableRecord

+ +

Some GRDB users eventually discover that the FetchableRecord protocol does not fit all situations. Use cases that are not well handled by FetchableRecord include:

+ +
    +
  • Your application needs polymorphic row decoding: it decodes some type or another, depending on the values contained in a database row.

  • +
  • Your application needs to decode rows with a context: each decoded value should be initialized with some extra value that does not come from the database.

  • +
  • Your application needs a record type that supports untrusted databases, and may fail at decoding database rows (throw an error when a row contains invalid values).

  • +
+ +

Since those use cases are not well handled by FetchableRecord, don’t try to implement them on top of this protocol: you’ll just fight the framework.

+ +

Instead, please have a look at the CustomizedDecodingOfDatabaseRows playground. You’ll run some sample code, and learn how to escape FetchableRecord when you need. And remember that leaving FetchableRecord will not deprive you of query interface requests and generally all SQL generation features of the TableRecord and PersistableRecord protocols.

+

Examples of Record Definitions

+ +

We will show below how to declare a record type for the following database table:

+
try dbQueue.write { db in
+    try db.create(table: "place") { t in
+        t.autoIncrementedPrimaryKey("id")
+        t.column("title", .text).notNull()
+        t.column("isFavorite", .boolean).notNull().defaults(to: false)
+        t.column("longitude", .double).notNull()
+        t.column("latitude", .double).notNull()
+    }
+}
+
+ +

Each one of the three examples below is correct. You will pick one or the other depending on your personal preferences and the requirements of your application:

+ +
+ Define a Codable struct, and adopt the record protocols you need + +This is the shortest way to define a record type. + +See the [Record Protocols Overview](#record-protocols-overview), and [Codable Records] for more information. + +“`swift +struct Place: Codable { + var id: Int64? + var title: String + var isFavorite: Bool + private var latitude: CLLocationDegrees + private var longitude: CLLocationDegrees + + var coordinate: CLLocationCoordinate2D { + get { + return CLLocationCoordinate2D( + latitude: latitude, + longitude: longitude) + } + set { + latitude = newValue.latitude + longitude = newValue.longitude + } + } +} + +// SQL generation +extension Place: TableRecord { + /// The table columns + enum Columns { + static let id = Column(CodingKeys.id) + static let title = Column(CodingKeys.title) + static let isFavorite = Column(CodingKeys.isFavorite) + static let latitude = Column(CodingKeys.latitude) + static let longitude = Column(CodingKeys.longitude) + } +} + +// Fetching methods +extension Place: FetchableRecord { } + +// Persistence methods +extension Place: MutablePersistableRecord { + // Update auto-incremented id upon successful insertion + mutating func didInsert(with rowID: Int64, for column: String?) { + id = rowID + } +} +”` + +
+ +
+ Define a plain struct, and adopt the record protocols you need + +See the [Record Protocols Overview](#record-protocols-overview) for more information. + +“`swift +struct Place { + var id: Int64? + var title: String + var isFavorite: Bool + var coordinate: CLLocationCoordinate2D +} + +// SQL generation +extension Place: TableRecord { + /// The table columns + enum Columns: String, ColumnExpression { + case id, title, isFavorite, latitude, longitude + } +} + +// Fetching methods +extension Place: FetchableRecord { + /// Creates a record from a database row + init(row: Row) { + id = row[Columns.id] + title = row[Columns.title] + isFavorite = row[Columns.isFavorite] + coordinate = CLLocationCoordinate2D( + latitude: row[Columns.latitude], + longitude: row[Columns.longitude]) + } +} + +// Persistence methods +extension Place: MutablePersistableRecord { + /// The values persisted in the database + func encode(to container: inout PersistenceContainer) { + container[Columns.id] = id + container[Columns.title] = title + container[Columns.isFavorite] = isFavorite + container[Columns.latitude] = coordinate.latitude + container[Columns.longitude] = coordinate.longitude + } + + // Update auto-incremented id upon successful insertion + mutating func didInsert(with rowID: Int64, for column: String?) { + id = rowID + } +} +”` + +
+ +
+ Define a plain struct optimized for fetching performance + +This struct derives is persistence methpds from the standard Encodable protocol (see [Codable Records]), but performs optimized row decoding by accessing database columns with numeric indexes. + +See the [Record Protocols Overview](#record-protocols-overview) for more information. + +“`swift +struct Place: Encodable { + var id: Int64? + var title: String + var isFavorite: Bool + private var latitude: CLLocationDegrees + private var longitude: CLLocationDegrees + + var coordinate: CLLocationCoordinate2D { + get { + return CLLocationCoordinate2D( + latitude: latitude, + longitude: longitude) + } + set { + latitude = newValue.latitude + longitude = newValue.longitude + } + } +} + +// SQL generation +extension Place: TableRecord { + /// The table columns + enum Columns { + static let id = Column(CodingKeys.id) + static let title = Column(CodingKeys.title) + static let isFavorite = Column(CodingKeys.isFavorite) + static let latitude = Column(CodingKeys.latitude) + static let longitude = Column(CodingKeys.longitude) + } + + /// Arrange the selected columns and lock their order + static let databaseSelection: [SQLSelectable] = [ + Columns.id, + Columns.title, + Columns.favorite, + Columns.latitude, + Columns.longitude] +} + +// Fetching methods +extension Place: FetchableRecord { + /// Creates a record from a database row + init(row: Row) { + // For high performance, use numeric indexes that match the + // order of Place.databaseSelection + id = row[0] + title = row[1] + isFavorite = row[2] + coordinate = CLLocationCoordinate2D( + latitude: row[3], + longitude: row[4]) + } +} + +// Persistence methods +extension Place: MutablePersistableRecord { + // Update auto-incremented id upon successful insertion + mutating func didInsert(with rowID: Int64, for column: String?) { + id = rowID + } +} +”` + +
+ +
+ Subclass the Record class + +See the [Record class](#record-class) for more information. + +“`swift +class Place: Record { + var id: Int64? + var title: String + var isFavorite: Bool + var coordinate: CLLocationCoordinate2D + + init(id: Int64?, title: String, isFavorite: Bool, coordinate: CLLocationCoordinate2D) { + self.id = id + self.title = title + self.isFavorite = isFavorite + self.coordinate = coordinate + super.init() + } + + /// The table name + override class var databaseTableName: String { + return "place” + } + + /// The table columns + enum Columns: String, ColumnExpression { + case id, title, isFavorite, latitude, longitude + } + + /// Creates a record from a database row + required init(row: Row) { + id = row[Columns.id] + title = row[Columns.title] + isFavorite = row[Columns.isFavorite] + coordinate = CLLocationCoordinate2D( + latitude: row[Columns.latitude], + longitude: row[Columns.longitude]) + super.init(row: row) + } + + /// The values persisted in the database + override func encode(to container: inout PersistenceContainer) { + container[Columns.id] = id + container[Columns.title] = title + container[Columns.isFavorite] = isFavorite + container[Columns.latitude] = coordinate.latitude + container[Columns.longitude] = coordinate.longitude + } + + // Update auto-incremented id upon successful insertion + override func didInsert(with rowID: Int64, for column: String?) { + id = rowID + } +} +“` + +
+

List of Record Methods

+ +

This is the list of record methods, along with their required protocols. The Record class adopts all these protocols, and adds a few extra methods.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodProtocolsNotes
Core Methods
init(row:)FetchableRecord
Type.databaseTableNameTableRecord
Type.databaseSelectionTableRecord*
Type.persistenceConflictPolicyPersistableRecord*
record.encode(to:)EncodableRecord
record.didInsert(with:for:)PersistableRecord
Insert and Update Records
record.insert(db)PersistableRecord
record.save(db)PersistableRecord
record.update(db)PersistableRecord
record.update(db, columns:...)PersistableRecord
record.updateChanges(db, from:...)PersistableRecord*
record.updateChanges(db) { ... }PersistableRecord*
record.updateChanges(db)Record*
Type.updateAll(db, ...)PersistableRecord
Type.filter(...).updateAll(db, ...)PersistableRecord²
Delete Records
record.delete(db)PersistableRecord
Type.deleteOne(db, key:...)PersistableRecord¹
Type.deleteAll(db)PersistableRecord
Type.deleteAll(db, keys:...)PersistableRecord¹
Type.filter(...).deleteAll(db)PersistableRecord²
Check Record Existence
record.exists(db)PersistableRecord
Convert Record to Dictionary
record.databaseDictionaryEncodableRecord
Count Records
Type.fetchCount(db)TableRecord
Type.filter(...).fetchCount(db)TableRecord²
Fetch Record Cursors
Type.fetchCursor(db)FetchableRecord & TableRecord
Type.fetchCursor(db, keys:...)FetchableRecord & TableRecord¹
Type.fetchCursor(db, sql: sql)FetchableRecord³
Type.fetchCursor(statement)FetchableRecord⁴
Type.filter(...).fetchCursor(db)FetchableRecord & TableRecord²
Fetch Record Arrays
Type.fetchAll(db)FetchableRecord & TableRecord
Type.fetchAll(db, keys:...)FetchableRecord & TableRecord¹
Type.fetchAll(db, sql: sql)FetchableRecord³
Type.fetchAll(statement)FetchableRecord⁴
Type.filter(...).fetchAll(db)FetchableRecord & TableRecord²
Fetch Individual Records
Type.fetchOne(db)FetchableRecord & TableRecord
Type.fetchOne(db, key:...)FetchableRecord & TableRecord¹
Type.fetchOne(db, sql: sql)FetchableRecord³
Type.fetchOne(statement)FetchableRecord⁴
Type.filter(...).fetchOne(db)FetchableRecord & TableRecord²
Codable Records
Type.databaseDecodingUserInfoFetchableRecord*
Type.databaseJSONDecoder(for:)FetchableRecord*
Type.databaseDateDecodingStrategyFetchableRecord*
Type.databaseEncodingUserInfoEncodableRecord*
Type.databaseJSONEncoder(for:)EncodableRecord*
Type.databaseDateEncodingStrategyEncodableRecord*
Type.databaseUUIDEncodingStrategyEncodableRecord*
Define Associations
Type.belongsTo(...)TableRecord*
Type.hasMany(...)TableRecord*
Type.hasOne(...)TableRecord*
Type.hasManyThrough(...)TableRecord*
Type.hasOneThrough(...)TableRecord*
Building Query Interface Requests
record.request(for:...)TableRecord & EncodableRecord*
Type.all()TableRecord²
Type.none()TableRecord²
Type.select(...)TableRecord²
Type.select(..., as:...)TableRecord²
Type.annotated(with:...)TableRecord²
Type.filter(...)TableRecord²
Type.matching(...)TableRecord²
Type.including(all:)TableRecord²
Type.including(optional:)TableRecord²
Type.including(required:)TableRecord²
Type.joining(optional:)TableRecord²
Type.joining(required:)TableRecord²
Type.order(...)TableRecord²
Type.orderByPrimaryKey()TableRecord²
Type.having(...)TableRecord²
Type.limit(...)TableRecord²
Record Comparison
record.databaseEquals(...)EncodableRecord
record.databaseChanges(from:...)EncodableRecord
record.updateChanges(db, from:...)PersistableRecord
record.updateChanges(db) { ... }PersistableRecord
record.hasDatabaseChangesRecord
record.databaseChangesRecord
record.updateChanges(db)Record
+ +

¹ All unique keys are supported: primary keys (single-column, composite, implicit RowID) and unique indexes:

+
try Player.fetchOne(db, key: 1)                               // Player?
+try Player.fetchOne(db, key: ["email": "arthur@example.com"]) // Player?
+try Country.fetchAll(db, keys: ["FR", "US"])                  // [Country]
+
+ +

² See Fetch Requests:

+
let request = Player.filter(emailColumn != nil).order(nameColumn)
+let players = try request.fetchAll(db)  // [Player]
+let count = try request.fetchCount(db)  // Int
+
+ +

³ See SQL queries:

+
let player = try Player.fetchOne(db, sql: "SELECT * FROM player WHERE id = ?", arguments: [1]) // Player?
+
+ +

⁴ See Prepared Statements:

+
let statement = try db.makeSelectStatement(sql: "SELECT * FROM player WHERE id = ?")
+let player = try Player.fetchOne(statement, arguments: [1])  // Player?
+
+

The Query Interface

+ +

The query interface lets you write pure Swift instead of SQL:

+
try dbQueue.write { db in
+    // Update database schema
+    try db.create(table: "wine") { t in ... }
+
+    // Fetch records
+    let wines = try Wine
+        .filter(originColumn == "Burgundy")
+        .order(priceColumn)
+        .fetchAll(db)
+
+    // Count
+    let count = try Wine
+        .filter(colorColumn == Color.red)
+        .fetchCount(db)
+
+    // Update
+    try Wine
+        .filter(originColumn == "Burgundy")
+        .updateAll(db, priceColumn *= 0.75)
+
+    // Delete
+    try Wine
+        .filter(corkedColumn == true)
+        .deleteAll(db)
+}
+
+ +

You need to open a database connection before you can query the database.

+ +

Please bear in mind that the query interface can not generate all possible SQL queries. You may also prefer writing SQL, and this is just OK. From little snippets to full queries, your SQL skills are welcome:

+
try dbQueue.write { db in
+    // Update database schema (with SQL)
+    try db.execute(sql: "CREATE TABLE wine (...)")
+
+    // Fetch records (with SQL)
+    let wines = try Wine.fetchAll(db,
+        sql: "SELECT * FROM wine WHERE origin = ? ORDER BY price",
+        arguments: ["Burgundy"])
+
+    // Count (with an SQL snippet)
+    let count = try Wine
+        .filter(sql: "color = ?", arguments: [Color.red])
+        .fetchCount(db)
+
+    // Update (with SQL)
+    try db.execute(sql: "UPDATE wine SET price = price * 0.75 WHERE origin = 'Burgundy'")
+
+    // Delete (with SQL)
+    try db.execute(sql: "DELETE FROM wine WHERE corked")
+}
+
+ +

So don’t miss the SQL API.

+ +
+

:point_up: Note: the generated SQL may change between GRDB releases, without notice: don’t have your application rely on any specific SQL output.

+
+ + +

Database Schema

+ +

Once granted with a database connection, you can setup your database schema without writing SQL:

+ + +

Create Tables

+
// CREATE TABLE place (
+//   id INTEGER PRIMARY KEY AUTOINCREMENT,
+//   title TEXT,
+//   favorite BOOLEAN NOT NULL DEFAULT 0,
+//   latitude DOUBLE NOT NULL,
+//   longitude DOUBLE NOT NULL
+// )
+try db.create(table: "place") { t in
+    t.autoIncrementedPrimaryKey("id")
+    t.column("title", .text)
+    t.column("favorite", .boolean).notNull().defaults(to: false)
+    t.column("longitude", .double).notNull()
+    t.column("latitude", .double).notNull()
+}
+
+ +

The create(table:) method covers nearly all SQLite table creation features. For virtual tables, see Full-Text Search, or use raw SQL.

+ +

SQLite itself has many reference documents about table creation: CREATE TABLE, Datatypes In SQLite Version 3, SQLite Foreign Key Support, ON CONFLICT, The WITHOUT ROWID Optimization.

+ +

Configure table creation:

+
// CREATE TABLE example ( ... )
+try db.create(table: "example") { t in ... }
+
+// CREATE TEMPORARY TABLE example IF NOT EXISTS (
+try db.create(table: "example", temporary: true, ifNotExists: true) { t in ... }
+
+ +
+

:bulb: Tip: database table names should be singular, and camel-cased. Make them look like Swift identifiers: place, country, postalAddress, ‘httpRequest’.

+ +

This will help you using Associations when you need them. Database table names that follow another naming convention are totally OK, but you will need to perform extra configuration.

+
+ +

Add regular columns with their name and eventual type (text, integer, double, numeric, boolean, blob, date and datetime) - see SQLite data types:

+
// CREATE TABLE example (
+//   a,
+//   name TEXT,
+//   creationDate DATETIME,
+try db.create(table: "example") { t in
+    t.column("a")
+    t.column("name", .text)
+    t.column("creationDate", .datetime)
+
+ +

Define not null columns, and set default values:

+
    // email TEXT NOT NULL,
+    t.column("email", .text).notNull()
+
+    // name TEXT NOT NULL DEFAULT 'Anonymous',
+    t.column("name", .text).notNull().defaults(to: "Anonymous")
+
+ +

Use an individual column as primary, unique, or foreign key. When defining a foreign key, the referenced column is the primary key of the referenced table (unless you specify otherwise):

+
    // id INTEGER PRIMARY KEY AUTOINCREMENT,
+    t.autoIncrementedPrimaryKey("id")
+
+    // uuid TEXT PRIMARY KEY,
+    t.column("uuid", .text).primaryKey()
+
+    // email TEXT UNIQUE,
+    t.column("email", .text).unique()
+
+    // countryCode TEXT REFERENCES country(code) ON DELETE CASCADE,
+    t.column("countryCode", .text).references("country", onDelete: .cascade)
+
+ +
+

:bulb: Tip: when you need an integer primary key that automatically generates unique values, it is highly recommended that you use the autoIncrementedPrimaryKey method:

+
try db.create(table: "example") { t in
+    t.autoIncrementedPrimaryKey("id")
+    ...
+}
+
+ +

The reason for this recommendation is that auto-incremented primary keys prevent the reuse of ids. This prevents your app or database observation tools to think that a row was updated, when it was actually deleted, then replaced. Depending on your application needs, this may be acceptable. But usually it is not.

+
+ +

Create an index on the column:

+
    t.column("score", .integer).indexed()
+
+ +

For extra index options, see Create Indexes below.

+ +

Perform integrity checks on individual columns, and SQLite will only let conforming rows in. In the example below, the $0 closure variable is a column which lets you build any SQL expression.

+
    // name TEXT CHECK (LENGTH(name) > 0)
+    // score INTEGER CHECK (score > 0)
+    t.column("name", .text).check { length($0) > 0 }
+    t.column("score", .integer).check(sql: "score > 0")
+
+ +

Other table constraints can involve several columns:

+
    // PRIMARY KEY (a, b),
+    t.primaryKey(["a", "b"])
+
+    // UNIQUE (a, b) ON CONFLICT REPLACE,
+    t.uniqueKey(["a", "b"], onConfict: .replace)
+
+    // FOREIGN KEY (a, b) REFERENCES parents(c, d),
+    t.foreignKey(["a", "b"], references: "parents")
+
+    // CHECK (a + b < 10),
+    t.check(Column("a") + Column("b") < 10)
+
+    // CHECK (a + b < 10)
+    t.check(sql: "a + b < 10")
+}
+
+

Modify Tables

+ +

SQLite lets you rename tables, and add columns to existing tables:

+
// ALTER TABLE referer RENAME TO referrer
+try db.rename(table: "referer", to: "referrer")
+
+// ALTER TABLE player ADD COLUMN url TEXT
+try db.alter(table: "player") { t in
+    t.add(column: "url", .text)
+}
+
+ +
+

:point_up: Note: SQLite restricts the possible table alterations, and may require you to recreate dependent triggers or views. See the documentation of the ALTER TABLE for details. See Advanced Database Schema Changes for a way to lift restrictions.

+
+

Drop Tables

+ +

Drop tables with the drop(table:) method:

+
try db.drop(table: "obsolete")
+
+

Create Indexes

+ +

Create indexes with the create(index:) method:

+
// CREATE UNIQUE INDEX byEmail ON users(email)
+try db.create(index: "byEmail", on: "users", columns: ["email"], unique: true)
+
+ +

Relevant SQLite documentation:

+ + +

Requests

+ +

The query interface requests let you fetch values from the database:

+
let request = Player.filter(emailColumn != nil).order(nameColumn)
+let players = try request.fetchAll(db)  // [Player]
+let count = try request.fetchCount(db)  // Int
+
+ +

All requests start from a type that adopts the TableRecord protocol, such as a Record subclass (see Records):

+
class Player : Record { ... }
+
+ +

Declare the table columns that you want to use for filtering, or sorting:

+
let idColumn = Column("id")
+let nameColumn = Column("name")
+
+ +

You can also declare column enums, if you prefer:

+
// Columns.id and Columns.name can be used just as
+// idColumn and nameColumn declared above.
+enum Columns: String, ColumnExpression {
+    case id
+    case name
+}
+
+ +

You can now build requests with the following methods: all, none, select, distinct, filter, matching, group, having, order, reversed, limit, joining, including. All those methods return another request, which you can further refine by applying another method: Player.select(...).filter(...).order(...).

+ +
    +
  • all(), none(): the requests for all rows, or no row.

    +
    // SELECT * FROM player
    +Player.all()
    +
    + +

    By default, all columns are selected. See Columns Selected by a Request.

  • +
  • select(...) and select(..., as:) define the selected columns. See Columns Selected by a Request.

    +
    // SELECT name FROM player
    +Player.select(nameColumn, as: String.self)
    +
  • +
  • annotated(with: expression...) extends the selection.

    +
    // SELECT *, (score + bonus) AS total FROM player
    +Player.annotated(with: (scoreColumn + bonusColumn).forKey("total"))
    +
    + +

    Such annotations can help using Associations:

    +
    // SELECT player.*, team.name
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let teamAlias = TableAlias()
    +let request = Player
    +    .annotated(with: teamAlias[nameColumn])
    +    .joining(required: Player.team.aliased(teamAlias))
    +
  • +
  • annotated(with: aggregate) extends the selection with association aggregates.

    +
    // SELECT team.*, COUNT(DISTINCT player.rowid) AS playerCount
    +// FROM team
    +// LEFT JOIN player ON player.teamId = team.id
    +// GROUP BY team.id
    +Team.annotated(with: Team.players.count)
    +
  • +
  • distinct() performs uniquing.

    +
    // SELECT DISTINCT name FROM player
    +Player.select(nameColumn, as: String.self).distinct()
    +
  • +
  • filter(expression) applies conditions.

    +
    // SELECT * FROM player WHERE id IN (1, 2, 3)
    +Player.filter([1,2,3].contains(idColumn))
    +
    +// SELECT * FROM player WHERE (name IS NOT NULL) AND (height > 1.75)
    +Player.filter(nameColumn != nil && heightColumn > 1.75)
    +
  • +
  • filter(key:) and filter(keys:) apply conditions on primary keys and unique keys:

    +
    // SELECT * FROM player WHERE id = 1
    +Player.filter(key: 1)
    +
    +// SELECT * FROM country WHERE isoCode IN ('FR', 'US')
    +Country.filter(keys: ["FR", "US"])
    +
    +// SELECT * FROM citizenship WHERE citizenId = 1 AND countryCode = 'FR'
    +Citizenship.filter(key: ["citizenId": 1, "countryCode": "FR"])
    +
    +// SELECT * FROM player WHERE email = 'arthur@example.com'
    +Player.filter(key: ["email": "arthur@example.com"])
    +
  • +
  • matching(pattern) performs full-text search.

    +
    // SELECT * FROM document WHERE document MATCH 'sqlite database'
    +let pattern = FTS3Pattern(matchingAllTokensIn: "SQLite database")
    +Document.matching(pattern)
    +
    + +

    When the pattern is nil, no row will match.

  • +
  • group(expression, ...) groups rows.

    +
    // SELECT name, MAX(score) FROM player GROUP BY name
    +Player
    +    .select(nameColumn, max(scoreColumn))
    +    .group(nameColumn)
    +
  • +
  • having(expression) applies conditions on grouped rows.

    +
    // SELECT team, MAX(score) FROM player GROUP BY team HAVING MIN(score) >= 1000
    +Player
    +    .select(teamColumn, max(scoreColumn))
    +    .group(teamColumn)
    +    .having(min(scoreColumn) >= 1000)
    +
  • +
  • having(aggregate) applies conditions on grouped rows, according to an association aggregate.

    +
    // SELECT team.*
    +// FROM team
    +// LEFT JOIN player ON player.teamId = team.id
    +// GROUP BY team.id
    +// HAVING COUNT(DISTINCT player.rowid) >= 5
    +Team.having(Team.players.count >= 5)
    +
  • +
  • order(ordering, ...) sorts.

    +
    // SELECT * FROM player ORDER BY name
    +Player.order(nameColumn)
    +
    +// SELECT * FROM player ORDER BY score DESC, name
    +Player.order(scoreColumn.desc, nameColumn)
    +
    + +

    SQLite considers NULL values to be smaller than any other values for sorting purposes. Hence, NULLs naturally appear at the beginning of an ascending ordering and at the end of a descending ordering. With a custom SQLite build, this can be changed using .ascNullsLast and .descNullsFirst:

    +
    // SELECT * FROM player ORDER BY score ASC NULLS LAST
    +Player.order(nameColumn.ascNullsLast)
    +
    + +

    Each order call clears any previous ordering:

    +
    // SELECT * FROM player ORDER BY name
    +Player.order(scoreColumn).order(nameColumn)
    +
  • +
  • orderByPrimaryKey() sorts by primary key:

    +
    // SELECT * FROM player ORDER BY id
    +Player.orderByPrimaryKey()
    +
    +// SELECT * FROM country ORDER BY code
    +Country.orderByPrimaryKey()
    +
    +// SELECT * FROM citizenship ORDER BY citizenId, countryCode
    +Citizenship.orderByPrimaryKey()
    +
  • +
  • reversed() reverses the eventual orderings.

    +
    // SELECT * FROM player ORDER BY score ASC, name DESC
    +Player.order(scoreColumn.desc, nameColumn).reversed()
    +
    + +

    If no ordering was already specified, this method has no effect:

    +
    // SELECT * FROM player
    +Player.all().reversed()
    +
  • +
  • limit(limit, offset: offset) limits and pages results.

    +
    // SELECT * FROM player LIMIT 5
    +Player.limit(5)
    +
    +// SELECT * FROM player LIMIT 5 OFFSET 10
    +Player.limit(5, offset: 10)
    +
  • +
  • joining(...) and including(...) fetch and join records through Associations.

    +
    // SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +Player.including(required: Player.team)
    +
  • +
+ +

You can refine requests by chaining those methods:

+
// SELECT * FROM player WHERE (email IS NOT NULL) ORDER BY name
+Player.order(nameColumn).filter(emailColumn != nil)
+
+ +

The select, order, group, and limit methods ignore and replace previously applied selection, orderings, grouping, and limits. On the opposite, filter, matching, and having methods extend the query:

+
Player                          // SELECT * FROM player
+    .filter(nameColumn != nil)  // WHERE (name IS NOT NULL)
+    .filter(emailColumn != nil) //        AND (email IS NOT NULL)
+    .order(nameColumn)          // - ignored -
+    .reversed()                 // - ignored -
+    .order(scoreColumn)         // ORDER BY score
+    .limit(20, offset: 40)      // - ignored -
+    .limit(10)                  // LIMIT 10
+
+ +

Raw SQL snippets are also accepted, with eventual arguments:

+
// SELECT DATE(creationDate), COUNT(*) FROM player WHERE name = 'Arthur' GROUP BY date(creationDate)
+Player
+    .select(sql: "DATE(creationDate), COUNT(*)")
+    .filter(sql: "name = ?", arguments: ["Arthur"])
+    .group(sql: "DATE(creationDate)")
+
+

Columns Selected by a Request

+ +

By default, query interface requests select all columns:

+
// SELECT * FROM player
+let request = Player.all()
+
+ +

The selection can be changed for each individual requests, or for all requests built from a given type.

+ +

The select(...) and select(..., as:) methods change the selection of a single request (see Fetching from Requests for detailed information):

+
let request = Player.select(max(scoreColumn))
+let maxScore: Int? = try Int.fetchOne(db, request)
+
+ +

The default selection for a record type is controlled by the databaseSelection property:

+
struct RestrictedPlayer : TableRecord {
+    static let databaseTableName = "player"
+    static let databaseSelection: [SQLSelectable] = [Column("id"), Column("name")]
+}
+
+struct ExtendedPlayer : TableRecord {
+    static let databaseTableName = "player"
+    static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID]
+}
+
+// SELECT id, name FROM player
+let request = RestrictedPlayer.all()
+
+// SELECT *, rowid FROM player
+let request = ExtendedPlayer.all()
+
+ +
+

:point_up: Note: make sure the databaseSelection property is explicitly declared as [SQLSelectable]. If it is not, the Swift compiler may silently miss the protocol requirement, resulting in sticky SELECT * requests. To verify your setup, see the How do I print a request as SQL? FAQ.

+
+

Expressions

+ +

Feed requests with SQL expressions built from your Swift code:

+

SQL Operators

+ +
    +
  • =, <>, <, <=, >, >=, IS, IS NOT

    + +

    Comparison operators are based on the Swift operators ==, !=, ===, !==, <, <=, >, >=:

    +
    // SELECT * FROM player WHERE (name = 'Arthur')
    +Player.filter(nameColumn == "Arthur")
    +
    +// SELECT * FROM player WHERE (name IS NULL)
    +Player.filter(nameColumn == nil)
    +
    +// SELECT * FROM player WHERE (score IS 1000)
    +Player.filter(scoreColumn === 1000)
    +
    +// SELECT * FROM rectangle WHERE width < height
    +Rectangle.filter(widthColumn < heightColumn)
    +
    + +
    +

    :point_up: Note: SQLite string comparison, by default, is case-sensitive and not Unicode-aware. See string comparison if you need more control.

    +
  • +
  • *, /, +, -

    + +

    SQLite arithmetic operators are derived from their Swift equivalent:

    +
    // SELECT ((temperature * 1.8) + 32) AS farenheit FROM planet
    +Planet.select((temperatureColumn * 1.8 + 32).forKey("farenheit"))
    +
    + +
    +

    :point_up: Note: an expression like nameColumn + "rrr" will be interpreted by SQLite as a numerical addition (with funny results), not as a string concatenation.

    +
  • +
  • AND, OR, NOT

    + +

    The SQL logical operators are derived from the Swift &&, || and !:

    +
    // SELECT * FROM player WHERE ((NOT verified) OR (score < 1000))
    +Player.filter(!verifiedColumn || scoreColumn < 1000)
    +
    + +

    When you want to join a sequence of expressions with AND or OR operators, use joined(operator:):

    +
    // SELECT * FROM player WHERE (verified AND (score >= 1000) AND (name IS NOT NULL))
    +let conditions = [
    +    verifiedColumn,
    +    scoreColumn >= 1000,
    +    nameColumn != nil]
    +Player.filter(conditions.joined(operator: .and))
    +
    + +

    When the sequence is empty, joined(operator: .and) returns true, and joined(operator: .or) returns false:

    +
    // SELECT * FROM player WHERE 1
    +Player.filter([].joined(operator: .and))
    +
    +// SELECT * FROM player WHERE 0
    +Player.filter([].joined(operator: .or))
    +
  • +
  • BETWEEN, IN, NOT IN

    + +

    To check inclusion in a Swift sequence (array, set, range…), call the contains method:

    +
    // SELECT * FROM player WHERE id IN (1, 2, 3)
    +Player.filter([1, 2, 3].contains(idColumn))
    +
    +// SELECT * FROM player WHERE id NOT IN (1, 2, 3)
    +Player.filter(![1, 2, 3].contains(idColumn))
    +
    +// SELECT * FROM player WHERE score BETWEEN 0 AND 1000
    +Player.filter((0...1000).contains(scoreColumn))
    +
    +// SELECT * FROM player WHERE (score >= 0) AND (score < 1000)
    +Player.filter((0..<1000).contains(scoreColumn))
    +
    +// SELECT * FROM player WHERE initial BETWEEN 'A' AND 'N'
    +Player.filter(("A"..."N").contains(initialColumn))
    +
    +// SELECT * FROM player WHERE (initial >= 'A') AND (initial < 'N')
    +Player.filter(("A"..<"N").contains(initialColumn))
    +
    + +
    +

    :point_up: Note: SQLite string comparison, by default, is case-sensitive and not Unicode-aware. See string comparison if you need more control.

    +
  • +
  • LIKE

    + +

    The SQLite LIKE operator is available as the like method:

    +
    // SELECT * FROM player WHERE (email LIKE '%@example.com')
    +Player.filter(emailColumn.like("%@example.com"))
    +
    + +
    +

    :point_up: Note: the SQLite LIKE operator is case-insensitive but not Unicode-aware. For example, the expression 'a' LIKE 'A' is true but 'æ' LIKE 'Æ' is false.

    +
  • +
  • MATCH

    + +

    The full-text MATCH operator is available through FTS3Pattern (for FTS3 and FTS4 tables) and FTS5Pattern (for FTS5):

    + +

    FTS3 and FTS4:

    +
    let pattern = FTS3Pattern(matchingAllTokensIn: "SQLite database")
    +
    +// SELECT * FROM document WHERE document MATCH 'sqlite database'
    +Document.matching(pattern)
    +
    +// SELECT * FROM document WHERE content MATCH 'sqlite database'
    +Document.filter(contentColumn.match(pattern))
    +
    + +

    FTS5:

    +
    let pattern = FTS5Pattern(matchingAllTokensIn: "SQLite database")
    +
    +// SELECT * FROM document WHERE document MATCH 'sqlite database'
    +Document.matching(pattern)
    +
  • +
+

SQL Functions

+ +
    +
  • ABS, AVG, COUNT, LENGTH, MAX, MIN, SUM:

    + +

    Those are based on the abs, average, count, length, max, min and sum Swift functions:

    +
    // SELECT MIN(score), MAX(score) FROM player
    +Player.select(min(scoreColumn), max(scoreColumn))
    +
    +// SELECT COUNT(name) FROM player
    +Player.select(count(nameColumn))
    +
    +// SELECT COUNT(DISTINCT name) FROM player
    +Player.select(count(distinct: nameColumn))
    +
  • +
  • IFNULL

    + +

    Use the Swift ?? operator:

    +
    // SELECT IFNULL(name, 'Anonymous') FROM player
    +Player.select(nameColumn ?? "Anonymous")
    +
    +// SELECT IFNULL(name, email) FROM player
    +Player.select(nameColumn ?? emailColumn)
    +
  • +
  • LOWER, UPPER

    + +

    The query interface does not give access to those SQLite functions. Nothing against them, but they are not unicode aware.

    + +

    Instead, GRDB extends SQLite with SQL functions that call the Swift built-in string functions capitalized, lowercased, uppercased, localizedCapitalized, localizedLowercased and localizedUppercased:

    +
    Player.select(nameColumn.uppercased())
    +
    + +
    +

    :point_up: Note: When comparing strings, you’d rather use a collation:

    +
    let name: String = ...
    +
    +// Not recommended
    +nameColumn.uppercased() == name.uppercased()
    +
    +// Better
    +nameColumn.collating(.caseInsensitiveCompare) == name
    +
    +
  • +
  • Custom SQL functions and aggregates

    + +

    You can apply your own custom SQL functions and aggregates:

    +
    let f = DatabaseFunction("f", ...)
    +
    +// SELECT f(name) FROM player
    +Player.select(f.apply(nameColumn))
    +
  • +
+

Fetching from Requests

+ +

Once you have a request, you can fetch the records at the origin of the request:

+
// Some request based on `Player`
+let request = Player.filter(...)... // QueryInterfaceRequest<Player>
+
+// Fetch players:
+try request.fetchCursor(db) // A Cursor of Player
+try request.fetchAll(db)    // [Player]
+try request.fetchOne(db)    // Player?
+
+ +

For example:

+
let allPlayers = try Player.fetchAll(db)                            // [Player]
+let arthur = try Player.filter(nameColumn == "Arthur").fetchOne(db) // Player?
+
+ +

See fetching methods for information about the fetchCursor, fetchAll and fetchOne methods.

+ +

You sometimes want to fetch other values.

+ +

The simplest way is to use the request as an argument to a fetching method of the desired type:

+
// Fetch an Int
+let request = Player.select(max(scoreColumn))
+let maxScore = try Int.fetchOne(db, request) // Int?
+
+// Fetch a Row
+let request = Player.select(min(scoreColumn), max(scoreColumn))
+let row = try Row.fetchOne(db, request)!     // Row
+let minScore = row[0] as Int?
+let maxScore = row[1] as Int?
+
+ +

You can also change the request so that it knows the type it has to fetch:

+ +
    +
  • With asRequest(of:), useful when you use Associations:

    +
    struct BookInfo: FetchableRecord, Decodable {
    +    var book: Book
    +    var author: Author
    +}
    +
    +// A request of BookInfo
    +let request = Book
    +    .including(required: Book.author)
    +    .asRequest(of: BookInfo.self)
    +
    +let bookInfos = try dbQueue.read { db in
    +    try request.fetchAll(db) // [BookInfo]
    +}
    +
  • +
  • With select(..., as:), which is handy when you change the selection:

    +
    // A request of Int
    +let request = Player.select(max(scoreColumn), as: Int.self)
    +
    +let maxScore = try dbQueue.read { db in
    +    try request.fetchOne(db) // Int?
    +}
    +
  • +
+

Fetching By Key

+ +

Fetching records according to their primary key is a very common task. It has a shortcut which accepts any single-column primary key:

+
// SELECT * FROM player WHERE id = 1
+try Player.fetchOne(db, key: 1)              // Player?
+
+// SELECT * FROM player WHERE id IN (1, 2, 3)
+try Player.fetchAll(db, keys: [1, 2, 3])     // [Player]
+
+// SELECT * FROM country WHERE isoCode = 'FR'
+try Country.fetchOne(db, key: "FR")          // Country?
+
+// SELECT * FROM country WHERE isoCode IN ('FR', 'US')
+try Country.fetchAll(db, keys: ["FR", "US"]) // [Country]
+
+ +

When the table has no explicit primary key, GRDB uses the hidden "rowid” column:

+
// SELECT * FROM document WHERE rowid = 1
+try Document.fetchOne(db, key: 1)            // Document?
+
+ +

For multiple-column primary keys and unique keys defined by unique indexes, provide a dictionary:

+
// SELECT * FROM citizenship WHERE citizenId = 1 AND countryCode = 'FR'
+try Citizenship.fetchOne(db, key: ["citizenId": 1, "countryCode": "FR"]) // Citizenship?
+
+// SELECT * FROM player WHERE email = 'arthur@example.com'
+try Player.fetchOne(db, key: ["email": "arthur@example.com"])              // Player?
+
+ +

When you want to build a request and plan to fetch from it later, use the filter(key:) and filter(keys:) methods:

+
// SELECT * FROM player WHERE id = 1
+let request = Player.filter(key: 1)
+let player = try request.fetchOne(db)    // Player?
+
+// SELECT * FROM player WHERE id IN (1, 2, 3)
+let request = Player.filter(keys: [1, 2, 3])
+let players = try request.fetchAll(db)   // [Player]
+
+// SELECT * FROM country WHERE isoCode = 'FR'
+let request = Country.filter(key: "FR")
+let country = try request.fetchOne(db)   // Country?
+
+// SELECT * FROM country WHERE isoCode IN ('FR', 'US')
+let request = Country.filter(keys: ["FR", "US"])
+let countries = try request.fetchAll(db) // [Country]
+
+// SELECT * FROM citizenship WHERE citizenId = 1 AND countryCode = 'FR'
+let request = Citizenship.filter(key: ["citizenId": 1, "countryCode": "FR"])
+let citizenship = request.fetchOne(db)   // Citizenship?
+
+// SELECT * FROM player WHERE email = 'arthur@example.com'
+let request = Player.filter(key: ["email": "arthur@example.com"])
+let player = try request.fetchOne(db)    // Player?
+
+

Fetching Aggregated Values

+ +

Requests can count. The fetchCount() method returns the number of rows that would be returned by a fetch request:

+
// SELECT COUNT(*) FROM player
+let count = try Player.fetchCount(db) // Int
+
+// SELECT COUNT(*) FROM player WHERE email IS NOT NULL
+let count = try Player.filter(emailColumn != nil).fetchCount(db)
+
+// SELECT COUNT(DISTINCT name) FROM player
+let count = try Player.select(nameColumn).distinct().fetchCount(db)
+
+// SELECT COUNT(*) FROM (SELECT DISTINCT name, score FROM player)
+let count = try Player.select(nameColumn, scoreColumn).distinct().fetchCount(db)
+
+ +

Other aggregated values can also be selected and fetched (see SQL Functions):

+
let request = Player.select(max(scoreColumn))
+let maxScore = try Int.fetchOne(db, request) // Int?
+
+let request = Player.select(min(scoreColumn), max(scoreColumn))
+let row = try Row.fetchOne(db, request)!     // Row
+let minScore = row[0] as Int?
+let maxScore = row[1] as Int?
+
+

Delete Requests

+ +

Requests can delete records, with the deleteAll() method:

+
// DELETE FROM player
+try Player.deleteAll(db)
+
+// DELETE FROM player WHERE team = 'red'
+try Player
+    .filter(teamColumn == "red")
+    .deleteAll(db)
+
+// DELETE FROM player ORDER BY score LIMIT 10
+try Player
+    .order(scoreColumn)
+    .limit(10)
+    .deleteAll(db)
+
+ +
+

:point_up: Note Deletion methods are only available for records that adopts the PersistableRecord protocol.

+
+ +

Deleting records according to their primary key is also quite common. It has a shortcut which accepts any single-column primary key:

+
// DELETE FROM player WHERE id = 1
+try Player.deleteOne(db, key: 1)
+
+// DELETE FROM player WHERE id IN (1, 2, 3)
+try Player.deleteAll(db, keys: [1, 2, 3])
+
+// DELETE FROM country WHERE isoCode = 'FR'
+try Country.deleteOne(db, key: "FR")
+
+// DELETE FROM country WHERE isoCode IN ('FR', 'US')
+try Country.deleteAll(db, keys: ["FR", "US"])
+
+ +

When the table has no explicit primary key, GRDB uses the hidden “rowid” column:

+
// DELETE FROM document WHERE rowid = 1
+try Document.deleteOne(db, key: 1)
+
+ +

For multiple-column primary keys and unique keys defined by unique indexes, provide a dictionary:

+
// DELETE FROM citizenship WHERE citizenId = 1 AND countryCode = 'FR'
+try Citizenship.deleteOne(db, key: ["citizenId": 1, "countryCode": "FR"])
+
+// DELETE FROM player WHERE email = 'arthur@example.com'
+Player.deleteOne(db, key: ["email": "arthur@example.com"])
+
+

Update Requests

+ +

Requests can batch update records. The updateAll() method accepts column assignments defined with the <- operator:

+
// UPDATE player SET score = 0, isHealthy = 1
+try Player.updateAll(db, scoreColumn <- 0, isHealthyColumn <- true)
+
+// UPDATE player SET score = 0 WHERE team = 'red'
+try Player
+    .filter(teamColumn == "red")
+    .updateAll(db, scoreColumn <- 0)
+
+// UPDATE player SET top = 1 ORDER BY score DESC LIMIT 10
+try Player
+    .order(scoreColumn.desc)
+    .limit(10)
+    .updateAll(db, topColumn <- true)
+
+ +

Column assignments accept any expression:

+
// UPDATE player SET score = score + (bonus * 2)
+try Player.updateAll(db, scoreColumn <- scoreColumn + bonusColumn * 2)
+
+ +

As a convenience, you can also use the +=, -=, *=, or /= operators:

+
// UPDATE player SET score = score + (bonus * 2)
+try Player.updateAll(db, scoreColumn += bonusColumn * 2)
+
+ +

Default Conflict Resolution rules apply, and you may also provide a specific one:

+
// UPDATE OR IGNORE player SET ...
+try Player.updateAll(db, onConflict: .ignore, /* assignments... */)
+
+ +
+

:point_up: Note The updateAll method is only available for records that adopts the PersistableRecord protocol.

+
+

Custom Requests

+ +

Until now, we have seen requests created from any type that adopts the TableRecord protocol:

+
let request = Player.all()  // QueryInterfaceRequest<Player>
+
+ +

Those requests of type QueryInterfaceRequest can fetch and count:

+
try request.fetchCursor(db) // A Cursor of Player
+try request.fetchAll(db)    // [Player]
+try request.fetchOne(db)    // Player?
+try request.fetchCount(db)  // Int
+
+ +

When the query interface can not generate the SQL you need, you can still fallback to raw SQL:

+
// Custom SQL is always welcome
+try Player.fetchAll(db, sql: "SELECT ...")   // [Player]
+
+ +

But you may prefer to bring some elegance back in, and build custom requests:

+
// No custom SQL in sight
+try Player.customRequest().fetchAll(db) // [Player]
+
+ + +

FetchRequest Protocol

+ +

FetchRequest is the protocol for all requests that run from a single select statement, and know how fetched rows should be interpreted:

+
protocol FetchRequest: DatabaseRegionConvertible {
+    /// The type that tells how fetched rows should be decoded
+    associatedtype RowDecoder
+
+    /// Returns a PreparedRequest made of a prepared statement that is ready to
+    /// be executed, and an eventual row adapter.
+    func makePreparedRequest(_ db: Database, forSingleResult singleResult: Bool) throws -> PreparedRequest
+
+    /// The number of rows fetched by the request.
+    func fetchCount(_ db: Database) throws -> Int
+}
+
+ +

When the RowDecoder associated type is Row, or a value, or a type that conforms to FetchableRecord, the request can fetch: see Fetching From Custom Requests below.

+ +

The makePreparedRequest(_:forSingleResult:) method accepts a database connection, a singleResult hint, and returns a “prepared request” made of a prepared statement and an optional row adapter. Conforming types can use the singleResult hint as an optimization opportunity, and return a statement that fetches at most one row, with a LIMIT SQL clause, when possible.

+ +

The fetchCount method has a default implementation that builds a correct but naive SQL query from the statement returned by prepare: SELECT COUNT(*) FROM (...). Adopting types can refine the counting SQL by customizing their fetchCount implementation.

+ +

The base DatabaseRegionConvertible protocol is involved in database observation. For more information, see DatabaseRegion, DatabaseRegionObservation, and ValueObservation.

+ +

The FetchRequest protocol is adopted, for example, by query interface requests:

+
// A FetchRequest whose RowDecoder associated type is Player:
+let request = Player.all()
+
+

Building Custom Requests

+ +

To build custom requests, you can use one of the built-in requests, derive requests from other requests, or create your own request type that adopts the FetchRequest protocol.

+ +
    +
  • SQLRequest is a fetch request built from raw SQL. For example:

    +
    extension Player {
    +    static func filter(color: Color) -> SQLRequest<Player> {
    +        return SQLRequest<Player>(
    +            sql: "SELECT * FROM player WHERE color = ?"
    +            arguments: [color])
    +    }
    +}
    +
    +// [Player]
    +try Player.filter(color: .red).fetchAll(db)
    +
    + +

    In Swift 5, you can build SQLRequest with SQL Interpolation:

    +
    // Swift 5
    +extension Player {
    +    static func filter(color: Color) -> SQLRequest<Player> {
    +        return "SELECT * FROM player WHERE color = \(color)"
    +    }
    +}
    +
  • +
  • The asRequest(of:) method changes the type fetched by the request. It is useful, for example, when you use Associations:

    +
    struct BookInfo: FetchableRecord, Decodable {
    +    var book: Book
    +    var author: Author
    +}
    +
    +let request = Book
    +    .including(required: Book.author)
    +    .asRequest(of: BookInfo.self)
    +
    +// [BookInfo]
    +try request.fetchAll(db)
    +
  • +
  • The adapted(_:) method eases the consumption of complex rows with row adapters. See Joined Queries Support for some sample code that uses this method.

  • +
  • AnyFetchRequest: a type-erased request.

  • +
+

Fetching From Custom Requests

+ +

A type adopting FetchRequest knows exactly what it has to do when its RowDecoder associated type can decode database rows (Row itself, values, or FetchableRecord):

+
let rowRequest = ...        // Some FetchRequest that fetches Row
+try request.fetchCursor(db) // A cursor of rows
+
+let playerRequest = ...     // Some FetchRequest that fetches Player
+try request.fetchAll(db)    // [Player]
+
+let intRequest = ...        // Some FetchRequest that fetches Int
+try request.fetchOne(db)    // Int?
+
+ +

For example:

+
let playerRequest = SQLRequest<Player>(
+    sql: "SELECT * FROM player WHERE color = ?"
+    arguments: [color])
+try request.fetchAll(db)    // [Player]
+
+ +

See fetching methods for information about the fetchCursor, fetchAll and fetchOne methods.

+ +

The RowDecoder type associated with the FetchRequest does not have to be Row, DatabaseValueConvertible, or FetchableRecord. See the Beyond FetchableRecord chapter for more information.

+

Migrations

+ +

Migrations are a convenient way to alter your database schema over time in a consistent and easy way.

+ +

Migrations run in order, once and only once. When a user upgrades your application, only non-applied migrations are run.

+ +

Inside each migration, you typically define and update your database tables according to your evolving application needs:

+
var migrator = DatabaseMigrator()
+
+// 1st migration
+migrator.registerMigration("v1") { db in
+    try db.create(table: "author") { t in ... }
+    try db.create(table: "book") { t in ... }
+    try db.create(index: ...)
+}
+
+// 2nd migration
+migrator.registerMigration("v2") { db in
+    try db.alter(table: "author") { t in ... }
+}
+
+// Migrations for future versions will be inserted here:
+//
+// // 3rd migration
+// migrator.registerMigration("...") { db in
+//     ...
+// }
+
+ +

Each migration runs in a separate transaction. Should one throw an error, its transaction is rollbacked, subsequent migrations do not run, and the error is eventually thrown by migrator.migrate(dbQueue).

+ +

The memory of applied migrations is stored in the database itself (in a reserved table).

+ +

You migrate the database up to the latest version with the migrate(_:) method:

+
try migrator.migrate(dbQueue) // or migrator.migrate(dbPool)
+
+ +

To migrate a database up to a specific version, use migrate(_:upTo:):

+
try migrator.migrate(dbQueue, upTo: "v2")
+
+ +

Migrations can only run forward:

+
try migrator.migrate(dbQueue, upTo: "v2")
+try migrator.migrate(dbQueue, upTo: "v1")
+// fatal error: database is already migrated beyond migration "v1"
+
+ +

Check if a migration has been applied:

+
let appliedMigrations = try migrator.appliedMigrations(in: dbQueue)
+if appliedMigrations.contains("v2") {
+    // "v2" migration has been applied
+}
+
+

The eraseDatabaseOnSchemaChange Option

+ +

A DatabaseMigrator can automatically wipe out the full database content, and recreate the whole database from scratch, if it detects that a migration has changed its definition:

+
var migrator = DatabaseMigrator()
+migrator.eraseDatabaseOnSchemaChange = true
+
+ +

Beware! This flag can destroy your precious users’ data!

+ +

Yet it may be useful in those two situations:

+ +
    +
  1. During application development, as you are still designing migrations, and the schema changes often.

    + +

    In this case, it is recommended that this flag does not ship in the distributed application:

    +
    var migrator = DatabaseMigrator()
    +#if DEBUG
    +// Speed up development by nuking the database when migrations change
    +migrator.eraseDatabaseOnSchemaChange = true
    +#endif
    +
  2. +
  3. When the database content can easily be recreated, such as a cache for some downloaded data.

  4. +
+ +

The eraseDatabaseOnSchemaChange option triggers a recreation of the database if the migrator detects a schema change. A schema change is any difference in the sqlite_master table, which contains the SQL used to create database tables, indexes, triggers, and views.

+

Advanced Database Schema Changes

+ +

SQLite does not support many schema changes, and won’t let you drop a table column with “ALTER TABLE … DROP COLUMN …”, for example.

+ +

Yet any kind of schema change is still possible. The SQLite documentation explains in detail how to do so: https://www.sqlite.org/lang_altertable.html#otheralter. This technique requires the temporary disabling of foreign key checks, and is supported by the registerMigrationWithDeferredForeignKeyCheck function:

+
// Add a NOT NULL constraint on player.name:
+migrator.registerMigrationWithDeferredForeignKeyCheck("AddNotNullCheckOnName") { db in
+    try db.create(table: "new_player") { t in
+        t.autoIncrementedPrimaryKey("id")
+        t.column("name", .text).notNull()
+    }
+    try db.execute(sql: "INSERT INTO new_player SELECT * FROM player")
+    try db.drop(table: "player")
+    try db.rename(table: "new_player", to: "player")
+}
+
+ +

While your migration code runs with disabled foreign key checks, those are re-enabled and checked at the end of the migration, regardless of eventual errors.

+

Joined Queries Support

+ +

GRDB helps consuming joined queries with complex selection.

+ +

In this chapter, we will focus on the extraction of information from complex rows, such as the ones fetched by the query below:

+
-- How to consume the left, middle, and right parts of those rows?
+SELECT player.*, team.*, MAX(round.score) AS maxScore
+FROM player
+LEFT JOIN team ON ...
+LEFT JOIN round ON ...
+GROUP BY ...
+
+ +

We will not talk about the generation of joined queries, which is covered in Associations.

+ +

So what are we talking about?

+ +

It is difficult to consume rows fetched from complex joined queries, because they often contain several columns with the same name: id from table player, id from table team, etc.

+ +

When such ambiguity happens, GRDB row accessors always favor the leftmost matching column. This means that row["id"] would give a player id, whithout any obvious way to access the team id.

+ +

A classical technique to avoid this ambiguity is to give each column a unique name. For example:

+
-- A classical technique
+SELECT player.id AS player_id, player.name AS player_name, team.id AS team_id, team.name AS team_name, team.color AS team_color, MAX(round.score) AS maxScore
+FROM player
+LEFT JOIN team ON ...
+LEFT JOIN round ON ...
+GROUP BY ...
+
+ +

This technique works pretty well, but it has three drawbacks:

+ +
    +
  1. The selection becomes hard to read and understand.
  2. +
  3. Such queries are difficult to write by hand.
  4. +
  5. The mangled names are a very bad fit for FetchableRecord types that expect specific column names. After all, if the Team record type can read SELECT * FROM team ..., it should be able to read SELECT ..., team.*, ... as well.
  6. +
+ +

We thus need another technique. Below we’ll see how to split rows into slices, and preserve column names.

+ +

SELECT player.*, team.*, MAX(round.score) AS maxScore FROM ... will be splitted into three slices: one that contains player’s columns, one that contains team’s columns, and a remaining slice that contains remaining column(s). The Player record type will be able to read the first slice, which contains the colums expected by the Player.init(row:) initializer. In the same way, the Team record type could read the second slice.

+ +

Unlike the name-mangling technique, splitting rows keeps SQL legible, accepts your hand-crafted SQL queries, and plays as nicely as possible with your existing record types.

+ + +

Splitting Rows, an Introduction

+ +

Let’s first write some introductory code, hoping that this chapter will make you understand how pieces fall together. We’ll see later how records will help us streamline the initial approach, how to track changes in joined requests, and how we can use the standard Decodable protocol.

+ +

To split rows, we will use row adapters. Row adapters adapt rows so that row consumers see exactly the columns they want. Among other things, row adapters can define several row scopes that give access to as many row slices. Sounds like a perfect match.

+ +

At the very beginning, there is an SQL query:

+
try dbQueue.read { db in
+    let sql = """
+        SELECT player.*, team.*, MAX(round.score) AS maxScore
+        FROM player
+        LEFT JOIN team ON ...
+        LEFT JOIN round ON ...
+        GROUP BY ...
+        """
+
+ +

We need an adapter that extracts player columns, in a slice that has as many columns as there are columns in the player table. That’s RangeRowAdapter:

+
    // SELECT player.*, team.*, ...
+    //        <------>
+    let playerWidth = try db.columns(in: "player").count
+    let playerAdapter = RangeRowAdapter(0 ..< playerWidth)
+
+ +

We also need an adapter that extracts team columns:

+
    // SELECT player.*, team.*, ...
+    //                  <---->
+    let teamWidth = try db.columns(in: "team").count
+    let teamAdapter = RangeRowAdapter(playerWidth ..< (playerWidth + teamWidth))
+
+ +

We merge those two adapters in a single ScopeAdapter that will allow us to access both sliced rows:

+
    let playerScope = "player"
+    let teamScope = "team"
+    let adapter = ScopeAdapter([
+        playerScope: playerAdapter,
+        teamScope: teamAdapter])
+
+ +

And now we can fetch, and start consuming our rows. You already know row cursors:

+
    let rows = try Row.fetchCursor(db, sql: sql, adapter: adapter)
+    while let row = try rows.next() {
+
+ +

From a fetched row, we can build a player:

+
        let player: Player = row[playerScope]
+
+ +

In the SQL query, the team is joined with the LEFT JOIN operator. This means that the team may be missing: its slice may contain team values, or it may only contain NULLs. When this happens, we don’t want to build a Team record, and we thus load an optional Team:

+
        let team: Team? = row[teamScope]
+
+ +

And finally, we can load the maximum score, assuming that the “maxScore” column is not ambiguous:

+
        let maxScore: Int = row["maxScore"]
+
+        print("player: \(player)")
+        print("team: \(team)")
+        print("maxScore: \(maxScore)")
+    }
+}
+
+ +
+

:bulb: In this chapter, we have learned:

+ +
    +
  • how to use RangeRowAdapter to extract a specific table’s columns into a row slice.
  • +
  • how to use ScopeAdapter to gives access to several row slices through named scopes.
  • +
  • how to use Row subscripting to extract records from rows, or optional records in order to deal with left joins.
  • +
+
+

Splitting Rows, the Record Way

+ +

Our introduction above has introduced important techniques. It uses row adapters in order to split rows. It uses Row subscripting in order to extract records from row slices.

+ +

But we may want to make it more usable and robust:

+ +
    +
  1. It’s generally easier to consume records than raw rows.
  2. +
  3. Joined records not always need all columns from a table (see TableRecord.databaseSelection in Columns Selected by a Request).
  4. +
  5. Building row adapters is long and error prone.
  6. +
+ +

To address the first bullet, let’s define a record that holds our player, optional team, and maximum score. Since it can decode database rows, it adopts the FetchableRecord protocol:

+
struct PlayerInfo {
+    var player: Player
+    var team: Team?
+    var maxScore: Int
+}
+
+/// PlayerInfo can decode rows:
+extension PlayerInfo: FetchableRecord {
+    private enum Scopes {
+        static let player = "player"
+        static let team = "team"
+    }
+
+    init(row: Row) {
+        player = row[Scopes.player]
+        team = row[Scopes.team]
+        maxScore = row["maxScore"]
+    }
+}
+
+ +

Let’s now write the method that fetches PlayerInfo records:

+
extension PlayerInfo {
+    static func fetchAll(_ db: Database) throws -> [PlayerInfo] {
+
+ +

To acknowledge that both Player and Team records may customize their selection of the “player” and “team” columns, we’ll write our SQL in a slightly different way:

+
        // Let Player and Team customize their selection:
+        let sql = """
+            SELECT
+                \(Player.selectionSQL()), -- instead of player.*
+                \(Team.selectionSQL()),   -- instead of team.*
+                MAX(round.score) AS maxScore
+            FROM player
+            LEFT JOIN team ON ...
+            LEFT JOIN round ON ...
+            GROUP BY ...
+            """
+
+ +

Player.selectionSQL() will output player.*, unless Player defines a customized selection.

+ +
+

:point_up: Note: you may also use SQL table aliases:

+
let sql = """
+    SELECT
+        \(Player.selectionSQL(alias: "p")),
+        \(Team.selectionSQL(alias: "t")),
+        MAX(r.score) AS maxScore
+    FROM player p
+    LEFT JOIN team t ON ...
+    LEFT JOIN round r ON ...
+    GROUP BY ...
+    """
+
+
+ +

Now is the time to build adapters (taking in account the customized selection of both player and team). We use the splittingRowAdapters global function, which builds row adapters of desired widths:

+
        let adapters = try splittingRowAdapters(columnCounts: [
+            Player.numberOfSelectedColumns(db),
+            Team.numberOfSelectedColumns(db)])
+
+        let adapter = ScopeAdapter([
+            Scopes.player: adapters[0],
+            Scopes.team: adapters[1]])
+
+ +
+

:point_up: Note: splittingRowAdapters returns as many adapters as necessary to fully split a row. In the example above, it returns three adapters: one for player, one for team, and one for the remaining columns.

+
+ +

And finally, we can fetch player infos:

+
        return try PlayerInfo.fetchAll(db, sql: sql, adapter: adapter)
+    }
+}
+
+ +

And when your app needs to fetch player infos, it now reads:

+
// Fetch player infos
+let playerInfos = try dbQueue.read { db in
+    try PlayerInfo.fetchAll(db)
+}
+
+ +
+

:bulb: In this chapter, we have learned:

+ +
    +
  • how to define a FetchableRecord record that consumes rows fetched from a joined query.
  • +
  • how to use selectionSQL and numberOfSelectedColumns in order to deal with nested record types that define custom selection.
  • +
  • how to use splittingRowAdapters in order to streamline the definition of row slices.
  • +
  • how to gather all relevant methods and constants in a record type, fully responsible of its relationship with the database.
  • +
+
+

Splitting Rows, the Request Way

+ +

The PlayerInfo.fetchAll method above directly fetches records. It’s all good, but in order to profit from database observation, you’ll need a custom request that defines a database query.

+ +

It is recommended that you read the previous paragraphs before you dive in this sample code. We start with the same PlayerInfo record as above:

+
struct PlayerInfo {
+    var player: Player
+    var team: Team?
+    var maxScore: Int
+}
+
+/// PlayerInfo can decode rows:
+extension PlayerInfo: FetchableRecord {
+    private enum Scopes {
+        static let player = "player"
+        static let team = "team"
+    }
+
+    init(row: Row) {
+        player = row[Scopes.player]
+        team = row[Scopes.team]
+        maxScore = row["maxScore"]
+    }
+}
+
+ +

Now we write a method that returns a request, and build the fetching method on top of that request:

+
extension PlayerInfo {
+    /// The request for all player infos
+    static func all() -> AdaptedFetchRequest<SQLRequest<PlayerInfo>> {
+        let sql = """
+            SELECT
+                \(Player.selectionSQL()),
+                \(Team.selectionSQL()),
+                MAX(round.score) AS maxScore
+            FROM player
+            LEFT JOIN team ON ...
+            LEFT JOIN round ON ...
+            GROUP BY ...
+            """
+        return SQLRequest<PlayerInfo>(sql: sql).adapted { db in
+            let adapters = try splittingRowAdapters(columnCounts: [
+                Player.numberOfSelectedColumns(db),
+                Team.numberOfSelectedColumns(db)])
+            return ScopeAdapter([
+                Scopes.player: adapters[0],
+                Scopes.team: adapters[1]])
+        }
+    }
+
+    /// Fetches all player infos
+    static func fetchAll(_ db: Database) throws -> [PlayerInfo] {
+        return try all().fetchAll(db)
+    }
+}
+
+ +

It is now time to use our request:

+
// Fetch player infos
+let playerInfos = try dbQueue.read { db in
+    try PlayerInfo.fetchAll(db)
+}
+
+// Track player infos with RxRGDB:
+PlayerInfo.all()
+    .rx.fetchAll(in: dbQueue)
+    .subscribe(onNext: { (playerInfos: [PlayerInfo]) in
+        print("Player infos have changed")
+    })
+
+ +
+

:bulb: In this chapter, we have learned how to define a custom request that can both fetch records from joined queries, and feed database observation tools.

+
+

Splitting Rows, the Codable Way

+ +

Codable Records build on top of the standard Decodable protocol in order to decode database rows.

+ +

You can consume complex joined queries with Codable records as well. As a demonstration, we’ll rewrite the above sample code:

+
struct Player: Decodable, FetchableRecord, TableRecord {
+    var id: Int64
+    var name: String
+}
+struct Team: Decodable, FetchableRecord, TableRecord {
+    var id: Int64
+    var name: String
+    var color: Color
+}
+struct PlayerInfo: Decodable, FetchableRecord {
+    var player: Player
+    var team: Team?
+    var maxScore: Int
+}
+
+extension PlayerInfo {
+    /// The request for all player infos
+    static func all() -> AdaptedFetchRequest<SQLRequest<PlayerInfo>> {
+        let sql = """
+            SELECT
+                \(Player.selectionSQL()),
+                \(Team.selectionSQL()),
+                MAX(round.score) AS maxScore
+            FROM player
+            LEFT JOIN team ON ...
+            LEFT JOIN round ON ...
+            GROUP BY ...
+            """
+        return SQLRequest<PlayerInfo>(sql: sql).adapted { db in
+            let adapters = try splittingRowAdapters(columnCounts: [
+                Player.numberOfSelectedColumns(db),
+                Team.numberOfSelectedColumns(db)])
+            return ScopeAdapter([
+                CodingKeys.player.stringValue: adapters[0],
+                CodingKeys.team.stringValue: adapters[1]])
+        }
+    }
+
+    /// Fetches all player infos
+    static func fetchAll(_ db: Database) throws -> [PlayerInfo] {
+        return try all().fetchAll(db)
+    }
+}
+
+// Fetch player infos
+let playerInfos = try dbQueue.read { db in
+    try PlayerInfo.fetchAll(db)
+}
+
+// Track player infos with RxRGDB:
+PlayerInfo.all()
+    .rx.fetchAll(in: dbQueue)
+    .subscribe(onNext: { (playerInfos: [PlayerInfo]) in
+        print("Player infos have changed")
+    })
+
+ +
+

:bulb: In this chapter, we have learned how to use the Decodable protocol and its associated CodingKeys enum in order to dry up our code.

+
+

Database Changes Observation

+ +

SQLite notifies its host application of changes performed to the database, as well of transaction commits and rollbacks.

+ +

GRDB puts this SQLite feature to some good use, and lets you observe the database in various ways:

+ + + +

Database observation requires that a single database queue or pool is kept open for all the duration of the database usage.

+

After Commit Hook

+ +

When your application needs to make sure a specific database transaction has been successfully committed before it executes some work, use the Database.afterNextTransactionCommit(_:) method.

+ +

Its closure argument is called right after database changes have been successfully written to disk:

+
try dbQueue.write { db in
+    db.afterNextTransactionCommit { db in
+        print("success")
+    }
+    ...
+} // prints "success"
+
+ +

The closure runs in a protected dispatch queue, serialized with all database updates.

+ +

This “after commit hook” helps synchronizing the database with other resources, such as files, or system sensors.

+ +

In the example below, a location manager starts monitoring a CLRegion if and only if it has successfully been stored in the database:

+
/// Inserts a region in the database, and start monitoring upon
+/// successful insertion.
+func startMonitoring(_ db: Database, region: CLRegion) throws {
+    // Make sure database is inside a transaction
+    try db.inSavepoint {
+
+        // Save the region in the database
+        try insert(...)
+
+        // Start monitoring if and only if the insertion is
+        // eventually committed
+        db.afterNextTransactionCommit { _ in
+            // locationManager prefers the main queue:
+            DispatchQueue.main.async {
+                locationManager.startMonitoring(for: region)
+            }
+        }
+
+        return .commit
+    }
+}
+
+ +

The method above won’t trigger the location manager if the transaction is eventually rollbacked (explicitly, or because of an error), as in the sample code below:

+
try dbQueue.write { db in
+    // success
+    try startMonitoring(db, region)
+
+    // On error, the transaction is rollbacked, the region is not inserted, and
+    // the location manager is not invoked.
+    try failableMethod(db)
+}
+
+

ValueObservation and DatabaseRegionObservation

+ +

ValueObservation and DatabaseRegionObservation are two database observations tools that track changes in database requests.

+
// Let's observe all players!
+let request = Player.all()
+
+ +

ValueObservation notifies your application with fresh values (this is what most applications need :+1:):

+
let observation = ValueObservation.tracking { db in
+    try request.fetchAll(db)
+}
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in
+        print("fresh players could not be fetched")
+    },
+    onChange: { (players: [Player]) in
+        let names = players.map { $0.name }.joined(separator: ", ")
+        print("Fresh players: \(names)")
+    })
+
+try dbQueue.write { db in
+    try Player(name: "Arthur").insert(db)
+}
+// Prints "Fresh players: Arthur, ..."
+
+ +

DatabaseRegionObservation notifies your application with database connections, right after an impactful database transaction has been committed (reserved for more advanced use cases :nerd_face:):

+
let observation = DatabaseRegionObservation(tracking: request)
+let observer = try observation.start(in: dbQueue) { (db: Database) in
+    print("Players have changed.")
+}
+
+try dbQueue.write { db in
+    try Player(name: "Barbara").insert(db)
+}
+// Prints "Players have changed."
+
+ + +

ValueObservation

+ +

ValueObservation tracks changes in the results of database requests, and notifies fresh values whenever the database changes.

+ +

Changes are only notified after they have been committed in the database. No insertion, update, or deletion in tracked tables is missed. This includes indirect changes triggered by foreign keys or SQL triggers.

+ + +

ValueObservation Usage

+ +

Here is a typical UIViewController which observes the database in order to keep its view up-to-date:

+
class PlayerViewController: UIViewController {
+    @IBOutlet weak var nameLabel: UILabel!
+    private var observer: TransactionObserver?
+
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+
+        // Define a ValueObservation which tracks a player
+        let observation = ValueObservation.tracking { db in
+            try Player.fetchOne(db, key: 42)
+        }
+
+        // Start observing the database
+        observer = observation.start(
+            in: dbQueue,
+            onError: { error in
+                print("player could not be fetched")
+            },
+            onChange: { [weak self] (player: Player?) in
+                // Player has been refreshed: update view
+                guard let self = self else { return }
+                self.nameLabel.text = player?.name
+            })
+    }
+
+    override func viewWillDisappear(_ animated: Bool) {
+        super.viewWillDisappear(animated)
+
+        // Stop observing the database
+        observer = nil
+    }
+}
+
+ +

By default, all values and errors are notified on the main queue. Views can be updated right from the onChange callback.

+ +

By default, an initial fetch is performed as soon as the observation starts: the view is set up and ready when the viewWillAppear method returns.

+ +

The observer returned by the start method is stored in a property of the view controller. This allows the view controller to control the duration of the observation. When the observer is deallocated, the observation stops. Meanwhile, all transactions that modify the observed player are notified, and the nameLabel is kept up-to-date.

+ +
+

:bulb: Tip: see the Demo Application for a sample app that uses ValueObservation.

+ +

:bulb: Tip: When fetching values is slow, and should never ever block the main queue, opt in for async notifications:

+
override func viewWillAppear(_ animated: Bool) {
+    super.viewWillAppear(animated)
+
+    // Define a ValueObservation which tracks a player
+    let observation = ValueObservation.tracking { db in
+        try Player.fetchOne(db, key: 42)
+    }
+
+    // Observation is asynchronous
+    observation.scheduling = .async(onQueue: .main, startImmediately: true)
+
+    // Start observing the database
+    observer = observation.start(
+        in: dbQueue,
+        onError: { error in
+            print("player could not be fetched")
+        },
+        onChange: { [weak self] (player: Player?) in
+            // Player has been refreshed: update view
+            guard let self = self else { return }
+            self.activityIndicator.stopAnimating()
+            self.nameLabel.text = player?.name
+        })
+
+    // Wait for player
+    activityIndicator.startAnimating()
+    nameLabel.text = nil
+}
+
+ +

See ValueObservation.scheduling for more information.

+
+

ValueObservation.tracking(value:)

+ +

In order to observe database values, you will generally define a ValueObservation which tracks the value you are interested in, and then start the observation.

+ +

For example:

+
// Track changes in a single player
+let observation = ValueObservation.tracking { db in
+    try Player.fetchOne(db, key: 42)
+}
+
+observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (player: Player?) in
+        print("Fresh player: \(player)")
+    })
+
+ +

You can observe several requests and several tables if you need: all writes that have an impact on the fetched values will trigger the observation, and call the onChange function.

+ +

It may happen that such an observation notifies identical consecutive values. This is because it will fetch a fresh value whenever a change could happen. For example, the observation for the maximum player score will notify a fresh value everytime a score is changed, inserted, or deleted, even if the maximum score is unchanged:

+
// Track changes in the maximum player score
+// This observation may notify duplicate values
+let observation = ValueObservation.tracking { db in
+    try Player.select(max(Column("score")), as: Int.self).fetchOne(db)
+}
+
+ +

You can filter out those duplicates with the ValueObservation.removeDuplicates method. It requires the observed value to adopt the Equatable protocol:

+
let observation = ValueObservation
+    .tracking { db in
+        try Player.select(max(Column("score")), as: Int.self).fetchOne(db)
+    }
+    .removeDuplicates()
+
+ +

We will see below other ways to define observations. They all add a little convenience, or optimization.

+

ValueObservation.tracking(_:fetch:)

+ +

The ValueObservation.tracking(_:fetch:) method is an optimized version of the ValueObservation.tracking(value:) method seen above.

+ +

The returned observation ouputs exactly the same results, but it can perform better when you use a database pool, and the fetch is slow. It reduces write contention by fetching fresh values without blocking write accesses. When you use a database queue, no optimization is applied.

+ +

It accepts two arguments:

+ +
    +
  1. A list of observed requests.
  2. +
  3. A closure that fetches a fresh value whenever one of the observed requests are modified.
  4. +
+ +

Changes that happen outside of the observed requests are ignored, so make sure you fully cover the database region you want to observe. This is the price you pay for the optimization.

+ +

Let’s give a practical example, and observe the “Hall of Fame”:

+
struct HallOfFame {
+    var totalPlayerCount: Int
+    var bestPlayers: [Player]
+}
+
+extension HallOfFame {
+    /// Fetch the HallOfFame
+    static fetch(_ db: Database) throws -> HallOfFame {
+        let totalPlayerCount = try Player.fetchCount(db)
+        let bestPlayers = try Player
+            .order(Column("score").desc)
+            .limit(10)
+            .fetchAll(db)
+        return HallOfFame(
+            totalPlayerCount: totalPlayerCount,
+            bestPlayers: bestPlayers)
+    }
+}
+
+ +

In order to track changes in the Hall of Fame in an optimized way, we see that any change to the player table can impact the Hall of Fame. We thus track the request for all players, Player.all(), and fetch a new Hall of Fame whenever players change:

+
let observation = ValueObservation.tracking(Player.all(), fetch: { db in
+    try HallOfFame.fetch(db)
+})
+
+ +
+

:point_up: Note: the initial parameter of ValueObservation.tracking(_:fetch:) can be fed with requests, and generally speaking, values that adopt the DatabaseRegionConvertible protocol.

+
+

observationForCount, observationForAll, observationForFirst

+ +

Given a request, even a custom request, you can observe its number of results, all results, or the first one:

+
request.observationForCount()
+request.observationForAll()
+request.observationForFirst()
+
+ +

Those observations are equivalent to the following ones, defined with ValueObservation.tracking(value:):

+
ValueObservation.tracking { db in try request.fetchCount(db) }
+ValueObservation.tracking { db in try request.fetchAll(db) }
+ValueObservation.tracking { db in try request.fetchOne(db) }
+
+ +

Yet they are optimized:

+ +
    +
  • They perform a filtering of consecutive identical values, based on raw database values, so that you are not notified of database changes that do not impact the result of the request.
  • +
  • They can perform better when you use a database pool, and the fetch is slow.
  • +
+

ValueObservation Transformations

+ + +

ValueObservation.map

+ +

The map method lets you transform the values notified by a ValueObservation.

+ +

For example:

+
// Observe a player's profile image
+let observation = ValueObservation
+    .tracking { db in try Player.fetchOne(db, key: 42) }
+    .map { player in player?.image }
+
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (image: UIImage?) in
+        print("Player picture has changed")
+    })
+
+ +

The transformation closure does not run on the main queue, and is suitable for heavy computations.

+

ValueObservation.compactMap

+ +

The compactMap method lets you transform and filter the values notified by a ValueObservation. Only non-nil transformed values are notified.

+ +

For example:

+
// Observe a player
+let observation = ValueObservation
+    .tracking { db in try Player.fetchOne(db, key: 42) }
+    .compactMap { $0 }
+
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (player: Player) in
+        print("Player name: \(player.name)")
+    })
+
+ +

The transformation closure does not run on the main queue, and is suitable for heavy computations.

+

ValueObservation.removeDuplicates

+ +

The removeDuplicates method filters out the consecutive equal values notified by a ValueObservation. The observed values must adopt the standard Equatable protocol.

+ +

For example:

+
let observation = ValueObservation
+    .tracking { db in try Player.fetchOne(db, key: 42) }
+    .removeDuplicates()
+
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (player: Player) in
+        print("Player: \(player)")
+    })
+
+ +
+

:point_up: Note: the observations returned by the observationForCount, observationForAll, observationForFirst methods already perform a similar filtering, based on raw database values.

+
+

ValueObservation.combine(…)

+ +

The ValueObservation.combine(...) method builds a single observation from several:

+
// Two base observations
+let playerCountObservation = ValueObservation.tracking { db in
+    try Player.fetchCount(db)
+}
+let bestPlayersObservation = ValueObservation.tracking { db in
+    try Player
+        .limit(10)
+        .order(Column("score").desc)
+        .fetchAll(db)
+}
+
+// The combined observation
+let observation = ValueObservation.combine(
+    playerCountObservation, 
+    bestPlayersObservation)
+
+// Start tracking the hall of fame
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (totalPlayerCount, bestPlayers) in
+        print("""
+            Best players out of \(totalPlayerCount):
+            \(bestPlayers)
+            """)
+    })
+
+ +

combine also exists as an instance method:

+
struct HallOfFame {
+    var totalPlayerCount: Int
+    var bestPlayers: [Player]
+}
+
+let observation = playerCountObservation.combine(bestPlayersObservation) {
+    HallOfFame(totalPlayerCount: $0, bestPlayers: $1)
+}
+
+ +

You can combine up to eight observations together. They can feed from as many database tables as needed.

+ +

Combining observations provides the guarantee that notified values are consistent.

+ +
+

:point_up: Note: readers who are familiar with Reactive Programming will recognize the CombineLatest operator in the ValueObservation combine method. The reactive operator does not care about data consistency, though: if you use a Reactive layer such as GRDBCombine or RxGRDB, make sure you compose observations with ValueObservation.combine, not with the CombineLatest operator.

+
+

ValueObservation Error Handling

+ +

When you start an observation, the onError callback is called whenever fresh values could not be fetched. It is scheduled just like values (see ValueObservation.scheduling):

+
let observer = observation.start(
+    in: dbQueue,
+    onError: { error in
+        print("fresh value could not be fetched")
+    },
+    onChange: { value in
+        print("fresh value: \(value)")
+    })
+
+ +

An error does not stop the observation. After an error has been received, subsequent transactions may succeed in notifying fresh values. You may witness such temporary errors when the database becomes temporarily unreachable, for example due to data protection.

+ +

Depending on the way your application wants to deal with such errors, you may want to tighten your control on the scheduling of database accesses with DatabaseRegionObservation. See also the reactive companion libraries GRDBCombine and RxGRDB, which stop observation whenever a ValueObservation error happens.

+ +

The onError callback can be omitted, but this is not recommended:

+
// Not recommended: omitting the onError callback
+let observer = try observation.start(in: dbQueue) { value in
+    print("fresh value: \(value)")
+}
+
+

ValueObservation Options

+ +

Some behaviors of value observations can be configured:

+ + +

ValueObservation.scheduling

+ +

The scheduling property lets you control how fresh values are notified:

+ +
    +
  • .mainQueue (the default): all values are notified on the main queue.

    + +

    If the observation starts on the main queue, an initial value is notified right upon subscription, synchronously:

    +
    // On main queue
    +let observer = observation.start(
    +    in: dbQueue,
    +    onError: { error in ... },
    +    onChange: { value in
    +        // On main queue
    +        print("fresh value: \(value)")
    +    })
    +// <- Here "fresh value" is already printed.
    +
    + +

    If the observation does not start on the main queue, an initial value is also notified on the main queue, but asynchronously:

    +
    // Not on the main queue
    +let observer = observation.start(
    +    in: dbQueue,
    +    onError: { error in ... },
    +    onChange: { value in
    +        // On main queue
    +        print("fresh value: \(value)")
    +    })
    +
    + +

    After the initial value has been notified, all subsequent values are notified asynchronously:

    +
    try dbQueue.write { db in ... }
    +// <- Eventually prints "fresh value" on the main queue
    +
  • +
  • .async(onQueue:startImmediately:): all values are asychronously notified on the specified queue.

    + +

    An initial value is fetched and notified if startImmediately is true.

    + +

    For example:

    +
    // On main queue
    +var observation = ...
    +observation.scheduling = .async(onQueue: .main, startImmediately: true)
    +let observer = observation.start(
    +    in: dbQueue,
    +    onError: { error in ... },
    +    onChange: { value in
    +        // On main queue
    +        print("fresh value: \(value)")
    +    })
    +// <- Eventually prints "fresh value"
    +
  • +
  • unsafe(startImmediately:): values are not all notified on the same dispatch queue.

    + +

    If startImmediately is true, an initial value is notified right upon subscription, synchronously, on the dispatch queue which starts the observation.

    +
    // On any queue
    +var observation = ...
    +observation.scheduling = .unsafe(startImmediately: true)
    +let observer = observation.start(
    +    in: dbQueue,
    +    onError: { error in ... },
    +    onChange: { value in
    +        print("fresh value: \(value)")
    +    })
    +// <- Here "fresh value" is already printed.
    +
    + +

    After the initial value has been notified, all subsequent values are notified on unspecified queues.

    + +
    +

    :point_up: Note: this unsafe mode is intended for third-party libraries that provide their own scheduling engine.

    +
  • +
+

ValueObservation.requiresWriteAccess

+ +

The requiresWriteAccess property is false by default. When true, a ValueObservation has a write access to the database, and its fetches are automatically wrapped in a savepoint:

+
var observation = ValueObservation.tracking { db in
+    // write access allowed
+    ...
+}
+observation.requiresWriteAccess = true
+
+ +

When you use a database pool, don’t use this flag unless you really need it. Observations with write access are less efficient because they block all writes for the whole duration of a fetch.

+

Advanced: ValueObservation.tracking(_:reducer:)

+ +

The most low-level way to define a ValueObservation is to create one from an observed database region (see above), and a reducer that adopts the ValueReducer protocol (:fire: EXPERIMENTAL):

+
protocol ValueReducer {
+    associatedtype Fetched
+    associatedtype Value
+
+    /// Fetches a database value
+    func fetch(_ db: Database) throws -> Fetched
+
+    /// Returns a notified value
+    mutating func value(_ fetched: Fetched) -> Value?
+}
+
+ +

The fetch method is called upon changes in the observed database region. It runs inside a protected dispatch queue and is guaranteed an immutable view of the last committed state of the database.

+ +

The value method transforms a fetched value into a notified value. It returns nil if the observer should not be notified. It runs inside a dispatch queue called the “reduce queue”, which is not the main queue, and not a database queue.

+ +

The sample code below counts the number of times the player table is modified:

+
var count = 0
+let reducer = AnyValueReducer(
+    fetch: { _ in /* don't fetch anything */ },
+    value: { _ -> Int? in
+        defer { count += 1 }
+        return count })
+let observation = ValueObservation.tracking(Player.all(), reducer: { _ in reducer })
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (count: Int) in
+        print("Number of transactions that have modified players: \(count)")
+    })
+// Prints "Number of transactions that have modified players: 0"
+
+try dbQueue.write { db in
+    try Player(...).insert(db)
+}
+// Prints "Number of transactions that have modified players: 1"
+
+

DatabaseRegionObservation

+ +

DatabaseRegionObservation tracks changes in database requests, and notifies each impactful transaction.

+ +

No insertion, update, or deletion in the tracked tables is missed. This includes indirect changes triggered by foreign keys or SQL triggers.

+ +

DatabaseRegionObservation calls your application right after changes have been committed in the database, and before any other thread had any opportunity to perform further changes. This is a pretty strong guarantee, that most applications do not really need. Instead, most applications prefer to be notified with fresh values: make sure you check ValueObservation before using DatabaseRegionObservation.

+

DatabaseRegionObservation Usage

+ +

Define an observation by providing one or several requests to track:

+
// Track all players
+let observation = DatabaseRegionObservation(tracking: Player.all())
+
+ +

Then start the observation from a database queue or pool:

+
let observer = try observation.start(in: dbQueue) { (db: Database) in
+    print("Players were changed")
+}
+
+ +

And enjoy the changes notifications:

+
try dbQueue.write { db in
+    try Player(name: "Arthur").insert(db)
+}
+// Prints "Players were changed"
+
+ +

By default, the observation lasts until the observer returned by the start method is deallocated. See DatabaseRegionObservation.extent for more details.

+ +

You can also feed DatabaseRegionObservation with DatabaseRegion, or any type which conforms to the DatabaseRegionConvertible protocol. For example:

+
// Observe the full database
+let observation = DatabaseRegionObservation(tracking: DatabaseRegion.fullDatabase)
+let observer = try observation.start(in: dbQueue) { (db: Database) in
+    print("Database was changed")
+}
+
+

DatabaseRegionObservation Use Cases

+ +

There are very few use cases for DatabaseRegionObservation.

+ +

For example:

+ +
    +
  • One needs to write in the database after an impactful transaction.

  • +
  • One needs to synchronize the content of the database file with some external resources, like other files, or system sensors like CLRegion monitoring.

  • +
  • On iOS, one needs to process a database transaction before the operating system had any opportunity to put the application in the suspended state.

  • +
  • One wants to build a database snapshot with a guaranteed snapshot content.

  • +
+ +

Outside of those use cases, it is much likely wrong to use a DatabaseRegionObservation. Please check other Database Observation options.

+

DatabaseRegionObservation.extent

+ +

The extent property lets you specify the duration of the observation. See Observation Extent for more details:

+
// This observation lasts until the database connection is closed
+var observation = DatabaseRegionObservation...
+observation.extent = .databaseLifetime
+_ = try observation.start(in: dbQueue) { db in ... }
+
+ +

The default extent is .observerLifetime: the observation stops when the observer returned by start is deallocated.

+ +

Regardless of the extent of an observation, you can always stop observation with the remove(transactionObserver:) method:

+
// Start
+let observer = try observation.start(in: dbQueue) { db in ... }
+
+// Stop
+dbQueue.remove(transactionObserver: observer)
+
+

TransactionObserver Protocol

+ +

The TransactionObserver protocol lets you observe individual database changes and transactions:

+
protocol TransactionObserver : class {
+    /// Notifies a database change:
+    /// - event.kind (insert, update, or delete)
+    /// - event.tableName
+    /// - event.rowID
+    ///
+    /// For performance reasons, the event is only valid for the duration of
+    /// this method call. If you need to keep it longer, store a copy:
+    /// event.copy().
+    func databaseDidChange(with event: DatabaseEvent)
+
+    /// Filters the database changes that should be notified to the
+    /// `databaseDidChange(with:)` method.
+    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool
+
+    /// An opportunity to rollback pending changes by throwing an error.
+    func databaseWillCommit() throws
+
+    /// Database changes have been committed.
+    func databaseDidCommit(_ db: Database)
+
+    /// Database changes have been rollbacked.
+    func databaseDidRollback(_ db: Database)
+}
+
+ + +

Activate a Transaction Observer

+ +

To activate a transaction observer, add it to the database queue or pool:

+
let observer = MyObserver()
+dbQueue.add(transactionObserver: observer)
+
+ +

By default, database holds weak references to its transaction observers: they are not retained, and stop getting notifications after they are deallocated. See Observation Extent for more options.

+

Database Changes And Transactions

+ +

A transaction observer is notified of all database changes: inserts, updates and deletes. This includes indirect changes triggered by ON DELETE and ON UPDATE actions associated to foreign keys, and SQL triggers.

+ +
+

:point_up: Note: the changes that are not notified are changes to internal system tables (such as sqlite_master), changes to WITHOUT ROWID tables, and the deletion of duplicate rows triggered by ON CONFLICT REPLACE clauses (this last exception might change in a future release of SQLite).

+
+ +

Notified changes are not actually written to disk until the transaction commits, and the databaseDidCommit callback is called. On the other side, databaseDidRollback confirms their invalidation:

+
try dbQueue.write { db in
+    try db.execute(sql: "INSERT ...") // 1. didChange
+    try db.execute(sql: "UPDATE ...") // 2. didChange
+}                                     // 3. willCommit, 4. didCommit
+
+try dbQueue.inTransaction { db in
+    try db.execute(sql: "INSERT ...") // 1. didChange
+    try db.execute(sql: "UPDATE ...") // 2. didChange
+    return .rollback                  // 3. didRollback
+}
+
+try dbQueue.write { db in
+    try db.execute(sql: "INSERT ...") // 1. didChange
+    throw SomeError()
+}                                     // 2. didRollback
+
+ +

Database statements that are executed outside of any transaction do not drop off the radar:

+
try dbQueue.inDatabase { db in
+    try db.execute(sql: "INSERT ...") // 1. didChange, 2. willCommit, 3. didCommit
+    try db.execute(sql: "UPDATE ...") // 4. didChange, 5. willCommit, 6. didCommit
+}
+
+ +

Changes that are on hold because of a savepoint are only notified after the savepoint has been released. This makes sure that notified events are only events that have an opportunity to be committed:

+
try dbQueue.inTransaction { db in
+    try db.execute(sql: "INSERT ...")            // 1. didChange
+
+    try db.execute(sql: "SAVEPOINT foo")
+    try db.execute(sql: "UPDATE ...")            // delayed
+    try db.execute(sql: "UPDATE ...")            // delayed
+    try db.execute(sql: "RELEASE SAVEPOINT foo") // 2. didChange, 3. didChange
+
+    try db.execute(sql: "SAVEPOINT foo")
+    try db.execute(sql: "UPDATE ...")            // not notified
+    try db.execute(sql: "ROLLBACK TO SAVEPOINT foo")
+
+    return .commit                               // 4. willCommit, 5. didCommit
+}
+
+ +

Eventual errors thrown from databaseWillCommit are exposed to the application code:

+
do {
+    try dbQueue.inTransaction { db in
+        ...
+        return .commit           // 1. willCommit (throws), 2. didRollback
+    }
+} catch {
+    // 3. The error thrown by the transaction observer.
+}
+
+ +
+

:point_up: Note: all callbacks are called in a protected dispatch queue, and serialized with all database updates.

+ +

:point_up: Note: the databaseDidChange(with:) and databaseWillCommit() callbacks must not touch the SQLite database. This limitation does not apply to databaseDidCommit and databaseDidRollback which can use their database argument.

+
+ +

DatabaseRegionObservation, ValueObservation, GRDBCombine, and RxGRDB are all based on the TransactionObserver protocol.

+ +

See also TableChangeObserver.swift, which shows a transaction observer that notifies of modified database tables with NSNotificationCenter.

+

Filtering Database Events

+ +

Transaction observers can avoid being notified of database changes they are not interested in.

+ +

The filtering happens in the observes(eventsOfKind:) method, which tells whether the observer wants notification of specific kinds of changes, or not. For example, here is how an observer can focus on the changes that happen on the “player” database table:

+
class PlayerObserver: TransactionObserver {
+    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool {
+        // Only observe changes to the "player" table.
+        return eventKind.tableName == "player"
+    }
+
+    func databaseDidChange(with event: DatabaseEvent) {
+        // This method is only called for changes that happen to
+        // the "player" table.
+    }
+}
+
+ +

Generally speaking, the observes(eventsOfKind:) method can distinguish insertions from deletions and updates, and is also able to inspect the columns that are about to be changed:

+
class PlayerScoreObserver: TransactionObserver {
+    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool {
+        // Only observe changes to the "score" column of the "player" table.
+        switch eventKind {
+        case .insert(let tableName):
+            return tableName == "player"
+        case .delete(let tableName):
+            return tableName == "player"
+        case .update(let tableName, let columnNames):
+            return tableName == "player" && columnNames.contains("score")
+        }
+    }
+}
+
+ +

When the observes(eventsOfKind:) method returns false for all event kinds, the observer is still notified of commits and rollbacks:

+
class PureTransactionObserver: TransactionObserver {
+    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool {
+        // Ignore all individual changes
+        return false
+    }
+
+    func databaseDidChange(with event: DatabaseEvent) { /* Never called */ }
+    func databaseWillCommit() throws { /* Called before commit */ }
+    func databaseDidRollback(_ db: Database) { /* Called on rollback */ }
+    func databaseDidCommit(_ db: Database) { /* Called on commit */ }
+}
+
+ +

For more information about event filtering, see DatabaseRegion.

+

Observation Extent

+ +

You can specify how long an observer is notified of database changes and transactions.

+ +

The remove(transactionObserver:) method explicitly stops notifications, at any time:

+
// From a database queue or pool:
+dbQueue.remove(transactionObserver: observer)
+
+// From a database connection:
+dbQueue.inDatabase { db in
+    db.remove(transactionObserver: observer)
+}
+
+ +

Alternatively, use the extent parameter of the add(transactionObserver:extent:) method:

+
let observer = MyObserver()
+
+// On a database queue or pool:
+dbQueue.add(transactionObserver: observer) // default extent
+dbQueue.add(transactionObserver: observer, extent: .observerLifetime)
+dbQueue.add(transactionObserver: observer, extent: .nextTransaction)
+dbQueue.add(transactionObserver: observer, extent: .databaseLifetime)
+
+// On a database connection:
+dbQueue.inDatabase { db in
+    db.add(transactionObserver: ...)
+}
+
+ +
    +
  • The default extent is .observerLifetime: the database holds a weak reference to the observer, and the observation automatically ends when the observer is deallocated. Meanwhile, observer is notified of all changes and transactions.

  • +
  • .nextTransaction activates the observer until the current or next transaction completes. The database keeps a strong reference to the observer until its databaseDidCommit or databaseDidRollback method is eventually called. Hereafter the observer won’t get any further notification.

  • +
  • .databaseLifetime has the database retain and notify the observer until the database connection is closed.

  • +
+ +

Finally, an observer may ignore all database changes until the end of the current transaction:

+
class PlayerObserver: TransactionObserver {
+    var playerTableWasModified = false
+
+    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool {
+        return eventKind.tableName == "player"
+    }
+
+    func databaseDidChange(with event: DatabaseEvent) {
+        playerTableWasModified = true
+
+        // It is pointless to keep on tracking further changes:
+        stopObservingDatabaseChangesUntilNextTransaction()
+    }
+}
+
+ +

After stopObservingDatabaseChangesUntilNextTransaction(), the databaseDidChange(with:) method will not be notified of any change for the remaining duration of the current transaction. This helps GRDB optimize database observation.

+

DatabaseRegion

+ +

DatabaseRegion is a type that helps observing changes in the results of a database request.

+ +

A request knows which database modifications can impact its results. It can communicate this information to transaction observers by the way of a DatabaseRegion.

+ +

DatabaseRegion fuels, for example, ValueObservation and DatabaseRegionObservation.

+ +

A region notifies potential changes, not actual changes in the results of a request. A change is notified if and only if a statement has actually modified the tracked tables and columns by inserting, updating, or deleting a row.

+ +

For example, if you observe the region of Player.select(max(Column("score"))), then you’ll get be notified of all changes performed on the score column of the player table (updates, insertions and deletions), even if they do not modify the value of the maximum score. However, you will not get any notification for changes performed on other database tables, or updates to other columns of the player table.

+ +

For more details, see the reference.

+

The DatabaseRegionConvertible Protocol

+ +

DatabaseRegionConvertible is a protocol for all types that can turn into a DatabaseRegion:

+
protocol DatabaseRegionConvertible {
+    func databaseRegion(_ db: Database) throws -> DatabaseRegion
+}
+
+ +

All requests adopt this protocol, and this allows them to be observed with DatabaseRegionObservation and ValueObservation.

+ +

Use this protocol when you want to encapsulate your complex requests in a dedicated type, and still profit from optimized observation APIs. See ValueObservation.tracking(_:fetch:) for more information.

+

Support for SQLite Pre-Update Hooks

+ +

When SQLite is built with the SQLITE_ENABLE_PREUPDATE_HOOK option, TransactionObserverType gets an extra callback which lets you observe individual column values in the rows modified by a transaction:

+
protocol TransactionObserverType : class {
+    #if SQLITE_ENABLE_PREUPDATE_HOOK
+    /// Notifies before a database change (insert, update, or delete)
+    /// with change information (initial / final values for the row's
+    /// columns).
+    ///
+    /// The event is only valid for the duration of this method call. If you
+    /// need to keep it longer, store a copy: event.copy().
+    func databaseWillChange(with event: DatabasePreUpdateEvent)
+    #endif
+}
+
+ +

This extra API can be activated in two ways:

+ +
    +
  1. Use the GRDB.swift CocoaPod with a custom compilation option, as below. It uses the system SQLite, which is compiled with SQLITE_ENABLE_PREUPDATE_HOOK support, but only on iOS 11.0+ (we don’t know the minimum version of macOS, tvOS, watchOS):

    +
    pod 'GRDB.swift'
    +platform :ios, '11.0' # or above
    +
    +post_install do |installer|
    +  installer.pods_project.targets.select { |target| target.name == "GRDB.swift" }.each do |target|
    +    target.build_configurations.each do |config|
    +      # Enable extra GRDB APIs
    +      config.build_settings['OTHER_SWIFT_FLAGS'] = "$(inherited) -D SQLITE_ENABLE_PREUPDATE_HOOK"
    +      # Enable extra SQLite APIs
    +      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = "$(inherited) GRDB_SQLITE_ENABLE_PREUPDATE_HOOK=1"
    +    end
    +  end
    +end
    +
    + +
    +

    :warning: Warning: make sure you use the right platform version! You will get runtime errors on devices with a lower version.

    + +

    :point_up: Note: the GRDB_SQLITE_ENABLE_PREUPDATE_HOOK=1 option in GCC_PREPROCESSOR_DEFINITIONS defines some C function prototypes that are lacking from the system <sqlite3.h> header. When Xcode eventually ships with an SDK that includes a complete header, you may get a compiler error about duplicate function definitions. When this happens, just remove this GRDB_SQLITE_ENABLE_PREUPDATE_HOOK=1 option.

    +
  2. +
  3. Use a custom SQLite build and activate the SQLITE_ENABLE_PREUPDATE_HOOK compilation option.

  4. +
+

Encryption

+ +

GRDB can encrypt your database with SQLCipher v3.4+.

+ +

Use CocoaPods, and specify in your Podfile:

+
# GRDB with SQLCipher 4
+pod 'GRDB.swift/SQLCipher'
+pod 'SQLCipher', '~> 4.0'
+
+# GRDB with SQLCipher 3
+pod 'GRDB.swift/SQLCipher'
+pod 'SQLCipher', '~> 3.4'
+
+ + +

Creating or Opening an Encrypted Database

+ +

You create and open an encrypted database by providing a passphrase to your database connection:

+
var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase("secret")
+}
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+ +

It is also in prepareDatabase that you perform other SQLCipher configuration steps that must happen early in the lifetime of a SQLCipher connection. For example:

+
var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase("secret")
+    try db.execute(sql: "PRAGMA cipher_page_size = ...")
+    try db.execute(sql: "PRAGMA kdf_iter = ...")
+}
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+ +

When you want to open an existing SQLCipher 3 database with SQLCipher 4, you may want to run the cipher_compatibility pragma:

+
// Open an SQLCipher 3 database with SQLCipher 4
+var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase("secret")
+    try db.execute(sql: "PRAGMA cipher_compatibility = 3")
+}
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+ +

See SQLCipher 4.0.0 Release and Upgrading to SQLCipher 4 for more information.

+

Changing the Passphrase of an Encrypted Database

+ +

You can change the passphrase of an already encrypted database.

+ +

When you use a database queue, open the database with the old passphrase, and then apply the new passphrase:

+
try dbQueue.write { db in
+    try db.changePassphrase("newSecret")
+}
+
+ +

When you use a database pool, make sure that no concurrent read can happen by changing the passphrase within the barrierWriteWithoutTransaction block. You must also ensure all future reads open a new database connection by calling the invalidateReadOnlyConnections method:

+
try dbPool.barrierWriteWithoutTransaction { db in
+    try db.changePassphrase("newSecret")
+    dbPool.invalidateReadOnlyConnections()
+}
+
+ +
+

:point_up: Note: When an application wants to keep on using a database queue or pool after the passphrase has changed, it is responsible for providing the correct passphrase to the usePassphrase method called in the database preparation function. Consider:

+
// WRONG: this won't work across a passphrase change
+let passphrase = try getPassphrase()
+var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase(passphrase)
+}
+
+// CORRECT: get the latest passphrase when it is needed
+var config = Configuration()
+config.prepareDatabase = { db in
+    let passphrase = try getPassphrase()
+    try db.usePassphrase(passphrase)
+}
+
+ +

:point_up: Note: The DatabasePool.barrierWriteWithoutTransaction method does not prevent database snapshots from accessing the database during the passphrase change, or after the new passphrase has been applied to the database. Those database accesses may throw errors. Applications should provide their own mechanism for invalidating open snapshots before the passphrase is changed.

+ +

:point_up: Note: Instead of changing the passphrase “in place” as described here, you can also export the database in a new encrypted database that uses the new passphrase. See Exporting a Database to an Encrypted Database.

+
+

Exporting a Database to an Encrypted Database

+ +

Providing a passphrase won’t encrypt a clear-text database that already exists, though. SQLCipher can’t do that, and you will get an error instead: SQLite error 26: file is encrypted or is not a database.

+ +

Instead, create a new encrypted database, at a distinct location, and export the content of the existing database. This can both encrypt a clear-text database, or change the passphrase of an encrypted databaase.

+ +

The technique to do that is documented by SQLCipher.

+ +

With GRDB, it gives:

+
// The existing database
+let existingDBQueue = try DatabaseQueue(path: "/path/to/existing.db")
+
+// The new encrypted database, at some distinct location:
+var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase("secret")
+}
+let newDBQueue = try DatabaseQueue(path: "/path/to/new.db", configuration: config)
+
+try existingDBQueue.inDatabase { db in
+    try db.execute(
+        sql: """
+            ATTACH DATABASE ? AS encrypted KEY ?;
+            SELECT sqlcipher_export('encrypted');
+            DETACH DATABASE encrypted;
+            """,
+        arguments: [newDBQueue.path, "secret"])
+}
+
+// Now the export is completed, and the existing database can be deleted.
+
+

Security Considerations

+

Managing the lifetime of the passphrase string

+ +

It is recommended to avoid keeping the passphrase in memory longer than necessary. To do this, make sure you load the passphrase from inside the prepareDatabase function:

+
// NOT RECOMMENDED: this keeps the passphrase in memory longer than necessary
+let passphrase = try getPassphrase()
+var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase(passphrase)
+}
+
+// RECOMMENDED: only load the passphrase when it is needed
+var config = Configuration()
+config.prepareDatabase = { db in
+    let passphrase = try getPassphrase()
+    try db.usePassphrase(passphrase)
+}
+
+ +

This technique manages the lifetime of the passphrase string. Some demanding users will want to go further, and manage the lifetime of the raw passphrase bytes. See below.

+

Managing the lifetime of the passphrase bytes

+ +

GRDB offers convenience methods for providing the database passphrases as Swift strings: usePassphrase(_:) and changePassphrase(_:). Those methods don’t keep the passphrase String in memory longer than necessary. But they are as secure as the standard String type: the lifetime of actual passphrase bytes in memory is not under control.

+ +

When you want to precisely manage the passphrase bytes, talk directly to SQLCipher, using its raw C functions.

+ +

For example:

+
import GRDB
+import SQLCipher
+
+var config = Configuration()
+config.prepareDatabase = { db in
+    ... // Carefully load passphrase bytes
+    let code = sqlite3_key(db.sqliteConnection, /* passphrase bytes */)
+    ... // Carefully dispose passphrase bytes
+    guard code == SQLITE_OK else {
+        throw DatabaseError(
+            resultCode: ResultCode(rawValue: code), 
+            message: db.lastErrorMessage)
+    }
+}
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+

Passphrase availability vs. Database availability

+ +

When the passphrase is securely stored in the system keychain, your application can protect it using the kSecAttrAccessible attribute.

+ +

Such protection prevents GRDB from creating SQLite connections when the passphrase is not available:

+
var config = Configuration()
+config.prepareDatabase = { db in
+    let passphrase = try loadPassphraseFromSystemKeychain()
+    try db.usePassphrase(passphrase)
+}
+
+// Success if and only if the passphrase is available
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+ +

For the same reason, database pools, which open SQLite connections on demand, may fail at any time as soon as the passphrase becomes unavailable:

+
// Success if and only if the passphrase is available
+let dbPool = try DatabasePool(path: dbPath, configuration: config)
+
+// May fail if passphrase has turned unavailable
+try dbPool.read { ... }
+
+// May trigger value observation failure if passphrase has turned unavailable
+try dbPool.write { ... }
+
+ +

Because DatabasePool maintains a pool of long-lived SQLite connections, some database accesses will use an existing connection, and succeed. And some other database accesses will fail, as soon as the pool wants to open a new connection. It is impossible to predict which accesses will succeed or fail.

+ +

For the same reason, a database queue, which also maintains a long-lived SQLite connection, will remain available even after the passphrase has turned unavailable.

+ +

Applications are thus responsible for protecting database accesses when the passphrase is unavailable. To this end, they can use Data Protection. They can also destroy their instances of database queue or pool when the passphrase becomes unavailable.

+

Backup

+ +

You can backup (copy) a database into another.

+ +

Backups can for example help you copying an in-memory database to and from a database file when you implement NSDocument subclasses.

+
let source: DatabaseQueue = ...      // or DatabasePool
+let destination: DatabaseQueue = ... // or DatabasePool
+try source.backup(to: destination)
+
+ +

The backup method blocks the current thread until the destination database contains the same contents as the source database.

+ +

When the source is a database pool, concurrent writes can happen during the backup. Those writes may, or may not, be reflected in the backup, but they won’t trigger any error.

+

Interrupt a Database

+ +

The interrupt() method causes any pending database operation to abort and return at its earliest opportunity.

+ +

It can be called from any thread.

+
dbQueue.interrupt()
+dbPool.interrupt()
+
+ +

A call to interrupt() that occurs when there are no running SQL statements is a no-op and has no effect on SQL statements that are started after interrupt() returns.

+ +

A database operation that is interrupted will throw a DatabaseError with code SQLITE_INTERRUPT. If the interrupted SQL operation is an INSERT, UPDATE, or DELETE that is inside an explicit transaction, then the entire transaction will be rolled back automatically. If the rolled back transaction was started by a transaction-wrapping method such as DatabaseWriter.write or Database.inTransaction, then all database accesses will throw a DatabaseError with code SQLITE_ABORT until the wrapping method returns.

+ +

For example:

+
try dbQueue.write { db in
+    try Player(...).insert(db)     // throws SQLITE_INTERRUPT
+    try Player(...).insert(db)     // not executed
+}                                  // throws SQLITE_INTERRUPT
+
+try dbQueue.write { db in
+    do {
+        try Player(...).insert(db) // throws SQLITE_INTERRUPT
+    } catch { }
+}                                  // throws SQLITE_ABORT
+
+try dbQueue.write { db in
+    do {
+        try Player(...).insert(db) // throws SQLITE_INTERRUPT
+    } catch { }
+    try Player(...).insert(db)     // throws SQLITE_ABORT
+}                                  // throws SQLITE_ABORT
+
+ +

You can catch both SQLITE_INTERRUPT and SQLITE_ABORT errors with the DatabaseError.isInterruptionError property:

+
do {
+    try dbPool.write { db in ... }
+} catch let error as DatabaseError where error.isInterruptionError {
+    // Oops, the database was interrupted.
+}
+
+ +

For more information, see Interrupt A Long-Running Query.

+

Avoiding SQL Injection

+ +

SQL injection is a technique that lets an attacker nuke your database.

+ +
+

XKCD: Exploits of a Mom

+ +

https://xkcd.com/327/

+
+ +

Here is an example of code that is vulnerable to SQL injection:

+
// BAD BAD BAD
+let id = 1
+let name = textField.text
+try dbQueue.write { db in
+    try db.execute(sql: "UPDATE students SET name = '\(name)' WHERE id = \(id)")
+}
+
+ +

If the user enters a funny string like Robert'; DROP TABLE students; --, SQLite will see the following SQL, and drop your database table instead of updating a name as intended:

+
UPDATE students SET name = 'Robert';
+DROP TABLE students;
+--' WHERE id = 1
+
+ +

To avoid those problems, never embed raw values in your SQL queries. The only correct technique is to provide arguments to your raw SQL queries:

+
let name = textField.text
+try dbQueue.write { db in
+    // Good
+    try db.execute(
+        sql: "UPDATE students SET name = ? WHERE id = ?",
+        arguments: [name, id])
+
+    // Just as good
+    try db.execute(
+        sql: "UPDATE students SET name = :name WHERE id = :id",
+        arguments: ["name": name, "id": id])
+}
+
+ +

When you use records and the query interface, GRDB always prevents SQL injection for you:

+
let id = 1
+let name = textField.text
+try dbQueue.write { db in
+    if var student = try Student.fetchOne(db, key: id) {
+        student.name = name
+        try student.update(db)
+    }
+}
+
+

Error Handling

+ +

GRDB can throw DatabaseError, PersistenceError, or crash your program with a fatal error.

+ +

Considering that a local database is not some JSON loaded from a remote server, GRDB focuses on trusted databases. Dealing with untrusted databases requires extra care.

+ + +

DatabaseError

+ +

DatabaseError are thrown on SQLite errors:

+
do {
+    try db.execute(
+        sql: "INSERT INTO pet (masterId, name) VALUES (?, ?)",
+        arguments: [1, "Bobby"])
+} catch let error as DatabaseError {
+    // The SQLite error code: 19 (SQLITE_CONSTRAINT)
+    error.resultCode
+
+    // The extended error code: 787 (SQLITE_CONSTRAINT_FOREIGNKEY)
+    error.extendedResultCode
+
+    // The eventual SQLite message: FOREIGN KEY constraint failed
+    error.message
+
+    // The eventual erroneous SQL query
+    // "INSERT INTO pet (masterId, name) VALUES (?, ?)"
+    error.sql
+
+    // Full error description:
+    // "SQLite error 19 with statement `INSERT INTO pet (masterId, name)
+    //  VALUES (?, ?)` arguments [1, "Bobby"]: FOREIGN KEY constraint failed""
+    error.description
+}
+
+ +

SQLite uses codes to distinguish between various errors:

+
do {
+    try ...
+} catch let error as DatabaseError where error.extendedResultCode == .SQLITE_CONSTRAINT_FOREIGNKEY {
+    // foreign key constraint error
+} catch let error as DatabaseError where error.resultCode == .SQLITE_CONSTRAINT {
+    // any other constraint error
+} catch let error as DatabaseError {
+    // any other database error
+}
+
+ +

In the example above, error.extendedResultCode is a precise extended result code, and error.resultCode is a less precise primary result code. Extended result codes are refinements of primary result codes, as SQLITE_CONSTRAINT_FOREIGNKEY is to SQLITE_CONSTRAINT, for example. See SQLite result codes for more information.

+ +

As a convenience, extended result codes match their primary result code in a switch statement:

+
do {
+    try ...
+} catch let error as DatabaseError {
+    switch error.extendedResultCode {
+    case ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY:
+        // foreign key constraint error
+    case ResultCode.SQLITE_CONSTRAINT:
+        // any other constraint error
+    default:
+        // any other database error
+    }
+}
+
+ +
+

:warning: Warning: SQLite has progressively introduced extended result codes accross its versions. The SQLite release notes are unfortunately not quite clear about that: write your handling of extended result codes with care.

+
+

PersistenceError

+ +

PersistenceError is thrown by the PersistableRecord protocol, in a single case: when the update method could not find any row to update:

+
do {
+    try player.update(db)
+} catch let PersistenceError.recordNotFound(databaseTableName: table, key: key) {
+    print("Key \(key) was not found in table \(table).")
+}
+
+

Fatal Errors

+ +

Fatal errors notify that the program, or the database, has to be changed.

+ +

They uncover programmer errors, false assumptions, and prevent misuses. Here are a few examples:

+ +
    +
  • The code asks for a non-optional value, when the database contains NULL:

    +
    // fatal error: could not convert NULL to String.
    +let name: String = row["name"]
    +
    + +

    Solution: fix the contents of the database, use NOT NULL constraints, or load an optional:

    +
    let name: String? = row["name"]
    +
  • +
  • Conversion from database value to Swift type fails:

    +
    // fatal error: could not convert "Mom’s birthday" to Date.
    +let date: Date = row["date"]
    +
    +// fatal error: could not convert "" to URL.
    +let url: URL = row["url"]
    +
    + +

    Solution: fix the contents of the database, or use DatabaseValue to handle all possible cases:

    +
    let dbValue: DatabaseValue = row["date"]
    +if dbValue.isNull {
    +    // Handle NULL
    +} else if let date = Date.fromDatabaseValue(dbValue) {
    +    // Handle valid date
    +} else {
    +    // Handle invalid date
    +}
    +
  • +
  • The database can’t guarantee that the code does what it says:

    +
    // fatal error: table player has no unique index on column email
    +try Player.deleteOne(db, key: ["email": "arthur@example.com"])
    +
    + +

    Solution: add a unique index to the player.email column, or use the deleteAll method to make it clear that you may delete more than one row:

    +
    try Player.filter(Column("email") == "arthur@example.com").deleteAll(db)
    +
  • +
  • Database connections are not reentrant:

    +
    // fatal error: Database methods are not reentrant.
    +dbQueue.write { db in
    +    dbQueue.write { db in
    +        ...
    +    }
    +}
    +
    + +

    Solution: avoid reentrancy, and instead pass a database connection along.

  • +
+

How to Deal with Untrusted Inputs

+ +

Let’s consider the code below:

+
let sql = "SELECT ..."
+
+// Some untrusted arguments for the query
+let arguments: [String: Any] = ...
+let rows = try Row.fetchCursor(db, sql: sql, arguments: StatementArguments(arguments))
+
+while let row = try rows.next() {
+    // Some untrusted database value:
+    let date: Date? = row[0]
+}
+
+ +

It has two opportunities to throw fatal errors:

+ +
    +
  • Untrusted arguments: The dictionary may contain values that do not conform to the DatabaseValueConvertible protocol, or may miss keys required by the statement.
  • +
  • Untrusted database content: The row may contain a non-null value that can’t be turned into a date.
  • +
+ +

In such a situation, you can still avoid fatal errors by exposing and handling each failure point, one level down in the GRDB API:

+
// Untrusted arguments
+if let arguments = StatementArguments(arguments) {
+    let statement = try db.makeSelectStatement(sql: sql)
+    try statement.validate(arguments: arguments)
+    statement.unsafeSetArguments(arguments)
+
+    var cursor = try Row.fetchCursor(statement)
+    while let row = try iterator.next() {
+        // Untrusted database content
+        let dbValue: DatabaseValue = row[0]
+        if dbValue.isNull {
+            // Handle NULL
+        if let date = Date.fromDatabaseValue(dbValue) {
+            // Handle valid date
+        } else {
+            // Handle invalid date
+        }
+    }
+}
+
+ +

See prepared statements and DatabaseValue for more information.

+

Error Log

+ +

SQLite can be configured to invoke a callback function containing an error code and a terse error message whenever anomalies occur.

+ +

This global error callback must be configured early in the lifetime of your application:

+
Database.logError = { (resultCode, message) in
+    NSLog("%@", "SQLite error \(resultCode): \(message)")
+}
+
+ +
+

:warning: Warning: Database.logError must be set before any database connection is opened. This includes the connections that your application opens with GRDB, but also connections opened by other tools, such as third-party libraries. Setting it after a connection has been opened is an SQLite misuse, and has no effect.

+
+ +

See The Error And Warning Log for more information.

+

Unicode

+ +

SQLite lets you store unicode strings in the database.

+ +

However, SQLite does not provide any unicode-aware string transformations or comparisons.

+

Unicode functions

+ +

The UPPER and LOWER built-in SQLite functions are not unicode-aware:

+
// "JéRôME"
+try String.fetchOne(db, sql: "SELECT UPPER('Jérôme')")
+
+ +

GRDB extends SQLite with SQL functions that call the Swift built-in string functions capitalized, lowercased, uppercased, localizedCapitalized, localizedLowercased and localizedUppercased:

+
// "JÉRÔME"
+let uppercased = DatabaseFunction.uppercase
+try String.fetchOne(db, sql: "SELECT \(uppercased.name)('Jérôme')")
+
+ +

Those unicode-aware string functions are also readily available in the query interface:

+
Player.select(nameColumn.uppercased)
+
+

String Comparison

+ +

SQLite compares strings in many occasions: when you sort rows according to a string column, or when you use a comparison operator such as = and <=.

+ +

The comparison result comes from a collating function, or collation. SQLite comes with three built-in collations that do not support Unicode: binary, nocase, and rtrim.

+ +

GRDB comes with five extra collations that leverage unicode-aware comparisons based on the standard Swift String comparison functions and operators:

+ +
    +
  • unicodeCompare (uses the built-in <= and == Swift operators)
  • +
  • caseInsensitiveCompare
  • +
  • localizedCaseInsensitiveCompare
  • +
  • localizedCompare
  • +
  • localizedStandardCompare
  • +
+ +

A collation can be applied to a table column. All comparisons involving this column will then automatically trigger the comparison function:

+
try db.create(table: "player") { t in
+    // Guarantees case-insensitive email unicity
+    t.column("email", .text).unique().collate(.nocase)
+
+    // Sort names in a localized case insensitive way
+    t.column("name", .text).collate(.localizedCaseInsensitiveCompare)
+}
+
+// Players are sorted in a localized case insensitive way:
+let players = try Player.order(nameColumn).fetchAll(db)
+
+ +
+

:warning: Warning: SQLite requires host applications to provide the definition of any collation other than binary, nocase and rtrim. When a database file has to be shared or migrated to another SQLite library of platform (such as the Android version of your application), make sure you provide a compatible collation.

+
+ +

If you can’t or don’t want to define the comparison behavior of a column (see warning above), you can still use an explicit collation in SQL requests and in the query interface:

+
let collation = DatabaseCollation.localizedCaseInsensitiveCompare
+let players = try Player.fetchAll(db,
+    sql: "SELECT * FROM player ORDER BY name COLLATE \(collation.name))")
+let players = try Player.order(nameColumn.collating(collation)).fetchAll(db)
+
+ +

You can also define your own collations:

+
let collation = DatabaseCollation("customCollation") { (lhs, rhs) -> NSComparisonResult in
+    // return the comparison of lhs and rhs strings.
+}
+dbQueue.add(collation: collation) // Or dbPool.add(collation: ...)
+
+

Memory Management

+ +

Both SQLite and GRDB use non-essential memory that help them perform better.

+ +

You can reclaim this memory with the releaseMemory method:

+
// Release as much memory as possible.
+dbQueue.releaseMemory()
+dbPool.releaseMemory()
+
+ +

This method blocks the current thread until all current database accesses are completed, and the memory collected.

+

Memory Management on iOS

+ +

The iOS operating system likes applications that do not consume much memory.

+ +

Database queues and pools can call the releaseMemory method for you, when application receives memory warnings, and when application enters background: call the setupMemoryManagement method after creating the queue or pool instance:

+
let dbQueue = try DatabaseQueue(...)
+dbQueue.setupMemoryManagement(in: UIApplication.shared)
+
+

Data Protection

+ +

Data Protection lets you protect files so that they are encrypted and unavailable until the device is unlocked.

+ +

Data protection can be enabled globally for all files created by an application.

+ +

You can also explicitly protect a database, by configuring its enclosing directory. This will not only protect the database file, but also all temporary files created by SQLite (including the persistent .shm and .wal files created by database pools).

+ +

For example, to explicitly use complete protection:

+
// Paths
+let fileManager = FileManager.default
+let directoryURL = try fileManager
+    .url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
+    .appendingPathComponent("database", isDirectory: true)
+let databaseURL = directoryURL.appendingPathComponent("db.sqlite")
+
+// Create directory if needed
+var isDirectory: ObjCBool = false
+if !fileManager.fileExists(atPath: directoryURL.path, isDirectory: &isDirectory) {
+    try fileManager.createDirectory(atPath: directoryURL.path, withIntermediateDirectories: false)
+} else if !isDirectory.boolValue {
+    throw NSError(domain: NSCocoaErrorDomain, code: NSFileWriteFileExistsError, userInfo: nil)
+}
+
+// Enable data protection
+try fileManager.setAttributes([.protectionKey : FileProtectionType.complete], ofItemAtPath: directoryURL.path)
+
+// Open database
+let dbQueue = try DatabaseQueue(path: databaseURL.path)
+
+ +

When a database is protected, an application that runs in the background on a locked device won’t be able to read or write from it. Instead, it will get DatabaseError with code SQLITE_IOERR (10) “disk I/O error”, or SQLITE_AUTH (23) “not authorized”.

+ +

You can catch those errors and wait for UIApplicationDelegate.applicationProtectedDataDidBecomeAvailable(_:) or UIApplicationProtectedDataDidBecomeAvailable notification in order to retry the failed database operation.

+

Concurrency

+ + +

Guarantees and Rules

+ +

GRDB ships with three concurrency modes:

+ +
    +
  • DatabaseQueue opens a single database connection, and serializes all database accesses.
  • +
  • DatabasePool manages a pool of several database connections, and allows concurrent reads and writes.
  • +
  • DatabaseSnapshot opens a single read-only database connection on an unchanging database content, and (currently) serializes all database accesses
  • +
+ +

All foster application safety: regardless of the concurrency mode you choose, GRDB provides you with the same guarantees, as long as you follow three rules.

+ +
    +
  • :bowtie: Guarantee 1: writes are always serialized. At every moment, there is no more than a single thread that is writing into the database.

    + +
    +

    Database writes always happen in a unique serial dispatch queue, named the writer protected dispatch queue.

    +
  • +
  • :bowtie: Guarantee 2: reads are always isolated. This means that they are guaranteed an immutable view of the database, and that you can perform subsequent fetches without fearing eventual concurrent writes to mess with your application logic:

    +
    try dbPool.read { db in // or dbQueue.read
    +    // Guaranteed to be equal
    +    let count1 = try Player.fetchCount(db)
    +    let count2 = try Player.fetchCount(db)
    +}
    +
    + +
    +

    In database queues, reads happen in the same protected dispatch queue as writes: isolation is just a consequence of the serialization of database accesses

    + +

    Database pools and snapshots both use the “snapshot isolation” made possible by SQLite’s WAL mode (see Isolation In SQLite).

    +
  • +
  • :bowtie: Guarantee 3: requests don’t fail, unless a database constraint violation, a programmer mistake, or a very low-level issue such as a disk error or an unreadable database file. GRDB grants correct use of SQLite, and particularly avoids locking errors and other SQLite misuses.

  • +
+ +

Those guarantees hold as long as you follow three rules:

+ +
    +
  • :point_up: Rule 1: Have a unique instance of DatabaseQueue or DatabasePool connected to any database file.

    + +

    This means that opening a new connection each time you access the database is a bad idea. Do share a single connection instead.

    + +

    See the Demo Application for a sample app that sets up a single database queue that is available throughout the application.

    + +

    See App Group Containers for the specific setup required by applications that share their database files.

    +
    // SAFE CONCURRENCY
    +func fetchCurrentUser(_ db: Database) throws -> User? {
    +    return try User.fetchOne(db)
    +}
    +// dbQueue is a singleton defined somewhere in your app
    +let user = try dbQueue.read { db in // or dbPool.read
    +    try fetchCurrentUser(db)
    +}
    +
    +// UNSAFE CONCURRENCY
    +// This method fails when some other thread is currently writing into
    +// the database.
    +func currentUser() throws -> User? {
    +    let dbQueue = try DatabaseQueue(...)
    +    return try dbQueue.read { db in
    +        try User.fetchOne(db)
    +    }
    +}
    +let user = try currentUser()
    +
  • +
  • :point_up: Rule 2: Group related statements within a single call to a DatabaseQueue or DatabasePool database access method (or use snapshots).

    + +

    Database access methods isolate your groups of related statements against eventual database updates performed by other threads, and guarantee a consistent view of the database. This isolation is only guaranteed inside the closure argument of those methods. Two consecutive calls do not guarantee isolation:

    +
    // SAFE CONCURRENCY
    +try dbPool.read { db in  // or dbQueue.read
    +    // Guaranteed to be equal:
    +    let count1 = try Place.fetchCount(db)
    +    let count2 = try Place.fetchCount(db)
    +}
    +
    +// UNSAFE CONCURRENCY
    +// Those two values may be different because some other thread may have
    +// modified the database between the two blocks:
    +let count1 = try dbPool.read { db in try Place.fetchCount(db) }
    +let count2 = try dbPool.read { db in try Place.fetchCount(db) }
    +
    + +

    In the same vein, when you fetch values that depends on some database updates, group them:

    +
    // SAFE CONCURRENCY
    +try dbPool.write { db in
    +    // The count is guaranteed to be non-zero
    +    try Place(...).insert(db)
    +    let count = try Place.fetchCount(db)
    +}
    +
    +// UNSAFE CONCURRENCY
    +// The count may be zero because some other thread may have performed
    +// a deletion between the two blocks:
    +try dbPool.write { db in try Place(...).insert(db) }
    +let count = try dbPool.read { db in try Place.fetchCount(db) }
    +
    + +

    On that last example, see Advanced DatabasePool if you look after extra performance.

  • +
  • :point_up: Rule 3: When you perform several modifications of the database that temporarily put the database in an inconsistent state, make sure those modifications are grouped within a transaction.

    +
    // SAFE CONCURRENCY
    +try dbPool.write { db in               // or dbQueue.write
    +    try Credit(destinationAccount, amount).insert(db)
    +    try Debit(sourceAccount, amount).insert(db)
    +}
    +
    +// SAFE CONCURRENCY
    +try dbPool.writeInTransaction { db in  // or dbQueue.inTransaction
    +    try Credit(destinationAccount, amount).insert(db)
    +    try Debit(sourceAccount, amount).insert(db)
    +    return .commit
    +}
    +
    +// UNSAFE CONCURRENCY
    +try dbPool.writeWithoutTransaction { db in
    +    try Credit(destinationAccount, amount).insert(db)
    +    // <- Concurrent dbPool.read sees a partial db update here
    +    try Debit(sourceAccount, amount).insert(db)
    +}
    +
    + +

    Without transaction, DatabasePool.read { ... } may see the first statement, but not the second, and access a database where the balance of accounts is not zero. A highly bug-prone situation.

    + +

    So do use transactions in order to guarantee database consistency accross your application threads: that’s what they are made for.

  • +
+

Differences between Database Queues and Pools

+ +

Despite the common guarantees and rules shared by database queues and pools, those two database accessors don’t have the same behavior.

+ +

Database queues serialize all database accesses, reads, and writes. There is never more than one thread that uses the database. In the image below, we see how three threads can see the database as time passes:

+ +

DatabaseQueueScheduling

+ +

Database pools also serialize all writes. But they allow concurrent reads and writes, and isolate reads so that they don’t see changes performed by other threads. This gives a very different picture:

+ +

DatabasePoolScheduling

+ +

See how, with database pools, two reads can see different database states at the same time.

+ +

For more information about database pools, grab information about SQLite WAL mode and snapshot isolation. See Database Observation when you look after automatic notifications of database changes.

+

Advanced DatabasePool

+ + +

The concurrentRead Method

+ +

Database pools are very concurrent, since all reads can run in parallel, and can even run during write operations. But writes are still serialized: at any given point in time, there is no more than a single thread that is writing into the database.

+ +

When your application modifies the database, and then reads some value that depends on those modifications, you may want to avoid locking the writer queue longer than necessary:

+
try dbPool.write { db in
+    // Increment the number of players
+    try Player(...).insert(db)
+
+    // Read the number of players. The writer queue is still locked :-(
+    let count = try Player.fetchCount(db)
+}
+
+ +

A wrong solution is to chain a write then a read, as below. Don’t do that, because another thread may modify the database in between, and make the read unreliable:

+
// WRONG
+try dbPool.write { db in
+    // Increment the number of players
+    try Player(...).insert(db)
+}
+// <- other threads can write in the database here
+try dbPool.read { db in
+    // Read some random value :-(
+    let count = try Player.fetchCount(db)
+}
+
+ +

The correct solution is the concurrentRead method, which must be called from within a write block, outside of any transaction.

+ +

concurrentRead returns a future value which you consume on any dispatch queue, with the wait() method:

+
// CORRECT
+let futureCount: DatabaseFuture<Int> = try dbPool.writeWithoutTransaction { db in
+    // increment the number of players
+    try Player(...).insert(db)
+
+    // <- not in a transaction here
+    let futureCount = dbPool.concurrentRead { db
+        return try Player.fetchCount(db)
+    }
+    return futureCount
+}
+// <- The writer queue has been unlocked :-)
+
+// Wait for the player count
+let count: Int = try futureCount.wait()
+
+ +

concurrentRead blocks until it can guarantee its closure argument an isolated access to the last committed state of the database. It then asynchronously executes the closure.

+ +

The closure can run concurrently with eventual updates performed after concurrentRead: those updates won’t be visible from within the closure. In the example below, the number of players is guaranteed to be non-zero, even though it is fetched concurrently with the player deletion:

+
try dbPool.writeWithoutTransaction { db in
+    // Increment the number of players
+    try Player(...).insert(db)
+
+    let futureCount = dbPool.concurrentRead { db
+        // Guaranteed to be non-zero
+        return try Player.fetchCount(db)
+    }
+
+    try Player.deleteAll(db)
+}
+
+ +

Transaction Observers can also use concurrentRead in their databaseDidCommit method in order to process database changes without blocking other threads that want to write into the database.

+

The barrierWriteWithoutTransaction Method

+
try dbPool.barrierWriteWithoutTransaction { db in
+    // Exclusive database access
+}
+
+ +

The barrier write guarantees exclusive access to the database: the method blocks until all concurrent database accesses are completed, reads and writes, and postpones all other accesses until it completes.

+ +

There is a known limitation: reads performed by database snapshots are out of scope, and may run concurrently with the barrier.

+

Database Snapshots

+ +

Database pool can take snapshots. A database snapshot sees an unchanging database content, as it existed at the moment it was created.

+ +

“Unchanging” means that a snapshot never sees any database modifications during all its lifetime. And yet it doesn’t prevent database updates. This “magic” is made possible by SQLite’s WAL mode (see Isolation In SQLite).

+ +

You create snapshots from a database pool:

+
let snapshot = try dbPool.makeSnapshot()
+
+ +

You can create as many snapshots as you need, regardless of the maximum number of readers in the pool. A snapshot database connection is closed when the snapshot gets deallocated.

+ +

A snapshot can be used from any thread. Its read methods is synchronous, and blocks the current thread until your database statements are executed:

+
// Read values:
+try snapshot.read { db in
+    let players = try Player.fetchAll(db)
+    let playerCount = try Player.fetchCount(db)
+}
+
+// Extract a value from the database:
+let playerCount = try snapshot.read { db in
+    try Player.fetchCount(db)
+}
+
+ +

When you want to control the latest committed changes seen by a snapshot, create the snapshot from the pool’s writer protected dispatch queue, outside of any transaction:

+
let snapshot1 = try dbPool.writeWithoutTransaction { db -> DatabaseSnapshot in
+    try db.inTransaction {
+        // delete all players
+        try Player.deleteAll()
+        return .commit
+    }
+
+    // <- not in a transaction here
+    return dbPool.makeSnapshot()
+}
+// <- Other threads may modify the database here
+let snapshot2 = try dbPool.makeSnapshot()
+
+try snapshot1.read { db in
+    // Guaranteed to be zero
+    try Player.fetchCount(db)
+}
+
+try snapshot2.read { db in
+    // Could be anything
+    try Player.fetchCount(db)
+}
+
+ +
+

:point_up: Note: snapshots currently serialize all database accesses. In the future, snapshots may allow concurrent reads.

+
+

DatabaseWriter and DatabaseReader Protocols

+ +

Both DatabaseQueue and DatabasePool adopt the DatabaseReader and DatabaseWriter protocols. DatabaseSnapshot adopts DatabaseReader only.

+ +

These protocols provide a unified API that let you write generic code that targets all concurrency modes. They fuel, for example:

+ + + +

Only five types adopt those protocols: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. Expanding this set is not supported: any future GRDB release may break your custom writers and readers, without notice.

+ +

DatabaseReader and DatabaseWriter provide the smallest common guarantees: they don’t erase the differences between queues, pools, and snapshots. See for example Differences between Database Queues and Pools.

+ +

However, you can prevent some parts of your application from writing in the database by giving them a DatabaseReader:

+
// This class can read in the database, but can't write into it.
+class MyReadOnlyComponent {
+    let reader: DatabaseReader
+
+    init(reader: DatabaseReader) {
+        self.reader = reader
+    }
+}
+
+let dbQueue: DatabaseQueue = ...
+let component = MyReadOnlyComponent(reader: dbQueue)
+
+ +
+

:point_up: Note: DatabaseReader is not a secure way to prevent an application component from writing in the database, because write access is just a cast away:

+
if let dbQueue = reader as? DatabaseQueue {
+    try dbQueue.write { ... }
+}
+
+
+

Asynchronous APIs

+ +

Database queues, pools, snapshots, as well as their common protocols DatabaseReader and DatabaseWriter provide asynchronous database access methods.

+ + +

asyncRead

+ +

The asyncRead method can be used from any thread. It submits your database statements for asynchronous execution on a protected dispatch queue:

+
reader.asyncRead { (result: Result<Database, Error>) in
+    try {
+        let db = try result.get()
+        let players = try Player.fetchAll(db)
+    } catch {
+        // handle error
+    }
+}
+
+ +

The argument function accepts a standard Result<Database, Error> which may contain a failure if it was impossible to start a reading access to the database.

+ +

Any attempt at modifying the database throws an error.

+ +

When you use a database queue or a database snapshot, the read has to wait for any eventual concurrent database access performed by this queue or snapshot to complete.

+ +

When you use a database pool, reads are generally non-blocking, unless the maximum number of concurrent reads has been reached. In this case, a read has to wait for another read to complete. That maximum number can be configured.

+ +
+

:point_up: Note: because it uses the standard Result type, asyncRead is only available with a Swift 5+ compiler, starting Xcode 10.2.

+
+

asyncWrite

+ +

The asyncWrite method can be used from any thread. It submits your database statements for asynchronous execution on a protected dispatch queue, wrapped inside a database transaction:

+
writer.asyncWrite({ (db: Database) in
+    try Player(...).insert(db)
+}, completion: { (db: Database, result: Result<Void, Error>) in
+    switch result {
+    case let .success:
+        // handle transaction success
+    case let .failure(error):
+        // handle transaction error
+    }
+})
+
+ +

asyncWrite accepts two function arguments. The first one executes your database updates. The second one is a completion function which accepts a database connection and the result of the asynchronous transaction.

+ +

On the first unhandled error during database updates, all changes are reverted, the whole transaction is rollbacked, and the error is passed to the completion function.

+ +

When the transaction completes successfully, the result of the first function is contained in the standard Result passed to the completion function:

+
writer.asyncWrite({ (db: Database) -> Int in
+    try Player(...).insert(db)
+    return try Player.fetchCount(db)
+}, completion: { (db: Database, result: Result<Int, Error>) in
+    switch result {
+    case let .success(newPlayerCount):
+        print("new player count: \(newPlayerCount)")
+    case let .failure(error):
+        // handle transaction error
+    }
+})
+
+ +

The scheduled asynchronous transaction has to wait for any eventual concurrent database write to complete before it can start.

+ +
+

:point_up: Note: because it uses the standard Result type, asyncWrite is only available with a Swift 5+ compiler, starting Xcode 10.2.

+
+

asyncWriteWithoutTransaction

+ +

The asyncWriteWithoutTransaction method can be used from any thread. It submits your database statements for asynchronous execution on a protected dispatch queue, outside of any transaction:

+
writer.asyncWriteWithoutTransaction { (db: Database) in
+    try {
+        try Player(...).insert(db)
+    } catch {
+        // handle error
+    }
+}
+
+ +

Writing outside of any transaction is dangerous. You should almost always prefer the asyncWrite method described above. Please see Transactions and Savepoints for more information.

+ +

The scheduled asynchronous updates have to wait for any eventual concurrent database write to complete before they can start.

+

asyncConcurrentRead

+ +

The asyncConcurrentRead method is available on database pools only. It is the asynchronous equivalent of the concurrentRead described in the Advanced DatabasePool chapter.

+ +

It must be called from a writing dispatch queue, outside of any transaction. You’ll get a fatal error otherwise.

+ +

The closure argument is guaranteed to see the database in the last committed state at the moment this method is called. Eventual concurrent database updates are not visible inside the block.

+ +

asyncConcurrentRead blocks until it can guarantee its closure argument an isolated access to the last committed state of the database. It then asynchronously executes the closure.

+ +

In the example below, the number of players is fetched concurrently with the player insertion. Yet the future is guaranteed to return zero:

+
try writer.asyncWriteWithoutTransaction { db in
+    do {
+        // Delete all players
+        try Player.deleteAll()
+
+        // <- not in a transaction here
+        // Count players concurrently
+        writer.asyncConcurrentRead { (result: Result<Database, Error>) in
+            try {
+                let db = try result.get()
+                // Guaranteed to be zero
+                let count = try Player.fetchCount()
+            } catch {
+                // handle error
+            }
+        }
+
+        // Insert a player
+        try Player(...).insert(db)
+    } catch {
+        // handle error
+    }
+}
+
+ +
+

:point_up: Note: because it uses the standard Result type, asyncWriteWithoutTransaction is only available with a Swift 5+ compiler, starting Xcode 10.2.

+
+

Unsafe Concurrency APIs

+ +

Database queues, pools, snapshots, as well as their common protocols DatabaseReader and DatabaseWriter provide unsafe database access methods. Unsafe APIs lift concurrency guarantees, and allow advanced yet unsafe patterns.

+ +
    +
  • unsafeRead

    + +

    The unsafeRead method is synchronous, and blocks the current thread until your database statements are executed in a protected dispatch queue. GRDB does just the bare minimum to provide a database connection that can read.

    + +

    When used on a database pool, reads are no longer isolated:

    +
    dbPool.unsafeRead { db in
    +    // Those two values may be different because some other thread
    +    // may have inserted or deleted a player between the two requests:
    +    let count1 = try Player.fetchCount(db)
    +    let count2 = try Player.fetchCount(db)
    +}
    +
    + +

    When used on a database queue, the closure argument is allowed to write in the database.

  • +
  • unsafeReentrantRead

    + +

    The unsafeReentrantRead behaves just as unsafeRead (see above), and allows reentrant calls:

    +
    dbPool.read { db1 in
    +    // No "Database methods are not reentrant" fatal error:
    +    dbPool.unsafeReentrantRead { db2 in
    +        dbPool.unsafeReentrantRead { db3 in
    +            ...
    +        }
    +    }
    +}
    +
    + +

    Reentrant database accesses make it very easy to break the second safety rule, which says: “group related statements within a single call to a DatabaseQueue or DatabasePool database access method.”. Using a reentrant method is pretty much likely the sign of a wrong application architecture that needs refactoring.

    + +

    There is a single valid use case for reentrant methods, which is when you are unable to control database access scheduling.

  • +
  • unsafeReentrantWrite

    + +

    The unsafeReentrantWrite method is synchronous, and blocks the current thread until your database statements are executed in a protected dispatch queue. Writes are serialized: eventual concurrent database updates are postponed until the block has executed.

    + +

    Reentrant calls are allowed:

    +
    dbQueue.write { db1 in
    +    // No "Database methods are not reentrant" fatal error:
    +    dbQueue.unsafeReentrantWrite { db2 in
    +        dbQueue.unsafeReentrantWrite { db3 in
    +            ...
    +        }
    +    }
    +}
    +
    + +

    Reentrant database accesses make it very easy to break the second safety rule, which says: “group related statements within a single call to a DatabaseQueue or DatabasePool database access method.”. Using a reentrant method is pretty much likely the sign of a wrong application architecture that needs refactoring.

    + +

    There is a single valid use case for reentrant methods, which is when you are unable to control database access scheduling.

  • +
+

Performance

+ +

GRDB is a reasonably fast library, and can deliver quite efficient SQLite access. See Comparing the Performances of Swift SQLite libraries for an overview.

+ +

You’ll find below general advice when you do look after performance:

+ +
    +
  • Focus
  • +
  • Know your platform
  • +
  • Use transactions
  • +
  • Don’t do useless work
  • +
  • Learn about SQL strengths and weaknesses
  • +
  • Avoid strings & dictionaries
  • +
+

Performance tip: focus

+ +

You don’t know which part of your program needs improvement until you have run a benchmarking tool.

+ +

Don’t make any assumption, avoid optimizing code too early, and use Instruments.

+

Performance tip: know your platform

+ +

If your application processes a huge JSON file and inserts thousands of rows in the database right from the main thread, it will quite likely become unresponsive, and provide a sub-quality user experience.

+ +

If not done yet, read the Concurrency Programming Guide and learn how to perform heavy computations without blocking your application.

+ +

Most GRBD APIs are synchronous. Spawning them into parallel queues is as easy as:

+
DispatchQueue.global().async { 
+    dbQueue.write { db in
+        // Perform database work
+    }
+    DispatchQueue.main.async { 
+        // update your user interface
+    }
+}
+
+

Performance tip: use transactions

+ +

Performing multiple updates to the database is much faster when executed inside a transaction. This is because a transaction allows SQLite to postpone writing changes to disk until the final commit:

+
// Inefficient
+try dbQueue.inDatabase { db in // or dbPool.writeWithoutTransaction
+    for player in players {
+        try player.insert(db)
+    }
+}
+
+// Efficient
+try dbQueue.write { db in      // or dbPool.write
+    for player in players {
+        try player.insert(db)
+    }
+}
+
+// Efficient
+try dbQueue.inTransaction { db in // or dbPool.writeInTransaction
+    for player in players {
+        try player.insert(db)
+    }
+    return .commit
+}
+
+

Performance tip: don’t do useless work

+ +

Obviously, no code is faster than any code.

+ +

Don’t fetch columns you don’t use

+
// SELECT * FROM player
+try Player.fetchAll(db)
+
+// SELECT id, name FROM player
+try Player.select(idColumn, nameColumn).fetchAll(db)
+
+ +

If your Player type can’t be built without other columns (it has non-optional properties for other columns), do define and use a different type.

+ +

See Columns Selected by a Request for more information.

+ +

Don’t fetch rows you don’t use

+ +

Use fetchOne when you need a single value, and otherwise limit your queries at the database level:

+
// Wrong way: this code may discard hundreds of useless database rows
+let players = try Player.order(scoreColumn.desc).fetchAll(db)
+let hallOfFame = players.prefix(5)
+
+// Better way
+let hallOfFame = try Player.order(scoreColumn.desc).limit(5).fetchAll(db)
+
+ +

Don’t copy values unless necessary

+ +

Particularly: the Array returned by the fetchAll method, and the cursor returned by fetchCursor aren’t the same:

+ +

fetchAll copies all values from the database into memory, when fetchCursor iterates database results as they are generated by SQLite, taking profit from SQLite efficiency.

+ +

You should only load arrays if you need to keep them for later use (such as iterating their contents in the main thread). Otherwise, use fetchCursor.

+ +

See fetching methods for more information about fetchAll and fetchCursor. See also the Row.dataNoCopy method.

+ +

Don’t update rows unless necessary

+ +

An UPDATE statement is costly: SQLite has to look for the updated row, update values, and write changes to disk.

+ +

When the overwritten values are the same as the existing ones, it’s thus better to avoid performing the UPDATE statement:.

+
if player.hasDatabaseChanges {
+    try player.update(db)
+}
+
+ +

See Record Comparison for more information.

+

Performance tip: learn about SQL strengths and weaknesses

+ +

Consider a simple use case: your store application has to display a list of authors with the number of available books:

+ +
    +
  • J. M. Coetzee (6)
  • +
  • Herman Melville (1)
  • +
  • Alice Munro (3)
  • +
  • Kim Stanley Robinson (7)
  • +
  • Oliver Sacks (4)
  • +
+ +

The following code is inefficient. It is an example of the N+1 problem, because it performs one query to load the authors, and then N queries, as many as there are authors. This turns very inefficient as the number of authors grows:

+
// SELECT * FROM author
+let authors = try Author.fetchAll(db)
+for author in authors {
+    // SELECT COUNT(*) FROM book WHERE authorId = ...
+    author.bookCount = try Book.filter(authorIdColumn == author.id).fetchCount(db)
+}
+
+ +

Instead, perform a single query:

+
let sql = """
+    SELECT author.*, COUNT(book.id) AS bookCount
+    FROM author
+    LEFT JOIN book ON book.authorId = author.id
+    GROUP BY author.id
+    """
+let authors = try Author.fetchAll(db, sql: sql)
+
+ +

In the example above, consider extending your Author with an extra bookCount property, or define and use a different type.

+ +

Generally, define indexes on your database tables, and use SQLite’s efficient query planning:

+ + +

Performance tip: avoid strings & dictionaries

+ +

The String and Dictionary Swift types are better avoided when you look for the best performance.

+ +

Now GRDB records, for your convenience, do use strings and dictionaries:

+
class Player : Record {
+    var id: Int64?
+    var name: String
+    var email: String
+
+    required init(_ row: Row) {
+        id = row["id"]       // String
+        name = row["name"]   // String
+        email = row["email"] // String
+        super.init()
+    }
+
+    override func encode(to container: inout PersistenceContainer) {
+        container["id"] = id              // String
+        container["name"] = name          // String
+        container["email"] = email        // String
+    }
+}
+
+ +

When convenience hurts performance, you can still use records, but you have better avoiding their string and dictionary-based methods.

+ +

For example, when fetching values, prefer loading columns by index:

+
// Strings & dictionaries
+let players = try Player.fetchAll(db)
+
+// Column indexes
+// SELECT id, name, email FROM player
+let request = Player.select(idColumn, nameColumn, emailColumn)
+let rows = try Row.fetchCursor(db, request)
+while let row = try rows.next() {
+    let id: Int64 = row[0]
+    let name: String = row[1]
+    let email: String = row[2]
+    let player = Player(id: id, name: name, email: email)
+    ...
+}
+
+ +

When inserting values, use reusable prepared statements, and set statements values with an array:

+
// Strings & dictionaries
+for player in players {
+    try player.insert(db)
+}
+
+// Prepared statement
+let insertStatement = db.prepareStatement("INSERT INTO player (name, email) VALUES (?, ?)")
+for player in players {
+    // Only use the unsafe arguments setter if you are sure that you provide
+    // all statement arguments. A mistake can store unexpected values in
+    // the database.
+    insertStatement.unsafeSetArguments([player.name, player.email])
+    try insertStatement.execute()
+}
+
+

FAQ

+ + +

How do I create a database in my application?

+ +

This question assumes that your application has to create a new database from scratch. If your app has to open an existing database that is embedded inside your application as a resource, see How do I open a database stored as a resource of my application? instead.

+ +

The database has to be stored in a valid place where it can be created and modified. For example, in the Application Support directory:

+
let databaseURL = try FileManager.default
+    .url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
+    .appendingPathComponent("db.sqlite")
+let dbQueue = try DatabaseQueue(path: databaseURL.path)
+
+

How do I open a database stored as a resource of my application?

+ +

If your application does not need to modify the database, open a read-only connection to your resource:

+
var config = Configuration()
+config.readonly = true
+let dbPath = Bundle.main.path(forResource: "db", ofType: "sqlite")!
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+ +

If the application should modify the database, you need to copy it to a place where it can be modified. For example, in the Application Support directory. Only then, open a connection:

+
let fileManager = FileManager.default
+let dbPath = try fileManager
+    .url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
+    .appendingPathComponent("db.sqlite")
+    .path
+if !fileManager.fileExists(atPath: dbPath) {
+    let dbResourcePath = Bundle.main.path(forResource: "db", ofType: "sqlite")!
+    try fileManager.copyItem(atPath: dbResourcePath, toPath: dbPath)
+}
+let dbQueue = try DatabaseQueue(path: dbPath)
+
+

How do I close a database connection?

+ +

Database connections are managed by database queues and pools. A connection is closed when its database queue or pool is deallocated, and all usages of this connection are completed.

+ +

Database accesses that run in background threads postpone the closing of connections.

+

How do I print a request as SQL?

+ +

When you want to debug a request that does not deliver the expected results, you may want to print the SQL that is actually executed.

+ +

You can turn your request into a SQLRequest instance:

+
try dbQueue.read { db in
+    let request = Wine
+        .filter(originColumn == "Burgundy")
+        .order(priceColumn)
+
+    let sqlRequest = try SQLRequest(db, request: request)
+    print(sqlRequest.sql)
+    // Prints SELECT * FROM wine WHERE origin = ? ORDER BY price
+    print(sqlRequest.arguments)
+    // Prints ["Burgundy"]
+}
+
+ +

Another option is to setup a tracing function that will print out all SQL requests executed by your application. You provide the trace function when you connect to the database:

+
var config = Configuration()
+config.trace = { print($0) } // Prints all SQL statements
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+try dbQueue.read { db in
+    let wines = Wine
+        .filter(originColumn == "Burgundy")
+        .order(priceColumn)
+        .fetchAll(db)
+    // Prints SELECT * FROM wine WHERE origin = 'Burgundy' ORDER BY price
+}
+
+ +
+

:point_up: Note: the generated SQL may change between GRDB releases, without notice: don’t have your application rely on any specific SQL output.

+
+

Generic parameter ‘T’ could not be inferred

+ +

You may get this error when using the read and write methods of database queues and pools:

+
// Generic parameter 'T' could not be inferred
+let string = try dbQueue.read { db in
+    let result = try String.fetchOne(db, ...)
+    return result
+}
+
+ +

This is a limitation of the Swift compiler.

+ +

The general workaround is to explicitly declare the type of the closure result:

+
// General Workaround
+let string = try dbQueue.read { db -> String? in
+    let result = try String.fetchOne(db, ...)
+    return result
+}
+
+ +

You can also, when possible, write a single-line closure:

+
// Single-line closure workaround:
+let string = try dbQueue.read { db in
+    try String.fetchOne(db, ...)
+}
+
+

SQLite error 10 “disk I/O error”, SQLite error 23 “not authorized”

+ +

Those errors may be the sign that SQLite can’t access the database due to data protection.

+ +

When your application should be able to run in the background on a locked device, it has to catch this error, and, for example, wait for UIApplicationDelegate.applicationProtectedDataDidBecomeAvailable(_:) or UIApplicationProtectedDataDidBecomeAvailable notification and retry the failed database operation.

+
do {
+    try ...
+} catch let error as DatabaseError where
+    error.resultCode == .SQLITE_IOERR ||
+    error.resultCode == .SQLITE_AUTH
+{
+    // Handle possible data protection error
+}
+
+ +

This error can also be prevented altogether by using a more relaxed file protection.

+

SQLite error 21 “wrong number of statement arguments” with LIKE queries

+ +

You may get the error “wrong number of statement arguments” when executing a LIKE query similar to:

+
let name = textField.text
+let players = try dbQueue.read { db in
+    try Player.fetchAll(db, sql: "SELECT * FROM player WHERE name LIKE '%?%'", arguments: [name])
+}
+
+ +

The problem lies in the '%?%' pattern.

+ +

SQLite only interprets ? as a parameter when it is a placeholder for a whole value (int, double, string, blob, null). In this incorrect query, ? is just a character in the '%?%' string: it is not a query parameter, and is not processed in any way. See https://www.sqlite.org/lang_expr.html#varparam for more information about SQLite parameters.

+ +

To fix the error, you can feed the request with the pattern itself, instead of the name:

+
let name = textField.text
+let players: [Player] = try dbQueue.read { db in
+    let pattern = "%\(name)%"
+    return try Player.fetchAll(db, sql: "SELECT * FROM player WHERE name LIKE ?", arguments: [pattern])
+}
+
+

What Are Experimental Features?

+ +

Since GRDB 1.0, all backwards compatibility guarantees of semantic versioning apply: no breaking change will happen until the next major version of the library.

+ +

There is an exception, though: experimental features, marked with the “:fire: EXPERIMENTAL” badge. Those are advanced features that are too young, or lack user feedback. They are not stabilized yet.

+ +

Those experimental features are not protected by semantic versioning, and may break between two minor releases of the library. To help them becoming stable, your feedback is greatly appreciated.

+

Sample Code

+ + + +
+ +

Thanks

+ + + +
+ +

URIs don’t change: people change them.

+

Changes Tracking

+ +

This chapter has been renamed Record Comparison.

+

FetchedRecordsController

+ +

This chapter has moved.

+

Persistable Protocol

+ +

This protocol has been renamed PersistableRecord in GRDB 3.0.

+

RowConvertible Protocol

+ +

This protocol has been renamed FetchableRecord in GRDB 3.0.

+

TableMapping Protocol

+ +

This protocol has been renamed TableRecord in GRDB 3.0.

+

Customized Decoding of Database Rows

+ +

This chapter has been renamed Beyond FetchableRecord.

+ + +

This chapter has moved.

+

Enabling FTS5 Support

+ +

This chapter has moved.

+

Dealing with External Connections

+ +

This chapter has been superseded by App Group Containers.

+ +
+
+ +
+
+ + + diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/js/jazzy.js b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/js/jazzy.js new file mode 100755 index 000000000..c31dc05e4 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/js/jazzy.js @@ -0,0 +1,59 @@ +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +function toggleItem($link, $content) { + var animationDuration = 300; + $link.toggleClass('token-open'); + $content.slideToggle(animationDuration); +} + +function itemLinkToContent($link) { + return $link.parent().parent().next(); +} + +// On doc load + hash-change, open any targetted item +function openCurrentItemIfClosed() { + if (window.jazzy.docset) { + return; + } + var $link = $(`.token[href="${location.hash}"]`); + $content = itemLinkToContent($link); + if ($content.is(':hidden')) { + toggleItem($link, $content); + } +} + +$(openCurrentItemIfClosed); +$(window).on('hashchange', openCurrentItemIfClosed); + +// On item link ('token') click, toggle its discussion +$('.token').on('click', function(event) { + if (window.jazzy.docset) { + return; + } + var $link = $(this); + toggleItem($link, itemLinkToContent($link)); + + // Keeps the document from jumping to the hash. + var href = $link.attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Clicks on links to the current, closed, item need to open the item +$("a:not('.token')").on('click', function() { + if (location == this.href) { + openCurrentItemIfClosed(); + } +}); diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/js/jquery.min.js b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/js/jquery.min.js new file mode 100644 index 000000000..a1c07fd80 --- /dev/null +++ b/docs/4.8/docsets/GRDB.docset/Contents/Resources/Documents/js/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0A tracing function that takes an SQL string.

"},"Typealiases.html#/s:4GRDB16SQLiteConnectiona":{"name":"SQLiteConnection","abstract":"

A raw SQLite connection, suitable for the SQLite C API.

"},"Typealiases.html#/s:4GRDB15SQLiteStatementa":{"name":"SQLiteStatement","abstract":"

A raw SQLite statement, suitable for the SQLite C API.

"},"Typealiases.html#/FTS5TokenCallback":{"name":"FTS5TokenCallback","abstract":"

A low-level SQLite function that lets FTS5Tokenizer notify tokens.

"},"Typealiases.html#/FTS5WrapperTokenCallback":{"name":"FTS5WrapperTokenCallback","abstract":"

A function that lets FTS5WrapperTokenizer notify tokens.

"},"Typealiases.html#/s:4GRDB17FTS5TokenCallbacka":{"name":"FTS5TokenCallback","abstract":"

A low-level SQLite function that lets FTS5Tokenizer notify tokens.

"},"Typealiases.html#/s:4GRDB24FTS5WrapperTokenCallbacka":{"name":"FTS5WrapperTokenCallback","abstract":"

A function that lets FTS5WrapperTokenizer notify tokens.

"},"Structs/FTS5TokenFlags.html#/s:SY8rawValue03RawB0Qzvp":{"name":"rawValue","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenFlags.html#/s:s9OptionSetP8rawValuex03RawD0Qz_tcfc":{"name":"init(rawValue:)","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenFlags.html#/s:4GRDB14FTS5TokenFlagsV9colocatedACvpZ":{"name":"colocated","abstract":"

FTS5_TOKEN_COLOCATED

","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenizerDescriptor.html#/s:4GRDB23FTS5TokenizerDescriptorV10componentsSaySSGvp":{"name":"components","abstract":"

The tokenizer components

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/s:4GRDB23FTS5TokenizerDescriptorV10componentsACSaySSG_tcfc":{"name":"init(components:)","abstract":"

Creates an FTS5 tokenizer descriptor.

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/s:4GRDB23FTS5TokenizerDescriptorV5ascii10separatorsACShySJG_tFZ":{"name":"ascii(separators:)","abstract":"

The “ascii” tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/s:4GRDB23FTS5TokenizerDescriptorV6porter8wrappingA2CSg_tFZ":{"name":"porter(wrapping:)","abstract":"

See https://www.sqlite.org/fts5.html#porter_tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/s:4GRDB23FTS5TokenizerDescriptorV9unicode6110diacritics10separators15tokenCharactersAcA0B0V10DiacriticsO_ShySJGALtFZ":{"name":"unicode61(diacritics:separators:tokenCharacters:)","abstract":"

An “unicode61” tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5Tokenization.html#/s:SY8rawValue03RawB0Qzvp":{"name":"rawValue","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/s:s9OptionSetP8rawValuex03RawD0Qz_tcfc":{"name":"init(rawValue:)","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/s:4GRDB16FTS5TokenizationV5queryACvpZ":{"name":"query","abstract":"

FTS5_TOKENIZE_QUERY

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/s:4GRDB16FTS5TokenizationV6prefixACvpZ":{"name":"prefix","abstract":"

FTS5_TOKENIZE_PREFIX

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/s:4GRDB16FTS5TokenizationV8documentACvpZ":{"name":"document","abstract":"

FTS5_TOKENIZE_DOCUMENT

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/s:4GRDB16FTS5TokenizationV3auxACvpZ":{"name":"aux","abstract":"

FTS5_TOKENIZE_AUX

","parent_name":"FTS5Tokenization"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV03rawC0SSvp":{"name":"rawPattern","abstract":"

The raw pattern string. Guaranteed to be a valid FTS5 pattern.

","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV18matchingAnyTokenInACSgSS_tcfc":{"name":"init(matchingAnyTokenIn:)","abstract":"

Creates a pattern that matches any token found in the input string;","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV19matchingAllTokensInACSgSS_tcfc":{"name":"init(matchingAllTokensIn:)","abstract":"

Creates a pattern that matches all tokens found in the input string;","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV14matchingPhraseACSgSS_tcfc":{"name":"init(matchingPhrase:)","abstract":"

Creates a pattern that matches a contiguous string; returns nil if no","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV20matchingPrefixPhraseACSgSS_tcfc":{"name":"init(matchingPrefixPhrase:)","abstract":"

Creates a pattern that matches a contiguous string prefix; returns","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV13databaseValueAA08DatabaseE0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV17fromDatabaseValueyACSgAA0eF0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an FTS5Pattern initialized from dbValue, if it","parent_name":"FTS5Pattern"},"Structs/FTS5/Diacritics.html#/s:4GRDB4FTS5V10DiacriticsO4keepyA2EmF":{"name":"keep","abstract":"

Do not remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS5/Diacritics.html#/s:4GRDB4FTS5V10DiacriticsO12removeLegacyyA2EmF":{"name":"removeLegacy","abstract":"

Remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS5/Diacritics.html#/remove":{"name":"remove","abstract":"

Remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS5/Diacritics.html":{"name":"Diacritics","abstract":"

Options for Latin script characters. Matches the raw “remove_diacritics”","parent_name":"FTS5"},"Structs/FTS5.html#/s:4GRDB4FTS5VACycfc":{"name":"init()","abstract":"

Creates a FTS5 module suitable for the Database","parent_name":"FTS5"},"Structs/FTS5.html#/s:4GRDB4FTS5V10moduleNameSSvp":{"name":"moduleName","abstract":"

The virtual table module name

","parent_name":"FTS5"},"Structs/FTS5.html#/s:4GRDB4FTS5V19makeTableDefinitionAA0bdE0CyF":{"name":"makeTableDefinition()","abstract":"

Don’t use this method.

","parent_name":"FTS5"},"Structs/FTS5.html#/s:4GRDB4FTS5V15moduleArguments3for2inSaySSGAA0B15TableDefinitionC_AA8DatabaseCtKF":{"name":"moduleArguments(for:in:)","abstract":"

Don’t use this method.

","parent_name":"FTS5"},"Structs/FTS5.html#/s:4GRDB4FTS5V8database_9didCreate5usingyAA8DatabaseC_SSAA0B15TableDefinitionCtKF":{"name":"database(_:didCreate:using:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS5"},"Structs/AnyValueReducer.html#/s:4GRDB15AnyValueReducerV5fetch5valueACyxq_GxAA8DatabaseCKc_q_Sgxctcfc":{"name":"init(fetch:value:)","abstract":"

Creates a reducer whose fetch(_:) and value(_:) methods wrap and","parent_name":"AnyValueReducer"},"Structs/AnyValueReducer.html#/s:4GRDB15AnyValueReducerVyACyxq_Gqd__c7FetchedQyd__Rsz0C0Qyd__Rs_AA0cD0Rd__lufc":{"name":"init(_:)","abstract":"

Creates a reducer that wraps and forwards operations to reducer.

","parent_name":"AnyValueReducer"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationV19requiresWriteAccessSbvp":{"name":"requiresWriteAccess","abstract":"

Default is false. Set this property to true when the observation","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationV10schedulingAA0B10SchedulingOvp":{"name":"scheduling","abstract":"

scheduling controls how fresh values are notified. Default","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationV10mapReduceryACyqd__Gqd__AA8DatabaseC_xtKclF":{"name":"mapReducer(_:)","abstract":"

Experimental

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE13trackingCountyACyAA0B8ReducersO16RemoveDuplicatesVy_AF5FetchVy_SiGGGqd__AA0I7RequestRd__lFZ":{"name":"trackingCount(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies its","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingAllyACyAA0B8ReducersO0E6ValuesVy_10RowDecoderQyd__GGqd__AA12FetchRequestRd__AA08DatabaseB11ConvertibleAJRQlFZ":{"name":"trackingAll(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingOneyACyAA0B8ReducersO0eB0Vy_10RowDecoderQyd__GGqd__AA12FetchRequestRd__AA08DatabaseB11ConvertibleAJRQlFZ":{"name":"trackingOne(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingAllyACyAA0B8ReducersO0E14OptionalValuesVy_10RowDecoder_8_WrappedQYd__GGqd__AA12FetchRequestRd__AA01_G8ProtocolAIRpd__AA08DatabaseB11ConvertibleAKRQlFZ":{"name":"trackingAll(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingAllyACyAA0B8ReducersO0E7RecordsVy_10RowDecoderQyd__GGqd__AA12FetchRequestRd__AA15FetchableRecordAJRQlFZ":{"name":"trackingAll(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingOneyACyAA0B8ReducersO0E6RecordVy_10RowDecoderQyd__GGqd__AA12FetchRequestRd__AA09FetchableG0AJRQlFZ":{"name":"trackingOne(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingAllyACyAA0B8ReducersO0E4RowsVGqd__AA12FetchRequestRd__AA3RowC0J7DecoderRtd__lFZ":{"name":"trackingAll(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingOneyACyAA0B8ReducersO0E3RowVGqd__AA12FetchRequestRd__AA0G0C0G7DecoderRtd__lFZ":{"name":"trackingOne(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE5start2in8onChangeAA19TransactionObserver_pAA14DatabaseReader_p_y0B0QzctKF":{"name":"start(in:onChange:)","abstract":"

Starts the value observation in the provided database reader (such as","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE5start2in7onError0G6ChangeAA19TransactionObserver_pAA14DatabaseReader_p_ys0H0_pcy0B0QzctF":{"name":"start(in:onError:onChange:)","abstract":"

Starts the value observation in the provided database reader (such as","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE8tracking_7reducerACyxGAA25DatabaseRegionConvertible_pd_xAA0G0CKctFZ":{"name":"tracking(_:reducer:)","abstract":"

Returns a ValueObservation which observes regions, and notifies the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE8tracking_7reducerACyxGSayAA25DatabaseRegionConvertible_pG_xAA0G0CKctFZ":{"name":"tracking(_:reducer:)","abstract":"

Returns a ValueObservation which observes regions, and notifies the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE8tracking5valueACyAA0B8ReducersO5FetchVy_qd__GGqd__AA8DatabaseCKc_tlFZ":{"name":"tracking(value:)","abstract":"

Creates a ValueObservation which notifies the values returned by the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE8tracking_5fetchACyAA0B8ReducersO5FetchVy_qd__GGAA25DatabaseRegionConvertible_pd_qd__AA0H0CKctlFZ":{"name":"tracking(_:fetch:)","abstract":"

Creates a ValueObservation which observes regions, and notifies the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE8tracking_5fetchACyAA0B8ReducersO5FetchVy_qd__GGSayAA25DatabaseRegionConvertible_pG_qd__AA0H0CKctlFZ":{"name":"tracking(_:fetch:)","abstract":"

Creates a ValueObservation which observes regions, and notifies the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine2Vy_qd__qd_0_GGACyqd__G_ACyqd_0_GtAA0B7ReducerRd__AaMRd_0_r0_lFZ":{"name":"combine(_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE7combineyACyAA0B8ReducersO3MapVy_AG8Combine2Vy_xqd__Gqd_0_GGACyqd__G_qd_0_0B0Qz_APQyd__tctAaDRd__r0_lF":{"name":"combine(_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine3Vy_qd__qd_0_qd_1_GGACyqd__G_ACyqd_0_GACyqd_1_GtAA0B7ReducerRd__AaNRd_0_AaNRd_1_r1_lFZ":{"name":"combine(_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE7combineyACyAA0B8ReducersO3MapVy_AG8Combine3Vy_xqd__qd_0_Gqd_1_GGACyqd__G_ACyqd_0_Gqd_1_0B0Qz_AQQyd__AQQyd_0_tctAaDRd__AaDRd_0_r1_lF":{"name":"combine(_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine4Vy_qd__qd_0_qd_1_qd_2_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_GtAA0B7ReducerRd__AaORd_0_AaORd_1_AaORd_2_r2_lFZ":{"name":"combine(_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE7combineyACyAA0B8ReducersO3MapVy_AG8Combine4Vy_xqd__qd_0_qd_1_Gqd_2_GGACyqd__G_ACyqd_0_GACyqd_1_Gqd_2_0B0Qz_ARQyd__ARQyd_0_ARQyd_1_tctAaDRd__AaDRd_0_AaDRd_1_r2_lF":{"name":"combine(_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine5Vy_qd__qd_0_qd_1_qd_2_qd_3_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_GACyqd_3_GtAA0B7ReducerRd__AaPRd_0_AaPRd_1_AaPRd_2_AaPRd_3_r3_lFZ":{"name":"combine(_:_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE7combineyACyAA0B8ReducersO3MapVy_AG8Combine5Vy_xqd__qd_0_qd_1_qd_2_Gqd_3_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_Gqd_3_0B0Qz_ASQyd__ASQyd_0_ASQyd_1_ASQyd_2_tctAaDRd__AaDRd_0_AaDRd_1_AaDRd_2_r3_lF":{"name":"combine(_:_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine6Vy_qd__qd_0_qd_1_qd_2_qd_3_qd_4_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_GACyqd_3_GACyqd_4_GtAA0B7ReducerRd__AaQRd_0_AaQRd_1_AaQRd_2_AaQRd_3_AaQRd_4_r4_lFZ":{"name":"combine(_:_:_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine7Vy_qd__qd_0_qd_1_qd_2_qd_3_qd_4_qd_5_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_GACyqd_3_GACyqd_4_GACyqd_5_GtAA0B7ReducerRd__AaRRd_0_AaRRd_1_AaRRd_2_AaRRd_3_AaRRd_4_AaRRd_5_r5_lFZ":{"name":"combine(_:_:_:_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine8Vy_qd__qd_0_qd_1_qd_2_qd_3_qd_4_qd_5_qd_6_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_GACyqd_3_GACyqd_4_GACyqd_5_GACyqd_6_GtAA0B7ReducerRd__AaSRd_0_AaSRd_1_AaSRd_2_AaSRd_3_AaSRd_4_AaSRd_5_AaSRd_6_r6_lFZ":{"name":"combine(_:_:_:_:_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE10compactMapyACyAA0B8ReducersO07CompactF0Vy_xqd__GGqd__Sg0B0QzclF":{"name":"compactMap(_:)","abstract":"

Returns a ValueObservation which notifies the non-nil results of calling","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE3mapyACyAA0B8ReducersO3MapVy_xqd__GGqd__0B0QzclF":{"name":"map(_:)","abstract":"

Returns a ValueObservation which notifies the results of calling the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzSQ0B0RpzlE20distinctUntilChangedACyAA0B8ReducersO16RemoveDuplicatesVy_xGGyF":{"name":"distinctUntilChanged()","abstract":"

Returns a ValueObservation which filters out consecutive equal values.

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzSQ0B0RpzlE16removeDuplicatesACyAA0B8ReducersO06RemoveF0Vy_xGGyF":{"name":"removeDuplicates()","abstract":"

Returns a ValueObservation which filters out consecutive equal values.

","parent_name":"ValueObservation"},"Structs/Inflections.html#/s:4GRDB11InflectionsVACycfc":{"name":"init()","abstract":"

Undocumented

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV6plural_7options_ySS_So26NSRegularExpressionOptionsVSStF":{"name":"plural(_:options:_:)","abstract":"

Appends a pluralization rule.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV8singular_7options_ySS_So26NSRegularExpressionOptionsVSStF":{"name":"singular(_:options:_:)","abstract":"

Appends a singularization rule.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV16uncountableWordsyySaySSGF":{"name":"uncountableWords(_:)","abstract":"

Appends uncountable words.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV15irregularSuffixyySS_SStF":{"name":"irregularSuffix(_:_:)","abstract":"

Appends an irregular singular/plural pair.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV9pluralizeyS2SF":{"name":"pluralize(_:)","abstract":"

Returns a pluralized string.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV11singularizeyS2SF":{"name":"singularize(_:)","abstract":"

Returns a singularized string.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV7defaultACvpZ":{"name":"default","abstract":"

The default inflections

","parent_name":"Inflections"},"Structs/PersistenceConflictPolicy.html#/s:4GRDB25PersistenceConflictPolicyV27conflictResolutionForInsertAA8DatabaseC0cF0Ovp":{"name":"conflictResolutionForInsert","abstract":"

The conflict resolution algorithm for insertions

","parent_name":"PersistenceConflictPolicy"},"Structs/PersistenceConflictPolicy.html#/s:4GRDB25PersistenceConflictPolicyV27conflictResolutionForUpdateAA8DatabaseC0cF0Ovp":{"name":"conflictResolutionForUpdate","abstract":"

The conflict resolution algorithm for updates

","parent_name":"PersistenceConflictPolicy"},"Structs/PersistenceConflictPolicy.html#/s:4GRDB25PersistenceConflictPolicyV6insert6updateAcA8DatabaseC0C10ResolutionO_AItcfc":{"name":"init(insert:update:)","abstract":"

Creates a policy

","parent_name":"PersistenceConflictPolicy"},"Structs/FetchedRecordsSectionInfo.html#/s:4GRDB25FetchedRecordsSectionInfoV08numberOfC0Sivp":{"name":"numberOfRecords","abstract":"

The number of records (rows) in the section.

","parent_name":"FetchedRecordsSectionInfo"},"Structs/FetchedRecordsSectionInfo.html#/s:4GRDB25FetchedRecordsSectionInfoV7recordsSayxGvp":{"name":"records","abstract":"

The array of records in the section.

","parent_name":"FetchedRecordsSectionInfo"},"Structs/PersistenceContainer.html#/s:4GRDB20PersistenceContainerVyAA24DatabaseValueConvertible_pSgSScip":{"name":"subscript(_:)","abstract":"

Accesses the value associated with the given column.

","parent_name":"PersistenceContainer"},"Structs/PersistenceContainer.html#/s:4GRDB20PersistenceContainerVyAA24DatabaseValueConvertible_pSgxcAA16ColumnExpressionRzluip":{"name":"subscript(_:)","abstract":"

Accesses the value associated with the given column.

","parent_name":"PersistenceContainer"},"Structs/ForeignKey.html#/s:4GRDB10ForeignKeyV_2toACSaySSG_AESgtcfc":{"name":"init(_:to:)","abstract":"

Creates a ForeignKey intended to define a record association.

","parent_name":"ForeignKey"},"Structs/ForeignKey.html#/s:4GRDB10ForeignKeyV_2toACSayAA16ColumnExpression_pG_AFSgtcfc":{"name":"init(_:to:)","abstract":"

Creates a ForeignKey intended to define a record association.

","parent_name":"ForeignKey"},"Structs/AllColumns.html#/s:4GRDB10AllColumnsVACycfc":{"name":"init()","abstract":"

Undocumented

","parent_name":"AllColumns"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV3absACvpZ":{"name":"abs","abstract":"

The ABS function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV3avgACvpZ":{"name":"avg","abstract":"

The AVG function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV6ifNullACvpZ":{"name":"ifNull","abstract":"

The IFNULL function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV6lengthACvpZ":{"name":"length","abstract":"

The LENGTH function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV3maxACvpZ":{"name":"max","abstract":"

The MAX function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV3minACvpZ":{"name":"min","abstract":"

The MIN function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV3sumACvpZ":{"name":"sum","abstract":"

The SUM function name

","parent_name":"SQLFunctionName"},"Structs/SQLExpressionLiteral.html#/s:4GRDB20SQLExpressionLiteralV3sqlSSvp":{"name":"sql","abstract":"

Undocumented

","parent_name":"SQLExpressionLiteral"},"Structs/SQLExpressionLiteral.html#/s:4GRDB20SQLExpressionLiteralV9argumentsAA18StatementArgumentsVvp":{"name":"arguments","abstract":"

Undocumented

","parent_name":"SQLExpressionLiteral"},"Structs/SQLExpressionLiteral.html#/s:4GRDB20SQLExpressionLiteralV3sql9argumentsACSS_AA18StatementArgumentsVtcfc":{"name":"init(sql:arguments:)","abstract":"

Experimental

","parent_name":"SQLExpressionLiteral"},"Structs/SQLExpressionLiteral.html#/s:4GRDB20SQLExpressionLiteralV7literalAcA10SQLLiteralV_tcfc":{"name":"init(literal:)","abstract":"

Experimental

","parent_name":"SQLExpressionLiteral"},"Structs/Column.html#/s:4GRDB6ColumnV5rowIDACvpZ":{"name":"rowID","abstract":"

The hidden rowID column

","parent_name":"Column"},"Structs/Column.html#/s:4GRDB6ColumnV4nameSSvp":{"name":"name","abstract":"

The name of the column

","parent_name":"Column"},"Structs/Column.html#/s:4GRDB6ColumnVyACSScfc":{"name":"init(_:)","abstract":"

Creates a column given its name.

","parent_name":"Column"},"Structs/Column.html#/s:4GRDB6ColumnVyACs9CodingKey_pcfc":{"name":"init(_:)","abstract":"

Creates a column given a CodingKey.

","parent_name":"Column"},"Structs/Column.html#/s:4GRDB6ColumnV4rankACvpZ":{"name":"rank","abstract":"

The FTS5 rank column

","parent_name":"Column"},"Structs/QueryInterfaceRequest.html#/s:4GRDB12FetchRequestP10RowDecoderQa":{"name":"RowDecoder","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6selectyACyxGSayAA13SQLSelectable_pGF":{"name":"select(_:)","abstract":"

Creates a request which selects selection.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6select_2asACyqd__GSayAA13SQLSelectable_pG_qd__mtlF":{"name":"select(_:as:)","abstract":"

Creates a request which selects selection, and fetches values of","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6select_2asACyqd__GAA13SQLSelectable_pd_qd__mtlF":{"name":"select(_:as:)","abstract":"

Creates a request which selects selection, and fetches values of","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6select3sql9arguments2asACyqd__GSS_AA18StatementArgumentsVqd__mtlF":{"name":"select(sql:arguments:as:)","abstract":"

Creates a request which selects sql, and fetches values of","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6select7literal2asACyqd__GAA10SQLLiteralV_qd__mtlF":{"name":"select(literal:as:)","abstract":"

Creates a request which selects an SQL literal, and fetches values of","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV9annotated4withACyxGSayAA13SQLSelectable_pG_tF":{"name":"annotated(with:)","abstract":"

Creates a request which appends selection.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6filteryACyxGAA14SQLExpressible_pAA8DatabaseCKcF":{"name":"filter(_:)","abstract":"

Creates a request with the provided predicate promise added to the","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV5orderyACyxGSayAA15SQLOrderingTerm_pGAA8DatabaseCKcF":{"name":"order(_:)","abstract":"

Creates a request with the provided orderings promise.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV8reversedACyxGyF":{"name":"reversed()","abstract":"

Creates a request that reverses applied orderings.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV9unorderedACyxGyF":{"name":"unordered()","abstract":"

Creates a request without any ordering.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV5groupyACyxGSayAA14SQLExpressible_pGAA8DatabaseCKcF":{"name":"group(_:)","abstract":"

Creates a request grouped according to expressions promise.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6havingyACyxGAA14SQLExpressible_pF":{"name":"having(_:)","abstract":"

Creates a request with the provided predicate added to the","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV8distinctACyxGyF":{"name":"distinct()","abstract":"

Creates a request which returns distinct rows.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV5limit_6offsetACyxGSi_SiSgtF":{"name":"limit(_:offset:)","abstract":"

Creates a request which fetches limit rows, starting at offset.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV7aliasedyACyxGAA10TableAliasCF":{"name":"aliased(_:)","abstract":"

Creates a request that allows you to define expressions that target","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV02asD02ofACyqd__Gqd__m_tlF":{"name":"asRequest(of:)","abstract":"

Creates a request bound to type Target.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A11TableRecordRzlE9annotated4withACyxGAA20AssociationAggregateVyxGd_tF":{"name":"annotated(with:)","abstract":"

Creates a request which appends aggregates to the current selection.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A11TableRecordRzlE9annotated4withACyxGSayAA20AssociationAggregateVyxGG_tF":{"name":"annotated(with:)","abstract":"

Creates a request which appends aggregates to the current selection.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A11TableRecordRzlE6havingyACyxGAA20AssociationAggregateVyxGF":{"name":"having(_:)","abstract":"

Creates a request which appends the provided aggregate predicate to","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A24MutablePersistableRecordRzlE9deleteAllySiAA8DatabaseCKF":{"name":"deleteAll(_:)","abstract":"

Deletes matching rows; returns the number of deleted rows.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A24MutablePersistableRecordRzlE9updateAll_10onConflict_SiAA8DatabaseC_AH0K10ResolutionOSgSayAA16ColumnAssignmentVGtKF":{"name":"updateAll(_:onConflict:_:)","abstract":"

Updates matching rows; returns the number of updated rows.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A24MutablePersistableRecordRzlE9updateAll_10onConflict__SiAA8DatabaseC_AH0K10ResolutionOSgAA16ColumnAssignmentVAMdtKF":{"name":"updateAll(_:onConflict:_:_:)","abstract":"

Updates matching rows; returns the number of updated rows.

","parent_name":"QueryInterfaceRequest"},"Structs/AssociationAggregate.html#/s:4GRDB20AssociationAggregateV7aliasedyACyxGSSF":{"name":"aliased(_:)","abstract":"

Returns an aggregate that is selected in a column with the given name.

","parent_name":"AssociationAggregate"},"Structs/AssociationAggregate.html#/s:4GRDB20AssociationAggregateV6forKeyyACyxGSSF":{"name":"forKey(_:)","abstract":"

Returns an aggregate that is selected in a column with the given name.

","parent_name":"AssociationAggregate"},"Structs/AssociationAggregate.html#/s:4GRDB20AssociationAggregateV7aliasedyACyxGs9CodingKey_pF":{"name":"aliased(_:)","abstract":"

Returns an aggregate that is selected in a column named like the given","parent_name":"AssociationAggregate"},"Structs/AssociationAggregate.html#/s:4GRDB20AssociationAggregateV6forKeyyACyxGs06CodingE0_pF":{"name":"forKey(_:)","abstract":"

Returns an aggregate that is selected in a column named like the given","parent_name":"AssociationAggregate"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV05eraseB14OnSchemaChangeSbvp":{"name":"eraseDatabaseOnSchemaChange","abstract":"

When the eraseDatabaseOnSchemaChange flag is true, the migrator will","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorVACycfc":{"name":"init()","abstract":"

A new migrator.

","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV17registerMigration_7migrateySS_yAA0B0CKctF":{"name":"registerMigration(_:migrate:)","abstract":"

Registers a migration.

","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV44registerMigrationWithDeferredForeignKeyCheck_7migrateySS_yAA0B0CKctF":{"name":"registerMigrationWithDeferredForeignKeyCheck(_:migrate:)","abstract":"

Undocumented

","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV7migrateyyAA0B6Writer_pKF":{"name":"migrate(_:)","abstract":"

Iterate migrations in the same order as they were registered. If a","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV7migrate_4upToyAA0B6Writer_p_SStKF":{"name":"migrate(_:upTo:)","abstract":"

Iterate migrations in the same order as they were registered, up to the","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV17appliedMigrations2inShySSGAA0B6Reader_p_tKF":{"name":"appliedMigrations(in:)","abstract":"

Returns the set of applied migration identifiers.

","parent_name":"DatabaseMigrator"},"Structs/FTS5TokenFlags.html#/rawValue":{"name":"rawValue","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenFlags.html#/init(rawValue:)":{"name":"init(rawValue:)","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenFlags.html#/colocated":{"name":"colocated","abstract":"

FTS5_TOKEN_COLOCATED

","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenizerDescriptor.html#/components":{"name":"components","abstract":"

The tokenizer components

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/init(components:)":{"name":"init(components:)","abstract":"

Creates an FTS5 tokenizer descriptor.

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/ascii(separators:)":{"name":"ascii(separators:)","abstract":"

The “ascii” tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/porter(wrapping:)":{"name":"porter(wrapping:)","abstract":"

See https://www.sqlite.org/fts5.html#porter_tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/unicode61(diacritics:separators:tokenCharacters:)":{"name":"unicode61(diacritics:separators:tokenCharacters:)","abstract":"

An “unicode61” tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5Tokenization.html#/rawValue":{"name":"rawValue","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/init(rawValue:)":{"name":"init(rawValue:)","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/query":{"name":"query","abstract":"

FTS5_TOKENIZE_QUERY

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/prefix":{"name":"prefix","abstract":"

FTS5_TOKENIZE_PREFIX

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/document":{"name":"document","abstract":"

FTS5_TOKENIZE_DOCUMENT

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/aux":{"name":"aux","abstract":"

FTS5_TOKENIZE_AUX

","parent_name":"FTS5Tokenization"},"Structs/FTS5Pattern.html#/rawPattern":{"name":"rawPattern","abstract":"

The raw pattern string. Guaranteed to be a valid FTS5 pattern.

","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/init(matchingAnyTokenIn:)":{"name":"init(matchingAnyTokenIn:)","abstract":"

Creates a pattern that matches any token found in the input string;","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/init(matchingAllTokensIn:)":{"name":"init(matchingAllTokensIn:)","abstract":"

Creates a pattern that matches all tokens found in the input string;","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/init(matchingPhrase:)":{"name":"init(matchingPhrase:)","abstract":"

Creates a pattern that matches a contiguous string; returns nil if no","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/init(matchingPrefixPhrase:)":{"name":"init(matchingPrefixPhrase:)","abstract":"

Creates a pattern that matches a contiguous string prefix; returns","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/databaseValue":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/fromDatabaseValue(_:)":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an FTS5Pattern initialized from dbValue, if it","parent_name":"FTS5Pattern"},"Structs/FTS5/Diacritics.html#/keep":{"name":"keep","abstract":"

Do not remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS5/Diacritics.html#/removeLegacy":{"name":"removeLegacy","abstract":"

Remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS5.html#/init()":{"name":"init()","abstract":"

Creates a FTS5 module suitable for the Database","parent_name":"FTS5"},"Structs/FTS5.html#/moduleName":{"name":"moduleName","abstract":"

The virtual table module name

","parent_name":"FTS5"},"Structs/FTS5.html#/makeTableDefinition()":{"name":"makeTableDefinition()","abstract":"

Don’t use this method.

","parent_name":"FTS5"},"Structs/FTS5.html#/moduleArguments(for:in:)":{"name":"moduleArguments(for:in:)","abstract":"

Don’t use this method.

","parent_name":"FTS5"},"Structs/FTS5.html#/database(_:didCreate:using:)":{"name":"database(_:didCreate:using:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS5"},"Structs/FTS4.html#/s:4GRDB4FTS4VACycfc":{"name":"init()","abstract":"

Creates a FTS4 module suitable for the Database","parent_name":"FTS4"},"Structs/FTS4.html#/s:4GRDB4FTS4V10moduleNameSSvp":{"name":"moduleName","abstract":"

The virtual table module name

","parent_name":"FTS4"},"Structs/FTS4.html#/s:4GRDB4FTS4V19makeTableDefinitionAA0bdE0CyF":{"name":"makeTableDefinition()","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS4"},"Structs/FTS4.html#/s:4GRDB4FTS4V15moduleArguments3for2inSaySSGAA0B15TableDefinitionC_AA8DatabaseCtF":{"name":"moduleArguments(for:in:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS4"},"Structs/FTS4.html#/s:4GRDB4FTS4V8database_9didCreate5usingyAA8DatabaseC_SSAA0B15TableDefinitionCtKF":{"name":"database(_:didCreate:using:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS4"},"Structs/FTS3TokenizerDescriptor.html#/s:4GRDB23FTS3TokenizerDescriptorV6simpleACvpZ":{"name":"simple","abstract":"

The “simple” tokenizer.

","parent_name":"FTS3TokenizerDescriptor"},"Structs/FTS3TokenizerDescriptor.html#/s:4GRDB23FTS3TokenizerDescriptorV6porterACvpZ":{"name":"porter","abstract":"

The “porter” tokenizer.

","parent_name":"FTS3TokenizerDescriptor"},"Structs/FTS3TokenizerDescriptor.html#/unicode61(diacritics:separators:tokenCharacters:)":{"name":"unicode61(diacritics:separators:tokenCharacters:)","abstract":"

The “unicode61” tokenizer.

","parent_name":"FTS3TokenizerDescriptor"},"Structs/FTS3TokenizerDescriptor.html#/s:4GRDB23FTS3TokenizerDescriptorV9unicode6110diacritics10separators15tokenCharactersAcA0B0V10DiacriticsO_ShySJGALtFZ":{"name":"unicode61(diacritics:separators:tokenCharacters:)","abstract":"

The “unicode61” tokenizer.

","parent_name":"FTS3TokenizerDescriptor"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV03rawC0SSvp":{"name":"rawPattern","abstract":"

The raw pattern string. Guaranteed to be a valid FTS3/4 pattern.

","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV03rawC0ACSS_tKcfc":{"name":"init(rawPattern:)","abstract":"

Creates a pattern from a raw pattern string; throws DatabaseError on","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/init(matchingAnyTokenIn:)":{"name":"init(matchingAnyTokenIn:)","abstract":"

Creates a pattern that matches any token found in the input string;","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/init(matchingAllTokensIn:)":{"name":"init(matchingAllTokensIn:)","abstract":"

Creates a pattern that matches all tokens found in the input string;","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/init(matchingPhrase:)":{"name":"init(matchingPhrase:)","abstract":"

Creates a pattern that matches a contiguous string; returns nil if no","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV18matchingAnyTokenInACSgSS_tcfc":{"name":"init(matchingAnyTokenIn:)","abstract":"

Creates a pattern that matches any token found in the input string;","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV19matchingAllTokensInACSgSS_tcfc":{"name":"init(matchingAllTokensIn:)","abstract":"

Creates a pattern that matches all tokens found in the input string;","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV14matchingPhraseACSgSS_tcfc":{"name":"init(matchingPhrase:)","abstract":"

Creates a pattern that matches a contiguous string; returns nil if no","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV13databaseValueAA08DatabaseE0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV17fromDatabaseValueyACSgAA0eF0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an FTS3Pattern initialized from dbValue, if it contains","parent_name":"FTS3Pattern"},"Structs/FTS3/Diacritics.html#/s:4GRDB4FTS3V10DiacriticsO4keepyA2EmF":{"name":"keep","abstract":"

Do not remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS3/Diacritics.html#/s:4GRDB4FTS3V10DiacriticsO12removeLegacyyA2EmF":{"name":"removeLegacy","abstract":"

Remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS3/Diacritics.html#/remove":{"name":"remove","abstract":"

Remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS3/Diacritics.html":{"name":"Diacritics","abstract":"

Options for Latin script characters. Matches the raw “remove_diacritics”","parent_name":"FTS3"},"Structs/FTS3.html#/s:4GRDB4FTS3VACycfc":{"name":"init()","abstract":"

Creates a FTS3 module suitable for the Database","parent_name":"FTS3"},"Structs/FTS3.html#/s:4GRDB4FTS3V10moduleNameSSvp":{"name":"moduleName","abstract":"

The virtual table module name

","parent_name":"FTS3"},"Structs/FTS3.html#/s:4GRDB4FTS3V19makeTableDefinitionAA0bdE0CyF":{"name":"makeTableDefinition()","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS3"},"Structs/FTS3.html#/s:4GRDB4FTS3V15moduleArguments3for2inSaySSGAA0B15TableDefinitionC_AA8DatabaseCtF":{"name":"moduleArguments(for:in:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS3"},"Structs/FTS3.html#/s:4GRDB4FTS3V8database_9didCreate5usingyAA8DatabaseC_SSAA0B15TableDefinitionCtF":{"name":"database(_:didCreate:using:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS3"},"Structs/DatabasePreUpdateEvent/Kind.html#/insert":{"name":"insert","abstract":"

SQLITE_INSERT

","parent_name":"Kind"},"Structs/DatabasePreUpdateEvent/Kind.html#/delete":{"name":"delete","abstract":"

SQLITE_DELETE

","parent_name":"Kind"},"Structs/DatabasePreUpdateEvent/Kind.html#/update":{"name":"update","abstract":"

SQLITE_UPDATE

","parent_name":"Kind"},"Structs/DatabasePreUpdateEvent/Kind.html":{"name":"Kind","abstract":"

An event kind

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/kind":{"name":"kind","abstract":"

The event kind

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/databaseName":{"name":"databaseName","abstract":"

The database name

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/tableName":{"name":"tableName","abstract":"

The table name

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/count":{"name":"count","abstract":"

The number of columns in the row that is being inserted, updated, or deleted.

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/depth":{"name":"depth","abstract":"

1 for inserts, updates, or deletes invoked by top-level triggers;","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/initialRowID":{"name":"initialRowID","abstract":"

The initial rowID of the row being changed for .Update and .Delete changes,","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/finalRowID":{"name":"finalRowID","abstract":"

The final rowID of the row being changed for .Update and .Insert changes,","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/initialDatabaseValues":{"name":"initialDatabaseValues","abstract":"

The initial database values in the row.

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/initialDatabaseValue(atIndex:)":{"name":"initialDatabaseValue(atIndex:)","abstract":"

Returns the initial DatabaseValue at given index.

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/finalDatabaseValues":{"name":"finalDatabaseValues","abstract":"

The final database values in the row.

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/finalDatabaseValue(atIndex:)":{"name":"finalDatabaseValue(atIndex:)","abstract":"

Returns the final DatabaseValue at given index.

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/copy()":{"name":"copy()","abstract":"

Returns an event that can be stored:

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabaseEvent/Kind.html#/s:4GRDB13DatabaseEventV4KindO6insertyA2EmF":{"name":"insert","abstract":"

SQLITE_INSERT

","parent_name":"Kind"},"Structs/DatabaseEvent/Kind.html#/s:4GRDB13DatabaseEventV4KindO6deleteyA2EmF":{"name":"delete","abstract":"

SQLITE_DELETE

","parent_name":"Kind"},"Structs/DatabaseEvent/Kind.html#/s:4GRDB13DatabaseEventV4KindO6updateyA2EmF":{"name":"update","abstract":"

SQLITE_UPDATE

","parent_name":"Kind"},"Structs/DatabaseEvent/Kind.html":{"name":"Kind","abstract":"

An event kind

","parent_name":"DatabaseEvent"},"Structs/DatabaseEvent.html#/s:4GRDB13DatabaseEventV4kindAC4KindOvp":{"name":"kind","abstract":"

The event kind

","parent_name":"DatabaseEvent"},"Structs/DatabaseEvent.html#/s:4GRDB13DatabaseEventV12databaseNameSSvp":{"name":"databaseName","abstract":"

The database name

","parent_name":"DatabaseEvent"},"Structs/DatabaseEvent.html#/s:4GRDB13DatabaseEventV9tableNameSSvp":{"name":"tableName","abstract":"

The table name

","parent_name":"DatabaseEvent"},"Structs/DatabaseEvent.html#/s:4GRDB13DatabaseEventV5rowIDs5Int64Vvp":{"name":"rowID","abstract":"

The rowID of the changed row.

","parent_name":"DatabaseEvent"},"Structs/DatabaseEvent.html#/s:4GRDB13DatabaseEventV4copyACyF":{"name":"copy()","abstract":"

Returns an event that can be stored:

","parent_name":"DatabaseEvent"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO3YMDyA2EmF":{"name":"YMD","abstract":"

The format “yyyy-MM-dd”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO6YMD_HMyA2EmF":{"name":"YMD_HM","abstract":"

The format “yyyy-MM-dd HH:mm”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO7YMD_HMSyA2EmF":{"name":"YMD_HMS","abstract":"

The format “yyyy-MM-dd HH:mm:ss”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO8YMD_HMSSyA2EmF":{"name":"YMD_HMSS","abstract":"

The format “yyyy-MM-dd HH:mm:ss.SSS”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO2HMyA2EmF":{"name":"HM","abstract":"

The format “HH:mm”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO3HMSyA2EmF":{"name":"HMS","abstract":"

The format “HH:mm:ss”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO4HMSSyA2EmF":{"name":"HMSS","abstract":"

The format “HH:mm:ss.SSS”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html":{"name":"Format","abstract":"

The available formats for reading and storing date components.

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV04dateD010Foundation0cD0Vvp":{"name":"dateComponents","abstract":"

The date components

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV6formatAC6FormatOvp":{"name":"format","abstract":"

The database format

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV_6formatAC10Foundation0cD0V_AC6FormatOtcfc":{"name":"init(_:format:)","abstract":"

Creates a DatabaseDateComponents from a DateComponents and a format.

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV15sqliteStatement5indexACs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV13databaseValueAA0bF0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV04fromB5ValueyACSgAA0bF0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a DatabaseDateComponents if dbValue contains a","parent_name":"DatabaseDateComponents"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV7isEmptySbvp":{"name":"isEmpty","abstract":"

Undocumented

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVACycfc":{"name":"init()","abstract":"

Creates empty StatementArguments.

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACxcSTRzAA24DatabaseValueConvertible_pSg7ElementRtzlufc":{"name":"init(_:)","abstract":"

Creates statement arguments from a sequence of optional values.

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACxcSTRzAA24DatabaseValueConvertible7ElementRpzlufc":{"name":"init(_:)","abstract":"

Creates statement arguments from a sequence of optional values.

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACSgSayypGcfc":{"name":"init(_:)","abstract":"

Creates statement arguments from any array. The result is nil unless all","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACSDySSAA24DatabaseValueConvertible_pSgGcfc":{"name":"init(_:)","abstract":"

Creates statement arguments from a sequence of (key, value) dictionary,","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACxcSTRzSS_AA24DatabaseValueConvertible_pSgt7ElementRtzlufc":{"name":"init(_:)","abstract":"

Creates statement arguments from a sequence of (key, value) pairs, such","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACSgSDys11AnyHashableVypGcfc":{"name":"init(_:)","abstract":"

Creates statement arguments from [AnyHashable: Any].

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV6append10contentsOfSDySSAA13DatabaseValueVGAC_tF":{"name":"append(contentsOf:)","abstract":"

Extends statement arguments with other arguments.

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV1poiyA2C_ACtFZ":{"name":"+(_:_:)","abstract":"

Creates a new StatementArguments by extending the left-hand size","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV2apoiyA2C_ACtFZ":{"name":"&+(_:_:)","abstract":"

Creates a new StatementArguments by extending the left-hand size","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV2peoiyyACz_ACtFZ":{"name":"+=(_:_:)","abstract":"

Extends the left-hand size arguments with the right-hand side arguments.

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV12arrayLiteralAcA24DatabaseValueConvertible_pSgd_tcfc":{"name":"init(arrayLiteral:)","abstract":"

Returns a StatementArguments from an array literal:

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV17dictionaryLiteralACSS_AA24DatabaseValueConvertible_pSgtd_tcfc":{"name":"init(dictionaryLiteral:)","abstract":"

Returns a StatementArguments from a dictionary literal:

","parent_name":"StatementArguments"},"Structs/SQLRequest.html#/s:4GRDB12FetchRequestP10RowDecoderQa":{"name":"RowDecoder","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV3sqlSSvp":{"name":"sql","abstract":"

The raw SQL query

","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV9argumentsAA18StatementArgumentsVvp":{"name":"arguments","abstract":"

The request argument

","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV7adapterAA10RowAdapter_pSgvp":{"name":"adapter","abstract":"

The request adapter

","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV3sql9arguments7adapter6cachedACyxGSS_AA18StatementArgumentsVAA10RowAdapter_pSgSbtcfc":{"name":"init(sql:arguments:adapter:cached:)","abstract":"

Creates a request from an SQL string, optional arguments, and","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV7literal7adapter6cachedACyxGAA10SQLLiteralV_AA10RowAdapter_pSgSbtcfc":{"name":"init(literal:adapter:cached:)","abstract":"

Creates a request from an SQLLiteral, and optional row adapter.

","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV_7request6cachedACyxGAA8DatabaseC_qd__SbtKc10RowDecoderQyd__RszAA12FetchRequestRd__lufc":{"name":"init(_:request:cached:)","abstract":"

Creates an SQL request from any other fetch request.

","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV20unicodeScalarLiteralACyxGSS_tcfc":{"name":"init(unicodeScalarLiteral:)","abstract":"

:nodoc

","parent_name":"SQLRequest"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV3sqlSSvp":{"name":"sql","abstract":"

Undocumented

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV9argumentsAA18StatementArgumentsVvp":{"name":"arguments","abstract":"

Undocumented

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV3sql9argumentsACSS_AA18StatementArgumentsVtcfc":{"name":"init(sql:arguments:)","abstract":"

Creates an SQLLiteral from a plain SQL string, and eventual arguments.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV6mapSQLyACS2SKXEKF":{"name":"mapSQL(_:)","abstract":"

Returns a literal whose SQL is transformed by the given closure.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV1poiyA2C_ACtFZ":{"name":"+(_:_:)","abstract":"

Returns the SQLLiteral produced by the concatenation of two literals.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV2peoiyyACz_ACtFZ":{"name":"+=(_:_:)","abstract":"

Appends an SQLLiteral to the receiver.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV6append7literalyAC_tF":{"name":"append(literal:)","abstract":"

Appends an SQLLiteral to the receiver.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV6append3sql9argumentsySS_AA18StatementArgumentsVtF":{"name":"append(sql:arguments:)","abstract":"

Appends a plain SQL string to the receiver, and eventual arguments.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV20unicodeScalarLiteralACSS_tcfc":{"name":"init(unicodeScalarLiteral:)","abstract":"

:nodoc

","parent_name":"SQLLiteral"},"Structs/ScopeAdapter.html#/s:4GRDB12ScopeAdapterVyACSDySSAA03RowC0_pGcfc":{"name":"init(_:)","abstract":"

Creates an adapter that preserves row contents and add scoped rows.

","parent_name":"ScopeAdapter"},"Structs/ScopeAdapter.html#/s:4GRDB12ScopeAdapterV4base6scopesAcA03RowC0_p_SDySSAaF_pGtcfc":{"name":"init(base:scopes:)","abstract":"

Creates an adapter based on the base adapter, and add scoped rows.

","parent_name":"ScopeAdapter"},"Structs/RangeRowAdapter.html#/s:4GRDB15RangeRowAdapterVyACSnySiGcfc":{"name":"init(_:)","abstract":"

Creates a RangeRowAdapter that only exposes a range of columns.

","parent_name":"RangeRowAdapter"},"Structs/RangeRowAdapter.html#/s:4GRDB15RangeRowAdapterVyACSNySiGcfc":{"name":"init(_:)","abstract":"

Creates a RangeRowAdapter that only exposes a range of columns.

","parent_name":"RangeRowAdapter"},"Structs/SuffixRowAdapter.html#/s:4GRDB16SuffixRowAdapterV9fromIndexACSi_tcfc":{"name":"init(fromIndex:)","abstract":"

Creates a SuffixRowAdapter that hides all columns before the","parent_name":"SuffixRowAdapter"},"Structs/ColumnMapping.html#/s:4GRDB13ColumnMappingVyACSDyS2SGcfc":{"name":"init(_:)","abstract":"

Creates a ColumnMapping with a dictionary from mapped column names to","parent_name":"ColumnMapping"},"Structs/EmptyRowAdapter.html#/s:4GRDB15EmptyRowAdapterVACycfc":{"name":"init()","abstract":"

Creates an EmptyRowAdapter

","parent_name":"EmptyRowAdapter"},"Structs/AnyFetchRequest.html#/s:4GRDB12FetchRequestP10RowDecoderQa":{"name":"RowDecoder","parent_name":"AnyFetchRequest"},"Structs/AnyFetchRequest.html#/s:4GRDB15AnyFetchRequestVyACyxGqd__cAA0cD0Rd__lufc":{"name":"init(_:)","abstract":"

Creates a request that wraps and forwards operations to request.

","parent_name":"AnyFetchRequest"},"Structs/AnyFetchRequest.html#/s:4GRDB15AnyFetchRequestVyACyxGAA15SelectStatementC_AA10RowAdapter_pSgtAA8DatabaseC_SbtKccfc":{"name":"init(_:)","abstract":"

Creates a request whose prepare() method wraps and forwards","parent_name":"AnyFetchRequest"},"Structs/AdaptedFetchRequest.html#/s:4GRDB12FetchRequestP10RowDecoderQa":{"name":"RowDecoder","parent_name":"AdaptedFetchRequest"},"Structs/PreparedRequest.html#/s:4GRDB15PreparedRequestV9statementAA15SelectStatementCvp":{"name":"statement","abstract":"

A prepared statement

","parent_name":"PreparedRequest"},"Structs/PreparedRequest.html#/s:4GRDB15PreparedRequestV7adapterAA10RowAdapter_pSgvp":{"name":"adapter","abstract":"

An eventual adapter for rows fetched by the select statement

","parent_name":"PreparedRequest"},"Structs/PreparedRequest.html#/s:4GRDB15PreparedRequestV9statement7adapterAcA15SelectStatementC_AA10RowAdapter_pSgtcfc":{"name":"init(statement:adapter:)","abstract":"

Creates a PreparedRequest.

","parent_name":"PreparedRequest"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO4nullyA2EmF":{"name":"null","abstract":"

The NULL storage class.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO5int64yAEs5Int64VcAEmF":{"name":"int64(_:)","abstract":"

The INTEGER storage class, wrapping an Int64.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO6doubleyAESdcAEmF":{"name":"double(_:)","abstract":"

The REAL storage class, wrapping a Double.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO6stringyAESScAEmF":{"name":"string(_:)","abstract":"

The TEXT storage class, wrapping a String.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO4blobyAE10Foundation4DataVcAEmF":{"name":"blob(_:)","abstract":"

The BLOB storage class, wrapping Data.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO5valueAA0bC11Convertible_pSgvp":{"name":"value","abstract":"

Returns Int64, Double, String, Data or nil.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO2eeoiySbAE_AEtFZ":{"name":"==(_:_:)","abstract":"

Return true if the storages are identical.

","parent_name":"Storage"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV7storageAC7StorageOvp":{"name":"storage","abstract":"

The SQLite storage

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV4nullACvpZ":{"name":"null","abstract":"

The NULL DatabaseValue.

","parent_name":"DatabaseValue"},"Structs/DatabaseValue/Storage.html":{"name":"Storage","abstract":"

An SQLite storage (NULL, INTEGER, REAL, TEXT, BLOB).

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV5valueACSgyp_tcfc":{"name":"init(value:)","abstract":"

Creates a DatabaseValue from Any.

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV6isNullSbvp":{"name":"isNull","abstract":"

Returns true if databaseValue is NULL.

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"

Returns whether two DatabaseValues are equal.

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV08databaseC0ACvp":{"name":"databaseValue","abstract":"

Returns self

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV04frombC0yACSgACFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns the database value

","parent_name":"DatabaseValue"},"Structs/DatabaseRegionObservation.html#/s:4GRDB25DatabaseRegionObservationV6extentAA0B0C011TransactionD6ExtentOvp":{"name":"extent","abstract":"

The extent of the database observation. The default is","parent_name":"DatabaseRegionObservation"},"Structs/DatabaseRegionObservation.html#/s:4GRDB25DatabaseRegionObservationV8trackingAcA0bC11Convertible_pd_tcfc":{"name":"init(tracking:)","abstract":"

Creates a DatabaseRegionObservation which observes regions, and","parent_name":"DatabaseRegionObservation"},"Structs/DatabaseRegionObservation.html#/s:4GRDB25DatabaseRegionObservationV8trackingACSayAA0bC11Convertible_pG_tcfc":{"name":"init(tracking:)","abstract":"

Creates a DatabaseRegionObservation which observes regions, and","parent_name":"DatabaseRegionObservation"},"Structs/DatabaseRegionObservation.html#/s:4GRDB25DatabaseRegionObservationV5start2in8onChangeAA19TransactionObserver_pAA0B6Writer_p_yAA0B0CctKF":{"name":"start(in:onChange:)","abstract":"

Starts the observation in the provided database writer (such as","parent_name":"DatabaseRegionObservation"},"Structs/AnyDatabaseRegionConvertible.html#/s:4GRDB28AnyDatabaseRegionConvertibleVyAcA0cD0VAA0C0CKccfc":{"name":"init(_:)","abstract":"

Undocumented

","parent_name":"AnyDatabaseRegionConvertible"},"Structs/AnyDatabaseRegionConvertible.html#/s:4GRDB28AnyDatabaseRegionConvertibleVyAcA0cdE0_pcfc":{"name":"init(_:)","abstract":"

Undocumented

","parent_name":"AnyDatabaseRegionConvertible"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV7isEmptySbvp":{"name":"isEmpty","abstract":"

Returns whether the region is empty.

","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV04fullB0ACvpZ":{"name":"fullDatabase","abstract":"

The region that covers the full database: all columns and all rows","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionVACycfc":{"name":"init()","abstract":"

Creates an empty database region.

","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV5tableACSS_tcfc":{"name":"init(table:)","abstract":"

Creates a region that spans all rows and columns of a database table.

","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV5unionyA2CF":{"name":"union(_:)","abstract":"

Returns the union of this region and the given one.

","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV9formUnionyyACF":{"name":"formUnion(_:)","abstract":"

Inserts the given region into this region

","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV10isModified14byEventsOfKindSbAA0b5EventI0O_tF":{"name":"isModified(byEventsOfKind:)","abstract":"

Returns whether the content in the region would be impacted if the","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV10isModified2bySbAA0B5EventV_tF":{"name":"isModified(by:)","abstract":"

Returns whether the content in the region is impacted by this event.

","parent_name":"DatabaseRegion"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV10resultCodeAA06ResultE0Vvp":{"name":"resultCode","abstract":"

The SQLite error code (see","parent_name":"DatabaseError"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV18extendedResultCodeAA0eF0Vvp":{"name":"extendedResultCode","abstract":"

The SQLite extended error code (see","parent_name":"DatabaseError"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV7messageSSSgvp":{"name":"message","abstract":"

The SQLite error message.

","parent_name":"DatabaseError"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV3sqlSSSgvp":{"name":"sql","abstract":"

The SQL query that yielded the error (if relevant).

","parent_name":"DatabaseError"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV10resultCode7message3sql9argumentsAcA06ResultE0V_SSSgAjA18StatementArgumentsVSgtcfc":{"name":"init(resultCode:message:sql:arguments:)","abstract":"

Creates a Database Error

","parent_name":"DatabaseError"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV014isInterruptionC0Sbvp":{"name":"isInterruptionError","abstract":"

Returns true if the error has code SQLITE_ABORT or SQLITE_INTERRUPT.

","parent_name":"DatabaseError"},"Structs/ResultCode.html#/s:SY8rawValue03RawB0Qzvp":{"name":"rawValue","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:SY8rawValuexSg03RawB0Qz_tcfc":{"name":"init(rawValue:)","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV07primarybC0ACvp":{"name":"primaryResultCode","abstract":"

A result code limited to the least significant 8 bits of the receiver.","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV2teoiySbAC_ACtFZ":{"name":"~=(_:_:)","abstract":"

Returns true if the code on the left matches the code on the right.

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV9SQLITE_OKACvpZ":{"name":"SQLITE_OK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_ERRORACvpZ":{"name":"SQLITE_ERROR","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_INTERNALACvpZ":{"name":"SQLITE_INTERNAL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV11SQLITE_PERMACvpZ":{"name":"SQLITE_PERM","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_ABORTACvpZ":{"name":"SQLITE_ABORT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV11SQLITE_BUSYACvpZ":{"name":"SQLITE_BUSY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_LOCKEDACvpZ":{"name":"SQLITE_LOCKED","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_NOMEMACvpZ":{"name":"SQLITE_NOMEM","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_READONLYACvpZ":{"name":"SQLITE_READONLY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV16SQLITE_INTERRUPTACvpZ":{"name":"SQLITE_INTERRUPT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_IOERRACvpZ":{"name":"SQLITE_IOERR","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV14SQLITE_CORRUPTACvpZ":{"name":"SQLITE_CORRUPT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_NOTFOUNDACvpZ":{"name":"SQLITE_NOTFOUND","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV11SQLITE_FULLACvpZ":{"name":"SQLITE_FULL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_CANTOPENACvpZ":{"name":"SQLITE_CANTOPEN","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_PROTOCOLACvpZ":{"name":"SQLITE_PROTOCOL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_EMPTYACvpZ":{"name":"SQLITE_EMPTY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_SCHEMAACvpZ":{"name":"SQLITE_SCHEMA","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_TOOBIGACvpZ":{"name":"SQLITE_TOOBIG","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_CONSTRAINTACvpZ":{"name":"SQLITE_CONSTRAINT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_MISMATCHACvpZ":{"name":"SQLITE_MISMATCH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_MISUSEACvpZ":{"name":"SQLITE_MISUSE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_NOLFSACvpZ":{"name":"SQLITE_NOLFS","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV11SQLITE_AUTHACvpZ":{"name":"SQLITE_AUTH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_FORMATACvpZ":{"name":"SQLITE_FORMAT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_RANGEACvpZ":{"name":"SQLITE_RANGE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_NOTADBACvpZ":{"name":"SQLITE_NOTADB","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_NOTICEACvpZ":{"name":"SQLITE_NOTICE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV14SQLITE_WARNINGACvpZ":{"name":"SQLITE_WARNING","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV10SQLITE_ROWACvpZ":{"name":"SQLITE_ROW","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV11SQLITE_DONEACvpZ":{"name":"SQLITE_DONE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV28SQLITE_ERROR_MISSING_COLLSEQACvpZ":{"name":"SQLITE_ERROR_MISSING_COLLSEQ","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_ERROR_RETRYACvpZ":{"name":"SQLITE_ERROR_RETRY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV21SQLITE_ERROR_SNAPSHOTACvpZ":{"name":"SQLITE_ERROR_SNAPSHOT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_IOERR_READACvpZ":{"name":"SQLITE_IOERR_READ","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV23SQLITE_IOERR_SHORT_READACvpZ":{"name":"SQLITE_IOERR_SHORT_READ","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_WRITEACvpZ":{"name":"SQLITE_IOERR_WRITE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_FSYNCACvpZ":{"name":"SQLITE_IOERR_FSYNC","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV22SQLITE_IOERR_DIR_FSYNCACvpZ":{"name":"SQLITE_IOERR_DIR_FSYNC","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV21SQLITE_IOERR_TRUNCATEACvpZ":{"name":"SQLITE_IOERR_TRUNCATE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_FSTATACvpZ":{"name":"SQLITE_IOERR_FSTAT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_IOERR_UNLOCKACvpZ":{"name":"SQLITE_IOERR_UNLOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_IOERR_RDLOCKACvpZ":{"name":"SQLITE_IOERR_RDLOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_IOERR_DELETEACvpZ":{"name":"SQLITE_IOERR_DELETE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_IOERR_BLOCKEDACvpZ":{"name":"SQLITE_IOERR_BLOCKED","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_NOMEMACvpZ":{"name":"SQLITE_IOERR_NOMEM","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_IOERR_ACCESSACvpZ":{"name":"SQLITE_IOERR_ACCESS","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV30SQLITE_IOERR_CHECKRESERVEDLOCKACvpZ":{"name":"SQLITE_IOERR_CHECKRESERVEDLOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_IOERR_LOCKACvpZ":{"name":"SQLITE_IOERR_LOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_CLOSEACvpZ":{"name":"SQLITE_IOERR_CLOSE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV22SQLITE_IOERR_DIR_CLOSEACvpZ":{"name":"SQLITE_IOERR_DIR_CLOSE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_IOERR_SHMOPENACvpZ":{"name":"SQLITE_IOERR_SHMOPEN","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_IOERR_SHMSIZEACvpZ":{"name":"SQLITE_IOERR_SHMSIZE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_IOERR_SHMLOCKACvpZ":{"name":"SQLITE_IOERR_SHMLOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_IOERR_SHMMAPACvpZ":{"name":"SQLITE_IOERR_SHMMAP","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_IOERR_SEEKACvpZ":{"name":"SQLITE_IOERR_SEEK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_IOERR_DELETE_NOENTACvpZ":{"name":"SQLITE_IOERR_DELETE_NOENT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_IOERR_MMAPACvpZ":{"name":"SQLITE_IOERR_MMAP","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_IOERR_GETTEMPPATHACvpZ":{"name":"SQLITE_IOERR_GETTEMPPATH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV21SQLITE_IOERR_CONVPATHACvpZ":{"name":"SQLITE_IOERR_CONVPATH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_VNODEACvpZ":{"name":"SQLITE_IOERR_VNODE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_IOERR_AUTHACvpZ":{"name":"SQLITE_IOERR_AUTH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_IOERR_BEGIN_ATOMICACvpZ":{"name":"SQLITE_IOERR_BEGIN_ATOMIC","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV26SQLITE_IOERR_COMMIT_ATOMICACvpZ":{"name":"SQLITE_IOERR_COMMIT_ATOMIC","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV28SQLITE_IOERR_ROLLBACK_ATOMICACvpZ":{"name":"SQLITE_IOERR_ROLLBACK_ATOMIC","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_LOCKED_SHAREDCACHEACvpZ":{"name":"SQLITE_LOCKED_SHAREDCACHE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_LOCKED_VTABACvpZ":{"name":"SQLITE_LOCKED_VTAB","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_BUSY_RECOVERYACvpZ":{"name":"SQLITE_BUSY_RECOVERY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_BUSY_SNAPSHOTACvpZ":{"name":"SQLITE_BUSY_SNAPSHOT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_CANTOPEN_NOTEMPDIRACvpZ":{"name":"SQLITE_CANTOPEN_NOTEMPDIR","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV21SQLITE_CANTOPEN_ISDIRACvpZ":{"name":"SQLITE_CANTOPEN_ISDIR","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_CANTOPEN_FULLPATHACvpZ":{"name":"SQLITE_CANTOPEN_FULLPATH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_CANTOPEN_CONVPATHACvpZ":{"name":"SQLITE_CANTOPEN_CONVPATH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_CANTOPEN_DIRTYWALACvpZ":{"name":"SQLITE_CANTOPEN_DIRTYWAL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_CORRUPT_VTABACvpZ":{"name":"SQLITE_CORRUPT_VTAB","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV23SQLITE_CORRUPT_SEQUENCEACvpZ":{"name":"SQLITE_CORRUPT_SEQUENCE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_READONLY_RECOVERYACvpZ":{"name":"SQLITE_READONLY_RECOVERY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_READONLY_CANTLOCKACvpZ":{"name":"SQLITE_READONLY_CANTLOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_READONLY_ROLLBACKACvpZ":{"name":"SQLITE_READONLY_ROLLBACK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV23SQLITE_READONLY_DBMOVEDACvpZ":{"name":"SQLITE_READONLY_DBMOVED","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_READONLY_CANTINITACvpZ":{"name":"SQLITE_READONLY_CANTINIT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_READONLY_DIRECTORYACvpZ":{"name":"SQLITE_READONLY_DIRECTORY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV21SQLITE_ABORT_ROLLBACKACvpZ":{"name":"SQLITE_ABORT_ROLLBACK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV23SQLITE_CONSTRAINT_CHECKACvpZ":{"name":"SQLITE_CONSTRAINT_CHECK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV28SQLITE_CONSTRAINT_COMMITHOOKACvpZ":{"name":"SQLITE_CONSTRAINT_COMMITHOOK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV28SQLITE_CONSTRAINT_FOREIGNKEYACvpZ":{"name":"SQLITE_CONSTRAINT_FOREIGNKEY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV26SQLITE_CONSTRAINT_FUNCTIONACvpZ":{"name":"SQLITE_CONSTRAINT_FUNCTION","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_CONSTRAINT_NOTNULLACvpZ":{"name":"SQLITE_CONSTRAINT_NOTNULL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV28SQLITE_CONSTRAINT_PRIMARYKEYACvpZ":{"name":"SQLITE_CONSTRAINT_PRIMARYKEY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_CONSTRAINT_TRIGGERACvpZ":{"name":"SQLITE_CONSTRAINT_TRIGGER","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_CONSTRAINT_UNIQUEACvpZ":{"name":"SQLITE_CONSTRAINT_UNIQUE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV22SQLITE_CONSTRAINT_VTABACvpZ":{"name":"SQLITE_CONSTRAINT_VTAB","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV23SQLITE_CONSTRAINT_ROWIDACvpZ":{"name":"SQLITE_CONSTRAINT_ROWID","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_NOTICE_RECOVER_WALACvpZ":{"name":"SQLITE_NOTICE_RECOVER_WAL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV30SQLITE_NOTICE_RECOVER_ROLLBACKACvpZ":{"name":"SQLITE_NOTICE_RECOVER_ROLLBACK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_WARNING_AUTOINDEXACvpZ":{"name":"SQLITE_WARNING_AUTOINDEX","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV16SQLITE_AUTH_USERACvpZ":{"name":"SQLITE_AUTH_USER","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV26SQLITE_OK_LOAD_PERMANENTLYACvpZ":{"name":"SQLITE_OK_LOAD_PERMANENTLY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ForeignKeyInfo.html#/s:4GRDB14ForeignKeyInfoV16destinationTableSSvp":{"name":"destinationTable","abstract":"

The name of the destination table

","parent_name":"ForeignKeyInfo"},"Structs/ForeignKeyInfo.html#/s:4GRDB14ForeignKeyInfoV7mappingSaySS6origin_SS11destinationtGvp":{"name":"mapping","abstract":"

The column to column mapping

","parent_name":"ForeignKeyInfo"},"Structs/ForeignKeyInfo.html#/s:4GRDB14ForeignKeyInfoV13originColumnsSaySSGvp":{"name":"originColumns","abstract":"

The origin columns

","parent_name":"ForeignKeyInfo"},"Structs/ForeignKeyInfo.html#/s:4GRDB14ForeignKeyInfoV18destinationColumnsSaySSGvp":{"name":"destinationColumns","abstract":"

The destination columns

","parent_name":"ForeignKeyInfo"},"Structs/PrimaryKeyInfo.html#/s:4GRDB14PrimaryKeyInfoV7columnsSaySSGvp":{"name":"columns","abstract":"

The columns in the primary key; this array is never empty.

","parent_name":"PrimaryKeyInfo"},"Structs/PrimaryKeyInfo.html#/s:4GRDB14PrimaryKeyInfoV11rowIDColumnSSSgvp":{"name":"rowIDColumn","abstract":"

When not nil, the name of the column that contains the INTEGER PRIMARY KEY.

","parent_name":"PrimaryKeyInfo"},"Structs/PrimaryKeyInfo.html#/s:4GRDB14PrimaryKeyInfoV7isRowIDSbvp":{"name":"isRowID","abstract":"

When true, the primary key is the rowid:

","parent_name":"PrimaryKeyInfo"},"Structs/IndexInfo.html#/s:4GRDB9IndexInfoV4nameSSvp":{"name":"name","abstract":"

The name of the index

","parent_name":"IndexInfo"},"Structs/IndexInfo.html#/s:4GRDB9IndexInfoV7columnsSaySSGvp":{"name":"columns","abstract":"

The indexed columns

","parent_name":"IndexInfo"},"Structs/IndexInfo.html#/s:4GRDB9IndexInfoV8isUniqueSbvp":{"name":"isUnique","abstract":"

True if the index is unique

","parent_name":"IndexInfo"},"Structs/ColumnInfo.html#/s:4GRDB10ColumnInfoV4nameSSvp":{"name":"name","abstract":"

The column name

","parent_name":"ColumnInfo"},"Structs/ColumnInfo.html#/s:4GRDB10ColumnInfoV4typeSSvp":{"name":"type","abstract":"

The column data type

","parent_name":"ColumnInfo"},"Structs/ColumnInfo.html#/s:4GRDB10ColumnInfoV9isNotNullSbvp":{"name":"isNotNull","abstract":"

True if and only if the column is constrained to be not null.

","parent_name":"ColumnInfo"},"Structs/ColumnInfo.html#/s:4GRDB10ColumnInfoV15defaultValueSQLSSSgvp":{"name":"defaultValueSQL","abstract":"

The SQL snippet that defines the default value, if any.

","parent_name":"ColumnInfo"},"Structs/ColumnInfo.html#/s:4GRDB10ColumnInfoV15primaryKeyIndexSivp":{"name":"primaryKeyIndex","abstract":"

Zero for columns that are not part of the primary key.

","parent_name":"ColumnInfo"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV18foreignKeysEnabledSbvp":{"name":"foreignKeysEnabled","abstract":"

If true, foreign key constraints are checked.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV8readonlySbvp":{"name":"readonly","abstract":"

If true, database modifications are disallowed.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV5labelSSSgvp":{"name":"label","abstract":"

The database label.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV5traceySScSgvp":{"name":"trace","abstract":"

A function that is called on every statement executed by the database.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV33acceptsDoubleQuotedStringLiteralsSbvp":{"name":"acceptsDoubleQuotedStringLiterals","abstract":"

If false, SQLite from version 3.29.0 will not interpret a double-quoted","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV31observesSuspensionNotificationsSbvp":{"name":"observesSuspensionNotifications","abstract":"

When true, the Database.suspendNotification and","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV15prepareDatabaseyAA0D0CKcSgvp":{"name":"prepareDatabase","abstract":"

A function that is run when an SQLite connection is opened, before the","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV22defaultTransactionKindAA8DatabaseC0dE0Ovp":{"name":"defaultTransactionKind","abstract":"

The default kind of transaction.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV24allowsUnsafeTransactionsSbvp":{"name":"allowsUnsafeTransactions","abstract":"

If false, it is a programmer error to leave a transaction opened at the","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV8busyModeAA8DatabaseC04BusyD0Ovp":{"name":"busyMode","abstract":"

The behavior in case of SQLITE_BUSY error. See https://www.sqlite.org/rescode.html#busy

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV18maximumReaderCountSivp":{"name":"maximumReaderCount","abstract":"

The maximum number of concurrent readers (applies to database","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV3qos8Dispatch0D3QoSVvp":{"name":"qos","abstract":"

The quality of service class for the work performed by the database.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV11targetQueueSo17OS_dispatch_queueCSgvp":{"name":"targetQueue","abstract":"

The target queue for all database accesses.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationVACycfc":{"name":"init()","abstract":"

Creates a factory configuration

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV10passphraseSSSgvp":{"name":"passphrase","abstract":"

The passphrase for the encrypted database.

","parent_name":"Configuration"},"Structs/Configuration.html":{"name":"Configuration","abstract":"

Configuration for a DatabaseQueue or DatabasePool.

"},"Structs/ColumnInfo.html":{"name":"ColumnInfo","abstract":"

A column of a database table.

"},"Structs/IndexInfo.html":{"name":"IndexInfo","abstract":"

An index on a database table.

"},"Structs/PrimaryKeyInfo.html":{"name":"PrimaryKeyInfo","abstract":"

Primary keys are returned from the Database.primaryKey(_:) method.

"},"Structs/ForeignKeyInfo.html":{"name":"ForeignKeyInfo","abstract":"

You get foreign keys from table names, with the"},"Structs/ResultCode.html":{"name":"ResultCode","abstract":"

Undocumented

"},"Structs/DatabaseError.html":{"name":"DatabaseError","abstract":"

DatabaseError wraps an SQLite error.

"},"Structs/DatabaseRegion.html":{"name":"DatabaseRegion","abstract":"

DatabaseRegion defines a region in the database. DatabaseRegion is dedicated"},"Structs/AnyDatabaseRegionConvertible.html":{"name":"AnyDatabaseRegionConvertible","abstract":"

A type-erased DatabaseRegionConvertible

"},"Structs/DatabaseRegionObservation.html":{"name":"DatabaseRegionObservation","abstract":"

DatabaseRegionObservation tracks changes in the results of database"},"Structs/DatabaseValue.html":{"name":"DatabaseValue","abstract":"

DatabaseValue is the intermediate type between SQLite and your values.

"},"Structs/PreparedRequest.html":{"name":"PreparedRequest","abstract":"

A PreparedRequest is a request that is ready to be executed.

"},"Structs/AdaptedFetchRequest.html":{"name":"AdaptedFetchRequest","abstract":"

An adapted request.

"},"Structs/AnyFetchRequest.html":{"name":"AnyFetchRequest","abstract":"

A type-erased FetchRequest.

"},"Structs.html#/s:4GRDB8RowIndexV":{"name":"RowIndex","abstract":"

Indexes to (ColumnName, DatabaseValue) pairs in a database row.

"},"Structs/EmptyRowAdapter.html":{"name":"EmptyRowAdapter","abstract":"

EmptyRowAdapter is a row adapter that hides all columns.

"},"Structs/ColumnMapping.html":{"name":"ColumnMapping","abstract":"

ColumnMapping is a row adapter that maps column names.

"},"Structs/SuffixRowAdapter.html":{"name":"SuffixRowAdapter","abstract":"

SuffixRowAdapter is a row adapter that hides the first columns in a row.

"},"Structs/RangeRowAdapter.html":{"name":"RangeRowAdapter","abstract":"

RangeRowAdapter is a row adapter that only exposes a range of columns.

"},"Structs/ScopeAdapter.html":{"name":"ScopeAdapter","abstract":"

ScopeAdapter is a row adapter that lets you define scopes on rows.

"},"Structs/SQLLiteral.html":{"name":"SQLLiteral","abstract":"

SQLLiteral is a type which support SQL"},"Structs/SQLRequest.html":{"name":"SQLRequest","abstract":"

A FetchRequest built from raw SQL.

"},"Structs/StatementArguments.html":{"name":"StatementArguments","abstract":"

StatementArguments provide values to argument placeholders in raw"},"Structs/DatabaseDateComponents.html":{"name":"DatabaseDateComponents","abstract":"

DatabaseDateComponents reads and stores DateComponents in the database.

"},"Structs/DatabaseEvent.html":{"name":"DatabaseEvent","abstract":"

A database event, notified to TransactionObserver.

"},"Structs/DatabasePreUpdateEvent.html":{"name":"DatabasePreUpdateEvent"},"Structs/FTS3.html":{"name":"FTS3","abstract":"

FTS3 lets you define “fts3” virtual tables.

"},"Structs/FTS3Pattern.html":{"name":"FTS3Pattern","abstract":"

A full text pattern that can query FTS3 and FTS4 virtual tables.

"},"Structs/FTS3TokenizerDescriptor.html":{"name":"FTS3TokenizerDescriptor","abstract":"

An FTS3 tokenizer, suitable for FTS3 and FTS4 table definitions:

"},"Structs/FTS4.html":{"name":"FTS4","abstract":"

FTS4 lets you define “fts4” virtual tables.

"},"Structs/FTS5.html":{"name":"FTS5","abstract":"

FTS5 lets you define “fts5” virtual tables.

"},"Structs/FTS5Pattern.html":{"name":"FTS5Pattern","abstract":"

A full text pattern that can query FTS5 virtual tables.

"},"Structs/FTS5Tokenization.html":{"name":"FTS5Tokenization","abstract":"

The reason why FTS5 is requesting tokenization.

"},"Structs/FTS5TokenizerDescriptor.html":{"name":"FTS5TokenizerDescriptor","abstract":"

An FTS5 tokenizer, suitable for FTS5 table definitions:

"},"Structs/FTS5TokenFlags.html":{"name":"FTS5TokenFlags","abstract":"

Flags that tell SQLite how to register a token.

"},"Structs/DatabaseMigrator.html":{"name":"DatabaseMigrator","abstract":"

A DatabaseMigrator registers and applies database migrations.

"},"Structs/AssociationAggregate.html":{"name":"AssociationAggregate","abstract":"

An AssociationAggregate is able to compute aggregated values from a"},"Structs.html#/s:4GRDB20BelongsToAssociationV":{"name":"BelongsToAssociation","abstract":"

The BelongsTo association sets up a one-to-one connection from a record"},"Structs.html#/s:4GRDB18HasManyAssociationV":{"name":"HasManyAssociation","abstract":"

The HasMany association indicates a one-to-many connection between two"},"Structs.html#/s:4GRDB25HasManyThroughAssociationV":{"name":"HasManyThroughAssociation","abstract":"

The HasManyThrough association is often used to set up a many-to-many"},"Structs.html#/s:4GRDB17HasOneAssociationV":{"name":"HasOneAssociation","abstract":"

The HasOne association indicates a one-to-one connection between two"},"Structs.html#/s:4GRDB24HasOneThroughAssociationV":{"name":"HasOneThroughAssociation","abstract":"

A HasOneThrough association sets up a one-to-one connection with"},"Structs/QueryInterfaceRequest.html":{"name":"QueryInterfaceRequest","abstract":"

QueryInterfaceRequest is a request that generates SQL for you.

"},"Structs.html#/s:4GRDB16ColumnAssignmentV":{"name":"ColumnAssignment","abstract":"

A ColumnAssignment can update rows in the database.

"},"Structs/Column.html":{"name":"Column","abstract":"

A column in a database table.

"},"Structs/SQLExpressionLiteral.html":{"name":"SQLExpressionLiteral","abstract":"

Experimental

"},"Structs/SQLFunctionName.html":{"name":"SQLFunctionName","abstract":"

Experimental

"},"Structs/AllColumns.html":{"name":"AllColumns","abstract":"

AllColumns is the * in SELECT *.

"},"Structs/ForeignKey.html":{"name":"ForeignKey","abstract":"

A ForeignKey helps building associations when GRDB can’t infer a foreign"},"Structs/PersistenceContainer.html":{"name":"PersistenceContainer","abstract":"

Use persistence containers in the encode(to:) method of your"},"Structs/FetchedRecordsSectionInfo.html":{"name":"FetchedRecordsSectionInfo","abstract":"

A section given by a FetchedRecordsController.

"},"Structs/PersistenceConflictPolicy.html":{"name":"PersistenceConflictPolicy","abstract":"

The MutablePersistableRecord protocol uses this type in order to handle SQLite"},"Structs/Inflections.html":{"name":"Inflections","abstract":"

Experimental

"},"Structs/ValueObservation.html":{"name":"ValueObservation","abstract":"

ValueObservation tracks changes in the results of database requests, and"},"Structs/AnyValueReducer.html":{"name":"AnyValueReducer","abstract":"

Experimental

"},"Protocols/FTS5WrapperTokenizer.html#/s:4GRDB20FTS5WrapperTokenizerP07wrappedD0AA0bD0_pvp":{"name":"wrappedTokenizer","abstract":"

The wrapped tokenizer

","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5WrapperTokenizer.html#/s:4GRDB20FTS5WrapperTokenizerP6accept5token5flags3for0F8CallbackySS_AA0B10TokenFlagsVAA0B12TokenizationVySS_AJtKXEtKF":{"name":"accept(token:flags:for:tokenCallback:)","abstract":"

Given a token produced by the wrapped tokenizer, notifies customized","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5WrapperTokenizer.html#/s:4GRDB20FTS5WrapperTokenizerPAAE8tokenize7context12tokenization5pText01nH013tokenCallbacks5Int32VSvSg_AA0B12TokenizationVSPys4Int8VGSgA2kL_Akr3KtXCtF":{"name":"tokenize(context:tokenization:pText:nText:tokenCallback:)","abstract":"

Default implementation

","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5Tokenizer.html#/s:4GRDB13FTS5TokenizerP8tokenize7context12tokenization5pText01nG013tokenCallbacks5Int32VSvSg_AA0B12TokenizationVSPys4Int8VGSgA2kL_Akr3KtXCtF":{"name":"tokenize(context:tokenization:pText:nText:tokenCallback:)","abstract":"

Tokenizes the text described by pText and nText, and","parent_name":"FTS5Tokenizer"},"Protocols/FTS5CustomTokenizer.html#/s:4GRDB19FTS5CustomTokenizerP4nameSSvpZ":{"name":"name","abstract":"

The name of the tokenizer; should uniquely identify your custom","parent_name":"FTS5CustomTokenizer"},"Protocols/FTS5CustomTokenizer.html#/s:4GRDB19FTS5CustomTokenizerP2db9argumentsxAA8DatabaseC_SaySSGtKcfc":{"name":"init(db:arguments:)","abstract":"

Creates a custom tokenizer.

","parent_name":"FTS5CustomTokenizer"},"Protocols/FTS5CustomTokenizer.html#/s:4GRDB19FTS5CustomTokenizerPAAE19tokenizerDescriptor9argumentsAA0bdF0VSaySSG_tFZ":{"name":"tokenizerDescriptor(arguments:)","abstract":"

Creates an FTS5 tokenizer descriptor.

","parent_name":"FTS5CustomTokenizer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","abstract":"

The type of fetched database values

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","abstract":"

The type of observed values

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","abstract":"

Feches database values upon changes in an observed database region.

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","abstract":"

Transforms a fetched value into an eventual observed value. Returns nil","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerPAAE10compactMapyAA0B8ReducersO07CompactE0Vy_xqd__Gqd__Sg0B0QzclF":{"name":"compactMap(_:)","abstract":"

Experimental

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerPAAE3mapyAA0B8ReducersO3MapVy_xqd__Gqd__0B0QzclF":{"name":"map(_:)","abstract":"

Experimental

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerPAASQ0B0RpzrlE20distinctUntilChangedAA0B8ReducersO16RemoveDuplicatesVy_xGyF":{"name":"distinctUntilChanged()","abstract":"

Experimental

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerPAASQ0B0RpzrlE16removeDuplicatesAA0B8ReducersO06RemoveE0Vy_xGyF":{"name":"removeDuplicates()","abstract":"

Experimental

","parent_name":"ValueReducer"},"Protocols/PersistableRecord.html#/s:4GRDB17PersistableRecordP9didInsert4with3forys5Int64V_SSSgtF":{"name":"didInsert(with:for:)","abstract":"

Notifies the record that it was succesfully inserted.

","parent_name":"PersistableRecord"},"Protocols/PersistableRecord.html#/s:4GRDB17PersistableRecordP6insertyyAA8DatabaseCKF":{"name":"insert(_:)","abstract":"

Executes an INSERT statement.

","parent_name":"PersistableRecord"},"Protocols/PersistableRecord.html#/s:4GRDB17PersistableRecordP4saveyyAA8DatabaseCKF":{"name":"save(_:)","abstract":"

Executes an INSERT or an UPDATE statement so that self is saved in","parent_name":"PersistableRecord"},"Protocols/PersistableRecord.html#/s:4GRDB17PersistableRecordPAAE13performInsertyyAA8DatabaseCKF":{"name":"performInsert(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"PersistableRecord"},"Protocols/PersistableRecord.html#/s:4GRDB17PersistableRecordPAAE11performSaveyyAA8DatabaseCKF":{"name":"performSave(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"PersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP25persistenceConflictPolicyAA011PersistencefG0VvpZ":{"name":"persistenceConflictPolicy","abstract":"

The policy that handles SQLite conflicts when records are inserted","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP9didInsert4with3forys5Int64V_SSSgtF":{"name":"didInsert(with:for:)","abstract":"

Notifies the record that it was succesfully inserted.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP6insertyyAA8DatabaseCKF":{"name":"insert(_:)","abstract":"

Executes an INSERT statement.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP6update_7columnsyAA8DatabaseC_ShySSGtKF":{"name":"update(_:columns:)","abstract":"

Executes an UPDATE statement.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP4saveyyAA8DatabaseCKF":{"name":"save(_:)","abstract":"

Executes an INSERT or an UPDATE statement so that self is saved in","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP6deleteySbAA8DatabaseCKF":{"name":"delete(_:)","abstract":"

Executes a DELETE statement.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP6existsySbAA8DatabaseCKF":{"name":"exists(_:)","abstract":"

Returns true if and only if the primary key matches a row in","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE6updateyyAA8DatabaseCKF":{"name":"update(_:)","abstract":"

Executes an UPDATE statement that updates all table columns.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13updateChanges_4fromSbAA8DatabaseC_qd__tKAaBRd__lF":{"name":"updateChanges(_:from:)","abstract":"

If the record has any difference from the other record, executes an","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13updateChanges_4withSbAA8DatabaseC_yxzKXEtKF":{"name":"updateChanges(_:with:)","abstract":"

Mutates the record according to the provided closure, and then, if the","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13performInsertyyAA8DatabaseCKF":{"name":"performInsert(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13performUpdate_7columnsyAA8DatabaseC_ShySSGtKF":{"name":"performUpdate(_:columns:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE11performSaveyyAA8DatabaseCKF":{"name":"performSave(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13performDeleteySbAA8DatabaseCKF":{"name":"performDelete(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13performExistsySbAA8DatabaseCKF":{"name":"performExists(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9deleteAllySiAA8DatabaseCKFZ":{"name":"deleteAll(_:)","abstract":"

Deletes all records; returns the number of deleted rows.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9updateAll_10onConflict_SiAA8DatabaseC_AG0H10ResolutionOSgSayAA16ColumnAssignmentVGtKFZ":{"name":"updateAll(_:onConflict:_:)","abstract":"

Updates all records; returns the number of updated records.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9updateAll_10onConflict__SiAA8DatabaseC_AG0H10ResolutionOSgAA16ColumnAssignmentVALdtKFZ":{"name":"updateAll(_:onConflict:_:_:)","abstract":"

Updates all records; returns the number of updated records.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9deleteAll_4keysSiAA8DatabaseC_qd__tKSTRd__AA0H16ValueConvertible7ElementRpd__lFZ":{"name":"deleteAll(_:keys:)","abstract":"

Delete records identified by their primary keys; returns the number of","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9deleteOne_3keySbAA8DatabaseC_qd__SgtKAA0H16ValueConvertibleRd__lFZ":{"name":"deleteOne(_:key:)","abstract":"

Delete a record, identified by its primary key; returns whether a","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9deleteAll_4keysSiAA8DatabaseC_SaySDySSAA0H16ValueConvertible_pSgGGtKFZ":{"name":"deleteAll(_:keys:)","abstract":"

Delete records identified by the provided unique keys (primary key or","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9deleteOne_3keySbAA8DatabaseC_SDySSAA0H16ValueConvertible_pSgGtKFZ":{"name":"deleteOne(_:key:)","abstract":"

Delete a record, identified by a unique key (the primary key or any key","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAARlzCrlE13updateChanges_4withSbAA8DatabaseC_yxKXEtKF":{"name":"updateChanges(_:with:)","abstract":"

Mutates the record according to the provided closure, and then, if the","parent_name":"MutablePersistableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordP3rowxAA3RowC_tcfc":{"name":"init(row:)","abstract":"

Creates a record from row.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordP24databaseDecodingUserInfoSDys06CodingfG3KeyVypGvpZ":{"name":"databaseDecodingUserInfo","abstract":"

When the FetchableRecord type also adopts the standard Decodable","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordP19databaseJSONDecoder3for10Foundation0E0CSS_tFZ":{"name":"databaseJSONDecoder(for:)","abstract":"

When the FetchableRecord type also adopts the standard Decodable","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordP28databaseDateDecodingStrategyAA08DatabaseefG0OvpZ":{"name":"databaseDateDecodingStrategy","abstract":"

When the FetchableRecord type also adopts the standard Decodable","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE11fetchCursor_9arguments7adapterAA0cE0CyxGAA15SelectStatementC_AA0I9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

A cursor over records fetched from a prepared statement.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchAll_9arguments7adapterSayxGAA15SelectStatementC_AA0I9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of records fetched from a prepared statement.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchOne_9arguments7adapterxSgAA15SelectStatementC_AA0I9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:arguments:adapter:)","abstract":"

Returns a single record fetched from a prepared statement.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE11fetchCursor_3sql9arguments7adapterAA0cE0CyxGAA8DatabaseC_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over records fetched from an SQL query.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchAll_3sql9arguments7adapterSayxGAA8DatabaseC_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of records fetched from an SQL query.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchOne_3sql9arguments7adapterxSgAA8DatabaseC_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:sql:arguments:adapter:)","abstract":"

Returns a single record fetched from an SQL query.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE11fetchCursoryAA0cE0CyxGAA8DatabaseC_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over records fetched from a fetch request.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchAllySayxGAA8DatabaseC_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of records fetched from a fetch request.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchOneyxSgAA8DatabaseC_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchOne(_:_:)","abstract":"

Returns a single record fetched from a fetch request.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE11fetchCursoryAA0cF0CyxGAA8DatabaseCKFZ":{"name":"fetchCursor(_:)","abstract":"

A cursor over all records fetched from the database.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchAllySayxGAA8DatabaseCKFZ":{"name":"fetchAll(_:)","abstract":"

An array of all records fetched from the database.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchOneyxSgAA8DatabaseCKFZ":{"name":"fetchOne(_:)","abstract":"

The first found record.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE11fetchCursor_4keysAA0cF0CyxGAA8DatabaseC_qd__tKSTRd__AA0H16ValueConvertible7ElementRpd__lFZ":{"name":"fetchCursor(_:keys:)","abstract":"

Returns a cursor over records, given their primary keys.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchAll_4keysSayxGAA8DatabaseC_qd__tKSTRd__AA0H16ValueConvertible7ElementRpd__lFZ":{"name":"fetchAll(_:keys:)","abstract":"

Returns an array of records, given their primary keys.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchOne_3keyxSgAA8DatabaseC_qd__SgtKAA0H16ValueConvertibleRd__lFZ":{"name":"fetchOne(_:key:)","abstract":"

Returns a single record given its primary key.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE11fetchCursor_4keysAA0cF0CyxGAA8DatabaseC_SaySDySSAA0H16ValueConvertible_pSgGGtKFZ":{"name":"fetchCursor(_:keys:)","abstract":"

Returns a cursor over records identified by the provided unique keys","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchAll_4keysSayxGAA8DatabaseC_SaySDySSAA0H16ValueConvertible_pSgGGtKFZ":{"name":"fetchAll(_:keys:)","abstract":"

Returns an array of records identified by the provided unique keys","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchOne_3keyxSgAA8DatabaseC_SDySSAA0H16ValueConvertible_pSgGSgtKFZ":{"name":"fetchOne(_:key:)","abstract":"

Returns a single record identified by a unique key (the primary key or","parent_name":"FetchableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordP6encode2toyAA20PersistenceContainerVz_tF":{"name":"encode(to:)","abstract":"

Encodes the record into database values.

","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordP24databaseEncodingUserInfoSDys06CodingfG3KeyVypGvpZ":{"name":"databaseEncodingUserInfo","abstract":"

When the EncodableRecord type also adopts the standard Encodable","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordP19databaseJSONEncoder3for10Foundation0E0CSS_tFZ":{"name":"databaseJSONEncoder(for:)","abstract":"

When the EncodableRecord type also adopts the standard Encodable","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordP28databaseDateEncodingStrategyAA08DatabaseefG0OvpZ":{"name":"databaseDateEncodingStrategy","abstract":"

When the EncodableRecord type also adopts the standard Encodable","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordP28databaseUUIDEncodingStrategyAA08DatabaseeF0OvpZ":{"name":"databaseUUIDEncodingStrategy","abstract":"

When the EncodableRecord type also adopts the standard Encodable","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordPAAE18databaseDictionarySDySSAA13DatabaseValueVGvp":{"name":"databaseDictionary","abstract":"

A dictionary whose keys are the columns encoded in the encode(to:) method.

","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordPAAE14databaseEqualsySbxF":{"name":"databaseEquals(_:)","abstract":"

Returns a boolean indicating whether this record and the other record","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordPAAE15databaseChanges4fromSDySSAA13DatabaseValueVGqd___tAaBRd__lF":{"name":"databaseChanges(from:)","abstract":"

A dictionary of values changed from the other record.

","parent_name":"EncodableRecord"},"Protocols/VirtualTableModule.html#/s:4GRDB18VirtualTableModuleP0C10DefinitionQa":{"name":"TableDefinition","abstract":"

The type of the closure argument in the","parent_name":"VirtualTableModule"},"Protocols/VirtualTableModule.html#/s:4GRDB18VirtualTableModuleP10moduleNameSSvp":{"name":"moduleName","abstract":"

The name of the module.

","parent_name":"VirtualTableModule"},"Protocols/VirtualTableModule.html#/s:4GRDB18VirtualTableModuleP04makeC10Definition0cF0QzyF":{"name":"makeTableDefinition()","abstract":"

Returns a table definition that is passed as the closure argument in the","parent_name":"VirtualTableModule"},"Protocols/VirtualTableModule.html#/s:4GRDB18VirtualTableModuleP15moduleArguments3for2inSaySSG0C10DefinitionQz_AA8DatabaseCtKF":{"name":"moduleArguments(for:in:)","abstract":"

Returns the module arguments for the CREATE VIRTUAL TABLE query.

","parent_name":"VirtualTableModule"},"Protocols/VirtualTableModule.html#/s:4GRDB18VirtualTableModuleP8database_9didCreate5usingyAA8DatabaseC_SS0C10DefinitionQztKF":{"name":"database(_:didCreate:using:)","abstract":"

Execute any relevant database statement after the virtual table has","parent_name":"VirtualTableModule"},"Protocols/AssociationToMany.html#/s:4GRDB11AssociationP6forKeyyxSSF":{"name":"forKey(_:)","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE5countAA0B9AggregateVy16OriginRowDecoderQzGvp":{"name":"count","abstract":"

The number of associated records.

","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE7isEmptyAA0B9AggregateVy16OriginRowDecoderQzGvp":{"name":"isEmpty","abstract":"

Creates an aggregate that is true if there exists no associated records.

","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE7averageyAA0B9AggregateVy16OriginRowDecoderQzGAA14SQLExpressible_pF":{"name":"average(_:)","abstract":"

Creates an aggregate which evaluate to the average value of the given","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE3maxyAA0B9AggregateVy16OriginRowDecoderQzGAA14SQLExpressible_pF":{"name":"max(_:)","abstract":"

Creates an aggregate which evaluate to the maximum value of the given","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE3minyAA0B9AggregateVy16OriginRowDecoderQzGAA14SQLExpressible_pF":{"name":"min(_:)","abstract":"

Creates an aggregate which evaluate to the minimum value of the given","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE3sumyAA0B9AggregateVy16OriginRowDecoderQzGAA14SQLExpressible_pF":{"name":"sum(_:)","abstract":"

Creates an aggregate which evaluate to the sum of the given expression","parent_name":"AssociationToMany"},"Protocols/AssociationToOne.html#/s:4GRDB11AssociationP6forKeyyxSSF":{"name":"forKey(_:)","parent_name":"AssociationToOne"},"Protocols/Association.html#/s:4GRDB11AssociationP16OriginRowDecoderQa":{"name":"OriginRowDecoder","abstract":"

The record type at the origin of the association.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationP6forKeyyxSSF":{"name":"forKey(_:)","abstract":"

Creates an association with the given key.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE6selectyxSayAA13SQLSelectable_pGF":{"name":"select(_:)","abstract":"

Creates an association which selects selection.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE9annotated4withxSayAA13SQLSelectable_pG_tF":{"name":"annotated(with:)","abstract":"

Creates an association which appends selection.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE6filteryxAA14SQLExpressible_pAA8DatabaseCKcF":{"name":"filter(_:)","abstract":"

Creates an association with the provided predicate promise added to","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE5orderyxSayAA15SQLOrderingTerm_pGAA8DatabaseCKcF":{"name":"order(_:)","abstract":"

Creates an association with the provided orderings promise.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE8reversedxyF":{"name":"reversed()","abstract":"

Creates an association that reverses applied orderings.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE9unorderedxyF":{"name":"unordered()","abstract":"

Creates an association without any ordering.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE7aliasedyxAA10TableAliasCF":{"name":"aliased(_:)","abstract":"

Creates an association that allows you to define expressions that target","parent_name":"Association"},"Protocols/ColumnExpression.html#/s:4GRDB16ColumnExpressionP4nameSSvp":{"name":"name","abstract":"

The unqualified name of a database column.

","parent_name":"ColumnExpression"},"Protocols/ColumnExpression.html#/s:4GRDB16ColumnExpressionPAAE5matchyAA13SQLExpression_pAA11FTS3PatternVSgF":{"name":"match(_:)","abstract":"

A matching SQL expression with the MATCH SQL operator.

","parent_name":"ColumnExpression"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordP08databaseB4NameSSvpZ":{"name":"databaseTableName","abstract":"

The name of the database table used to build requests.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordP17databaseSelectionSayAA13SQLSelectable_pGvpZ":{"name":"databaseSelection","abstract":"

The default request selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE8matchingyAA21QueryInterfaceRequestVyxGAA11FTS3PatternVSgFZ":{"name":"matching(_:)","abstract":"

Returns a QueryInterfaceRequest with a matching predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9belongsTo_3key5usingAA07BelongsE11AssociationVyxqd__Gqd__m_SSSgAA10ForeignKeyVSgtAaBRd__lFZ":{"name":"belongsTo(_:key:using:)","abstract":"

Creates a “Belongs To” association between Self and the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE7hasMany_3key5usingAA03HasE11AssociationVyxqd__Gqd__m_SSSgAA10ForeignKeyVSgtAaBRd__lFZ":{"name":"hasMany(_:key:using:)","abstract":"

Creates a “Has many” association between Self and the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE7hasMany_7through5using3keyAA03HasE18ThroughAssociationVyx10RowDecoderQyd_0_GAKm_qd__qd_0_SSSgt06OriginlM0Qyd__RszAA0K0Rd__AaPRd_0_ANQyd_0_AJRtd__r0_lFZ":{"name":"hasMany(_:through:using:key:)","abstract":"

Creates a “Has Many Through” association between Self and the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6hasOne_3key5usingAA03HasE11AssociationVyxqd__Gqd__m_SSSgAA10ForeignKeyVSgtAaBRd__lFZ":{"name":"hasOne(_:key:using:)","abstract":"

Creates a “Has one” association between Self and the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6hasOne_7through5using3keyAA03HasE18ThroughAssociationVyx10RowDecoderQyd_0_GAKm_qd__qd_0_SSSgt06OriginlM0Qyd__RszAA0k2ToE0Rd__AaPRd_0_ANQyd_0_AJRtd__r0_lFZ":{"name":"hasOne(_:through:using:key:)","abstract":"

Creates a “Has One Through” association between Self and the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9including3allAA21QueryInterfaceRequestVyxGqd___t16OriginRowDecoderQyd__RszAA17AssociationToManyRd__lFZ":{"name":"including(all:)","abstract":"

Creates a request that prefetches an association.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9including8optionalAA21QueryInterfaceRequestVyxGqd___t16OriginRowDecoderQyd__RszAA11AssociationRd__lFZ":{"name":"including(optional:)","abstract":"

Creates a request that includes an association. The columns of the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9including8requiredAA21QueryInterfaceRequestVyxGqd___t16OriginRowDecoderQyd__RszAA11AssociationRd__lFZ":{"name":"including(required:)","abstract":"

Creates a request that includes an association. The columns of the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE7joining8optionalAA21QueryInterfaceRequestVyxGqd___t16OriginRowDecoderQyd__RszAA11AssociationRd__lFZ":{"name":"joining(optional:)","abstract":"

Creates a request that includes an association. The columns of the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE7joining8requiredAA21QueryInterfaceRequestVyxGqd___t16OriginRowDecoderQyd__RszAA11AssociationRd__lFZ":{"name":"joining(required:)","abstract":"

Creates a request that includes an association. The columns of the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9annotated4withAA21QueryInterfaceRequestVyxGAA20AssociationAggregateVyxGd_tFZ":{"name":"annotated(with:)","abstract":"

Creates a request with aggregates appended to the selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9annotated4withAA21QueryInterfaceRequestVyxGSayAA20AssociationAggregateVyxGG_tFZ":{"name":"annotated(with:)","abstract":"

Creates a request with aggregates appended to the selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6havingyAA21QueryInterfaceRequestVyxGAA20AssociationAggregateVyxGFZ":{"name":"having(_:)","abstract":"

Creates a request with the provided aggregate predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE3allAA21QueryInterfaceRequestVyxGyFZ":{"name":"all()","abstract":"

Creates a request which fetches all records.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE4noneAA21QueryInterfaceRequestVyxGyFZ":{"name":"none()","abstract":"

Creates a request which fetches no record.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6selectyAA21QueryInterfaceRequestVyxGAA13SQLSelectable_pd_tFZ":{"name":"select(_:)","abstract":"

Creates a request which selects selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6selectyAA21QueryInterfaceRequestVyxGSayAA13SQLSelectable_pGFZ":{"name":"select(_:)","abstract":"

Creates a request which selects selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select3sql9argumentsAA21QueryInterfaceRequestVyxGSS_AA18StatementArgumentsVtFZ":{"name":"select(sql:arguments:)","abstract":"

Creates a request which selects sql.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select7literalAA21QueryInterfaceRequestVyxGAA10SQLLiteralV_tFZ":{"name":"select(literal:)","abstract":"

Creates a request which selects an SQL literal.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select_2asAA21QueryInterfaceRequestVyqd__GSayAA13SQLSelectable_pG_qd__mtlFZ":{"name":"select(_:as:)","abstract":"

Creates a request which selects selection, and fetches values of","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select_2asAA21QueryInterfaceRequestVyqd__GAA13SQLSelectable_pd_qd__mtlFZ":{"name":"select(_:as:)","abstract":"

Creates a request which selects selection, and fetches values of","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select3sql9arguments2asAA21QueryInterfaceRequestVyqd__GSS_AA18StatementArgumentsVqd__mtlFZ":{"name":"select(sql:arguments:as:)","abstract":"

Creates a request which selects sql, and fetches values of","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select7literal2asAA21QueryInterfaceRequestVyqd__GAA10SQLLiteralV_qd__mtlFZ":{"name":"select(literal:as:)","abstract":"

Creates a request which selects an SQL literal, and fetches values of","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9annotated4withAA21QueryInterfaceRequestVyxGSayAA13SQLSelectable_pG_tFZ":{"name":"annotated(with:)","abstract":"

Creates a request which appends selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9annotated4withAA21QueryInterfaceRequestVyxGAA13SQLSelectable_pd_tFZ":{"name":"annotated(with:)","abstract":"

Creates a request which appends selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filteryAA21QueryInterfaceRequestVyxGAA14SQLExpressible_pFZ":{"name":"filter(_:)","abstract":"

Creates a request with the provided predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter3keyAA21QueryInterfaceRequestVyxGqd__Sg_tAA24DatabaseValueConvertibleRd__lFZ":{"name":"filter(key:)","abstract":"

Creates a request with the provided primary key predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter4keysAA21QueryInterfaceRequestVyxGqd___tSTRd__AA24DatabaseValueConvertible7ElementRpd__lFZ":{"name":"filter(keys:)","abstract":"

Creates a request with the provided primary key predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter3keyAA21QueryInterfaceRequestVyxGSDySSAA24DatabaseValueConvertible_pSgGSg_tFZ":{"name":"filter(key:)","abstract":"

Creates a request with the provided primary key predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter4keysAA21QueryInterfaceRequestVyxGSaySDySSAA24DatabaseValueConvertible_pSgGG_tFZ":{"name":"filter(keys:)","abstract":"

Creates a request with the provided primary key predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter3sql9argumentsAA21QueryInterfaceRequestVyxGSS_AA18StatementArgumentsVtFZ":{"name":"filter(sql:arguments:)","abstract":"

Creates a request with the provided predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter7literalAA21QueryInterfaceRequestVyxGAA10SQLLiteralV_tFZ":{"name":"filter(literal:)","abstract":"

Creates a request with the provided predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE5orderyAA21QueryInterfaceRequestVyxGAA15SQLOrderingTerm_pd_tFZ":{"name":"order(_:)","abstract":"

Creates a request sorted according to the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE5orderyAA21QueryInterfaceRequestVyxGSayAA15SQLOrderingTerm_pGFZ":{"name":"order(_:)","abstract":"

Creates a request sorted according to the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE17orderByPrimaryKeyAA21QueryInterfaceRequestVyxGyFZ":{"name":"orderByPrimaryKey()","abstract":"

Creates a request sorted by primary key.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE5order3sql9argumentsAA21QueryInterfaceRequestVyxGSS_AA18StatementArgumentsVtFZ":{"name":"order(sql:arguments:)","abstract":"

Creates a request sorted according to sql.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE5order7literalAA21QueryInterfaceRequestVyxGAA10SQLLiteralV_tFZ":{"name":"order(literal:)","abstract":"

Creates a request sorted according to an SQL literal.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE5limit_6offsetAA21QueryInterfaceRequestVyxGSi_SiSgtFZ":{"name":"limit(_:offset:)","abstract":"

Creates a request which fetches limit rows, starting at","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE7aliasedyAA21QueryInterfaceRequestVyxGAA0B5AliasCFZ":{"name":"aliased(_:)","abstract":"

Creates a request that allows you to define expressions that target","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE10fetchCountySiAA8DatabaseCKFZ":{"name":"fetchCount(_:)","abstract":"

The number of records.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE12selectionSQL5aliasS2SSg_tFZ":{"name":"selectionSQL(alias:)","abstract":"

The selection as an SQL String.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE23numberOfSelectedColumnsySiAA8DatabaseCKFZ":{"name":"numberOfSelectedColumns(_:)","abstract":"

Returns the number of selected columns.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE19observationForCountAA16ValueObservationVyAA0G8ReducersO16RemoveDuplicatesVy_AH5FetchVy_SiGGGyFZ":{"name":"observationForCount()","abstract":"

Creates a ValueObservation which observes the record table, and notifies","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE8matchingyAA21QueryInterfaceRequestVyxGAA11FTS5PatternVSgFZ":{"name":"matching(_:)","abstract":"

Returns a QueryInterfaceRequest with a matching predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPA2A09EncodableC0RzrlE7request3forAA21QueryInterfaceRequestVy10RowDecoderQyd__Gqd___t06OriginjK0Qyd__RszAA11AssociationRd__lF":{"name":"request(for:)","abstract":"

Creates a request that fetches the associated record(s).

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPA2A09FetchableC0RzrlE17observationForAllAA16ValueObservationVyAA0H8ReducersO0G7RecordsVy_xGGyFZ":{"name":"observationForAll()","abstract":"

Creates a ValueObservation which observes the record table, and notifies","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPA2A09FetchableC0RzrlE19observationForFirstAA16ValueObservationVyAA0H8ReducersO03OneC0Vy_xGGyFZ":{"name":"observationForFirst()","abstract":"

Creates a ValueObservation which observes the table record, and notifies","parent_name":"TableRecord"},"Protocols/FTS5WrapperTokenizer.html#/wrappedTokenizer":{"name":"wrappedTokenizer","abstract":"

The wrapped tokenizer

","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5WrapperTokenizer.html#/accept(token:flags:for:tokenCallback:)":{"name":"accept(token:flags:for:tokenCallback:)","abstract":"

Given a token produced by the wrapped tokenizer, notifies customized","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5WrapperTokenizer.html#/tokenize(context:tokenization:pText:nText:tokenCallback:)":{"name":"tokenize(context:tokenization:pText:nText:tokenCallback:)","abstract":"

Default implementation

","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5Tokenizer.html#/tokenize(context:tokenization:pText:nText:tokenCallback:)":{"name":"tokenize(context:tokenization:pText:nText:tokenCallback:)","abstract":"

Tokenizes the text described by pText and nText, and","parent_name":"FTS5Tokenizer"},"Protocols/FTS5CustomTokenizer.html#/name":{"name":"name","abstract":"

The name of the tokenizer; should uniquely identify your custom","parent_name":"FTS5CustomTokenizer"},"Protocols/FTS5CustomTokenizer.html#/init(db:arguments:)":{"name":"init(db:arguments:)","abstract":"

Creates a custom tokenizer.

","parent_name":"FTS5CustomTokenizer"},"Protocols/FTS5CustomTokenizer.html#/tokenizerDescriptor(arguments:)":{"name":"tokenizerDescriptor(arguments:)","abstract":"

Creates an FTS5 tokenizer descriptor.

","parent_name":"FTS5CustomTokenizer"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverP8observes12eventsOfKindSbAA013DatabaseEventG0O_tF":{"name":"observes(eventsOfKind:)","abstract":"

Filters database changes that should be notified the the","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverP17databaseDidChange4withyAA13DatabaseEventV_tF":{"name":"databaseDidChange(with:)","abstract":"

Notifies a database change (insert, update, or delete).

","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverP18databaseWillCommityyKF":{"name":"databaseWillCommit()","abstract":"

When a transaction is about to be committed, the transaction observer","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverP17databaseDidCommityyAA8DatabaseCF":{"name":"databaseDidCommit(_:)","abstract":"

Database changes have been committed.

","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverP19databaseDidRollbackyyAA8DatabaseCF":{"name":"databaseDidRollback(_:)","abstract":"

Database changes have been rollbacked.

","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/databaseWillChange(with:)":{"name":"databaseWillChange(with:)","abstract":"

Notifies before a database change (insert, update, or delete)","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverPAAE037stopObservingDatabaseChangesUntilNextB0yyF":{"name":"stopObservingDatabaseChangesUntilNextTransaction()","abstract":"

After this method has been called, the databaseDidChange(with:)","parent_name":"TransactionObserver"},"Protocols/StatementColumnConvertible.html#/s:4GRDB26StatementColumnConvertibleP06sqliteB05indexxs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Initializes a value from a raw SQLite statement pointer.

","parent_name":"StatementColumnConvertible"},"Protocols/RowAdapter.html#/s:4GRDB10RowAdapterP08layoutedC04fromAA08LayoutedbC0_pAA0B6Layout_p_tKF":{"name":"layoutedAdapter(from:)","abstract":"

Experimental

","parent_name":"RowAdapter"},"Protocols/RowAdapter.html#/s:4GRDB10RowAdapterPAAE12addingScopesyAaB_pSDySSAaB_pGF":{"name":"addingScopes(_:)","abstract":"

Returns an adapter based on self, with added scopes.

","parent_name":"RowAdapter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP5writeyqd__qd__AA0B0CKXEKlF":{"name":"write(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP23writeWithoutTransactionyqd__qd__AA0B0CKXEKlF":{"name":"writeWithoutTransaction(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP10asyncWrite_10completionyqd__AA0B0CKc_yAG_s6ResultOyqd__s5Error_pGtctlF":{"name":"asyncWrite(_:completion:)","abstract":"

Asynchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP28asyncWriteWithoutTransactionyyyAA0B0CcF":{"name":"asyncWriteWithoutTransaction(_:)","abstract":"

Asynchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP20unsafeReentrantWriteyqd__qd__AA0B0CKXEKlF":{"name":"unsafeReentrantWrite(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP14concurrentReadyAA0B6FutureCyqd__Gqd__AA0B0CKclF":{"name":"concurrentRead(_:)","abstract":"

Concurrently executes a read-only block in a protected dispatch queue.

","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterPAAE3add19transactionObserver6extentyAA011TransactionF0_p_AA0B0C0H17ObservationExtentOtF":{"name":"add(transactionObserver:extent:)","abstract":"

Add a transaction observer, so that it gets notified of","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterPAAE5eraseyyKF":{"name":"erase()","abstract":"

Erases the content of the database.

","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterPAAE6vacuumyyKF":{"name":"vacuum()","abstract":"

Rebuilds the database file, repacking it into a minimal amount of","parent_name":"DatabaseWriter"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestP10RowDecoderQa":{"name":"RowDecoder","abstract":"

The type that tells how fetched database rows should be interpreted.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestP7prepare_15forSingleResultAA15SelectStatementC_AA10RowAdapter_pSgtAA8DatabaseC_SbtKF":{"name":"prepare(_:forSingleResult:)","abstract":"

This method is deprecated. Use","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestP012makePreparedC0_15forSingleResultAA0eC0VAA8DatabaseC_SbtKF":{"name":"makePreparedRequest(_:forSingleResult:)","abstract":"

Returns a PreparedRequest that is ready to be executed.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestP10fetchCountySiAA8DatabaseCKF":{"name":"fetchCount(_:)","abstract":"

Returns the number of rows fetched by the request.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPAAE7adaptedyAA07AdaptedbC0VyxGAA10RowAdapter_pAA8DatabaseCKcF":{"name":"adapted(_:)","abstract":"

Returns an adapted request.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPAAE14databaseRegionyAA08DatabaseE0VAA0F0CKF":{"name":"databaseRegion(_:)","abstract":"

Returns the database region that the request looks into.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPAAE19observationForCountAA16ValueObservationVyAA0G8ReducersO16RemoveDuplicatesVy_AH0B0Vy_SiGGGyF":{"name":"observationForCount()","abstract":"

Creates a ValueObservation which observes request, and notifies its","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzrlE11fetchCursoryAA0deJ0CyAFGAA0D0CKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzrlE8fetchAllySayAFGAA0D0CKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzrlE8fetchOneyAFSgAA0D0CKF":{"name":"fetchOne(_:)","abstract":"

The first fetched value.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzrlE11fetchCursoryAA08NullablehiM0CyAIGAA0H0CKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched optional values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzrlE8fetchAllySayAISgGAA0H0CKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched optional values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A3RowC0D7DecoderRtzrlE11fetchCursoryAA0dG0CAA8DatabaseCKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched rows.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A3RowC0D7DecoderRtzrlE8fetchAllySayAEGAA8DatabaseCKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched rows.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A3RowC0D7DecoderRtzrlE8fetchOneyAESgAA8DatabaseCKF":{"name":"fetchOne(_:)","abstract":"

The first fetched row.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzAA015StatementColumnF0AFRQrlE11fetchCursoryAA04FastdeL0CyAFGAA0D0CKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzAA015StatementColumnF0AFRQrlE8fetchAllySayAFGAA0D0CKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzAA015StatementColumnF0AFRQrlE8fetchOneyAFSgAA0D0CKF":{"name":"fetchOne(_:)","abstract":"

The first fetched value.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzAA015StatementColumnJ0AIRQrlE11fetchCursoryAA012FastNullablehiO0CyAIGAA0H0CKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched optional values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzAA015StatementColumnJ0AIRQrlE8fetchAllySayAISgGAA0H0CKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched optional values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A15FetchableRecord10RowDecoderRpzrlE11fetchCursoryAA0eI0CyAFGAA8DatabaseCKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched records.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A15FetchableRecord10RowDecoderRpzrlE8fetchAllySayAFGAA8DatabaseCKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched records.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A15FetchableRecord10RowDecoderRpzrlE8fetchOneyAFSgAA8DatabaseCKF":{"name":"fetchOne(_:)","abstract":"

The first fetched record.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzrlE17observationForAllAA0E11ObservationVyAA0E8ReducersO0K6ValuesVy_AFGGyF":{"name":"observationForAll()","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzrlE19observationForFirstAA0E11ObservationVyAA0E8ReducersO03OneE0Vy_AFGGyF":{"name":"observationForFirst()","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzrlE17observationForAllAA0I11ObservationVyAA0I8ReducersO0nD6ValuesVy_AIGGyF":{"name":"observationForAll()","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzrlE19observationForFirstAA0I11ObservationVyAA0I8ReducersO03OneI0Vy_AIGGyF":{"name":"observationForFirst()","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A15FetchableRecord10RowDecoderRpzrlE17observationForAllAA16ValueObservationVyAA0K8ReducersO0J7RecordsVy_AFGGyF":{"name":"observationForAll()","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A15FetchableRecord10RowDecoderRpzrlE19observationForFirstAA16ValueObservationVyAA0K8ReducersO03OneE0Vy_AFGGyF":{"name":"observationForFirst()","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A3RowC0D7DecoderRtzrlE17observationForAllAA16ValueObservationVyAA0I8ReducersO0H4RowsVGyF":{"name":"observationForAll()","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A3RowC0D7DecoderRtzrlE19observationForFirstAA16ValueObservationVyAA0I8ReducersO03OneD0VGyF":{"name":"observationForFirst()","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"FetchRequest"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertibleP08databaseC0AA0bC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertibleP04frombC0yxSgAA0bC0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a value initialized from dbValue, if possible.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE11fetchCursor_9arguments7adapterAA0bcF0CyxGAA15SelectStatementC_AA0J9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

Returns a cursor over values fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchAll_9arguments7adapterSayxGAA15SelectStatementC_AA0J9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of values fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchOne_9arguments7adapterxSgAA15SelectStatementC_AA0J9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:arguments:adapter:)","abstract":"

Returns a single value fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE11fetchCursor_3sql9arguments7adapterAA0bcF0CyxGAA0B0C_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over values fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchAll_3sql9arguments7adapterSayxGAA0B0C_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of values fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchOne_3sql9arguments7adapterxSgAA0B0C_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:sql:arguments:adapter:)","abstract":"

Returns a single value fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE11fetchCursoryAA0bcF0CyxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over values fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchAllySayxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of values fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchOneyxSgAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchOne(_:_:)","abstract":"

Returns a single value fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE11fetchCursor_9arguments7adapterAA04FastbcH0CyxGAA06SelectE0C_AA0E9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

Returns a cursor over values fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchAll_9arguments7adapterSayxGAA06SelectE0C_AA0E9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of values fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchOne_9arguments7adapterxSgAA06SelectE0C_AA0E9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:arguments:adapter:)","abstract":"

Returns a single value fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE11fetchCursor_3sql9arguments7adapterAA04FastbcH0CyxGAA0B0C_SSAA0E9ArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over values fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchAll_3sql9arguments7adapterSayxGAA0B0C_SSAA0E9ArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of values fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchOne_3sql9arguments7adapterxSgAA0B0C_SSAA0E9ArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:sql:arguments:adapter:)","abstract":"

Returns a single value fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE11fetchCursoryAA04FastbcH0CyxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over values fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchAllySayxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of values fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchOneyxSgAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchOne(_:_:)","abstract":"

Returns a single value fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAA10Foundation09ReferenceD0RzAaB0F4TypeAdEPRpzrlE08databaseC0AA0bC0Vvp":{"name":"databaseValue","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAA10Foundation09ReferenceD0RzAaB0F4TypeAdEPRpzrlE04frombC0yxSgAA0bC0VFZ":{"name":"fromDatabaseValue(_:)","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAASYRzAaB03RawC0SYRpzrlE08databaseC0AA0bC0Vvp":{"name":"databaseValue","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAASYRzAaB03RawC0SYRpzrlE04frombC0yxSgAA0bC0VFZ":{"name":"fromDatabaseValue(_:)","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseRegionConvertible.html#/s:4GRDB25DatabaseRegionConvertibleP08databaseC0yAA0bC0VAA0B0CKF":{"name":"databaseRegion(_:)","abstract":"

Returns a database region.

","parent_name":"DatabaseRegionConvertible"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP13configurationAA13ConfigurationVvp":{"name":"configuration","abstract":"

The database configuration

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP9interruptyyF":{"name":"interrupt()","abstract":"

This method causes any pending database operation to abort and return at","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP4readyqd__qd__AA0B0CKXEKlF":{"name":"read(_:)","abstract":"

Synchronously executes a read-only block that takes a database","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP9asyncReadyyys6ResultOyAA0B0Cs5Error_pGcF":{"name":"asyncRead(_:)","abstract":"

Asynchronously executes a read-only block that takes a","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP10unsafeReadyqd__qd__AA0B0CKXEKlF":{"name":"unsafeRead(_:)","abstract":"

Synchronously executes a read-only block that takes a database","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP19unsafeReentrantReadyqd__qd__AA0B0CKXEKlF":{"name":"unsafeReentrantRead(_:)","abstract":"

Synchronously executes a block that takes a database connection, and","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP3add8functionyAA0B8FunctionC_tF":{"name":"add(function:)","abstract":"

Add or redefine an SQL function.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP6remove8functionyAA0B8FunctionC_tF":{"name":"remove(function:)","abstract":"

Remove an SQL function.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP3add9collationyAA0B9CollationC_tF":{"name":"add(collation:)","abstract":"

Add or redefine a collation.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP6remove9collationyAA0B9CollationC_tF":{"name":"remove(collation:)","abstract":"

Remove a collation.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP3add11observation7onError0F6ChangeAA19TransactionObserver_pAA16ValueObservationVyqd__G_ys0G0_pcy0K0Qyd__ctAA0K7ReducerRd__lF":{"name":"add(observation:onError:onChange:)","abstract":"

Starts a value observation.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP6remove19transactionObserveryAA011TransactionF0_p_tF":{"name":"remove(transactionObserver:)","abstract":"

Remove a transaction observer.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderPAAE6backup2toyAA0B6Writer_p_tKF":{"name":"backup(to:)","abstract":"

Copies the database contents into another database.

","parent_name":"DatabaseReader"},"Protocols/DatabaseAggregate.html#/s:4GRDB17DatabaseAggregatePxycfc":{"name":"init()","abstract":"

Creates an aggregate.

","parent_name":"DatabaseAggregate"},"Protocols/DatabaseAggregate.html#/s:4GRDB17DatabaseAggregateP4stepyySayAA0B5ValueVGKF":{"name":"step(_:)","abstract":"

This method is called at each step of the aggregation.

","parent_name":"DatabaseAggregate"},"Protocols/DatabaseAggregate.html#/s:4GRDB17DatabaseAggregateP8finalizeAA0B16ValueConvertible_pSgyKF":{"name":"finalize()","abstract":"

Returns the final result

","parent_name":"DatabaseAggregate"},"Protocols/Cursor.html#/s:4GRDB6CursorP7ElementQa":{"name":"Element","abstract":"

The type of element traversed by the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorP4next7ElementQzSgyKF":{"name":"next()","abstract":"

Advances to the next element and returns it, or nil if no next element","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE7isEmptySbyKF":{"name":"isEmpty()","abstract":"

Returns a Boolean value indicating whether the cursor contains","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE8contains5whereS2b7ElementQzKXE_tKF":{"name":"contains(where:)","abstract":"

Returns a Boolean value indicating whether the cursor contains an","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE10enumeratedAA010EnumeratedB0CyxGyF":{"name":"enumerated()","abstract":"

Returns a cursor of pairs (n, x), where n represents a consecutive","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6filteryAA06FilterB0CyxGSb7ElementQzKcF":{"name":"filter(_:)","abstract":"

Returns the elements of the cursor that satisfy the given predicate.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE5first5where7ElementQzSgSbAGKXE_tKF":{"name":"first(where:)","abstract":"

Returns the first element of the cursor that satisfies the given","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE10compactMapyAA0dB0CyAA06FilterB0CyAFyxqd__SgGGqd__GAI7ElementQzKclF":{"name":"compactMap(_:)","abstract":"

Returns a cursor over the concatenated non-nil results of mapping","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE4drop5whileAA09DropWhileB0CyxGSb7ElementQzKc_tF":{"name":"drop(while:)","abstract":"

Returns a cursor that skips any initial elements that satisfy","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE9dropFirstyAA04DropdB0CyxGSiF":{"name":"dropFirst(_:)","abstract":"

Returns a cursor containing all but the given number of initial","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE9dropFirstAA04DropdB0CyxGyF":{"name":"dropFirst()","abstract":"

Returns a cursor containing all but the first element of the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE8dropLastySay7ElementQzGSiKF":{"name":"dropLast(_:)","abstract":"

Returns an array containing all but the given number of final","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE8dropLastSay7ElementQzGyKF":{"name":"dropLast()","abstract":"

Returns an array containing all but the last element of the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE7flatMapyAA07FlattenB0CyAA0dB0CyxAA03AnyB0Cy7ElementQyd__GGGqd__AKQzKcSTRd__lF":{"name":"flatMap(_:)","abstract":"

Returns a cursor over the concatenated results of mapping transform","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE7flatMapyAA07FlattenB0CyAA0dB0Cyxqd__GGqd__7ElementQzKcAaBRd__lF":{"name":"flatMap(_:)","abstract":"

Returns a cursor over the concatenated results of mapping transform","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE7forEachyyy7ElementQzKXEKF":{"name":"forEach(_:)","abstract":"

Calls the given closure on each element in the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE3mapyAA03MapB0Cyxqd__Gqd__7ElementQzKclF":{"name":"map(_:)","abstract":"

Returns a cursor over the results of the transform function applied to","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE3max2by7ElementQzSgSbAG_AGtKXE_tKF":{"name":"max(by:)","abstract":"

Returns the maximum element in the cursor, using the given predicate as","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE3min2by7ElementQzSgSbAG_AGtKXE_tKF":{"name":"min(by:)","abstract":"

Returns the minimum element in the cursor, using the given predicate as","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6prefixyAA06PrefixB0CyxGSiF":{"name":"prefix(_:)","abstract":"

Returns a cursor, up to the specified maximum length, containing the","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6prefix5whileAA011PrefixWhileB0CyxGSb7ElementQzKc_tF":{"name":"prefix(while:)","abstract":"

Returns a cursor of the initial consecutive elements that satisfy","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6reduceyqd__qd___qd__qd___7ElementQztKXEtKlF":{"name":"reduce(_:_:)","abstract":"

Returns the result of calling the given combining closure with each","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6reduce4into_qd__qd___yqd__z_7ElementQztKXEtKlF":{"name":"reduce(into:_:)","abstract":"

Returns the result of calling the given combining closure with each","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6suffixySay7ElementQzGSiKF":{"name":"suffix(_:)","abstract":"

Returns an array, up to the given maximum length, containing the","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAASQ7ElementRpzrlE8containsySbAEKF":{"name":"contains(_:)","abstract":"

Returns a Boolean value indicating whether the cursor contains the","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAASL7ElementRpzrlE3maxAESgyKF":{"name":"max()","abstract":"

Returns the maximum element in the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAASL7ElementRpzrlE3minAESgyKF":{"name":"min()","abstract":"

Returns the minimum element in the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPA2aB7ElementRpzrlE6joinedAA07FlattenB0CyxGyF":{"name":"joined()","abstract":"

Returns the elements of this cursor of cursors, concatenated.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAST7ElementRpzrlE6joinedAA07FlattenB0CyAA03MapB0CyxAA03AnyB0CyAD_ADQZGGGyF":{"name":"joined()","abstract":"

Returns the elements of this cursor of sequences, concatenated.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAASy7ElementRpzrlE6joined9separatorS2S_tKF":{"name":"joined(separator:)","abstract":"

Returns the elements of this cursor of sequences, concatenated.

","parent_name":"Cursor"},"Protocols/Cursor.html":{"name":"Cursor","abstract":"

A type that supplies the values of some external resource, one at a time.

"},"Protocols/DatabaseAggregate.html":{"name":"DatabaseAggregate","abstract":"

The protocol for custom SQLite aggregates.

"},"Protocols/DatabaseReader.html":{"name":"DatabaseReader","abstract":"

The protocol for all types that can fetch values from a database.

"},"Protocols/DatabaseRegionConvertible.html":{"name":"DatabaseRegionConvertible","abstract":"

Undocumented

"},"Protocols/DatabaseValueConvertible.html":{"name":"DatabaseValueConvertible","abstract":"

Types that adopt DatabaseValueConvertible can be initialized from"},"Protocols/FetchRequest.html":{"name":"FetchRequest","abstract":"

The protocol for all requests that fetch database rows, and tell how those"},"Protocols/DatabaseWriter.html":{"name":"DatabaseWriter","abstract":"

The protocol for all types that can update a database.

"},"Protocols/RowAdapter.html":{"name":"RowAdapter","abstract":"

RowAdapter is a protocol that helps two incompatible row interfaces working"},"Protocols/StatementColumnConvertible.html":{"name":"StatementColumnConvertible","abstract":"

The StatementColumnConvertible protocol grants access to the low-level C"},"Protocols/TransactionObserver.html":{"name":"TransactionObserver","abstract":"

A transaction observer is notified of all changes and transactions committed"},"Protocols/FTS5CustomTokenizer.html":{"name":"FTS5CustomTokenizer","abstract":"

The protocol for custom FTS5 tokenizers.

"},"Protocols/FTS5Tokenizer.html":{"name":"FTS5Tokenizer","abstract":"

The protocol for FTS5 tokenizers

"},"Protocols/FTS5WrapperTokenizer.html":{"name":"FTS5WrapperTokenizer","abstract":"

The protocol for custom FTS5 tokenizers that wrap another tokenizer.

"},"Protocols/TableRecord.html":{"name":"TableRecord","abstract":"

Types that adopt TableRecord declare a particular relationship with"},"Protocols/ColumnExpression.html":{"name":"ColumnExpression","abstract":"

Adopt the ColumnExpression protocol when you define a column type.

"},"Protocols/Association.html":{"name":"Association","abstract":"

Experimental

"},"Protocols/AssociationToOne.html":{"name":"AssociationToOne","abstract":"

Experimental

"},"Protocols/AssociationToMany.html":{"name":"AssociationToMany","abstract":"

Experimental

"},"Protocols/VirtualTableModule.html":{"name":"VirtualTableModule","abstract":"

The protocol for SQLite virtual table modules. It lets you define a DSL for"},"Protocols/EncodableRecord.html":{"name":"EncodableRecord","abstract":"

Types that adopt EncodableRecord can be encoded into the database.

"},"Protocols/FetchableRecord.html":{"name":"FetchableRecord","abstract":"

Types that adopt FetchableRecord can be initialized from a database Row.

"},"Protocols/MutablePersistableRecord.html":{"name":"MutablePersistableRecord","abstract":"

Types that adopt MutablePersistableRecord can be inserted, updated, and deleted.

"},"Protocols/PersistableRecord.html":{"name":"PersistableRecord","abstract":"

Types that adopt PersistableRecord can be inserted, updated, and deleted.

"},"Protocols/ValueReducer.html":{"name":"ValueReducer","abstract":"

Experimental

"},"Functions.html#/s:4GRDB20splittingRowAdapters12columnCountsSayAA0C7Adapter_pGSaySiG_tF":{"name":"splittingRowAdapters(columnCounts:)","abstract":"

Returns an array of row adapters that split a row according to the input"},"Functions.html#/s:4GRDB1nopyAA20AssociationAggregateVyxGAElF":{"name":"!(_:)","abstract":"

Returns a logically negated aggregate.

"},"Functions.html#/s:4GRDB2aaoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"&&(_:_:)","abstract":"

Groups two aggregates with the AND SQL operator.

"},"Functions.html#/s:4GRDB2oooiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"||(_:_:)","abstract":"

Groups two aggregates with the OR SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"==(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"==(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"==(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA20AssociationAggregateVyxGAE_SbtlF":{"name":"==(_:_:)","abstract":"

Returns an aggregate that checks the boolean value of an aggregate.

"},"Functions.html#/s:4GRDB2eeoiyAA20AssociationAggregateVyxGSb_AEtlF":{"name":"==(_:_:)","abstract":"

Returns an aggregate that checks the boolean value of an aggregate.

"},"Functions.html#/s:4GRDB2neoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"!=(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"!=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"!=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA20AssociationAggregateVyxGAE_SbtlF":{"name":"!=(_:_:)","abstract":"

Returns an aggregate that checks the boolean value of an aggregate.

"},"Functions.html#/s:4GRDB2neoiyAA20AssociationAggregateVyxGSb_AEtlF":{"name":"!=(_:_:)","abstract":"

Returns an aggregate that checks the boolean value of an aggregate.

"},"Functions.html#/s:4GRDB3eeeoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"===(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"===(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"===(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the IS SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"!==(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"!==(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"!==(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"<=(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"<=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"<=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the <= SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"<(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"<(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"<(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the < SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":">(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":">(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":">(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the > SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":">=(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":">=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":">=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the >= SQL operator.

"},"Functions.html#/s:4GRDB1sopyAA20AssociationAggregateVyxGAElF":{"name":"-(_:)","abstract":"

Returns an arithmetically negated aggregate.

"},"Functions.html#/s:4GRDB1poiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"+(_:_:)","abstract":"

Returns an aggregate that sums two aggregates with the + SQL operator.

"},"Functions.html#/s:4GRDB1poiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"+(_:_:)","abstract":"

Returns an aggregate that sums an aggregate with the + SQL operator.

"},"Functions.html#/s:4GRDB1poiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"+(_:_:)","abstract":"

Returns an aggregate that sums an aggregate with the + SQL operator.

"},"Functions.html#/s:4GRDB1soiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"-(_:_:)","abstract":"

Returns an aggregate that substracts two aggregates with the - SQL operator.

"},"Functions.html#/s:4GRDB1soiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"-(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the - SQL operator.

"},"Functions.html#/s:4GRDB1soiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"-(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the - SQL operator.

"},"Functions.html#/s:4GRDB1moiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"*(_:_:)","abstract":"

Returns an aggregate that multiplies two aggregates with the * SQL operator.

"},"Functions.html#/s:4GRDB1moiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"*(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the * SQL operator.

"},"Functions.html#/s:4GRDB1moiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"*(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the * SQL operator.

"},"Functions.html#/s:4GRDB1doiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"/(_:_:)","abstract":"

Returns an aggregate that multiplies two aggregates with the / SQL operator.

"},"Functions.html#/s:4GRDB1doiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"/(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the / SQL operator.

"},"Functions.html#/s:4GRDB1doiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"/(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the / SQL operator.

"},"Functions.html#/s:4GRDB2qqoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"??(_:_:)","abstract":"

Returns an aggregate that evaluates the IFNULL SQL function.

"},"Functions.html#/s:4GRDB2lsoiyAA16ColumnAssignmentVAA0C10Expression_p_AA14SQLExpressible_ptF":{"name":"<-(_:_:)","abstract":"

Creates an assignment to a value.

"},"Functions.html#/s:4GRDB2peoiyAA16ColumnAssignmentVAA0C10Expression_p_AA14SQLExpressible_ptF":{"name":"+=(_:_:)","abstract":"

Creates an assignment that adds a value

"},"Functions.html#/s:4GRDB2seoiyAA16ColumnAssignmentVAA0C10Expression_p_AA14SQLExpressible_ptF":{"name":"-=(_:_:)","abstract":"

Creates an assignment that subtracts a value

"},"Functions.html#/s:4GRDB2meoiyAA16ColumnAssignmentVAA0C10Expression_p_AA14SQLExpressible_ptF":{"name":"*=(_:_:)","abstract":"

Creates an assignment that multiplies by a value

"},"Functions.html#/s:4GRDB2deoiyAA16ColumnAssignmentVAA0C10Expression_p_AA14SQLExpressible_ptF":{"name":"/=(_:_:)","abstract":"

Creates an assignment that divides by a value

"},"Functions.html#/s:4GRDB3absyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"abs(_:)","abstract":"

Returns an expression that evaluates the ABS SQL function.

"},"Functions.html#/s:4GRDB7averageyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"average(_:)","abstract":"

Returns an expression that evaluates the AVG SQL function.

"},"Functions.html#/s:4GRDB5countyAA13SQLExpression_pAA13SQLSelectable_pF":{"name":"count(_:)","abstract":"

Returns an expression that evaluates the COUNT SQL function.

"},"Functions.html#/s:4GRDB5count8distinctAA13SQLExpression_pAA22SQLSpecificExpressible_p_tF":{"name":"count(distinct:)","abstract":"

Returns an expression that evaluates the COUNT(DISTINCT) SQL function.

"},"Functions.html#/s:4GRDB2qqoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"??(_:_:)","abstract":"

Returns an expression that evaluates the IFNULL SQL function.

"},"Functions.html#/s:4GRDB6lengthyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"length(_:)","abstract":"

Returns an expression that evaluates the LENGTH SQL function.

"},"Functions.html#/s:4GRDB3maxyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"max(_:)","abstract":"

Returns an expression that evaluates the MAX SQL function.

"},"Functions.html#/s:4GRDB3minyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"min(_:)","abstract":"

Returns an expression that evaluates the MIN SQL function.

"},"Functions.html#/s:4GRDB3sumyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"sum(_:)","abstract":"

Returns an expression that evaluates the SUM SQL function.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_pSgtF":{"name":"==(_:_:)","abstract":"

An SQL expression that compares two expressions with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_pSgtF":{"name":"==(_:_:)","abstract":"

An SQL expression that compares two expressions with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_SbtF":{"name":"==(_:_:)","abstract":"

An SQL expression that checks the boolean value of an expression.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA22SQLSpecificExpressible_ptF":{"name":"==(_:_:)","abstract":"

An SQL expression that compares two expressions with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA21SQLCollatedExpressionVtF":{"name":"==(_:_:)","abstract":"

An SQL expression that compares two expressions with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pSb_AA22SQLSpecificExpressible_ptF":{"name":"==(_:_:)","abstract":"

An SQL expression that checks the boolean value of an expression.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"==(_:_:)","abstract":"

An SQL expression that compares two expressions with the = SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_pSgtF":{"name":"!=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_pSgtF":{"name":"!=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_SbtF":{"name":"!=(_:_:)","abstract":"

An SQL expression that checks the boolean value of an expression.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA22SQLSpecificExpressible_ptF":{"name":"!=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA21SQLCollatedExpressionVtF":{"name":"!=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pSb_AA22SQLSpecificExpressible_ptF":{"name":"!=(_:_:)","abstract":"

An SQL expression that checks the boolean value of an expression.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"!=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <> SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_pSgtF":{"name":"===(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_pSgtF":{"name":"===(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA22SQLSpecificExpressible_ptF":{"name":"===(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA21SQLCollatedExpressionVtF":{"name":"===(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"===(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_pSgtF":{"name":"!==(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_pSgtF":{"name":"!==(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA22SQLSpecificExpressible_ptF":{"name":"!==(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA21SQLCollatedExpressionVtF":{"name":"!==(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"!==(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"<(_:_:)","abstract":"

An SQL expression that compares two expressions with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_ptF":{"name":"<(_:_:)","abstract":"

An SQL expression that compares two expressions with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"<(_:_:)","abstract":"

An SQL expression that compares two expressions with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA13SQLExpression_pAA14SQLExpressible_p_AA21SQLCollatedExpressionVtF":{"name":"<(_:_:)","abstract":"

An SQL expression that compares two expressions with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"<(_:_:)","abstract":"

An SQL expression that compares two expressions with the < SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"<=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_ptF":{"name":"<=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"<=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA13SQLExpression_pAA14SQLExpressible_p_AA21SQLCollatedExpressionVtF":{"name":"<=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"<=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <= SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":">(_:_:)","abstract":"

An SQL expression that compares two expressions with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_ptF":{"name":">(_:_:)","abstract":"

An SQL expression that compares two expressions with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":">(_:_:)","abstract":"

An SQL expression that compares two expressions with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA13SQLExpression_pAA14SQLExpressible_p_AA21SQLCollatedExpressionVtF":{"name":">(_:_:)","abstract":"

An SQL expression that compares two expressions with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":">(_:_:)","abstract":"

An SQL expression that compares two expressions with the > SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":">=(_:_:)","abstract":"

An SQL expression that compares two expressions with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_ptF":{"name":">=(_:_:)","abstract":"

An SQL expression that compares two expressions with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":">=(_:_:)","abstract":"

An SQL expression that compares two expressions with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA13SQLExpression_pAA14SQLExpressible_p_AA21SQLCollatedExpressionVtF":{"name":">=(_:_:)","abstract":"

An SQL expression that compares two expressions with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":">=(_:_:)","abstract":"

An SQL expression that compares two expressions with the >= SQL operator.

"},"Functions.html#/s:4GRDB1moiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"*(_:_:)","abstract":"

An SQL arithmetic multiplication.

"},"Functions.html#/s:4GRDB1moiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"*(_:_:)","abstract":"

An SQL arithmetic multiplication.

"},"Functions.html#/s:4GRDB1moiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"*(_:_:)","abstract":"

An SQL arithmetic multiplication.

"},"Functions.html#/s:4GRDB1doiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"/(_:_:)","abstract":"

An SQL arithmetic division.

"},"Functions.html#/s:4GRDB1doiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"/(_:_:)","abstract":"

An SQL arithmetic division.

"},"Functions.html#/s:4GRDB1doiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"/(_:_:)","abstract":"

An SQL arithmetic division.

"},"Functions.html#/s:4GRDB1poiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"+(_:_:)","abstract":"

An SQL arithmetic addition.

"},"Functions.html#/s:4GRDB1poiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"+(_:_:)","abstract":"

An SQL arithmetic addition.

"},"Functions.html#/s:4GRDB1poiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"+(_:_:)","abstract":"

An SQL arithmetic addition.

"},"Functions.html#/s:4GRDB1sopyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"-(_:)","abstract":"

A negated SQL arithmetic expression.

"},"Functions.html#/s:4GRDB1soiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"-(_:_:)","abstract":"

An SQL arithmetic substraction.

"},"Functions.html#/s:4GRDB1soiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"-(_:_:)","abstract":"

An SQL arithmetic substraction.

"},"Functions.html#/s:4GRDB1soiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"-(_:_:)","abstract":"

An SQL arithmetic substraction.

"},"Functions.html#/s:4GRDB2aaoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"&&(_:_:)","abstract":"

A logical SQL expression with the AND SQL operator.

"},"Functions.html#/s:4GRDB2aaoiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"&&(_:_:)","abstract":"

A logical SQL expression with the AND SQL operator.

"},"Functions.html#/s:4GRDB2aaoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"&&(_:_:)","abstract":"

A logical SQL expression with the AND SQL operator.

"},"Functions.html#/s:4GRDB2oooiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"||(_:_:)","abstract":"

A logical SQL expression with the OR SQL operator.

"},"Functions.html#/s:4GRDB2oooiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"||(_:_:)","abstract":"

A logical SQL expression with the OR SQL operator.

"},"Functions.html#/s:4GRDB2oooiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"||(_:_:)","abstract":"

A logical SQL expression with the OR SQL operator.

"},"Functions.html#/s:4GRDB1nopyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"!(_:)","abstract":"

A negated logical SQL expression with the NOT SQL operator.

"},"Functions.html#/s:4GRDB21databaseQuestionMarks5countSSSi_tF":{"name":"databaseQuestionMarks(count:)","abstract":"

Return as many question marks separated with commas as the count argument.

"},"Extensions/CountableClosedRange.html#/s:SN4GRDBAA14SQLExpressibleRzSxRzSZ6StrideSxRpzrlE8containsyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"CountableClosedRange"},"Extensions/CountableRange.html#/s:Sn4GRDBAA14SQLExpressibleRzSxRzSZ6StrideSxRpzrlE8containsyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"CountableRange"},"Extensions/ClosedRange.html#/s:SN4GRDBAA14SQLExpressibleRzrlE8containsyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"ClosedRange"},"Extensions/ClosedRange.html#/s:SN4GRDBAA14SQLExpressibleRzrlE8containsyAA13SQLExpression_pAA21SQLCollatedExpressionVF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"ClosedRange"},"Extensions/Range.html#/s:Sn4GRDBAA14SQLExpressibleRzrlE8containsyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"Range"},"Extensions/Range.html#/s:Sn4GRDBAA14SQLExpressibleRzrlE8containsyAA13SQLExpression_pAA21SQLCollatedExpressionVF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"Range"},"Extensions/TableRecord.html#/matching(_:)":{"name":"matching(_:)","abstract":"

Returns a QueryInterfaceRequest with a matching predicate.

","parent_name":"TableRecord"},"Extensions/TableRequest.html#/matching(_:)":{"name":"matching(_:)","abstract":"

Creates a request with a full-text predicate added to the eventual","parent_name":"TableRequest"},"Extensions/DatabaseQueue.html#/add(tokenizer:)":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"DatabaseQueue"},"Extensions/Column.html#/rank":{"name":"rank","abstract":"

The FTS5 rank column

","parent_name":"Column"},"Extensions/String.html#/s:SS4GRDBE15sqliteStatement5indexSSs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"String"},"Extensions/String.html#/s:SS4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"String"},"Extensions/String.html#/s:SS4GRDBE17fromDatabaseValueySSSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a String initialized from dbValue, if possible.

","parent_name":"String"},"Extensions/String.html#/s:SS4GRDBE24quotedDatabaseIdentifierSSvp":{"name":"quotedDatabaseIdentifier","abstract":"

Returns the receiver, quoted for safe insertion as an identifier in an","parent_name":"String"},"Extensions/Float.html#/s:Sf4GRDBE15sqliteStatement5indexSfs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Float"},"Extensions/Float.html#/s:Sf4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Float"},"Extensions/Float.html#/s:Sf4GRDBE17fromDatabaseValueySfSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a Float initialized from dbValue, if possible.

","parent_name":"Float"},"Extensions/Double.html#/s:Sd4GRDBE15sqliteStatement5indexSds13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Double"},"Extensions/Double.html#/s:Sd4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Double"},"Extensions/Double.html#/s:Sd4GRDBE17fromDatabaseValueySdSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a Double initialized from dbValue, if possible.

","parent_name":"Double"},"Extensions/UInt64.html#/s:s6UInt64V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"UInt64"},"Extensions/UInt64.html#/s:s6UInt64V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"UInt64"},"Extensions/UInt64.html#/s:s6UInt64V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an UInt64 initialized from dbValue, if possible.

","parent_name":"UInt64"},"Extensions/UInt32.html#/s:s6UInt32V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"UInt32"},"Extensions/UInt32.html#/s:s6UInt32V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"UInt32"},"Extensions/UInt32.html#/s:s6UInt32V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an UInt32 initialized from dbValue, if possible.

","parent_name":"UInt32"},"Extensions/UInt16.html#/s:s6UInt16V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"UInt16"},"Extensions/UInt16.html#/s:s6UInt16V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"UInt16"},"Extensions/UInt16.html#/s:s6UInt16V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an UInt16 initialized from dbValue, if possible.

","parent_name":"UInt16"},"Extensions/UInt8.html#/s:s5UInt8V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"UInt8"},"Extensions/UInt8.html#/s:s5UInt8V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"UInt8"},"Extensions/UInt8.html#/s:s5UInt8V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an UInt8 initialized from dbValue, if possible.

","parent_name":"UInt8"},"Extensions/UInt.html#/s:Su4GRDBE15sqliteStatement5indexSus13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"UInt"},"Extensions/UInt.html#/s:Su4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"UInt"},"Extensions/UInt.html#/s:Su4GRDBE17fromDatabaseValueySuSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int initialized from dbValue, if possible.

","parent_name":"UInt"},"Extensions/Int64.html#/s:s5Int64V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Int64"},"Extensions/Int64.html#/s:s5Int64V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Int64"},"Extensions/Int64.html#/s:s5Int64V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int64 initialized from dbValue, if possible.

","parent_name":"Int64"},"Extensions/Int32.html#/s:s5Int32V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_ABtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Int32"},"Extensions/Int32.html#/s:s5Int32V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Int32"},"Extensions/Int32.html#/s:s5Int32V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int32 initialized from dbValue, if possible.

","parent_name":"Int32"},"Extensions/Int16.html#/s:s5Int16V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Int16"},"Extensions/Int16.html#/s:s5Int16V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Int16"},"Extensions/Int16.html#/s:s5Int16V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int16 initialized from dbValue, if possible.

","parent_name":"Int16"},"Extensions/Int8.html#/s:s4Int8V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Int8"},"Extensions/Int8.html#/s:s4Int8V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Int8"},"Extensions/Int8.html#/s:s4Int8V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int8 initialized from dbValue, if possible.

","parent_name":"Int8"},"Extensions/Int.html#/s:Si4GRDBE15sqliteStatement5indexSis13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Int"},"Extensions/Int.html#/s:Si4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Int"},"Extensions/Int.html#/s:Si4GRDBE17fromDatabaseValueySiSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int initialized from dbValue, if possible.

","parent_name":"Int"},"Extensions/Bool.html#/s:Sb4GRDBE15sqliteStatement5indexSbs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Bool"},"Extensions/Bool.html#/s:Sb4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Bool"},"Extensions/Bool.html#/s:Sb4GRDBE17fromDatabaseValueySbSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a Bool initialized from dbValue, if possible.

","parent_name":"Bool"},"Extensions/UUID.html#/s:4GRDB24DatabaseValueConvertibleP08databaseC0AA0bC0Vvp":{"name":"databaseValue","parent_name":"UUID"},"Extensions/UUID.html#/s:4GRDB24DatabaseValueConvertibleP04frombC0yxSgAA0bC0VFZ":{"name":"fromDatabaseValue(_:)","parent_name":"UUID"},"Extensions/UUID.html#/s:4GRDB26StatementColumnConvertibleP06sqliteB05indexxs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","parent_name":"UUID"},"Extensions/NSUUID.html#/s:4GRDB24DatabaseValueConvertibleP08databaseC0AA0bC0Vvp":{"name":"databaseValue","parent_name":"NSUUID"},"Extensions/NSUUID.html#/s:4GRDB24DatabaseValueConvertibleP04frombC0yxSgAA0bC0VFZ":{"name":"fromDatabaseValue(_:)","parent_name":"NSUUID"},"Extensions/NSURL.html#/s:So5NSURLC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.","parent_name":"NSURL"},"Extensions/NSURL.html#/s:So5NSURLC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an NSURL initialized from dbValue, if possible.

","parent_name":"NSURL"},"Extensions/NSString.html#/s:So8NSStringC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"NSString"},"Extensions/NSString.html#/s:So8NSStringC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an NSString initialized from dbValue, if possible.

","parent_name":"NSString"},"Extensions/NSNumber.html#/s:So8NSNumberC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"NSNumber"},"Extensions/NSNumber.html#/s:So8NSNumberC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an NSNumber initialized from dbValue, if possible.

","parent_name":"NSNumber"},"Extensions/NSNull.html#/s:So6NSNullC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns DatabaseValue.null.

","parent_name":"NSNull"},"Extensions/NSNull.html#/s:So6NSNullC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns nil.

","parent_name":"NSNull"},"Extensions/NSData.html#/s:So6NSDataC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"NSData"},"Extensions/NSData.html#/s:So6NSDataC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an NSData initialized from dbValue, if it contains","parent_name":"NSData"},"Extensions/Date.html#/s:10Foundation4DateV4GRDBE13databaseValueAD08DatabaseE0Vvp":{"name":"databaseValue","abstract":"

Returns a database value that contains the date encoded as","parent_name":"Date"},"Extensions/Date.html#/s:10Foundation4DateV4GRDBE17fromDatabaseValueyACSgAD0eF0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a date initialized from dbValue, if possible.

","parent_name":"Date"},"Extensions/Date.html#/s:10Foundation4DateV4GRDBE9julianDayACSgSd_tcfc":{"name":"init(julianDay:)","abstract":"

Creates a date from a Julian Day.

","parent_name":"Date"},"Extensions/Date.html#/s:10Foundation4DateV4GRDBE15sqliteStatement5indexACs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Date"},"Extensions/NSDate.html#/s:So6NSDateC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a database value that contains the date encoded as","parent_name":"NSDate"},"Extensions/NSDate.html#/s:So6NSDateC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a date initialized from dbValue, if possible.

","parent_name":"NSDate"},"Extensions/Data.html#/s:4GRDB26StatementColumnConvertibleP06sqliteB05indexxs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV4GRDBE13databaseValueAD08DatabaseE0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV4GRDBE17fromDatabaseValueyACSgAD0eF0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a Data initialized from dbValue, if it contains","parent_name":"Data"},"Extensions/CGFloat.html#/s:12CoreGraphics7CGFloatV4GRDBE13databaseValueAD08DatabaseF0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"CGFloat"},"Extensions/CGFloat.html#/s:12CoreGraphics7CGFloatV4GRDBE17fromDatabaseValueyACSgAD0fG0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a CGFloat initialized from dbValue, if possible.

","parent_name":"CGFloat"},"Extensions/Collection.html#/s:Sl4GRDBAA10SQLLiteralV7ElementRtzrlE6joined9separatorACSS_tF":{"name":"joined(separator:)","abstract":"

Returns the concatenated SQLLiteral of this collection of literals,","parent_name":"Collection"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE11fetchCursor_9arguments7adapterAA08NullablebcF0CyxGAA15SelectStatementC_AA0K9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

Returns a cursor over optional values fetched from a prepared statement.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE8fetchAll_9arguments7adapterSayxSgGAA15SelectStatementC_AA0J9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of optional values fetched from a prepared statement.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE11fetchCursor_3sql9arguments7adapterAA08NullablebcF0CyxGAA0B0C_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over optional values fetched from an SQL query.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE8fetchAll_3sql9arguments7adapterSayxSgGAA0B0C_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of optional values fetched from an SQL query.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE11fetchCursoryAA08NullablebcF0CyxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over optional values fetched from a fetch request.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE8fetchAllySayxSgGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of optional values fetched from a fetch request.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE11fetchCursor_9arguments7adapterAA012FastNullablebcH0CyxGAA06SelectE0C_AA0E9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

Returns a cursor over optional values fetched from a prepared statement.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE8fetchAll_9arguments7adapterSayxSgGAA06SelectE0C_AA0E9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of optional values fetched from a prepared statement.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE11fetchCursor_3sql9arguments7adapterAA012FastNullablebcH0CyxGAA0B0C_SSAA0E9ArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over optional values fetched from an SQL query.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE8fetchAll_3sql9arguments7adapterSayxSgGAA0B0C_SSAA0E9ArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of optional values fetched from an SQL query.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE11fetchCursoryAA012FastNullablebcH0CyxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over optional values fetched from a fetch request.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE8fetchAllySayxSgGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of optional values fetched from a fetch request.

","parent_name":"Optional"},"Extensions/Database.html#/usePassphrase(_:)":{"name":"usePassphrase(_:)","abstract":"

Sets the passphrase used to crypt and decrypt an SQLCipher database.

","parent_name":"Database"},"Extensions/Database.html#/changePassphrase(_:)":{"name":"changePassphrase(_:)","abstract":"

Changes the passphrase used by an SQLCipher encrypted database.

","parent_name":"Database"},"Extensions/Database.html#/dropFTS5SynchronizationTriggers(forTable:)":{"name":"dropFTS5SynchronizationTriggers(forTable:)","abstract":"

Deletes the synchronization triggers for a synchronized FTS5 table

","parent_name":"Database"},"Extensions/Database.html#/add(tokenizer:)":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"Database"},"Extensions/Database.html#/makeFTS5Pattern(rawPattern:forTable:)":{"name":"makeFTS5Pattern(rawPattern:forTable:)","abstract":"

Creates a pattern from a raw pattern string; throws DatabaseError on","parent_name":"Database"},"Extensions/Database.html#/makeTokenizer(_:)":{"name":"makeTokenizer(_:)","abstract":"

Creates an FTS5 tokenizer, given its descriptor.

","parent_name":"Database"},"Extensions/Set.html#/s:Sh4GRDBEyShyxGqd__Kc7ElementQyd__RszAA6CursorRd__lufc":{"name":"init(_:)","abstract":"

Creates a set containing the elements of a cursor.

","parent_name":"Set"},"Extensions/Sequence.html#/s:ST4GRDBE7flatMapyAA13FlattenCursorCyAA0cE0CyAA03AnyE0Cy7ElementQzGqd__GGqd__AJKcAA0E0Rd__lF":{"name":"flatMap(_:)","abstract":"

Returns a cursor over the concatenated results of mapping transform","parent_name":"Sequence"},"Extensions/Sequence.html#/s:ST4GRDBAA10SQLLiteralV7ElementRtzrlE6joined9separatorACSS_tF":{"name":"joined(separator:)","abstract":"

Returns the concatenated SQLLiteral of this sequence of literals,","parent_name":"Sequence"},"Extensions/Sequence.html#/s:ST4GRDBAA14SQLExpressible7ElementRpzrlE8containsyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in","parent_name":"Sequence"},"Extensions/Sequence.html#/s:ST4GRDBAA14SQLExpressible7ElementRpzrlE8containsyAA13SQLExpression_pAA21SQLCollatedExpressionVF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in","parent_name":"Sequence"},"Extensions/Sequence.html#/s:ST4GRDBAA13SQLExpression_p7ElementRtzrlE6joined8operatorAaB_pAA24SQLLogicalBinaryOperatorO_tF":{"name":"joined(operator:)","abstract":"

Returns an expression by joining all elements with an SQL","parent_name":"Sequence"},"Extensions/Array.html#/s:Sa4GRDBEySayxGqd__Kc7ElementQyd__RszAA6CursorRd__lufc":{"name":"init(_:)","abstract":"

Creates an array containing the elements of a cursor.

","parent_name":"Array"},"Extensions/Array.html":{"name":"Array"},"Extensions/Sequence.html":{"name":"Sequence"},"Extensions/Set.html":{"name":"Set"},"Extensions/Database.html":{"name":"Database"},"Extensions/Optional.html":{"name":"Optional","abstract":"

Swift’s Optional comes with built-in methods that allow to fetch cursors"},"Extensions/Collection.html":{"name":"Collection"},"Extensions/CGFloat.html":{"name":"CGFloat","abstract":"

CGFloat adopts DatabaseValueConvertible

"},"Extensions/Data.html":{"name":"Data","abstract":"

Data is convertible to and from DatabaseValue.

"},"Extensions/NSDate.html":{"name":"NSDate","abstract":"

NSDate is stored in the database using the format"},"Extensions/Date.html":{"name":"Date","abstract":"

Date is stored in the database using the format"},"Extensions/NSData.html":{"name":"NSData","abstract":"

NSData is convertible to and from DatabaseValue.

"},"Extensions/NSNull.html":{"name":"NSNull","abstract":"

NSNull adopts DatabaseValueConvertible

"},"Extensions/NSNumber.html":{"name":"NSNumber","abstract":"

NSNumber adopts DatabaseValueConvertible

"},"Extensions/NSString.html":{"name":"NSString","abstract":"

NSString adopts DatabaseValueConvertible

"},"Extensions/NSURL.html":{"name":"NSURL","abstract":"

NSURL stores its absoluteString in the database.

"},"Extensions.html#/s:10Foundation3URLV":{"name":"URL","abstract":"

URL stores its absoluteString in the database.

"},"Extensions/NSUUID.html":{"name":"NSUUID","abstract":"

NSUUID adopts DatabaseValueConvertible

"},"Extensions/UUID.html":{"name":"UUID","abstract":"

UUID adopts DatabaseValueConvertible

"},"Extensions/Bool.html":{"name":"Bool","abstract":"

Bool adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Int.html":{"name":"Int","abstract":"

Int adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Int8.html":{"name":"Int8","abstract":"

Int8 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Int16.html":{"name":"Int16","abstract":"

Int16 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Int32.html":{"name":"Int32","abstract":"

Int32 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Int64.html":{"name":"Int64","abstract":"

Int64 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/UInt.html":{"name":"UInt","abstract":"

UInt adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/UInt8.html":{"name":"UInt8","abstract":"

UInt8 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/UInt16.html":{"name":"UInt16","abstract":"

UInt16 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/UInt32.html":{"name":"UInt32","abstract":"

UInt32 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/UInt64.html":{"name":"UInt64","abstract":"

UInt64 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Double.html":{"name":"Double","abstract":"

Double adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Float.html":{"name":"Float","abstract":"

Float adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/String.html":{"name":"String","abstract":"

String adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Column.html":{"name":"Column"},"Extensions/DatabaseQueue.html":{"name":"DatabaseQueue"},"Extensions/TableRequest.html":{"name":"TableRequest"},"Extensions/TableRecord.html":{"name":"TableRecord"},"Extensions/Range.html":{"name":"Range"},"Extensions/ClosedRange.html":{"name":"ClosedRange"},"Extensions/CountableRange.html":{"name":"CountableRange"},"Extensions/CountableClosedRange.html":{"name":"CountableClosedRange"},"Enums/ValueReducers/Combine8.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine8"},"Enums/ValueReducers/Combine8.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine8"},"Enums/ValueReducers/Combine8.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine8"},"Enums/ValueReducers/Combine8.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine8"},"Enums/ValueReducers/Combine7.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine7"},"Enums/ValueReducers/Combine7.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine7"},"Enums/ValueReducers/Combine7.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine7"},"Enums/ValueReducers/Combine7.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine7"},"Enums/ValueReducers/Combine6.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine6"},"Enums/ValueReducers/Combine6.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine6"},"Enums/ValueReducers/Combine6.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine6"},"Enums/ValueReducers/Combine6.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine6"},"Enums/ValueReducers/Combine5.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine5"},"Enums/ValueReducers/Combine5.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine5"},"Enums/ValueReducers/Combine5.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine5"},"Enums/ValueReducers/Combine5.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine5"},"Enums/ValueReducers/Combine4.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine4"},"Enums/ValueReducers/Combine4.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine4"},"Enums/ValueReducers/Combine4.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine4"},"Enums/ValueReducers/Combine4.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine4"},"Enums/ValueReducers/Combine3.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine3"},"Enums/ValueReducers/Combine3.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine3"},"Enums/ValueReducers/Combine3.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine3"},"Enums/ValueReducers/Combine3.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine3"},"Enums/ValueReducers/Combine2.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine2"},"Enums/ValueReducers/Combine2.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine2"},"Enums/ValueReducers/Combine2.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine2"},"Enums/ValueReducers/Combine2.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine2"},"Enums/ValueReducers/Combine2.html":{"name":"Combine2","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine3.html":{"name":"Combine3","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine4.html":{"name":"Combine4","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine5.html":{"name":"Combine5","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine6.html":{"name":"Combine6","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine7.html":{"name":"Combine7","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine8.html":{"name":"Combine8","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueScheduling.html#/s:4GRDB15ValueSchedulingO9mainQueueyA2CmF":{"name":"mainQueue","abstract":"

All values are notified on the main queue.

","parent_name":"ValueScheduling"},"Enums/ValueScheduling.html#/s:4GRDB15ValueSchedulingO5asyncyACSo17OS_dispatch_queueC_SbtcACmF":{"name":"async(onQueue:startImmediately:)","abstract":"

All values are asychronously notified on the specified queue.

","parent_name":"ValueScheduling"},"Enums/ValueScheduling.html#/s:4GRDB15ValueSchedulingO6unsafeyACSb_tcACmF":{"name":"unsafe(startImmediately:)","abstract":"

Values are not all notified on the same dispatch queue.

","parent_name":"ValueScheduling"},"Enums/PersistenceError.html#/s:4GRDB16PersistenceErrorO14recordNotFoundyACSS_SDySSAA13DatabaseValueVGtcACmF":{"name":"recordNotFound(databaseTableName:key:)","abstract":"

Thrown by MutablePersistableRecord.update() when no matching row could be","parent_name":"PersistenceError"},"Enums/FetchedRecordChange.html#/s:4GRDB19FetchedRecordChangeO9insertionyAC10Foundation9IndexPathV_tcACmF":{"name":"insertion(indexPath:)","abstract":"

An insertion event, at given indexPath.

","parent_name":"FetchedRecordChange"},"Enums/FetchedRecordChange.html#/s:4GRDB19FetchedRecordChangeO8deletionyAC10Foundation9IndexPathV_tcACmF":{"name":"deletion(indexPath:)","abstract":"

A deletion event, at given indexPath.

","parent_name":"FetchedRecordChange"},"Enums/FetchedRecordChange.html#/s:4GRDB19FetchedRecordChangeO4moveyAC10Foundation9IndexPathV_AGSDySSAA13DatabaseValueVGtcACmF":{"name":"move(indexPath:newIndexPath:changes:)","abstract":"

A move event, from indexPath to newIndexPath. The changes are a","parent_name":"FetchedRecordChange"},"Enums/FetchedRecordChange.html#/s:4GRDB19FetchedRecordChangeO6updateyAC10Foundation9IndexPathV_SDySSAA13DatabaseValueVGtcACmF":{"name":"update(indexPath:changes:)","abstract":"

An update event, at given indexPath. The changes are a dictionary","parent_name":"FetchedRecordChange"},"Enums/FetchedRecordChange.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"FetchedRecordChange"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO010deferredToC0yA2CmF":{"name":"deferredToDate","abstract":"

The strategy that uses formatting from the Date structure.

","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO026timeIntervalSinceReferenceC0yA2CmF":{"name":"timeIntervalSinceReferenceDate","abstract":"

Decodes numeric values as a number of seconds between the date and","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO21timeIntervalSince1970yA2CmF":{"name":"timeIntervalSince1970","abstract":"

Decodes numeric values as a number of seconds between the date and","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO21millisecondsSince1970yA2CmF":{"name":"millisecondsSince1970","abstract":"

Decodes numeric values as a number of milliseconds between the date and","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO7iso8601yA2CmF":{"name":"iso8601","abstract":"

Decodes dates according to the ISO 8601 standards

","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO9formattedyACSo15NSDateFormatterCcACmF":{"name":"formatted(_:)","abstract":"

Decodes a String, according to the provided formatter

","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO6customyAC10Foundation0C0VSgAA0B5ValueVccACmF":{"name":"custom(_:)","abstract":"

Decodes according to the user-provided function.

","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseUUIDEncodingStrategy.html#/s:4GRDB28DatabaseUUIDEncodingStrategyO14deferredToUUIDyA2CmF":{"name":"deferredToUUID","abstract":"

The strategy that uses formatting from the UUID type.

","parent_name":"DatabaseUUIDEncodingStrategy"},"Enums/DatabaseUUIDEncodingStrategy.html#/s:4GRDB28DatabaseUUIDEncodingStrategyO6stringyA2CmF":{"name":"string","abstract":"

Encodes UUIDs as strings such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”

","parent_name":"DatabaseUUIDEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO010deferredToC0yA2CmF":{"name":"deferredToDate","abstract":"

The strategy that uses formatting from the Date structure.

","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO026timeIntervalSinceReferenceC0yA2CmF":{"name":"timeIntervalSinceReferenceDate","abstract":"

Encodes a Double: the number of seconds between the date and","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO21timeIntervalSince1970yA2CmF":{"name":"timeIntervalSince1970","abstract":"

Encodes a Double: the number of seconds between the date and","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO16secondsSince1970yA2CmF":{"name":"secondsSince1970","abstract":"

Encodes an Int64: the number of seconds between the date and","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO21millisecondsSince1970yA2CmF":{"name":"millisecondsSince1970","abstract":"

Encodes an Int64: the number of milliseconds between the date and","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO7iso8601yA2CmF":{"name":"iso8601","abstract":"

Encodes dates according to the ISO 8601 and RFC 3339 standards

","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO9formattedyACSo15NSDateFormatterCcACmF":{"name":"formatted(_:)","abstract":"

Encodes a String, according to the provided formatter

","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO6customyAcA0B16ValueConvertible_pSg10Foundation0C0VccACmF":{"name":"custom(_:)","abstract":"

Encodes the result of the user-provided function

","parent_name":"DatabaseDateEncodingStrategy"},"Enums/SQLLogicalBinaryOperator.html#/s:4GRDB24SQLLogicalBinaryOperatorO3andyA2CmF":{"name":"and","abstract":"

Undocumented

","parent_name":"SQLLogicalBinaryOperator"},"Enums/SQLLogicalBinaryOperator.html#/s:4GRDB24SQLLogicalBinaryOperatorO2oryA2CmF":{"name":"or","abstract":"

Undocumented

","parent_name":"SQLLogicalBinaryOperator"},"Enums/DatabaseEventKind.html#/s:4GRDB17DatabaseEventKindO6insertyACSS_tcACmF":{"name":"insert(tableName:)","abstract":"

The insertion of a row in a database table

","parent_name":"DatabaseEventKind"},"Enums/DatabaseEventKind.html#/s:4GRDB17DatabaseEventKindO6deleteyACSS_tcACmF":{"name":"delete(tableName:)","abstract":"

The deletion of a row in a database table

","parent_name":"DatabaseEventKind"},"Enums/DatabaseEventKind.html#/s:4GRDB17DatabaseEventKindO6updateyACSS_ShySSGtcACmF":{"name":"update(tableName:columnNames:)","abstract":"

The update of a set of columns in a database table

","parent_name":"DatabaseEventKind"},"Enums/DatabaseEventKind.html#/s:4GRDB17DatabaseEventKindO9tableNameSSvp":{"name":"tableName","abstract":"

The impacted database table

","parent_name":"DatabaseEventKind"},"Enums/DatabaseEventKind.html":{"name":"DatabaseEventKind","abstract":"

A kind of database event. See the TransactionObserver protocol for"},"Enums/SQLLogicalBinaryOperator.html":{"name":"SQLLogicalBinaryOperator","abstract":"

Undocumented

"},"Enums/DatabaseDateEncodingStrategy.html":{"name":"DatabaseDateEncodingStrategy","abstract":"

DatabaseDateEncodingStrategy specifies how EncodableRecord types that also"},"Enums/DatabaseUUIDEncodingStrategy.html":{"name":"DatabaseUUIDEncodingStrategy","abstract":"

DatabaseUUIDEncodingStrategy specifies how EncodableRecord types that also"},"Enums/DatabaseDateDecodingStrategy.html":{"name":"DatabaseDateDecodingStrategy","abstract":"

DatabaseDateDecodingStrategy specifies how FetchableRecord types that also"},"Enums/FetchedRecordChange.html":{"name":"FetchedRecordChange","abstract":"

A record change, given by a FetchedRecordsController to its change callback.

"},"Enums/PersistenceError.html":{"name":"PersistenceError","abstract":"

An error thrown by a type that adopts PersistableRecord.

"},"Enums/ValueScheduling.html":{"name":"ValueScheduling","abstract":"

ValueScheduling controls how ValueObservation schedules the notifications"},"Enums/ValueReducers.html":{"name":"ValueReducers","abstract":"

A namespace for types related to the ValueReducer protocol.

"},"Classes/FTS5ColumnDefinition.html#/s:4GRDB20FTS5ColumnDefinitionC10notIndexedACXDyF":{"name":"notIndexed()","abstract":"

Excludes the column from the full-text index.

","parent_name":"FTS5ColumnDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC9tokenizerAA0B19TokenizerDescriptorVSgvp":{"name":"tokenizer","abstract":"

The virtual table tokenizer

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC7contentSSSgvp":{"name":"content","abstract":"

The FTS5 content option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC12contentRowIDSSSgvp":{"name":"contentRowID","abstract":"

The FTS5 content_rowid option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC8prefixesShySiGSgvp":{"name":"prefixes","abstract":"

Support for the FTS5 prefix option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC10columnSizeSiSgvp":{"name":"columnSize","abstract":"

Support for the FTS5 columnsize option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC6detailSSSgvp":{"name":"detail","abstract":"

Support for the FTS5 detail option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC6columnyAA0b6ColumnD0CSSF":{"name":"column(_:)","abstract":"

Appends a table column.

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC11synchronize04withC0ySS_tF":{"name":"synchronize(withTable:)","abstract":"

Synchronizes the full-text table with the content of an external","parent_name":"FTS5TableDefinition"},"Classes/Record.html#/s:4GRDB6RecordCACycfc":{"name":"init()","abstract":"

Creates a Record.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC3rowAcA3RowC_tcfc":{"name":"init(row:)","abstract":"

Creates a Record from a row.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC17databaseTableNameSSvpZ":{"name":"databaseTableName","abstract":"

The name of a database table.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC25persistenceConflictPolicyAA011PersistencedE0VvpZ":{"name":"persistenceConflictPolicy","abstract":"

The policy that handles SQLite conflicts when records are inserted","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC17databaseSelectionSayAA13SQLSelectable_pGvpZ":{"name":"databaseSelection","abstract":"

The default request selection.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC6encode2toyAA20PersistenceContainerVz_tF":{"name":"encode(to:)","abstract":"

Defines the values persisted in the database.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC9didInsert4with3forys5Int64V_SSSgtF":{"name":"didInsert(with:for:)","abstract":"

Notifies the record that it was succesfully inserted.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC4copyACXDyF":{"name":"copy()","abstract":"

Returns a copy of self, initialized from all values encoded in the","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC18hasDatabaseChangesSbvp":{"name":"hasDatabaseChanges","abstract":"

A boolean that indicates whether the record has changes that have not","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC15databaseChangesSDySSAA13DatabaseValueVSgGvp":{"name":"databaseChanges","abstract":"

A dictionary of changes that have not been saved.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC6insertyyAA8DatabaseCKF":{"name":"insert(_:)","abstract":"

Executes an INSERT statement.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC6update_7columnsyAA8DatabaseC_ShySSGtKF":{"name":"update(_:columns:)","abstract":"

Executes an UPDATE statement.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC13updateChangesySbAA8DatabaseCKF":{"name":"updateChanges(_:)","abstract":"

If the record has been changed, executes an UPDATE statement so that","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC4saveyyAA8DatabaseCKF":{"name":"save(_:)","abstract":"

Executes an INSERT or an UPDATE statement so that self is saved in","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC6deleteySbAA8DatabaseCKF":{"name":"delete(_:)","abstract":"

Executes a DELETE statement.

","parent_name":"Record"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC_3sql9arguments7adapter5queue12isSameRecordACyxGAA14DatabaseWriter_p_SSAA18StatementArgumentsVAA10RowAdapter_pSgSo012OS_dispatch_H0CSbx_xtcSgtKcfc":{"name":"init(_:sql:arguments:adapter:queue:isSameRecord:)","abstract":"

Creates a fetched records controller initialized from a SQL query and","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC_7request5queue12isSameRecordACyxGAA14DatabaseWriter_p_qd__So012OS_dispatch_F0CSbx_xtcSgtKc10RowDecoderQyd__RszAA12FetchRequestRd__lufc":{"name":"init(_:request:queue:isSameRecord:)","abstract":"

Creates a fetched records controller initialized from a fetch request","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC12performFetchyyKF":{"name":"performFetch()","abstract":"

Executes the controller’s fetch request.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC14databaseWriterAA08DatabaseF0_pvp":{"name":"databaseWriter","abstract":"

The database writer used to fetch records.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC5queueSo012OS_dispatch_E0Cvp":{"name":"queue","abstract":"

The dispatch queue on which the controller must be used.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC10setRequestyyqd__K10RowDecoderQyd__RszAA05FetchF0Rd__lF":{"name":"setRequest(_:)","abstract":"

Updates the fetch request, and eventually notifies the tracking","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC10setRequest3sql9arguments7adapterySS_AA18StatementArgumentsVAA10RowAdapter_pSgtKF":{"name":"setRequest(sql:arguments:adapter:)","abstract":"

Updates the fetch request, and eventually notifies the tracking","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC12trackChanges10willChange02onH003didH0yyACyxGcSg_yAH_xAA0b6RecordH0OtcSgAItF":{"name":"trackChanges(willChange:onChange:didChange:)","abstract":"

Registers changes notification callbacks.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC12trackChanges14fetchAlongside10willChange02onJ003didJ0yqd__AA8DatabaseCKc_yACyxG_qd__tcSgyAK_xAA0b6RecordJ0OtcSgALtlF":{"name":"trackChanges(fetchAlongside:willChange:onChange:didChange:)","abstract":"

Registers changes notification callbacks.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC11trackErrorsyyyACyxG_s5Error_ptcF":{"name":"trackErrors(_:)","abstract":"

Registers an error callback.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC30allowBackgroundChangesTracking2inySo13UIApplicationC_tF":{"name":"allowBackgroundChangesTracking(in:)","abstract":"

Call this method when changes performed while the application is","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC07fetchedC0SayxGvp":{"name":"fetchedRecords","abstract":"

The fetched records.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/allowBackgroundChangesTracking(in:)":{"name":"allowBackgroundChangesTracking(in:)","abstract":"

Call this method when changes performed while the application is","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC6record2atx10Foundation9IndexPathV_tF":{"name":"record(at:)","abstract":"

Returns the object at the given index path.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC8sectionsSayAA0bC11SectionInfoVyxGGvp":{"name":"sections","abstract":"

The sections for the fetched records.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerCA2A11TableRecordRzrlE_3sql9arguments7adapter5queueACyxGAA14DatabaseWriter_p_SSAA18StatementArgumentsVAA10RowAdapter_pSgSo012OS_dispatch_J0CtKcfc":{"name":"init(_:sql:arguments:adapter:queue:)","abstract":"

Creates a fetched records controller initialized from a SQL query and","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerCA2A11TableRecordRzrlE_7request5queueACyxGAA14DatabaseWriter_p_qd__So012OS_dispatch_H0CtKc10RowDecoderQyd__RszAA12FetchRequestRd__lufc":{"name":"init(_:request:queue:)","abstract":"

Creates a fetched records controller initialized from a fetch request","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerCA2A15EncodableRecordRzrlE9indexPath3for10Foundation05IndexH0VSgx_tF":{"name":"indexPath(for:)","abstract":"

Returns the indexPath of a given record.

","parent_name":"FetchedRecordsController"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC10primaryKey10onConflict13autoincrementACXDAA8DatabaseC0G10ResolutionOSg_SbtF":{"name":"primaryKey(onConflict:autoincrement:)","abstract":"

Adds a primary key constraint on the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC7notNull10onConflictACXDAA8DatabaseC0G10ResolutionOSg_tF":{"name":"notNull(onConflict:)","abstract":"

Adds a NOT NULL constraint on the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC6unique10onConflictACXDAA8DatabaseC0F10ResolutionOSg_tF":{"name":"unique(onConflict:)","abstract":"

Adds a UNIQUE constraint on the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC7indexedACXDyF":{"name":"indexed()","abstract":"

Adds an index of the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC5checkyACXDAA14SQLExpressible_pAA0B0VXEF":{"name":"check(_:)","abstract":"

Adds a CHECK constraint on the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC5check3sqlACXDSS_tF":{"name":"check(sql:)","abstract":"

Adds a CHECK constraint on the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC8defaults2toACXDAA24DatabaseValueConvertible_p_tF":{"name":"defaults(to:)","abstract":"

Defines the default column value.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC8defaults3sqlACXDSS_tF":{"name":"defaults(sql:)","abstract":"

Defines the default column value.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC7collateyACXDAA8DatabaseC13CollationNameVF":{"name":"collate(_:)","abstract":"
try db.create(table: \"player\") { t in","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC7collateyACXDAA17DatabaseCollationCF":{"name":"collate(_:)","abstract":"
try db.create(table: \"player\") { t in","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC10references_6column8onDelete0F6Update8deferredACXDSS_SSSgAA8DatabaseC16ForeignKeyActionOSgANSbtF":{"name":"references(_:column:onDelete:onUpdate:deferred:)","abstract":"

Defines a foreign key.

","parent_name":"ColumnDefinition"},"Classes/TableAlteration.html#/s:4GRDB15TableAlterationC3add6column_AA16ColumnDefinitionCSS_AA8DatabaseC0F4TypeVSgtF":{"name":"add(column:_:)","abstract":"

Appends a column to the table.

","parent_name":"TableAlteration"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC25autoIncrementedPrimaryKey_10onConflictAA06ColumnC0CSS_AA8DatabaseC0I10ResolutionOSgtF":{"name":"autoIncrementedPrimaryKey(_:onConflict:)","abstract":"

Defines the auto-incremented primary key.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC6columnyAA06ColumnC0CSS_AA8DatabaseC0E4TypeVSgtF":{"name":"column(_:_:)","abstract":"

Appends a table column.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC10primaryKey_10onConflictySaySSG_AA8DatabaseC0G10ResolutionOSgtF":{"name":"primaryKey(_:onConflict:)","abstract":"

Defines the table primary key.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC9uniqueKey_10onConflictySaySSG_AA8DatabaseC0G10ResolutionOSgtF":{"name":"uniqueKey(_:onConflict:)","abstract":"

Adds a unique key.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC10foreignKey_10references7columns8onDelete0H6Update8deferredySaySSG_SSAJSgAA8DatabaseC07ForeignE6ActionOSgAPSbtF":{"name":"foreignKey(_:references:columns:onDelete:onUpdate:deferred:)","abstract":"

Adds a foreign key.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC5checkyyAA14SQLExpressible_pF":{"name":"check(_:)","abstract":"

Adds a CHECK constraint.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC5check3sqlySS_tF":{"name":"check(sql:)","abstract":"

Adds a CHECK constraint.

","parent_name":"TableDefinition"},"Classes/TableAlias.html#/s:4GRDB10TableAliasC4nameACSSSg_tcfc":{"name":"init(name:)","abstract":"

Undocumented

","parent_name":"TableAlias"},"Classes/TableAlias.html#/s:4GRDB10TableAliasCyAA13SQLSelectable_pAaD_pcip":{"name":"subscript(_:)","abstract":"

Returns a qualified value that is able to resolve ambiguities in","parent_name":"TableAlias"},"Classes/TableAlias.html#/s:4GRDB10TableAliasCyAA13SQLExpression_pAaD_pcip":{"name":"subscript(_:)","abstract":"

Returns a qualified expression that is able to resolve ambiguities in","parent_name":"TableAlias"},"Classes/FTS5ColumnDefinition.html#/notIndexed()":{"name":"notIndexed()","abstract":"

Excludes the column from the full-text index.

","parent_name":"FTS5ColumnDefinition"},"Classes/FTS5TableDefinition.html#/tokenizer":{"name":"tokenizer","abstract":"

The virtual table tokenizer

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/content":{"name":"content","abstract":"

The FTS5 content option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/contentRowID":{"name":"contentRowID","abstract":"

The FTS5 content_rowid option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/prefixes":{"name":"prefixes","abstract":"

Support for the FTS5 prefix option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/columnSize":{"name":"columnSize","abstract":"

Support for the FTS5 columnsize option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/detail":{"name":"detail","abstract":"

Support for the FTS5 detail option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/column(_:)":{"name":"column(_:)","abstract":"

Appends a table column.

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/synchronize(withTable:)":{"name":"synchronize(withTable:)","abstract":"

Synchronizes the full-text table with the content of an external","parent_name":"FTS5TableDefinition"},"Classes/FTS4ColumnDefinition.html#/s:4GRDB20FTS4ColumnDefinitionC10notIndexedACXDyF":{"name":"notIndexed()","abstract":"

Excludes the column from the full-text index.

","parent_name":"FTS4ColumnDefinition"},"Classes/FTS4ColumnDefinition.html#/s:4GRDB20FTS4ColumnDefinitionC12asLanguageIdACXDyF":{"name":"asLanguageId()","abstract":"

Uses the column as the Int32 language id hidden column.

","parent_name":"FTS4ColumnDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC9tokenizerAA23FTS3TokenizerDescriptorVSgvp":{"name":"tokenizer","abstract":"

The virtual table tokenizer

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC7contentSSSgvp":{"name":"content","abstract":"

The FTS4 content option

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC8compressSSSgvp":{"name":"compress","abstract":"

The FTS4 compress option

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC10uncompressSSSgvp":{"name":"uncompress","abstract":"

The FTS4 uncompress option

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC9matchinfoSSSgvp":{"name":"matchinfo","abstract":"

The FTS4 matchinfo option

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC8prefixesShySiGSgvp":{"name":"prefixes","abstract":"

Support for the FTS5 prefix option

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC6columnyAA0b6ColumnD0CSSF":{"name":"column(_:)","abstract":"

Appends a table column.

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC11synchronize04withC0ySS_tF":{"name":"synchronize(withTable:)","abstract":"

Synchronizes the full-text table with the content of an external","parent_name":"FTS4TableDefinition"},"Classes/FTS3TableDefinition.html#/s:4GRDB19FTS3TableDefinitionC9tokenizerAA0B19TokenizerDescriptorVSgvp":{"name":"tokenizer","abstract":"

The virtual table tokenizer

","parent_name":"FTS3TableDefinition"},"Classes/FTS3TableDefinition.html#/s:4GRDB19FTS3TableDefinitionC6columnyySSF":{"name":"column(_:)","abstract":"

Appends a table column.

","parent_name":"FTS3TableDefinition"},"Classes/UpdateStatement.html#/s:4GRDB15UpdateStatementC7execute9argumentsyAA0C9ArgumentsVSg_tKF":{"name":"execute(arguments:)","abstract":"

Executes the SQL query.

","parent_name":"UpdateStatement"},"Classes/Statement.html#/s:4GRDB9StatementC06sqliteB0s13OpaquePointerVvp":{"name":"sqliteStatement","abstract":"

The raw SQLite statement, suitable for the SQLite C API.

","parent_name":"Statement"},"Classes/Statement.html#/s:4GRDB9StatementC3sqlSSvp":{"name":"sql","abstract":"

The SQL query

","parent_name":"Statement"},"Classes/Statement.html#/s:4GRDB9StatementC9argumentsAA0B9ArgumentsVvp":{"name":"arguments","abstract":"

The statement arguments.

","parent_name":"Statement"},"Classes/Statement.html#/s:4GRDB9StatementC8validate9argumentsyAA0B9ArgumentsV_tKF":{"name":"validate(arguments:)","abstract":"

Throws a DatabaseError of code SQLITE_ERROR if arguments don’t fill all","parent_name":"Statement"},"Classes/Statement.html#/s:4GRDB9StatementC18unsafeSetArgumentsyyAA0bE0VF":{"name":"unsafeSetArguments(_:)","abstract":"

Set arguments without any validation. Trades safety for performance.

","parent_name":"Statement"},"Classes/SelectStatement.html#/s:4GRDB15SelectStatementC14databaseRegionAA08DatabaseE0Vvp":{"name":"databaseRegion","abstract":"

The database region that the statement looks into.

","parent_name":"SelectStatement"},"Classes/SelectStatement.html#/s:4GRDB15SelectStatementC11columnCountSivp":{"name":"columnCount","abstract":"

The number of columns in the resulting rows.

","parent_name":"SelectStatement"},"Classes/SelectStatement.html#/s:4GRDB15SelectStatementC11columnNamesSaySSGvp":{"name":"columnNames","abstract":"

The column names, ordered from left to right.

","parent_name":"SelectStatement"},"Classes/SelectStatement.html#/s:4GRDB15SelectStatementC5index8ofColumnSiSgSS_tF":{"name":"index(ofColumn:)","abstract":"

Returns the index of the leftmost column named name, in a","parent_name":"SelectStatement"},"Classes/RowCursor.html#/s:4GRDB9RowCursorC9statementAA15SelectStatementCvp":{"name":"statement","abstract":"

Undocumented

","parent_name":"RowCursor"},"Classes/Row/PrefetchedRowsView.html#/s:4GRDB3RowC18PrefetchedRowsViewV7isEmptySbvp":{"name":"isEmpty","abstract":"

True if there is no prefetched associated rows.

","parent_name":"PrefetchedRowsView"},"Classes/Row/PrefetchedRowsView.html#/s:4GRDB3RowC18PrefetchedRowsViewV4keysShySSGvp":{"name":"keys","abstract":"

The keys for available prefetched rows

","parent_name":"PrefetchedRowsView"},"Classes/Row/PrefetchedRowsView.html#/s:4GRDB3RowC18PrefetchedRowsViewVySayACGSgSScip":{"name":"subscript(_:)","abstract":"

Returns the prefetched rows associated with the given key.

","parent_name":"PrefetchedRowsView"},"Classes/Row/ScopesTreeView.html#/s:4GRDB3RowC14ScopesTreeViewV5namesShySSGvp":{"name":"names","abstract":"

The scopes defined on this row, recursively.

","parent_name":"ScopesTreeView"},"Classes/Row/ScopesTreeView.html#/s:4GRDB3RowC14ScopesTreeViewVyACSgSScip":{"name":"subscript(_:)","abstract":"

Returns the row associated with the given scope.

","parent_name":"ScopesTreeView"},"Classes/Row/ScopesView.html#/s:Sl5IndexQa":{"name":"Index","parent_name":"ScopesView"},"Classes/Row/ScopesView.html#/s:4GRDB3RowC10ScopesViewV5namesSD4KeysVySSAA08LayoutedB7Adapter_p_Gvp":{"name":"names","abstract":"

The scopes defined on this row.

","parent_name":"ScopesView"},"Classes/Row/ScopesView.html#/s:4GRDB3RowC10ScopesViewVyACSgSScip":{"name":"subscript(_:)","abstract":"

Returns the row associated with the given scope, or nil if the","parent_name":"ScopesView"},"Classes/Row.html#/s:4GRDB3RowC5countSivp":{"name":"count","abstract":"

The number of columns in the row.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC14prefetchedRowsAC010PrefetchedD4ViewVvp":{"name":"prefetchedRows","abstract":"

A view on the prefetched associated rows.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCACycfc":{"name":"init()","abstract":"

Creates an empty row.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyACSDySSAA24DatabaseValueConvertible_pSgGcfc":{"name":"init(_:)","abstract":"

Creates a row from a dictionary of values.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyACSgSDys11AnyHashableVypGcfc":{"name":"init(_:)","abstract":"

Creates a row from [AnyHashable: Any].

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC4copyACyF":{"name":"copy()","abstract":"

Returns an immutable copy of the row.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC11columnNamess15LazyMapSequenceVyACSSGvp":{"name":"columnNames","abstract":"

The names of columns in the row.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC9hasColumnySbSSF":{"name":"hasColumn(_:)","abstract":"

Returns true if and only if the row has that column.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC20containsNonNullValueSbvp":{"name":"containsNonNullValue","abstract":"

Returns true if and only if one column contains a non-null value, or if","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC7hasNull7atIndexSbSi_tF":{"name":"hasNull(atIndex:)","abstract":"

Returns true if the row contains null at given index.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyAA24DatabaseValueConvertible_pSgSicip":{"name":"subscript(_:)","abstract":"

Returns Int64, Double, String, Data or nil, depending on the value","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgSicAA24DatabaseValueConvertibleRzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given index, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgSicAA24DatabaseValueConvertibleRzAA015StatementColumnE0Rzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given index, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSicAA24DatabaseValueConvertibleRzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given index, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSicAA24DatabaseValueConvertibleRzAA015StatementColumnE0Rzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given index, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyAA24DatabaseValueConvertible_pSgSScip":{"name":"subscript(_:)","abstract":"

Returns Int64, Double, String, Data or nil, depending on the value","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgSScAA24DatabaseValueConvertibleRzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgSScAA24DatabaseValueConvertibleRzAA015StatementColumnE0Rzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSScAA24DatabaseValueConvertibleRzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSScAA24DatabaseValueConvertibleRzAA015StatementColumnE0Rzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyAA24DatabaseValueConvertible_pSgxcAA16ColumnExpressionRzluip":{"name":"subscript(_:)","abstract":"

Returns Int64, Double, String, NSData or nil, depending on the value","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgq_cAA24DatabaseValueConvertibleRzAA16ColumnExpressionR_r0_luip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgq_cAA24DatabaseValueConvertibleRzAA015StatementColumnE0RzAA0G10ExpressionR_r0_luip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxq_cAA24DatabaseValueConvertibleRzAA16ColumnExpressionR_r0_luip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxq_cAA24DatabaseValueConvertibleRzAA015StatementColumnE0RzAA0G10ExpressionR_r0_luip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC10dataNoCopy7atIndex10Foundation4DataVSgSi_tF":{"name":"dataNoCopy(atIndex:)","abstract":"

Returns the optional Data at given index.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC10dataNoCopy5named10Foundation4DataVSgSS_tF":{"name":"dataNoCopy(named:)","abstract":"

Returns the optional Data at given column.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC10dataNoCopyy10Foundation4DataVSgxAA16ColumnExpressionRzlF":{"name":"dataNoCopy(_:)","abstract":"

Returns the optional NSData at given column.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC14databaseValuess15LazyMapSequenceVyAcA13DatabaseValueVGvp":{"name":"databaseValues","abstract":"

The database values in the row.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSScAA15FetchableRecordRzluip":{"name":"subscript(_:)","abstract":"

Returns the record associated with the given scope.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgSScAA15FetchableRecordRzluip":{"name":"subscript(_:)","abstract":"

Returns the eventual record associated with the given scope.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSScSmRzAA15FetchableRecord7ElementRpzluip":{"name":"subscript(_:)","abstract":"

Returns the records encoded in the given prefetched rows.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyShyxGSScAA15FetchableRecordRzSHRzluip":{"name":"subscript(_:)","abstract":"

Returns the set of records encoded in the given prefetched rows.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC6scopesAC10ScopesViewVvp":{"name":"scopes","abstract":"

Returns a view on the scopes defined by row adapters.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC10scopesTreeAC06ScopesD4ViewVvp":{"name":"scopesTree","abstract":"

Returns a view on the scopes tree defined by row adapters.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8unscopedACvp":{"name":"unscoped","abstract":"

Returns a copy of the row, without any scopes.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC9unadaptedACvp":{"name":"unadapted","abstract":"

Return the raw row fetched from the database.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC11fetchCursor_9arguments7adapterAA0bD0CAA15SelectStatementC_AA0H9ArgumentsVSgAA0B7Adapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

Returns a cursor over rows fetched from a prepared statement.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchAll_9arguments7adapterSayACGAA15SelectStatementC_AA0H9ArgumentsVSgAA0B7Adapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of rows fetched from a prepared statement.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchOne_9arguments7adapterACSgAA15SelectStatementC_AA0H9ArgumentsVSgAA0B7Adapter_pSgtKFZ":{"name":"fetchOne(_:arguments:adapter:)","abstract":"

Returns a single row fetched from a prepared statement.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC11fetchCursor_3sql9arguments7adapterAA0bD0CAA8DatabaseC_SSAA18StatementArgumentsVAA0B7Adapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over rows fetched from an SQL query.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchAll_3sql9arguments7adapterSayACGAA8DatabaseC_SSAA18StatementArgumentsVAA0B7Adapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of rows fetched from an SQL query.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchOne_3sql9arguments7adapterACSgAA8DatabaseC_SSAA18StatementArgumentsVAA0B7Adapter_pSgtKFZ":{"name":"fetchOne(_:sql:arguments:adapter:)","abstract":"

Returns a single row fetched from an SQL query.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC11fetchCursoryAA0bD0CAA8DatabaseC_xtKAA12FetchRequestRzlFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over rows fetched from a fetch request.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchAllySayACGAA8DatabaseC_xtKAA12FetchRequestRzlFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of rows fetched from a fetch request.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchOneyACSgAA8DatabaseC_xtKAA12FetchRequestRzlFZ":{"name":"fetchOne(_:_:)","abstract":"

Returns a single row fetched from a fetch request.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC17dictionaryLiteralACSS_AA24DatabaseValueConvertible_pSgtd_tcfc":{"name":"init(dictionaryLiteral:)","abstract":"

Creates a row initialized with elements. Column order is preserved, and","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCySS_AA13DatabaseValueVtAA0B5IndexVcip":{"name":"subscript(_:)","abstract":"

Accesses the (ColumnName, DatabaseValue) pair at given index.

","parent_name":"Row"},"Classes/Row/ScopesView.html":{"name":"ScopesView","abstract":"

A view of the scopes defined by row adapters. It is a collection of","parent_name":"Row"},"Classes/Row/ScopesTreeView.html":{"name":"ScopesTreeView","abstract":"

A view on the scopes tree defined by row adapters.

","parent_name":"Row"},"Classes/Row/PrefetchedRowsView.html":{"name":"PrefetchedRowsView","abstract":"

A view on the prefetched associated rows.

","parent_name":"Row"},"Classes/AnyDatabaseWriter.html#/s:4GRDB17AnyDatabaseWriterCyAcA0cD0_pcfc":{"name":"init(_:)","abstract":"

Creates a database writer that wraps a base database writer.

","parent_name":"AnyDatabaseWriter"},"Classes/DatabaseFuture.html#/s:4GRDB14DatabaseFutureC4waitxyKF":{"name":"wait()","abstract":"

Blocks the current thread until the value is available, and returns it.

","parent_name":"DatabaseFuture"},"Classes/DatabaseSnapshot.html#/s:4GRDB16DatabaseSnapshotC13configurationAA13ConfigurationVvp":{"name":"configuration","abstract":"

The database configuration

","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP9interruptyyF":{"name":"interrupt()","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB16DatabaseSnapshotC4readyxxAA0B0CKXEKlF":{"name":"read(_:)","abstract":"

Synchronously executes a read-only block that takes a database","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB16DatabaseSnapshotC9asyncReadyyys6ResultOyAA0B0Cs5Error_pGcF":{"name":"asyncRead(_:)","abstract":"

Asynchronously executes a read-only block in a protected dispatch queue.

","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP3add8functionyAA0B8FunctionC_tF":{"name":"add(function:)","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP6remove8functionyAA0B8FunctionC_tF":{"name":"remove(function:)","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP3add9collationyAA0B9CollationC_tF":{"name":"add(collation:)","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP6remove9collationyAA0B9CollationC_tF":{"name":"remove(collation:)","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP3add11observation7onError0F6ChangeAA19TransactionObserver_pAA16ValueObservationVyqd__G_ys0G0_pcy0K0Qyd__ctAA0K7ReducerRd__lF":{"name":"add(observation:onError:onChange:)","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP6remove19transactionObserveryAA011TransactionF0_p_tF":{"name":"remove(transactionObserver:)","parent_name":"DatabaseSnapshot"},"Classes/AnyDatabaseReader.html#/s:4GRDB17AnyDatabaseReaderCyAcA0cD0_pcfc":{"name":"init(_:)","abstract":"

Creates a database reader that wraps a base database reader.

","parent_name":"AnyDatabaseReader"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC13configurationAA13ConfigurationVvp":{"name":"configuration","abstract":"

The database configuration

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC4pathSSvp":{"name":"path","abstract":"

The path to the database file; it is “:memory:” for in-memory databases.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC4path13configurationACSS_AA13ConfigurationVtKcfc":{"name":"init(path:configuration:)","abstract":"

Opens the SQLite database at path path.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC13configurationAcA13ConfigurationV_tcfc":{"name":"init(configuration:)","abstract":"

Opens an in-memory SQLite database.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC13releaseMemoryyyF":{"name":"releaseMemory()","abstract":"

Free as much memory as possible.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC21setupMemoryManagement2inySo13UIApplicationC_tF":{"name":"setupMemoryManagement(in:)","abstract":"

Listens to UIApplicationDidEnterBackgroundNotification and","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB14DatabaseReaderP9interruptyyF":{"name":"interrupt()","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC4readyxxAA0B0CKXEKlF":{"name":"read(_:)","abstract":"

Synchronously executes a read-only block in a protected dispatch queue,","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC9asyncReadyyys6ResultOyAA0B0Cs5Error_pGcF":{"name":"asyncRead(_:)","abstract":"

Asynchronously executes a read-only block in a protected dispatch queue.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB14DatabaseWriterP14concurrentReadyAA0B6FutureCyqd__Gqd__AA0B0CKclF":{"name":"concurrentRead(_:)","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC13inTransactionyyAA0B0C0E4KindOSg_AF0E10CompletionOAFKXEtKF":{"name":"inTransaction(_:_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC23writeWithoutTransactionyxxAA0B0CKXEKlF":{"name":"writeWithoutTransaction(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC02inB0yxxAA0B0CKXEKlF":{"name":"inDatabase(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC20unsafeReentrantWriteyxxAA0B0CKXEKlF":{"name":"unsafeReentrantWrite(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue, and","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC28asyncWriteWithoutTransactionyyyAA0B0CcF":{"name":"asyncWriteWithoutTransaction(_:)","abstract":"

Asynchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC3add8functionyAA0B8FunctionC_tF":{"name":"add(function:)","abstract":"

Add or redefine an SQL function.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC6remove8functionyAA0B8FunctionC_tF":{"name":"remove(function:)","abstract":"

Remove an SQL function.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC3add9collationyAA0B9CollationC_tF":{"name":"add(collation:)","abstract":"

Add or redefine a collation.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC6remove9collationyAA0B9CollationC_tF":{"name":"remove(collation:)","abstract":"

Remove a collation.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/setupMemoryManagement(in:)":{"name":"setupMemoryManagement(in:)","abstract":"

Listens to UIApplicationDidEnterBackgroundNotification and","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC6change10passphraseySS_tKF":{"name":"change(passphrase:)","abstract":"

Changes the passphrase of an encrypted database

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC3add9tokenizeryxm_tAA19FTS5CustomTokenizerRzlF":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"DatabaseQueue"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC4pathSSvp":{"name":"path","abstract":"

The path to the database.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB14DatabaseReaderP13configurationAA13ConfigurationVvp":{"name":"configuration","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC4path13configurationACSS_AA13ConfigurationVtKcfc":{"name":"init(path:configuration:)","abstract":"

Opens the SQLite database at path path.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC10checkpointyyAA0B0C14CheckpointModeOKF":{"name":"checkpoint(_:)","abstract":"

Runs a WAL checkpoint

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC13releaseMemoryyyF":{"name":"releaseMemory()","abstract":"

Free as much memory as possible.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC21setupMemoryManagement2inySo13UIApplicationC_tF":{"name":"setupMemoryManagement(in:)","abstract":"

Listens to UIApplicationDidEnterBackgroundNotification and","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB14DatabaseReaderP9interruptyyF":{"name":"interrupt()","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC4readyxxAA0B0CKXEKlF":{"name":"read(_:)","abstract":"

Synchronously executes a read-only block in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC9asyncReadyyys6ResultOyAA0B0Cs5Error_pGcF":{"name":"asyncRead(_:)","abstract":"

Asynchronously executes a read-only block in a protected dispatch queue.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC10unsafeReadyxxAA0B0CKXEKlF":{"name":"unsafeRead(_:)","abstract":"

Synchronously executes a read-only block in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC19unsafeReentrantReadyxxAA0B0CKXEKlF":{"name":"unsafeReentrantRead(_:)","abstract":"

Synchronously executes a read-only block in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB14DatabaseWriterP14concurrentReadyAA0B6FutureCyqd__Gqd__AA0B0CKclF":{"name":"concurrentRead(_:)","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC19asyncConcurrentReadyyys6ResultOyAA0B0Cs5Error_pGcF":{"name":"asyncConcurrentRead(_:)","abstract":"

Asynchronously executes a read-only block in a protected dispatch queue.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC29invalidateReadOnlyConnectionsyyF":{"name":"invalidateReadOnlyConnections()","abstract":"

Invalidates open read-only SQLite connections.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC23writeWithoutTransactionyxxAA0B0CKXEKlF":{"name":"writeWithoutTransaction(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC30barrierWriteWithoutTransactionyxxAA0B0CKXEKlF":{"name":"barrierWriteWithoutTransaction(_:)","abstract":"

A barrier write ensures that no database access is executed until all","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC18writeInTransactionyyAA0B0C0F4KindOSg_AF0F10CompletionOAFKXEtKF":{"name":"writeInTransaction(_:_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC20unsafeReentrantWriteyxxAA0B0CKXEKlF":{"name":"unsafeReentrantWrite(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC28asyncWriteWithoutTransactionyyyAA0B0CcF":{"name":"asyncWriteWithoutTransaction(_:)","abstract":"

Asynchronously executes database updates in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC3add8functionyAA0B8FunctionC_tF":{"name":"add(function:)","abstract":"

Add or redefine an SQL function.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC6remove8functionyAA0B8FunctionC_tF":{"name":"remove(function:)","abstract":"

Remove an SQL function.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC3add9collationyAA0B9CollationC_tF":{"name":"add(collation:)","abstract":"

Add or redefine a collation.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC6remove9collationyAA0B9CollationC_tF":{"name":"remove(collation:)","abstract":"

Remove a collation.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/add(tokenizer:)":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC12makeSnapshotAA0bE0CyKF":{"name":"makeSnapshot()","abstract":"

Creates a database snapshot.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/setupMemoryManagement(in:)":{"name":"setupMemoryManagement(in:)","abstract":"

Listens to UIApplicationDidEnterBackgroundNotification and","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC6change10passphraseySS_tKF":{"name":"change(passphrase:)","abstract":"

Changes the passphrase of an encrypted database

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC3add9tokenizeryxm_tAA19FTS5CustomTokenizerRzlF":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"DatabasePool"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC4nameSSvp":{"name":"name","abstract":"

Undocumented

","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC_13argumentCount4pure8functionACSS_s5Int32VSgSbAA0B16ValueConvertible_pSgSayAA0bI0VGKctcfc":{"name":"init(_:argumentCount:pure:function:)","abstract":"

Returns an SQL function.

","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC_13argumentCount4pure9aggregateACSS_s5Int32VSgSbxmtcAA0B9AggregateRzlufc":{"name":"init(_:argumentCount:pure:aggregate:)","abstract":"

Returns an SQL aggregate function.

","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC10capitalizeACvpZ":{"name":"capitalize","abstract":"

An SQL function that returns the Swift built-in capitalized","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC9lowercaseACvpZ":{"name":"lowercase","abstract":"

An SQL function that returns the Swift built-in lowercased","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC9uppercaseACvpZ":{"name":"uppercase","abstract":"

An SQL function that returns the Swift built-in uppercased","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC19localizedCapitalizeACvpZ":{"name":"localizedCapitalize","abstract":"

An SQL function that returns the Swift built-in","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC18localizedLowercaseACvpZ":{"name":"localizedLowercase","abstract":"

An SQL function that returns the Swift built-in","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC18localizedUppercaseACvpZ":{"name":"localizedUppercase","abstract":"

An SQL function that returns the Swift built-in","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC5applyyAA13SQLExpression_pAA14SQLExpressible_pd_tF":{"name":"apply(_:)","abstract":"

Returns an SQL expression that applies the function.

","parent_name":"DatabaseFunction"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC4nameSSvp":{"name":"name","abstract":"

Undocumented

","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC_8functionACSS_So18NSComparisonResultVSS_SStctcfc":{"name":"init(_:function:)","abstract":"

Creates a collation.

","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC14unicodeCompareACvpZ":{"name":"unicodeCompare","abstract":"

A collation, or SQL string comparison function, that compares strings","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC22caseInsensitiveCompareACvpZ":{"name":"caseInsensitiveCompare","abstract":"

A collation, or SQL string comparison function, that compares strings","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC31localizedCaseInsensitiveCompareACvpZ":{"name":"localizedCaseInsensitiveCompare","abstract":"

A collation, or SQL string comparison function, that compares strings","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC16localizedCompareACvpZ":{"name":"localizedCompare","abstract":"

A collation, or SQL string comparison function, that compares strings","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC24localizedStandardCompareACvpZ":{"name":"localizedStandardCompare","abstract":"

A collation, or SQL string comparison function, that compares strings","parent_name":"DatabaseCollation"},"Classes/Database/TransactionObservationExtent.html#/s:4GRDB8DatabaseC28TransactionObservationExtentO16observerLifetimeyA2EmF":{"name":"observerLifetime","abstract":"

Observation lasts until observer is deallocated

","parent_name":"TransactionObservationExtent"},"Classes/Database/TransactionObservationExtent.html#/s:4GRDB8DatabaseC28TransactionObservationExtentO04nextC0yA2EmF":{"name":"nextTransaction","abstract":"

Observation lasts until the next transaction

","parent_name":"TransactionObservationExtent"},"Classes/Database/TransactionObservationExtent.html#/s:4GRDB8DatabaseC28TransactionObservationExtentO16databaseLifetimeyA2EmF":{"name":"databaseLifetime","abstract":"

Observation lasts until the database is closed

","parent_name":"TransactionObservationExtent"},"Classes/Database/TransactionKind.html#/s:4GRDB8DatabaseC15TransactionKindO8deferredyA2EmF":{"name":"deferred","abstract":"

Undocumented

","parent_name":"TransactionKind"},"Classes/Database/TransactionKind.html#/s:4GRDB8DatabaseC15TransactionKindO9immediateyA2EmF":{"name":"immediate","abstract":"

Undocumented

","parent_name":"TransactionKind"},"Classes/Database/TransactionKind.html#/s:4GRDB8DatabaseC15TransactionKindO9exclusiveyA2EmF":{"name":"exclusive","abstract":"

Undocumented

","parent_name":"TransactionKind"},"Classes/Database/TransactionCompletion.html#/s:4GRDB8DatabaseC21TransactionCompletionO6commityA2EmF":{"name":"commit","abstract":"

Undocumented

","parent_name":"TransactionCompletion"},"Classes/Database/TransactionCompletion.html#/s:4GRDB8DatabaseC21TransactionCompletionO8rollbackyA2EmF":{"name":"rollback","abstract":"

Undocumented

","parent_name":"TransactionCompletion"},"Classes/Database/ForeignKeyAction.html#/s:4GRDB8DatabaseC16ForeignKeyActionO7cascadeyA2EmF":{"name":"cascade","abstract":"

Undocumented

","parent_name":"ForeignKeyAction"},"Classes/Database/ForeignKeyAction.html#/s:4GRDB8DatabaseC16ForeignKeyActionO8restrictyA2EmF":{"name":"restrict","abstract":"

Undocumented

","parent_name":"ForeignKeyAction"},"Classes/Database/ForeignKeyAction.html#/s:4GRDB8DatabaseC16ForeignKeyActionO7setNullyA2EmF":{"name":"setNull","abstract":"

Undocumented

","parent_name":"ForeignKeyAction"},"Classes/Database/ForeignKeyAction.html#/s:4GRDB8DatabaseC16ForeignKeyActionO10setDefaultyA2EmF":{"name":"setDefault","abstract":"

Undocumented

","parent_name":"ForeignKeyAction"},"Classes/Database/ConflictResolution.html#/s:4GRDB8DatabaseC18ConflictResolutionO8rollbackyA2EmF":{"name":"rollback","abstract":"

Undocumented

","parent_name":"ConflictResolution"},"Classes/Database/ConflictResolution.html#/s:4GRDB8DatabaseC18ConflictResolutionO5abortyA2EmF":{"name":"abort","abstract":"

Undocumented

","parent_name":"ConflictResolution"},"Classes/Database/ConflictResolution.html#/s:4GRDB8DatabaseC18ConflictResolutionO4failyA2EmF":{"name":"fail","abstract":"

Undocumented

","parent_name":"ConflictResolution"},"Classes/Database/ConflictResolution.html#/s:4GRDB8DatabaseC18ConflictResolutionO6ignoreyA2EmF":{"name":"ignore","abstract":"

Undocumented

","parent_name":"ConflictResolution"},"Classes/Database/ConflictResolution.html#/s:4GRDB8DatabaseC18ConflictResolutionO7replaceyA2EmF":{"name":"replace","abstract":"

Undocumented

","parent_name":"ConflictResolution"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeVyAESScfc":{"name":"init(_:)","abstract":"

Undocumented

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV4textAEvpZ":{"name":"text","abstract":"

The TEXT SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV7integerAEvpZ":{"name":"integer","abstract":"

The INTEGER SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV6doubleAEvpZ":{"name":"double","abstract":"

The DOUBLE SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV7numericAEvpZ":{"name":"numeric","abstract":"

The NUMERIC SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV7booleanAEvpZ":{"name":"boolean","abstract":"

The BOOLEAN SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV4blobAEvpZ":{"name":"blob","abstract":"

The BLOB SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV4dateAEvpZ":{"name":"date","abstract":"

The DATE SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV8datetimeAEvpZ":{"name":"datetime","abstract":"

The DATETIME SQL column type

","parent_name":"ColumnType"},"Classes/Database/CollationName.html#/s:4GRDB8DatabaseC13CollationNameVyAESScfc":{"name":"init(_:)","abstract":"

Undocumented

","parent_name":"CollationName"},"Classes/Database/CollationName.html#/s:4GRDB8DatabaseC13CollationNameV6binaryAEvpZ":{"name":"binary","abstract":"

The BINARY built-in SQL collation

","parent_name":"CollationName"},"Classes/Database/CollationName.html#/s:4GRDB8DatabaseC13CollationNameV6nocaseAEvpZ":{"name":"nocase","abstract":"

The NOCASE built-in SQL collation

","parent_name":"CollationName"},"Classes/Database/CollationName.html#/s:4GRDB8DatabaseC13CollationNameV5rtrimAEvpZ":{"name":"rtrim","abstract":"

The RTRIM built-in SQL collation

","parent_name":"CollationName"},"Classes/Database/CheckpointMode.html#/s:4GRDB8DatabaseC14CheckpointModeO7passiveyA2EmF":{"name":"passive","abstract":"

Undocumented

","parent_name":"CheckpointMode"},"Classes/Database/CheckpointMode.html#/s:4GRDB8DatabaseC14CheckpointModeO4fullyA2EmF":{"name":"full","abstract":"

Undocumented

","parent_name":"CheckpointMode"},"Classes/Database/CheckpointMode.html#/s:4GRDB8DatabaseC14CheckpointModeO7restartyA2EmF":{"name":"restart","abstract":"

Undocumented

","parent_name":"CheckpointMode"},"Classes/Database/CheckpointMode.html#/s:4GRDB8DatabaseC14CheckpointModeO8truncateyA2EmF":{"name":"truncate","abstract":"

Undocumented

","parent_name":"CheckpointMode"},"Classes/Database/BusyMode.html#/s:4GRDB8DatabaseC8BusyModeO14immediateErroryA2EmF":{"name":"immediateError","abstract":"

The SQLITE_BUSY error is immediately returned to the connection that","parent_name":"BusyMode"},"Classes/Database/BusyMode.html#/s:4GRDB8DatabaseC8BusyModeO7timeoutyAESdcAEmF":{"name":"timeout(_:)","abstract":"

The SQLITE_BUSY error will be returned only if the database remains","parent_name":"BusyMode"},"Classes/Database/BusyMode.html#/s:4GRDB8DatabaseC8BusyModeO8callbackyAESbSiccAEmF":{"name":"callback(_:)","abstract":"

A custom callback that is called when a database is locked.","parent_name":"BusyMode"},"Classes/Database.html#/s:4GRDB8DatabaseC16sqliteConnections13OpaquePointerVvp":{"name":"sqliteConnection","abstract":"

The raw SQLite connection, suitable for the SQLite C API.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC8logErroryAA10ResultCodeV_SStcSgvpZ":{"name":"logError","abstract":"

The error logging function.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13configurationAA13ConfigurationVvp":{"name":"configuration","abstract":"

The database configuration

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC17lastInsertedRowIDs5Int64Vvp":{"name":"lastInsertedRowID","abstract":"

The rowID of the most recently inserted row.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC12changesCountSivp":{"name":"changesCount","abstract":"

The number of rows modified, inserted or deleted by the most recent","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC17totalChangesCountSivp":{"name":"totalChangesCount","abstract":"

The total number of rows modified, inserted or deleted by all successful","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC19isInsideTransactionSbvp":{"name":"isInsideTransaction","abstract":"

True if the database connection is currently in a transaction.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13lastErrorCodeAA06ResultE0Vvp":{"name":"lastErrorCode","abstract":"

The last error code

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC16lastErrorMessageSSSgvp":{"name":"lastErrorMessage","abstract":"

The last error message

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC3add8functionyAA0B8FunctionC_tF":{"name":"add(function:)","abstract":"

Add or redefine an SQL function.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6remove8functionyAA0B8FunctionC_tF":{"name":"remove(function:)","abstract":"

Remove an SQL function.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC3add9collationyAA0B9CollationC_tF":{"name":"add(collation:)","abstract":"

Add or redefine a collation.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6remove9collationyAA0B9CollationC_tF":{"name":"remove(collation:)","abstract":"

Remove a collation.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC19suspendNotificationSo18NSNotificationNameavpZ":{"name":"suspendNotification","abstract":"

When this notification is posted, databases which were opened with the","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC18resumeNotificationSo18NSNotificationNameavpZ":{"name":"resumeNotification","abstract":"

When this notification is posted, databases which were opened with the","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13inTransactionyyAC0D4KindOSg_AC0D10CompletionOyKXEtKF":{"name":"inTransaction(_:_:)","abstract":"

Executes a block inside a database transaction.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC11inSavepointyyAC21TransactionCompletionOyKXEKF":{"name":"inSavepoint(_:)","abstract":"

Executes a block inside a savepoint.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC16beginTransactionyyAC0D4KindOSgKF":{"name":"beginTransaction(_:)","abstract":"

Begins a database transaction.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC8rollbackyyKF":{"name":"rollback()","abstract":"

Rollbacks a database transaction.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6commityyKF":{"name":"commit()","abstract":"

Commits a database transaction.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC16clearSchemaCacheyyF":{"name":"clearSchemaCache()","abstract":"

Clears the database schema cache.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC11tableExistsySbSSKF":{"name":"tableExists(_:)","abstract":"

Returns whether a table exists.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC21isSQLiteInternalTableySbSSF":{"name":"isSQLiteInternalTable(_:)","abstract":"

Returns whether a table is an internal SQLite table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC19isGRDBInternalTableySbSSF":{"name":"isGRDBInternalTable(_:)","abstract":"

Returns whether a table is an internal GRDB table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC10viewExistsySbSSKF":{"name":"viewExists(_:)","abstract":"

Returns whether a view exists.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13triggerExistsySbSSKF":{"name":"triggerExists(_:)","abstract":"

Returns whether a trigger exists.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC10primaryKeyyAA07PrimaryD4InfoVSSKF":{"name":"primaryKey(_:)","abstract":"

The primary key for table named tableName.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7indexes2onSayAA9IndexInfoVGSS_tKF":{"name":"indexes(on:)","abstract":"

The indexes on table named tableName; returns the empty array if the","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC5table_12hasUniqueKeySbSS_xtKSTRzSS7ElementRtzlF":{"name":"table(_:hasUniqueKey:)","abstract":"

True if a sequence of columns uniquely identifies a row, that is to say","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC11foreignKeys2onSayAA14ForeignKeyInfoVGSS_tKF":{"name":"foreignKeys(on:)","abstract":"

The foreign keys defined on table named tableName.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7columns2inSayAA10ColumnInfoVGSS_tKF":{"name":"columns(in:)","abstract":"

The columns in the table named tableName

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC19makeSelectStatement3sqlAA0dE0CSS_tKF":{"name":"makeSelectStatement(sql:)","abstract":"

Returns a new prepared statement that can be reused.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC21cachedSelectStatement3sqlAA0dE0CSS_tKF":{"name":"cachedSelectStatement(sql:)","abstract":"

Returns a prepared statement that can be reused.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC19makeUpdateStatement3sqlAA0dE0CSS_tKF":{"name":"makeUpdateStatement(sql:)","abstract":"

Returns a new prepared statement that can be reused.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC21cachedUpdateStatement3sqlAA0dE0CSS_tKF":{"name":"cachedUpdateStatement(sql:)","abstract":"

Returns a prepared statement that can be reused.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7execute3sql9argumentsySS_AA18StatementArgumentsVtKF":{"name":"execute(sql:arguments:)","abstract":"

Executes one or several SQL statements, separated by semi-colons.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7execute7literalyAA10SQLLiteralV_tKF":{"name":"execute(literal:)","abstract":"

Executes one or several SQL statements, separated by semi-colons.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC12BusyCallbacka":{"name":"BusyCallback","abstract":"

See BusyMode and https://www.sqlite.org/c3ref/busy_handler.html

","parent_name":"Database"},"Classes/Database/BusyMode.html":{"name":"BusyMode","abstract":"

When there are several connections to a database, a connection may try","parent_name":"Database"},"Classes/Database/CheckpointMode.html":{"name":"CheckpointMode","abstract":"

The available checkpoint modes.

","parent_name":"Database"},"Classes/Database/CollationName.html":{"name":"CollationName","abstract":"

A built-in SQLite collation.

","parent_name":"Database"},"Classes/Database/ColumnType.html":{"name":"ColumnType","abstract":"

An SQL column type.

","parent_name":"Database"},"Classes/Database/ConflictResolution.html":{"name":"ConflictResolution","abstract":"

An SQLite conflict resolution.

","parent_name":"Database"},"Classes/Database/ForeignKeyAction.html":{"name":"ForeignKeyAction","abstract":"

A foreign key action.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC16LogErrorFunctiona":{"name":"LogErrorFunction","abstract":"

log function that takes an error message.

","parent_name":"Database"},"Classes/Database/TransactionCompletion.html":{"name":"TransactionCompletion","abstract":"

The end of a transaction: Commit, or Rollback

","parent_name":"Database"},"Classes/Database/TransactionKind.html":{"name":"TransactionKind","abstract":"

An SQLite transaction kind. See https://www.sqlite.org/lang_transaction.html

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC3add19transactionObserver6extentyAA011TransactionE0_p_AC0G17ObservationExtentOtF":{"name":"add(transactionObserver:extent:)","abstract":"

Add a transaction observer, so that it gets notified of","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6remove19transactionObserveryAA011TransactionE0_p_tF":{"name":"remove(transactionObserver:)","abstract":"

Remove a transaction observer.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC26afterNextTransactionCommityyyACcF":{"name":"afterNextTransactionCommit(_:)","abstract":"

Registers a closure to be executed after the next or current","parent_name":"Database"},"Classes/Database/TransactionObservationExtent.html":{"name":"TransactionObservationExtent","abstract":"

The extent of a transaction observation

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC31dropFTS4SynchronizationTriggers8forTableySS_tKF":{"name":"dropFTS4SynchronizationTriggers(forTable:)","abstract":"

Deletes the synchronization triggers for a synchronized FTS4 table

","parent_name":"Database"},"Classes/Database.html#/create(table:temporary:ifNotExists:withoutRowID:body:)":{"name":"create(table:temporary:ifNotExists:withoutRowID:body:)","abstract":"

Creates a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create5table9temporary11ifNotExists12withoutRowID4bodyySS_S3byAA15TableDefinitionCXEtKF":{"name":"create(table:temporary:ifNotExists:withoutRowID:body:)","abstract":"

Creates a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create5table9temporary11ifNotExists4bodyySS_S2byAA15TableDefinitionCXEtKF":{"name":"create(table:temporary:ifNotExists:body:)","abstract":"

Creates a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6rename5table2toySS_SStKF":{"name":"rename(table:to:)","abstract":"

Renames a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC5alter5table4bodyySS_yAA15TableAlterationCXEtKF":{"name":"alter(table:body:)","abstract":"

Modifies a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC4drop5tableySS_tKF":{"name":"drop(table:)","abstract":"

Deletes a database table.

","parent_name":"Database"},"Classes/Database.html#/create(index:on:columns:unique:ifNotExists:condition:)":{"name":"create(index:on:columns:unique:ifNotExists:condition:)","abstract":"

Creates an index.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create5index2on7columns6unique11ifNotExistsySS_SSSaySSGS2btKF":{"name":"create(index:on:columns:unique:ifNotExists:)","abstract":"

Creates an index.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create5index2on7columns6unique11ifNotExists9conditionySS_SSSaySSGS2bAA14SQLExpressible_ptKF":{"name":"create(index:on:columns:unique:ifNotExists:condition:)","abstract":"

Creates a partial index.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC4drop5indexySS_tKF":{"name":"drop(index:)","abstract":"

Deletes a database index.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7reindex9collationyAC13CollationNameV_tKF":{"name":"reindex(collation:)","abstract":"

Delete and recreate from scratch all indices that use this collation.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7reindex9collationyAA0B9CollationC_tKF":{"name":"reindex(collation:)","abstract":"

Delete and recreate from scratch all indices that use this collation.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create12virtualTable11ifNotExists5usingySS_SbSStKF":{"name":"create(virtualTable:ifNotExists:using:)","abstract":"

Creates a virtual database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create12virtualTable11ifNotExists5using_ySS_Sbxy0E10DefinitionQzcSgtKAA07VirtualE6ModuleRzlF":{"name":"create(virtualTable:ifNotExists:using:_:)","abstract":"

Creates a virtual database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13usePassphraseyySSKF":{"name":"usePassphrase(_:)","abstract":"

Sets the passphrase used to crypt and decrypt an SQLCipher database.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC16changePassphraseyySSKF":{"name":"changePassphrase(_:)","abstract":"

Changes the passphrase used by an SQLCipher encrypted database.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC31dropFTS5SynchronizationTriggers8forTableySS_tKF":{"name":"dropFTS5SynchronizationTriggers(forTable:)","abstract":"

Deletes the synchronization triggers for a synchronized FTS5 table

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC3add9tokenizeryxm_tAA19FTS5CustomTokenizerRzlF":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC15makeFTS5Pattern03rawE08forTableAA0dE0VSS_SStKF":{"name":"makeFTS5Pattern(rawPattern:forTable:)","abstract":"

Creates a pattern from a raw pattern string; throws DatabaseError on","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13makeTokenizeryAA04FTS5D0_pAA0eD10DescriptorVKF":{"name":"makeTokenizer(_:)","abstract":"

Creates an FTS5 tokenizer, given its descriptor.

","parent_name":"Database"},"Classes/Database.html#/create(table:temporary:ifNotExists:body:)":{"name":"create(table:temporary:ifNotExists:body:)","abstract":"

Creates a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create5index2on7columns6unique11ifNotExists9conditionySS_SSSaySSGS2bAA14SQLExpressible_pSgtKF":{"name":"create(index:on:columns:unique:ifNotExists:condition:)","abstract":"

Creates an index.

","parent_name":"Database"},"Classes/Database.html#/create(index:on:columns:unique:ifNotExists:)":{"name":"create(index:on:columns:unique:ifNotExists:)","abstract":"

Creates an index.

","parent_name":"Database"},"Classes/AnyCursor.html#/s:4GRDB9AnyCursorCyACyxGqd__c7ElementQyd__RszAA0C0Rd__lufc":{"name":"init(_:)","abstract":"

Creates a cursor that wraps a base cursor but whose type depends only on","parent_name":"AnyCursor"},"Classes/AnyCursor.html#/s:4GRDB9AnyCursorC8iteratorACyxGqd___tc7ElementQyd__RszStRd__lufc":{"name":"init(iterator:)","abstract":"

Creates a cursor that wraps a base iterator but whose type depends only","parent_name":"AnyCursor"},"Classes/AnyCursor.html#/s:4GRDB9AnyCursorCyACyxGqd__c7ElementQyd__RszSTRd__lufc":{"name":"init(_:)","abstract":"

Creates a cursor that wraps a base sequence but whose type depends only","parent_name":"AnyCursor"},"Classes/AnyCursor.html#/s:4GRDB9AnyCursorCyACyxGxSgyKccfc":{"name":"init(_:)","abstract":"

Creates a cursor that wraps the given closure in its next() method

","parent_name":"AnyCursor"},"Classes/AnyCursor.html":{"name":"AnyCursor","abstract":"

A type-erased cursor of Element.

"},"Classes/Database.html":{"name":"Database","abstract":"

A Database connection.

"},"Classes/DatabaseCollation.html":{"name":"DatabaseCollation","abstract":"

A Collation is a string comparison function used by SQLite.

"},"Classes/DatabaseFunction.html":{"name":"DatabaseFunction","abstract":"

An SQL function or aggregate.

"},"Classes/DatabasePool.html":{"name":"DatabasePool","abstract":"

A DatabasePool grants concurrent accesses to an SQLite database.

"},"Classes/DatabaseQueue.html":{"name":"DatabaseQueue","abstract":"

A DatabaseQueue serializes access to an SQLite database.

"},"Classes/AnyDatabaseReader.html":{"name":"AnyDatabaseReader","abstract":"

A type-erased DatabaseReader

"},"Classes/DatabaseSnapshot.html":{"name":"DatabaseSnapshot","abstract":"

A DatabaseSnapshot sees an unchanging database content, as it existed at the"},"Classes.html#/s:4GRDB19DatabaseValueCursorC":{"name":"DatabaseValueCursor","abstract":"

A cursor of database values extracted from a single column."},"Classes.html#/s:4GRDB27NullableDatabaseValueCursorC":{"name":"NullableDatabaseValueCursor","abstract":"

A cursor of optional database values extracted from a single column."},"Classes/DatabaseFuture.html":{"name":"DatabaseFuture","abstract":"

A future database value, returned by the DatabaseWriter.concurrentRead(_:)"},"Classes/AnyDatabaseWriter.html":{"name":"AnyDatabaseWriter","abstract":"

A type-erased DatabaseWriter

"},"Classes/Row.html":{"name":"Row","abstract":"

A database row.

"},"Classes/RowCursor.html":{"name":"RowCursor","abstract":"

A cursor of database rows. For example:

"},"Classes/SelectStatement.html":{"name":"SelectStatement","abstract":"

A subclass of Statement that fetches database rows.

"},"Classes/Statement.html":{"name":"Statement","abstract":"

A statement represents an SQL query.

"},"Classes/UpdateStatement.html":{"name":"UpdateStatement","abstract":"

A subclass of Statement that executes SQL queries.

"},"Classes.html#/s:4GRDB23FastDatabaseValueCursorC":{"name":"FastDatabaseValueCursor","abstract":"

A cursor of database values extracted from a single column."},"Classes.html#/s:4GRDB31FastNullableDatabaseValueCursorC":{"name":"FastNullableDatabaseValueCursor","abstract":"

A cursor of optional database values extracted from a single column."},"Classes/FTS3TableDefinition.html":{"name":"FTS3TableDefinition","abstract":"

The FTS3TableDefinition class lets you define columns of a FTS3 virtual table.

"},"Classes/FTS4TableDefinition.html":{"name":"FTS4TableDefinition","abstract":"

The FTS4TableDefinition class lets you define columns of a FTS4 virtual table.

"},"Classes/FTS4ColumnDefinition.html":{"name":"FTS4ColumnDefinition","abstract":"

The FTS4ColumnDefinition class lets you refine a column of an FTS4"},"Classes/FTS5TableDefinition.html":{"name":"FTS5TableDefinition","abstract":"

The FTS5TableDefinition class lets you define columns of a FTS5 virtual table.

"},"Classes/FTS5ColumnDefinition.html":{"name":"FTS5ColumnDefinition","abstract":"

The FTS5ColumnDefinition class lets you refine a column of an FTS5"},"Classes/TableAlias.html":{"name":"TableAlias","abstract":"

Experimental

"},"Classes/TableDefinition.html":{"name":"TableDefinition","abstract":"

The TableDefinition class lets you define table columns and constraints.

"},"Classes/TableAlteration.html":{"name":"TableAlteration","abstract":"

The TableAlteration class lets you alter database tables.

"},"Classes/ColumnDefinition.html":{"name":"ColumnDefinition","abstract":"

The ColumnDefinition class lets you refine a table column.

"},"Classes.html#/s:4GRDB12RecordCursorC":{"name":"RecordCursor","abstract":"

A cursor of records. For example:

"},"Classes/FetchedRecordsController.html":{"name":"FetchedRecordsController","abstract":"

You use FetchedRecordsController to track changes in the results of an"},"Classes/Record.html":{"name":"Record","abstract":"

Record is a class that wraps a table row, or the result of any query. It is"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Enums.html":{"name":"Enumerations","abstract":"

The following enumerations are available globally.

"},"Extensions.html":{"name":"Extensions","abstract":"

The following extensions are available globally.

"},"Functions.html":{"name":"Functions","abstract":"

The following functions are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"},"Structs.html":{"name":"Structures","abstract":"

The following structures are available globally.

"},"Typealiases.html":{"name":"Type Aliases","abstract":"

The following type aliases are available globally.

"}} \ No newline at end of file diff --git a/docs/4.8/docsets/GRDB.docset/Contents/Resources/docSet.dsidx b/docs/4.8/docsets/GRDB.docset/Contents/Resources/docSet.dsidx new file mode 100644 index 000000000..34d6d12d5 Binary files /dev/null and b/docs/4.8/docsets/GRDB.docset/Contents/Resources/docSet.dsidx differ diff --git a/docs/4.8/docsets/GRDB.tgz b/docs/4.8/docsets/GRDB.tgz new file mode 100644 index 000000000..d0a331dff Binary files /dev/null and b/docs/4.8/docsets/GRDB.tgz differ diff --git a/docs/4.8/docsets/GRDB.xml b/docs/4.8/docsets/GRDB.xml new file mode 100644 index 000000000..cdea5eb1b --- /dev/null +++ b/docs/4.8/docsets/GRDB.xml @@ -0,0 +1 @@ +4.8.0http://groue.github.io/GRDB.swift/docs/4.8/docsets/GRDB.tgz diff --git a/docs/4.8/img/carat.png b/docs/4.8/img/carat.png new file mode 100755 index 000000000..29d2f7fd4 Binary files /dev/null and b/docs/4.8/img/carat.png differ diff --git a/docs/4.8/img/dash.png b/docs/4.8/img/dash.png new file mode 100755 index 000000000..6f694c7a0 Binary files /dev/null and b/docs/4.8/img/dash.png differ diff --git a/docs/4.8/img/gh.png b/docs/4.8/img/gh.png new file mode 100755 index 000000000..628da97c7 Binary files /dev/null and b/docs/4.8/img/gh.png differ diff --git a/docs/4.8/index.html b/docs/4.8/index.html new file mode 100644 index 000000000..5455cefdc --- /dev/null +++ b/docs/4.8/index.html @@ -0,0 +1,8650 @@ + + + + GRDB Reference + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+
+ +

GRDB: A toolkit for SQLite databases, with a focus on application development

+ +

A toolkit for SQLite databases, with a focus on application development

+ +

+ Swift 4.2 + Swift 5 + Platforms + License + Build Status +

+ +
+ +

Latest release: January 8, 2020 • version 4.8.0 • CHANGELOG • Migrating From GRDB 3 to GRDB 4

+ +

Requirements: iOS 9.0+ / macOS 10.9+ / tvOS 9.0+ / watchOS 2.0+ • Swift 4.2+ / Xcode 10.0+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Swift versionGRDB version
Swift 5v4.8.0
Swift 4.2v4.8.0
Swift 4.1v3.7.0
Swift 4v2.10.0
Swift 3.2v1.3.0
Swift 3.1v1.3.0
Swift 3v1.0
Swift 2.3v0.81.2
Swift 2.2v0.80.2
+ +

Contact:

+ + +

What is this?

+ +

GRDB provides raw access to SQL and advanced SQLite features, because one sometimes enjoys a sharp tool. It has robust concurrency primitives, so that multi-threaded applications can efficiently use their databases. It grants your application models with persistence and fetching methods, so that you don’t have to deal with SQL and raw database rows when you don’t want to.

+ +

Compared to SQLite.swift or FMDB, GRDB can spare you a lot of glue code. Compared to Core Data or Realm, it can simplify your multi-threaded applications.

+ +

It comes with up-to-date documentation, general guides, and it is fast.

+ +

See Why Adopt GRDB? if you are looking for your favorite database library.

+ +
+ +

+ Features • + Usage • + Installation • + Documentation • + Demo Application • + FAQ +

+ +
+

Features

+ +

GRDB ships with:

+ + + +

Companion libraries that enhance and extend GRDB:

+ + +

Usage

+ +
+ Connect to an SQLite database + +“`swift +import GRDB + +// Simple database connection +let dbQueue = try DatabaseQueue(path: ”/path/to/database.sqlite") + +// Enhanced multithreading based on SQLite’s WAL mode +let dbPool = try DatabasePool(path: “/path/to/database.sqlite”) +“` + +See [Database Connections](#database-connections) + +
+ +
+ Execute SQL statements + +”`swift +try dbQueue.write { db in + try db.execute(sql: “”“ + CREATE TABLE place ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + title TEXT NOT NULL, + favorite BOOLEAN NOT NULL DEFAULT 0, + latitude DOUBLE NOT NULL, + longitude DOUBLE NOT NULL) + ”“”) + + try db.execute(sql: “”“ + INSERT INTO place (title, favorite, latitude, longitude) + VALUES (?, ?, ?, ?) + ”“”, arguments: [“Paris”, true, 48.85341, 2.3488]) + + let parisId = db.lastInsertedRowID + + // Swift 5 only + try db.execute(literal: “”“ + INSERT INTO place (title, favorite, latitude, longitude) + VALUES (\("Madrid”), \(true), \(40.41678), \(-3.70379)) + “”“) +} +”` + +See [Executing Updates](#executing-updates) + +
+ +
+ Fetch database rows and values + +“`swift +try dbQueue.read { db in + // Fetch database rows + let rows = try Row.fetchCursor(db, sql: "SELECT * FROM place”) + while let row = try rows.next() { + let title: String = row[“title”] + let isFavorite: Bool = row[“favorite”] + let coordinate = CLLocationCoordinate2D( + latitude: row[“latitude”], + longitude: row[“longitude”]) + } + + // Fetch values + let placeCount = try Int.fetchOne(db, sql: “SELECT COUNT(*) FROM place”)! // Int + let placeTitles = try String.fetchAll(db, sql: “SELECT title FROM place”) // [String] +} + +let placeCount = try dbQueue.read { db in + try Int.fetchOne(db, sql: “SELECT COUNT(*) FROM place”)! +} +“` + +See [Fetch Queries](#fetch-queries) + +
+ +
+ Store custom models aka "records” + +“`swift +struct Place { + var id: Int64? + var title: String + var isFavorite: Bool + var coordinate: CLLocationCoordinate2D +} + +// snip: turn Place into a "record” by adopting the protocols that +// provide fetching and persistence methods. + +try dbQueue.write { db in + // Create database table + try db.create(table: “place”) { t in + t.autoIncrementedPrimaryKey(“id”) + t.column(“title”, .text).notNull() + t.column(“favorite”, .boolean).notNull().defaults(to: false) + t.column(“longitude”, .double).notNull() + t.column(“latitude”, .double).notNull() + } + + var berlin = Place( + id: nil, + title: “Berlin”, + isFavorite: false, + coordinate: CLLocationCoordinate2D(latitude: 52.52437, longitude: 13.41053)) + + try berlin.insert(db) + berlin.id // some value + + berlin.isFavorite = true + try berlin.update(db) +} +“` + +See [Records](#records) + +
+ +
+ Fetch records and values with the Swift query interface + +”`swift +try dbQueue.read { db in + // Place? + let paris = try Place.fetchOne(db, key: 1) + + // Place? + let berlin = try Place.filter(Column(“title”) == “Berlin”).fetchOne(db) + + // [Place] + let favoritePlaces = try Place + .filter(Column(“favorite”) == true) + .order(Column(“title”)) + .fetchAll(db) + + // Int + let favoriteCount = try Place.filter(Column(“favorite”)).fetchCount(db) + + // SQL is always welcome + let places = try Place.fetchAll(db, sql: “SELECT * FROM place”) +} +“` + +See the [Query Interface](#the-query-interface) + +
+ +
+ Be notified of database changes + +”`swift +let observation = ValueObservation.tracking { db in + try Place.fetchAll(db) +} +observation.start( + in: dbQueue, + onError: { error in + print(“fresh places could not be fetched”) + } + onChange: { (places: [Place]) in + print(“Places have changed.”) + }) +“` + +See [Database Changes Observation](#database-changes-observation) + +
+

Documentation

+ +

GRDB runs on top of SQLite: you should get familiar with the SQLite FAQ. For general and detailed information, jump to the SQLite Documentation.

+

Reference

+ + +

Getting Started

+ + +

SQLite and SQL

+ + +

Records and the Query Interface

+ + +

Application Tools

+ + +

Good to Know

+ + +

General Guides & Good Practices

+ + + +

FAQ

+ +

Sample Code

+

Installation

+ +

The installation procedures below have GRDB use the version of SQLite that ships with the target operating system.

+ +

See Encryption for the installation procedure of GRDB with SQLCipher.

+ +

See Custom SQLite builds for the installation procedure of GRDB with a customized build of SQLite 3.28.0.

+ +

See Enabling FTS5 Support for the installation procedure of GRDB with support for the FTS5 full-text engine.

+

CocoaPods

+ +

CocoaPods is a dependency manager for Xcode projects. To use GRDB with CocoaPods (version 1.2 or higher), specify in your Podfile:

+
pod 'GRDB.swift'
+
+ +

GRDB can be installed as a framework, or a static library.

+

Swift Package Manager

+ +

The Swift Package Manager automates the distribution of Swift code. To use GRDB with SPM, add a dependency to your Package.swift file:

+
let package = Package(
+    dependencies: [
+        .package(url: "https://github.com/groue/GRDB.swift.git", ...)
+    ]
+)
+
+ +

Note that Linux is not currently supported.

+

Carthage

+ +

Carthage is unsupported. For some context about this decision, see #433.

+

Manually

+ +
    +
  1. Download a copy of GRDB, or clone its repository and make sure you checkout the latest tagged version.

  2. +
  3. Embed the GRDB.xcodeproj project in your own project.

  4. +
  5. Add the GRDBOSX, GRDBiOS, GRDBtvOS, or GRDBWatchOS target in the Target Dependencies section of the Build Phases tab of your application target (extension target for WatchOS).

  6. +
  7. Add the GRDB.framework from the targetted platform to the Embedded Binaries section of the General tab of your application target (extension target for WatchOS).

  8. +
+ +
+

:bulb: Tip: see the Demo Application for an example of such integration.

+
+

Demo Application

+ +

The repository comes with a Demo Application that shows you:

+ + +

Database Connections

+ +

GRDB provides two classes for accessing SQLite databases: DatabaseQueue and DatabasePool:

+
import GRDB
+
+// Pick one:
+let dbQueue = try DatabaseQueue(path: "/path/to/database.sqlite")
+let dbPool = try DatabasePool(path: "/path/to/database.sqlite")
+
+ +

The differences are:

+ +
    +
  • Database pools allow concurrent database accesses (this can improve the performance of multithreaded applications).
  • +
  • Database pools open your SQLite database in the WAL mode (unless read-only).
  • +
  • Database queues support in-memory databases.
  • +
+ +

If you are not sure, choose DatabaseQueue. You will always be able to switch to DatabasePool later.

+ + +

Database Queues

+ +

Open a database queue with the path to a database file:

+
import GRDB
+
+let dbQueue = try DatabaseQueue(path: "/path/to/database.sqlite")
+let inMemoryDBQueue = DatabaseQueue()
+
+ +

SQLite creates the database file if it does not already exist. The connection is closed when the database queue gets deallocated.

+ +

A database queue can be used from any thread. The write and read methods are synchronous, and block the current thread until your database statements are executed in a protected dispatch queue:

+
// Modify the database:
+try dbQueue.write { db in
+    try db.create(table: "place") { ... }
+    try Place(...).insert(db)
+}
+
+// Read values:
+try dbQueue.read { db in
+    let places = try Place.fetchAll(db)
+    let placeCount = try Place.fetchCount(db)
+}
+
+ +

Database access methods can return values:

+
let placeCount = try dbQueue.read { db in
+    try Place.fetchCount(db)
+}
+
+let newPlaceCount = try dbQueue.write { db -> Int in
+    try Place(...).insert(db)
+    return try Place.fetchCount(db)
+}
+
+ +

A database queue serializes accesses to the database, which means that there is never more than one thread that uses the database.

+ +
    +
  • When you don’t need to modify the database, prefer the read method. It prevents any modification to the database.

  • +
  • The write method wraps your database statements in a transaction that commits if and only if no error occurs. On the first unhandled error, all changes are reverted, the whole transaction is rollbacked, and the error is rethrown.

    + +

    When precise transaction handling is required, see Transactions and Savepoints.

  • +
+ +

A database queue needs your application to follow rules in order to deliver its safety guarantees. Please refer to the Concurrency chapter.

+ +
+

:bulb: Tip: see the Demo Application for a sample code that sets up a database queue on iOS.

+
+

DatabaseQueue Configuration

+
var config = Configuration()
+config.readonly = true
+config.foreignKeysEnabled = true // Default is already true
+config.trace = { print($0) }     // Prints all SQL statements
+config.label = "MyDatabase"      // Useful when your app opens multiple databases
+
+let dbQueue = try DatabaseQueue(
+    path: "/path/to/database.sqlite",
+    configuration: config)
+
+ +

See Configuration for more details.

+

Database Pools

+ +

A database pool allows concurrent database accesses.

+
import GRDB
+let dbPool = try DatabasePool(path: "/path/to/database.sqlite")
+
+ +

SQLite creates the database file if it does not already exist. The connection is closed when the database pool gets deallocated.

+ +
+

:point_up: Note: unless read-only, a database pool opens your database in the SQLite “WAL mode”. The WAL mode does not fit all situations. Please have a look at https://www.sqlite.org/wal.html.

+
+ +

A database pool can be used from any thread. The write and read methods are synchronous, and block the current thread until your database statements are executed in a protected dispatch queue:

+
// Modify the database:
+try dbPool.write { db in
+    try db.create(table: "place") { ... }
+    try Place(...).insert(db)
+}
+
+// Read values:
+try dbPool.read { db in
+    let places = try Place.fetchAll(db)
+    let placeCount = try Place.fetchCount(db)
+}
+
+ +

Database access methods can return values:

+
let placeCount = try dbPool.read { db in
+    try Place.fetchCount(db)
+}
+
+let newPlaceCount = try dbPool.write { db -> Int in
+    try Place(...).insert(db)
+    return try Place.fetchCount(db)
+}
+
+ +

Database pools allow several threads to access the database at the same time:

+ +
    +
  • When you don’t need to modify the database, prefer the read method, because several threads can perform reads in parallel.

    + +

    Reads are generally non-blocking, unless the maximum number of concurrent reads has been reached. In this case, a read has to wait for another read to complete. That maximum number can be configured.

  • +
  • Reads are guaranteed an immutable view of the last committed state of the database, regardless of concurrent writes. This kind of isolation is called snapshot isolation.

  • +
  • Unlike reads, writes are serialized. There is never more than a single thread that is writing into the database.

  • +
  • The write method wraps your database statements in a transaction that commits if and only if no error occurs. On the first unhandled error, all changes are reverted, the whole transaction is rollbacked, and the error is rethrown.

    + +

    When precise transaction handling is required, see Transactions and Savepoints.

  • +
  • Database pools can take snapshots of the database.

  • +
+ +

A database pool needs your application to follow rules in order to deliver its safety guarantees. See the Concurrency chapter for more details about database pools, how they differ from database queues, and advanced use cases.

+ +
+

:bulb: Tip: see the Demo Application for a sample code that sets up a database queue on iOS, and just replace DatabaseQueue with DatabasePool.

+
+

DatabasePool Configuration

+
var config = Configuration()
+config.readonly = true
+config.foreignKeysEnabled = true // Default is already true
+config.trace = { print($0) }     // Prints all SQL statements
+config.label = "MyDatabase"      // Useful when your app opens multiple databases
+config.maximumReaderCount = 10   // The default is 5
+
+let dbPool = try DatabasePool(
+    path: "/path/to/database.sqlite",
+    configuration: config)
+
+ +

See Configuration for more details.

+ +

Database pools are more memory-hungry than database queues. See Memory Management for more information.

+

SQLite API

+ +

In this section of the documentation, we will talk SQL. Jump to the query interface if SQL is not your cup of tea.

+ + + +

Advanced topics:

+ + +

Executing Updates

+ +

Once granted with a database connection, the execute method executes the SQL statements that do not return any database row, such as CREATE TABLE, INSERT, DELETE, ALTER, etc.

+ +

For example:

+
try dbQueue.write { db in
+    try db.execute(sql: """
+        CREATE TABLE player (
+            id INTEGER PRIMARY KEY AUTOINCREMENT,
+            name TEXT NOT NULL,
+            score INT)
+        """)
+
+    try db.execute(
+        sql: "INSERT INTO player (name, score) VALUES (?, ?)",
+        arguments: ["Barbara", 1000])
+
+    try db.execute(
+        sql: "UPDATE player SET score = :score WHERE id = :id",
+        arguments: ["score": 1000, "id": 1])
+    }
+}
+
+ +

The ? and colon-prefixed keys like :score in the SQL query are the statements arguments. You pass arguments with arrays or dictionaries, as in the example above. See Values for more information on supported arguments types (Bool, Int, String, Date, Swift enums, etc.), and StatementArguments for a detailed documentation of SQLite arguments.

+ +

In Swift 5, you can embed query arguments right into your SQL queries, with the literal argument label, as in the example below. See SQL Interpolation for more details.

+
// Swift 5
+try dbQueue.write { db in
+    try db.execute(literal: """
+        INSERT INTO player (name, score)
+        VALUES (\("O'Brien"), \(550))
+        """)
+}
+
+ +

Never ever embed values directly in your raw SQL strings. See Avoiding SQL Injection for more information:

+
// WRONG: don't embed values in raw SQL strings
+let id = 123
+let name = textField.text
+try db.execute(
+    sql: "UPDATE player SET name = '\(name)' WHERE id = \(id)")
+
+// CORRECT: use SQL Interpolation (Swift 5)
+try db.execute(
+    literal: "UPDATE player SET name = \(name) WHERE id = \(id)")
+
+// CORRECT: use arguments dictionary
+try db.execute(
+    sql: "UPDATE player SET name = :name WHERE id = :id",
+    arguments: ["name": name, "id": id])
+
+// CORRECT: use arguments array
+try db.execute(
+    sql: "UPDATE player SET name = ? WHERE id = ?",
+    arguments: [name, id])
+
+ +

Join multiple statements with a semicolon:

+
try db.execute(sql: """
+    INSERT INTO player (name, score) VALUES (?, ?);
+    INSERT INTO player (name, score) VALUES (?, ?);
+    """, arguments: ["Arthur", 750, "Barbara", 1000])
+
+// Swift 5
+try db.execute(literal: """
+    INSERT INTO player (name, score) VALUES (\("Arthur"), \(750));
+    INSERT INTO player (name, score) VALUES (\("Barbara"), \(1000));
+    """)
+
+ +

When you want to make sure that a single statement is executed, use Prepared Statements.

+ +

After an INSERT statement, you can get the row ID of the inserted row:

+
try db.execute(
+    sql: "INSERT INTO player (name, score) VALUES (?, ?)",
+    arguments: ["Arthur", 1000])
+let playerId = db.lastInsertedRowID
+
+ +

Don’t miss Records, that provide classic persistence methods:

+
var player = Player(name: "Arthur", score: 1000)
+try player.insert(db)
+let playerId = player.id
+
+

Fetch Queries

+ +

Database connections let you fetch database rows, plain values, and custom models aka “records”.

+ +

Rows are the raw results of SQL queries:

+
try dbQueue.read { db in
+    if let row = try Row.fetchOne(db, sql: "SELECT * FROM wine WHERE id = ?", arguments: [1]) {
+        let name: String = row["name"]
+        let color: Color = row["color"]
+        print(name, color)
+    }
+}
+
+ +

Values are the Bool, Int, String, Date, Swift enums, etc. stored in row columns:

+
try dbQueue.read { db in
+    let urls = try URL.fetchCursor(db, sql: "SELECT url FROM wine")
+    while let url = try urls.next() {
+        print(url)
+    }
+}
+
+ +

Records are your application objects that can initialize themselves from rows:

+
let wines = try dbQueue.read { db in
+    try Wine.fetchAll(db, sql: "SELECT * FROM wine")
+}
+
+ + +

Fetching Methods

+ +

Throughout GRDB, you can always fetch cursors, arrays, or single values of any fetchable type (database row, simple value, or custom record):

+
try Row.fetchCursor(...) // A Cursor of Row
+try Row.fetchAll(...)    // [Row]
+try Row.fetchOne(...)    // Row?
+
+ +
    +
  • fetchCursor returns a cursor over fetched values:

    +
    let rows = try Row.fetchCursor(db, sql: "SELECT ...") // A Cursor of Row
    +
  • +
  • fetchAll returns an array:

    +
    let players = try Player.fetchAll(db, sql: "SELECT ...") // [Player]
    +
  • +
  • fetchOne returns a single optional value, and consumes a single database row (if any).

    +
    let count = try Int.fetchOne(db, sql: "SELECT COUNT(*) ...") // Int?
    +
  • +
+

Cursors

+ +

Whenever you consume several rows from the database, you can fetch an Array, or a Cursor.

+ +

The fetchAll() method returns a regular Swift array, that you iterate like all other arrays:

+
try dbQueue.read { db in
+    // [Player]
+    let players = try Player.fetchAll(db, sql: "SELECT ...")
+    for player in players {
+        // use player
+    }
+}
+
+ +

Unlike arrays, cursors returned by fetchCursor() load their results step after step:

+
try dbQueue.read { db in
+    // Cursor of Player
+    let players = try Player.fetchCursor(db, sql: "SELECT ...")
+    while let player = try players.next() {
+        // use player
+    }
+}
+
+ +

Both arrays and cursors can iterate over database results. How do you choose one or the other? Look at the differences:

+ +
    +
  • Cursors can not be used on any thread: you must consume a cursor on the dispatch queue it was created in. Particularly, don’t extract a cursor out of a database access method:

    +
    // Wrong
    +let cursor = try dbQueue.read { db in
    +    try Player.fetchCursor(db, ...)
    +}
    +while let player = try cursor.next() { ... }
    +
    + +

    Conversely, arrays may be consumed on any thread:

    +
    // OK
    +let array = try dbQueue.read { db in
    +    try Player.fetchAll(db, ...)
    +}
    +for player in array { ... }
    +
  • +
  • Cursors can be iterated only one time. Arrays can be iterated many times.

  • +
  • Cursors iterate database results in a lazy fashion, and don’t consume much memory. Arrays contain copies of database values, and may take a lot of memory when there are many fetched results.

  • +
  • Cursors are granted with direct access to SQLite, unlike arrays that have to take the time to copy database values. If you look after extra performance, you may prefer cursors over arrays.

  • +
  • Cursors adopt the Cursor protocol, which looks a lot like standard lazy sequences of Swift. As such, cursors come with many convenience methods: compactMap, contains, dropFirst, dropLast, drop(while:), enumerated, filter, first, flatMap, forEach, joined, joined(separator:), max, max(by:), min, min(by:), map, prefix, prefix(while:), reduce, reduce(into:), suffix:

    +
    // Prints all Github links
    +try URL
    +    .fetchCursor(db, sql: "SELECT url FROM link")
    +    .filter { url in url.host == "github.com" }
    +    .forEach { url in print(url) }
    +
    +// An efficient cursor of coordinates:
    +let locations = try Row.
    +    .fetchCursor(db, sql: "SELECT latitude, longitude FROM place")
    +    .map { row in
    +        CLLocationCoordinate2D(latitude: row[0], longitude: row[1])
    +    }
    +
    +// Turn cursors into arrays or sets:
    +let array = try Array(cursor)
    +let set = try Set(cursor)
    +
  • +
  • Cursors are not Swift sequences. That’s because Swift sequences can’t handle iteration errors, when reading SQLite results may fail at any time. SQL functions may throw errors. On iOS, data protection may block access to the database file in the background. On macOS, your application users may mess with the file system.

  • +
  • Cursors require a little care:

    + +
      +
    • Don’t modify the results during a cursor iteration:

      +
      // Undefined behavior
      +while let player = try players.next() {
      +    try db.execute(sql: "DELETE ...")
      +}
      +
    • +
    • Don’t turn a cursor of Row into an array. You would not get the distinct rows you expect. To get a array of rows, use Row.fetchAll(...). Generally speaking, make sure you copy a row whenever you extract it from a cursor for later use: row.copy().

    • +
  • +
+ +

If you don’t see, or don’t care about the difference, use arrays. If you care about memory and performance, use cursors when appropriate.

+

Row Queries

+ + +

Fetching Rows

+ +

Fetch cursors of rows, arrays, or single rows (see fetching methods):

+
try dbQueue.read { db in
+    try Row.fetchCursor(db, sql: "SELECT ...", arguments: ...) // A Cursor of Row
+    try Row.fetchAll(db, sql: "SELECT ...", arguments: ...)    // [Row]
+    try Row.fetchOne(db, sql: "SELECT ...", arguments: ...)    // Row?
+
+    let rows = try Row.fetchCursor(db, sql: "SELECT * FROM wine")
+    while let row = try rows.next() {
+        let name: String = row["name"]
+        let color: Color = row["color"]
+        print(name, color)
+    }
+}
+
+let rows = try dbQueue.read { db in
+    try Row.fetchAll(db, sql: "SELECT * FROM player")
+}
+
+ +

Arguments are optional arrays or dictionaries that fill the positional ? and colon-prefixed keys like :name in the query:

+
let rows = try Row.fetchAll(db,
+    sql: "SELECT * FROM player WHERE name = ?",
+    arguments: ["Arthur"])
+
+let rows = try Row.fetchAll(db,
+    sql: "SELECT * FROM player WHERE name = :name",
+    arguments: ["name": "Arthur"])
+
+ +

See Values for more information on supported arguments types (Bool, Int, String, Date, Swift enums, etc.), and StatementArguments for a detailed documentation of SQLite arguments.

+ +

Unlike row arrays that contain copies of the database rows, row cursors are close to the SQLite metal, and require a little care:

+ +
+

:point_up: Don’t turn a cursor of Row into an array. You would not get the distinct rows you expect. To get a array of rows, use Row.fetchAll(...). Generally speaking, make sure you copy a row whenever you extract it from a cursor for later use: row.copy().

+
+

Column Values

+ +

Read column values by index or column name:

+
let name: String = row[0]      // 0 is the leftmost column
+let name: String = row["name"] // Leftmost matching column - lookup is case-insensitive
+let name: String = row[Column("name")] // Using query interface's Column
+
+ +

Make sure to ask for an optional when the value may be NULL:

+
let name: String? = row["name"]
+
+ +

The row[] subscript returns the type you ask for. See Values for more information on supported value types:

+
let bookCount: Int     = row["bookCount"]
+let bookCount64: Int64 = row["bookCount"]
+let hasBooks: Bool     = row["bookCount"] // false when 0
+
+let string: String     = row["date"]      // "2015-09-11 18:14:15.123"
+let date: Date         = row["date"]      // Date
+self.date = row["date"] // Depends on the type of the property.
+
+ +

You can also use the as type casting operator:

+
row[...] as Int
+row[...] as Int?
+
+ +
+

:warning: Warning: avoid the as! and as? operators:

+
if let int = row[...] as? Int { ... } // BAD - doesn't work
+if let int = row[...] as Int? { ... } // GOOD
+
+
+ +

Generally speaking, you can extract the type you need, provided it can be converted from the underlying SQLite value:

+ +
    +
  • Successful conversions include:

    + +
      +
    • All numeric SQLite values to all numeric Swift types, and Bool (zero is the only false boolean).
    • +
    • Text SQLite values to Swift String.
    • +
    • Blob SQLite values to Foundation Data.
    • +
    + +

    See Values for more information on supported types (Bool, Int, String, Date, Swift enums, etc.)

  • +
  • NULL returns nil.

    +
    let row = try Row.fetchOne(db, sql: "SELECT NULL")!
    +row[0] as Int? // nil
    +row[0] as Int  // fatal error: could not convert NULL to Int.
    +
    + +

    There is one exception, though: the DatabaseValue type:

    +
    row[0] as DatabaseValue // DatabaseValue.null
    +
  • +
  • Missing columns return nil.

    +
    let row = try Row.fetchOne(db, sql: "SELECT 'foo' AS foo")!
    +row["missing"] as String? // nil
    +row["missing"] as String  // fatal error: no such column: missing
    +
    + +

    You can explicitly check for a column presence with the hasColumn method.

  • +
  • Invalid conversions throw a fatal error.

    +
    let row = try Row.fetchOne(db, sql: "SELECT 'Mom’s birthday'")!
    +row[0] as String // "Mom’s birthday"
    +row[0] as Date?  // fatal error: could not convert "Mom’s birthday" to Date.
    +row[0] as Date   // fatal error: could not convert "Mom’s birthday" to Date.
    +
    +let row = try Row.fetchOne(db, sql: "SELECT 256")!
    +row[0] as Int    // 256
    +row[0] as UInt8? // fatal error: could not convert 256 to UInt8.
    +row[0] as UInt8  // fatal error: could not convert 256 to UInt8.
    +
    + +

    Those conversion fatal errors can be avoided with the DatabaseValue type:

    +
    let row = try Row.fetchOne(db, sql: "SELECT 'Mom’s birthday'")!
    +let dbValue: DatabaseValue = row[0]
    +if dbValue.isNull {
    +    // Handle NULL
    +} else if let date = Date.fromDatabaseValue(dbValue) {
    +    // Handle valid date
    +} else {
    +    // Handle invalid date
    +}
    +
    + +

    This extra verbosity is the consequence of having to deal with an untrusted database: you may consider fixing the content of your database instead. See Fatal Errors for more information.

  • +
  • SQLite has a weak type system, and provides convenience conversions that can turn String to Int, Double to Blob, etc.

    + +

    GRDB will sometimes let those conversions go through:

    +
    let rows = try Row.fetchCursor(db, sql: "SELECT '20 small cigars'")
    +while let row = try rows.next() {
    +    row[0] as Int   // 20
    +}
    +
    + +

    Don’t freak out: those conversions did not prevent SQLite from becoming the immensely successful database engine you want to use. And GRDB adds safety checks described just above. You can also prevent those convenience conversions altogether by using the DatabaseValue type.

  • +
+

DatabaseValue

+ +

DatabaseValue is an intermediate type between SQLite and your values, which gives information about the raw value stored in the database.

+ +

You get DatabaseValue just like other value types:

+
let dbValue: DatabaseValue = row[0]
+let dbValue: DatabaseValue? = row["name"] // nil if and only if column does not exist
+
+// Check for NULL:
+dbValue.isNull // Bool
+
+// The stored value:
+dbValue.storage.value // Int64, Double, String, Data, or nil
+
+// All the five storage classes supported by SQLite:
+switch dbValue.storage {
+case .null:                 print("NULL")
+case .int64(let int64):     print("Int64: \(int64)")
+case .double(let double):   print("Double: \(double)")
+case .string(let string):   print("String: \(string)")
+case .blob(let data):       print("Data: \(data)")
+}
+
+ +

You can extract regular values (Bool, Int, String, Date, Swift enums, etc.) from DatabaseValue with the DatabaseValueConvertible.fromDatabaseValue() method:

+
let dbValue: DatabaseValue = row["bookCount"]
+let bookCount   = Int.fromDatabaseValue(dbValue)   // Int?
+let bookCount64 = Int64.fromDatabaseValue(dbValue) // Int64?
+let hasBooks    = Bool.fromDatabaseValue(dbValue)  // Bool?, false when 0
+
+let dbValue: DatabaseValue = row["date"]
+let string = String.fromDatabaseValue(dbValue)     // "2015-09-11 18:14:15.123"
+let date   = Date.fromDatabaseValue(dbValue)       // Date?
+
+ +

fromDatabaseValue returns nil for invalid conversions:

+
let row = try Row.fetchOne(db, sql: "SELECT 'Mom’s birthday'")!
+let dbValue: DatabaseValue = row[0]
+let string = String.fromDatabaseValue(dbValue) // "Mom’s birthday"
+let int    = Int.fromDatabaseValue(dbValue)    // nil
+let date   = Date.fromDatabaseValue(dbValue)   // nil
+
+

Rows as Dictionaries

+ +

Row adopts the standard RandomAccessCollection protocol, and can be seen as a dictionary of DatabaseValue:

+
// All the (columnName, dbValue) tuples, from left to right:
+for (columnName, dbValue) in row {
+    ...
+}
+
+ +

You can build rows from dictionaries (standard Swift dictionaries and NSDictionary). See Values for more information on supported types:

+
let row: Row = ["name": "foo", "date": nil]
+let row = Row(["name": "foo", "date": nil])
+let row = Row(/* [AnyHashable: Any] */) // nil if invalid dictionary
+
+ +

Yet rows are not real dictionaries: they may contain duplicate columns:

+
let row = try Row.fetchOne(db, sql: "SELECT 1 AS foo, 2 AS foo")!
+row.columnNames    // ["foo", "foo"]
+row.databaseValues // [1, 2]
+row["foo"]         // 1 (leftmost matching column)
+for (columnName, dbValue) in row { ... } // ("foo", 1), ("foo", 2)
+
+ +

When you build a dictionary from a row, you have to disambiguate identical columns, and choose how to present database values. For example:

+ +
    +
  • A [String: DatabaseValue] dictionary that keeps leftmost value in case of duplicated column name:

    +
    let dict = Dictionary(row, uniquingKeysWith: { (left, _) in left })
    +
  • +
  • A [String: AnyObject] dictionary which keeps rightmost value in case of duplicated column name. This dictionary is identical to FMResultSet’s resultDictionary from FMDB. It contains NSNull values for null columns, and can be shared with Objective-C:

    +
    let dict = Dictionary(
    +    row.map { (column, dbValue) in
    +        (column, dbValue.storage.value as AnyObject)
    +    },
    +    uniquingKeysWith: { (_, right) in right })
    +
  • +
  • A [String: Any] dictionary that can feed, for example, JSONSerialization:

    +
    let dict = Dictionary(
    +    row.map { (column, dbValue) in
    +        (column, dbValue.storage.value)
    +    },
    +    uniquingKeysWith: { (left, _) in left })
    +
  • +
+ +

See the documentation of Dictionary.init(_:uniquingKeysWith:) for more information.

+

Value Queries

+ +

Instead of rows, you can directly fetch values. Like rows, fetch them as cursors, arrays, or single values (see fetching methods). Values are extracted from the leftmost column of the SQL queries:

+
try dbQueue.read { db in
+    try Int.fetchCursor(db, sql: "SELECT ...", arguments: ...) // A Cursor of Int
+    try Int.fetchAll(db, sql: "SELECT ...", arguments: ...)    // [Int]
+    try Int.fetchOne(db, sql: "SELECT ...", arguments: ...)    // Int?
+
+    // When database may contain NULL:
+    try Optional<Int>.fetchCursor(db, sql: "SELECT ...", arguments: ...) // A Cursor of Int?
+    try Optional<Int>.fetchAll(db, sql: "SELECT ...", arguments: ...)    // [Int?]
+}
+
+let playerCount = try dbQueue.read { db in
+    try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM player")!
+}
+
+ +

fetchOne returns an optional value which is nil in two cases: either the SELECT statement yielded no row, or one row with a NULL value.

+ +

There are many supported value types (Bool, Int, String, Date, Swift enums, etc.). See Values for more information:

+
let count = try Int.fetchOne(db, sql: "SELECT COUNT(*) FROM player")! // Int
+let urls = try URL.fetchAll(db, sql: "SELECT url FROM link")          // [URL]
+
+

Values

+ +

GRDB ships with built-in support for the following value types:

+ + + +

Values can be used as statement arguments:

+
let url: URL = ...
+let verified: Bool = ...
+try db.execute(
+    sql: "INSERT INTO link (url, verified) VALUES (?, ?)",
+    arguments: [url, verified])
+
+ +

Values can be extracted from rows:

+
let rows = try Row.fetchCursor(db, sql: "SELECT * FROM link")
+while let row = try rows.next() {
+    let url: URL = row["url"]
+    let verified: Bool = row["verified"]
+}
+
+ +

Values can be directly fetched:

+
let urls = try URL.fetchAll(db, sql: "SELECT url FROM link")  // [URL]
+
+ +

Use values in Records:

+
struct Link: FetchableRecord {
+    var url: URL
+    var isVerified: Bool
+
+    init(row: Row) {
+        url = row["url"]
+        isVerified = row["verified"]
+    }
+}
+
+ +

Use values in the query interface:

+
let url: URL = ...
+let link = try Link.filter(Column("url") == url).fetchOne(db)
+
+

Data (and Memory Savings)

+ +

Data suits the BLOB SQLite columns. It can be stored and fetched from the database just like other values:

+
let rows = try Row.fetchCursor(db, sql: "SELECT data, ...")
+while let row = try rows.next() {
+    let data: Data = row["data"]
+}
+
+ +

At each step of the request iteration, the row[] subscript creates two copies of the database bytes: one fetched by SQLite, and another, stored in the Swift Data value.

+ +

You have the opportunity to save memory by not copying the data fetched by SQLite:

+
while let row = try rows.next() {
+    let data = row.dataNoCopy(named: "data") // Data?
+}
+
+ +

The non-copied data does not live longer than the iteration step: make sure that you do not use it past this point.

+

Date and DateComponents

+ +

Date and DateComponents can be stored and fetched from the database.

+ +

Here is how GRDB supports the various date formats supported by SQLite:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SQLite formatDateDateComponents
YYYY-MM-DDRead ¹Read/Write
YYYY-MM-DD HH:MMRead ¹Read/Write
YYYY-MM-DD HH:MM:SSRead ¹Read/Write
YYYY-MM-DD HH:MM:SS.SSSRead/Write ¹Read/Write
YYYY-MM-DD*T*HH:MMRead ¹Read
YYYY-MM-DD*T*HH:MM:SSRead ¹Read
YYYY-MM-DD*T*HH:MM:SS.SSSRead ¹Read
HH:MMRead/Write
HH:MM:SSRead/Write
HH:MM:SS.SSSRead/Write
Timestamps since unix epochRead ²
now
+ +

¹ Dates are stored and read in the UTC time zone. Missing components are assumed to be zero.

+ +

² GRDB 2+ interprets numerical values as timestamps that fuel Date(timeIntervalSince1970:). Previous GRDB versions used to interpret numbers as julian days. Julian days are still supported, with the Date(julianDay:) initializer.

+

Date

+ +

Date can be stored and fetched from the database just like other values:

+
try db.execute(
+    sql: "INSERT INTO player (creationDate, ...) VALUES (?, ...)",
+    arguments: [Date(), ...])
+
+let row = try Row.fetchOne(db, ...)!
+let creationDate: Date = row["creationDate"]
+
+ +

Dates are stored using the format “YYYY-MM-DD HH:MM:SS.SSS” in the UTC time zone. It is precise to the millisecond.

+ +
+

:point_up: Note: this format was chosen because it is the only format that is:

+ +
    +
  • Comparable (ORDER BY date works)
  • +
  • Comparable with the SQLite keyword CURRENT_TIMESTAMP (WHERE date > CURRENT_TIMESTAMP works)
  • +
  • Able to feed SQLite date & time functions
  • +
  • Precise enough
  • +
+
+ +

When the default format does not fit your needs, customize date conversions. For example:

+
try db.execute(
+    sql: "INSERT INTO player (creationDate, ...) VALUES (?, ...)",
+    arguments: [Date().timeIntervalSinceReferenceDate, ...])
+
+let row = try Row.fetchOne(db, ...)!
+let creationDate = Date(timeIntervalSinceReferenceDate: row["creationDate"])
+
+ +

See Codable Records for more date customization options.

+

DateComponents

+ +

DateComponents is indirectly supported, through the DatabaseDateComponents helper type.

+ +

DatabaseDateComponents reads date components from all date formats supported by SQLite, and stores them in the format of your choice, from HH:MM to YYYY-MM-DD HH:MM:SS.SSS.

+ +

DatabaseDateComponents can be stored and fetched from the database just like other values:

+
let components = DateComponents()
+components.year = 1973
+components.month = 9
+components.day = 18
+
+// Store "1973-09-18"
+let dbComponents = DatabaseDateComponents(components, format: .YMD)
+try db.execute(
+    sql: "INSERT INTO player (birthDate, ...) VALUES (?, ...)",
+    arguments: [dbComponents, ...])
+
+// Read "1973-09-18"
+let row = try Row.fetchOne(db, sql: "SELECT birthDate ...")!
+let dbComponents: DatabaseDateComponents = row["birthDate"]
+dbComponents.format         // .YMD (the actual format found in the database)
+dbComponents.dateComponents // DateComponents
+
+

NSNumber and NSDecimalNumber

+ +

NSNumber can be stored and fetched from the database just like other values. Floating point NSNumbers are stored as Double. Integer and boolean, as Int64. Integers that don’t fit Int64 won’t be stored: you’ll get a fatal error instead. Be cautious when an NSNumber contains an UInt64, for example.

+ +

NSDecimalNumber deserves a longer discussion:

+ +

SQLite has no support for decimal numbers. Given the table below, SQLite will actually store integers or doubles:

+
CREATE TABLE transfer (
+    amount DECIMAL(10,5) -- will store integer or double, actually
+)
+
+ +

This means that computations will not be exact:

+
try db.execute(sql: "INSERT INTO transfer (amount) VALUES (0.1)")
+try db.execute(sql: "INSERT INTO transfer (amount) VALUES (0.2)")
+let sum = try NSDecimalNumber.fetchOne(db, sql: "SELECT SUM(amount) FROM transfer")!
+
+// Yikes! 0.3000000000000000512
+print(sum)
+
+ +

Don’t blame SQLite or GRDB, and instead store your decimal numbers differently.

+ +

A classic technique is to store integers instead, since SQLite performs exact computations of integers. For example, don’t store Euros, but store cents instead:

+
// Write
+let amount = NSDecimalNumber(string: "0.10")
+let integerAmount = amount.multiplying(byPowerOf10: 2).int64Value
+try db.execute(sql: "INSERT INTO transfer (amount) VALUES (?)", arguments: [integerAmount])
+
+// Read
+let integerAmount = try Int64.fetchOne(db, sql: "SELECT SUM(amount) FROM transfer")!
+let amount = NSDecimalNumber(value: integerAmount).multiplying(byPowerOf10: -2) // 0.10
+
+

UUID

+ +

UUID can be stored and fetched from the database just like other values.

+ +

GRDB stores uuids as 16-bytes data blobs, and decodes them from both 16-bytes data blobs and strings such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”.

+

Swift Enums

+ +

Swift enums and generally all types that adopt the RawRepresentable protocol can be stored and fetched from the database just like their raw values:

+
enum Color : Int {
+    case red, white, rose
+}
+
+enum Grape : String {
+    case chardonnay, merlot, riesling
+}
+
+// Declare empty DatabaseValueConvertible adoption
+extension Color : DatabaseValueConvertible { }
+extension Grape : DatabaseValueConvertible { }
+
+// Store
+try db.execute(
+    sql: "INSERT INTO wine (grape, color) VALUES (?, ?)",
+    arguments: [Grape.merlot, Color.red])
+
+// Read
+let rows = try Row.fetchCursor(db, sql: "SELECT * FROM wine")
+while let row = try rows.next() {
+    let grape: Grape = row["grape"]
+    let color: Color = row["color"]
+}
+
+ +

When a database value does not match any enum case, you get a fatal error. This fatal error can be avoided with the DatabaseValue type:

+
let row = try Row.fetchOne(db, sql: "SELECT 'syrah'")!
+
+row[0] as String  // "syrah"
+row[0] as Grape?  // fatal error: could not convert "syrah" to Grape.
+row[0] as Grape   // fatal error: could not convert "syrah" to Grape.
+
+let dbValue: DatabaseValue = row[0]
+if dbValue.isNull {
+    // Handle NULL
+} else if let grape = Grape.fromDatabaseValue(dbValue) {
+    // Handle valid grape
+} else {
+    // Handle unknown grape
+}
+
+

Custom Value Types

+ +

Conversion to and from the database is based on the DatabaseValueConvertible protocol:

+
protocol DatabaseValueConvertible {
+    /// Returns a value that can be stored in the database.
+    var databaseValue: DatabaseValue { get }
+
+    /// Returns a value initialized from dbValue, if possible.
+    static func fromDatabaseValue(_ dbValue: DatabaseValue) -> Self?
+}
+
+ +

All types that adopt this protocol can be used like all other values (Bool, Int, String, Date, Swift enums, etc.)

+ +

The databaseValue property returns DatabaseValue, a type that wraps the five values supported by SQLite: NULL, Int64, Double, String and Data. Since DatabaseValue has no public initializer, use DatabaseValue.null, or another type that already adopts the protocol: 1.databaseValue, "foo".databaseValue, etc. Conversion to DatabaseValue must not fail.

+ +

The fromDatabaseValue() factory method returns an instance of your custom type if the database value contains a suitable value. If the database value does not contain a suitable value, such as “foo” for Date, fromDatabaseValue must return nil (GRDB will interpret this nil result as a conversion error, and react accordingly).

+

Transactions and Savepoints

+ + +

Transactions and Safety

+ +

A transaction is a fundamental tool of SQLite that guarantees data consistency as well as proper isolation between application threads and database connections.

+ +

GRDB generally opens transactions for you, as a way to enforce its concurrency guarantees, and provide maximal security for both your application data and application logic:

+
// BEGIN TRANSACTION
+// INSERT INTO credit ...
+// INSERT INTO debit ...
+// COMMIT
+try dbQueue.write { db in
+    try Credit(destinationAccount, amount).insert(db)
+    try Debit(sourceAccount, amount).insert(db)
+}
+
+// BEGIN TRANSACTION
+// INSERT INTO credit ...
+// INSERT INTO debit ...
+// COMMIT
+try dbPool.write { db in
+    try Credit(destinationAccount, amount).insert(db)
+    try Debit(sourceAccount, amount).insert(db)
+}
+
+ +

Yet you may need to exactly control when transactions take place:

+

Explicit Transactions

+ +

DatabaseQueue.inDatabase() and DatabasePool.writeWithoutTransaction() execute your database statements outside of any transaction:

+
// INSERT INTO credit ...
+// INSERT INTO debit ...
+try dbQueue.inDatabase { db in
+    try Credit(destinationAccount, amount).insert(db)
+    try Debit(sourceAccount, amount).insert(db)
+}
+
+// INSERT INTO credit ...
+// INSERT INTO debit ...
+try dbPool.writeWithoutTransaction { db in
+    try Credit(destinationAccount, amount).insert(db)
+    try Debit(sourceAccount, amount).insert(db)
+}
+
+ +

Writing outside of any transaction is dangerous, for two reasons:

+ +
    +
  • In our credit/debit example, you may successfully insert a credit, but fail inserting the debit, and end up with unbalanced accounts (oops).

    +
    // UNSAFE DATABASE INTEGRITY
    +try dbQueue.inDatabase { db in // or dbPool.writeWithoutTransaction
    +    try Credit(destinationAccount, amount).insert(db) // may succeed
    +    try Debit(sourceAccount, amount).insert(db)      // may fail
    +}
    +
    + +

    Transactions avoid this kind of bug.

  • +
  • Database pool concurrent reads can see an inconsistent state of the database:

    +
    // UNSAFE CONCURRENCY
    +try dbPool.writeWithoutTransaction { db in
    +    try Credit(destinationAccount, amount).insert(db)
    +    // <- Concurrent dbPool.read sees a partial db update here
    +    try Debit(sourceAccount, amount).insert(db)
    +}
    +
    + +

    Transactions avoid this kind of bug, too.

  • +
+ +

To open explicit transactions, use one of the Database.inTransaction, DatabaseQueue.inTransaction, or DatabasePool.writeInTransaction methods:

+
// BEGIN TRANSACTION
+// INSERT INTO credit ...
+// INSERT INTO debit ...
+// COMMIT
+try dbQueue.inDatabase { db in  // or dbPool.writeWithoutTransaction
+    try db.inTransaction {
+        try Credit(destinationAccount, amount).insert(db)
+        try Debit(sourceAccount, amount).insert(db)
+        return .commit
+    }
+}
+
+// BEGIN TRANSACTION
+// INSERT INTO credit ...
+// INSERT INTO debit ...
+// COMMIT
+try dbQueue.inTransaction { db in  // or dbPool.writeInTransaction
+    try Credit(destinationAccount, amount).insert(db)
+    try Debit(sourceAccount, amount).insert(db)
+    return .commit
+}
+
+ +

If an error is thrown from the transaction block, the transaction is rollbacked and the error is rethrown by the inTransaction method. If you return .rollback instead of .commit, the transaction is also rollbacked, but no error is thrown.

+ +

You can also perform manual transaction management:

+
try dbQueue.inDatabase { db in  // or dbPool.writeWithoutTransaction
+    try db.beginTransaction()
+    ...
+    try db.commit()
+
+    try db.execute(sql: "BEGIN TRANSACTION")
+    ...
+    try db.execute(sql: "ROLLBACK")
+}
+
+ +

Transactions can’t be left opened unless you set the allowsUnsafeTransactions configuration flag:

+
// fatal error: A transaction has been left opened at the end of a database access
+try dbQueue.inDatabase { db in
+    try db.execute(sql: "BEGIN TRANSACTION")
+    // <- no commit or rollback
+}
+
+ +

You can ask if a transaction is currently opened:

+
func myCriticalMethod(_ db: Database) throws {
+    precondition(db.isInsideTransaction, "This method requires a transaction")
+    try ...
+}
+
+ +

Yet, you have a better option than checking for transactions: critical database sections should use savepoints, described below:

+
func myCriticalMethod(_ db: Database) throws {
+    try db.inSavepoint {
+        // Here the database is guaranteed to be inside a transaction.
+        try ...
+    }
+}
+
+

Savepoints

+ +

Statements grouped in a savepoint can be rollbacked without invalidating a whole transaction:

+
try dbQueue.write { db in
+    // Makes sure both inserts succeed, or none:
+    try db.inSavepoint {
+        try Credit(destinationAccount, amount).insert(db)
+        try Debit(sourceAccount, amount).insert(db)
+        return .commit
+    }
+
+    // Other savepoints, etc...
+}
+
+ +

If an error is thrown from the savepoint block, the savepoint is rollbacked and the error is rethrown by the inSavepoint method. If you return .rollback instead of .commit, the savepoint is also rollbacked, but no error is thrown.

+ +

Unlike transactions, savepoints can be nested. They implicitly open a transaction if no one was opened when the savepoint begins. As such, they behave just like nested transactions. Yet the database changes are only written to disk when the outermost transaction is committed:

+
try dbQueue.inDatabase { db in
+    try db.inSavepoint {
+        ...
+        try db.inSavepoint {
+            ...
+            return .commit
+        }
+        ...
+        return .commit  // writes changes to disk
+    }
+}
+
+ +

SQLite savepoints are more than nested transactions, though. For advanced uses, use SQLite savepoint documentation.

+

Transaction Kinds

+ +

SQLite supports three kinds of transactions: deferred (the default), immediate, and exclusive.

+ +

The transaction kind can be changed in the database configuration, or for each transaction:

+
// 1) Default configuration:
+let dbQueue = try DatabaseQueue(path: "...")
+
+// BEGIN DEFERED TRANSACTION ...
+dbQueue.write { db in ... }
+
+// BEGIN EXCLUSIVE TRANSACTION ...
+dbQueue.inTransaction(.exclusive) { db in ... }
+
+// 2) Customized default transaction kind:
+var config = Configuration()
+config.defaultTransactionKind = .immediate
+let dbQueue = try DatabaseQueue(path: "...", configuration: config)
+
+// BEGIN IMMEDIATE TRANSACTION ...
+dbQueue.write { db in ... }
+
+// BEGIN EXCLUSIVE TRANSACTION ...
+dbQueue.inTransaction(.exclusive) { db in ... }
+
+

Prepared Statements

+ +

Prepared Statements let you prepare an SQL query and execute it later, several times if you need, with different arguments.

+ +

There are two kinds of prepared statements: select statements, and update statements:

+
try dbQueue.write { db in
+    let updateSQL = "INSERT INTO player (name, score) VALUES (:name, :score)"
+    let updateStatement = try db.makeUpdateStatement(sql: updateSQL)
+
+    let selectSQL = "SELECT * FROM player WHERE name = ?"
+    let selectStatement = try db.makeSelectStatement(sql: selectSQL)
+}
+
+ +

The ? and colon-prefixed keys like :name in the SQL query are the statement arguments. You set them with arrays or dictionaries (arguments are actually of type StatementArguments, which happens to adopt the ExpressibleByArrayLiteral and ExpressibleByDictionaryLiteral protocols).

+
updateStatement.arguments = ["name": "Arthur", "score": 1000]
+selectStatement.arguments = ["Arthur"]
+
+ +

After arguments are set, you can execute the prepared statement:

+
try updateStatement.execute()
+
+ +

Select statements can be used wherever a raw SQL query string would fit (see fetch queries):

+
let rows = try Row.fetchCursor(selectStatement)    // A Cursor of Row
+let players = try Player.fetchAll(selectStatement) // [Player]
+let player = try Player.fetchOne(selectStatement)  // Player?
+
+ +

You can set the arguments at the moment of the statement execution:

+
try updateStatement.execute(arguments: ["name": "Arthur", "score": 1000])
+let player = try Player.fetchOne(selectStatement, arguments: ["Arthur"])
+
+ +
+

:point_up: Note: it is a programmer error to reuse a prepared statement that has failed: GRDB may crash if you do so.

+
+ +

See row queries, value queries, and Records for more information.

+

Prepared Statements Cache

+ +

When the same query will be used several times in the lifetime of your application, you may feel a natural desire to cache prepared statements.

+ +

Don’t cache statements yourself.

+ +
+

:point_up: Note: This is because you don’t have the necessary tools. Statements are tied to specific SQLite connections and dispatch queues which you don’t manage yourself, especially when you use database pools. A change in the database schema may, or may not invalidate a statement. On systems earlier than OSX 10.10 that don’t have the sqlite3_close_v2 function, SQLite connections won’t close properly if statements have been kept alive.

+
+ +

Instead, use the cachedUpdateStatement and cachedSelectStatement methods. GRDB does all the hard caching and memory management stuff for you:

+
let updateStatement = try db.cachedUpdateStatement(sql: sql)
+let selectStatement = try db.cachedSelectStatement(sql: sql)
+
+ +

Should a cached prepared statement throw an error, don’t reuse it (it is a programmer error). Instead, reload it from the cache.

+

Custom SQL Functions and Aggregates

+ +

SQLite lets you define SQL functions and aggregates.

+ +

A custom SQL function or aggregate extends SQLite:

+
SELECT reverse(name) FROM player;   -- custom function
+SELECT maxLength(name) FROM player; -- custom aggregate
+
+ + +

Custom SQL Functions

+
let reverse = DatabaseFunction("reverse", argumentCount: 1, pure: true) { (values: [DatabaseValue]) in
+    // Extract string value, if any...
+    guard let string = String.fromDatabaseValue(values[0]) else {
+        return nil
+    }
+    // ... and return reversed string:
+    return String(string.reversed())
+}
+dbQueue.add(function: reverse)   // Or dbPool.add(function: ...)
+
+try dbQueue.read { db in
+    // "oof"
+    try String.fetchOne(db, sql: "SELECT reverse('foo')")!
+}
+
+ +

The function argument takes an array of DatabaseValue, and returns any valid value (Bool, Int, String, Date, Swift enums, etc.) The number of database values is guaranteed to be argumentCount.

+ +

SQLite has the opportunity to perform additional optimizations when functions are “pure”, which means that their result only depends on their arguments. So make sure to set the pure argument to true when possible.

+ +

Functions can take a variable number of arguments:

+ +

When you don’t provide any explicit argumentCount, the function can take any number of arguments:

+
let averageOf = DatabaseFunction("averageOf", pure: true) { (values: [DatabaseValue]) in
+    let doubles = values.compactMap { Double.fromDatabaseValue($0) }
+    return doubles.reduce(0, +) / Double(doubles.count)
+}
+dbQueue.add(function: averageOf)
+
+try dbQueue.read { db in
+    // 2.0
+    try Double.fetchOne(db, sql: "SELECT averageOf(1, 2, 3)")!
+}
+
+ +

Functions can throw:

+
let sqrt = DatabaseFunction("sqrt", argumentCount: 1, pure: true) { (values: [DatabaseValue]) in
+    guard let double = Double.fromDatabaseValue(values[0]) else {
+        return nil
+    }
+    guard double >= 0 else {
+        throw DatabaseError(message: "invalid negative number")
+    }
+    return sqrt(double)
+}
+dbQueue.add(function: sqrt)
+
+// SQLite error 1 with statement `SELECT sqrt(-1)`: invalid negative number
+try dbQueue.read { db in
+    try Double.fetchOne(db, sql: "SELECT sqrt(-1)")!
+}
+
+ +

Use custom functions in the query interface:

+
// SELECT reverseString("name") FROM player
+Player.select(reverseString.apply(nameColumn))
+
+ +

GRDB ships with built-in SQL functions that perform unicode-aware string transformations. See Unicode.

+

Custom Aggregates

+ +

Before registering a custom aggregate, you need to define a type that adopts the DatabaseAggregate protocol:

+
protocol DatabaseAggregate {
+    // Initializes an aggregate
+    init()
+
+    // Called at each step of the aggregation
+    mutating func step(_ dbValues: [DatabaseValue]) throws
+
+    // Returns the final result
+    func finalize() throws -> DatabaseValueConvertible?
+}
+
+ +

For example:

+
struct MaxLength : DatabaseAggregate {
+    var maxLength: Int = 0
+
+    mutating func step(_ dbValues: [DatabaseValue]) {
+        // At each step, extract string value, if any...
+        guard let string = String.fromDatabaseValue(dbValues[0]) else {
+            return
+        }
+        // ... and update the result
+        let length = string.count
+        if length > maxLength {
+            maxLength = length
+        }
+    }
+
+    func finalize() -> DatabaseValueConvertible? {
+        return maxLength
+    }
+}
+
+let maxLength = DatabaseFunction(
+    "maxLength",
+    argumentCount: 1,
+    pure: true,
+    aggregate: MaxLength.self)
+
+dbQueue.add(function: maxLength)   // Or dbPool.add(function: ...)
+
+try dbQueue.read { db in
+    // Some Int
+    try Int.fetchOne(db, sql: "SELECT maxLength(name) FROM player")!
+}
+
+ +

The step method of the aggregate takes an array of DatabaseValue. This array contains as many values as the argumentCount parameter (or any number of values, when argumentCount is omitted).

+ +

The finalize method of the aggregate returns the final aggregated value (Bool, Int, String, Date, Swift enums, etc.).

+ +

SQLite has the opportunity to perform additional optimizations when aggregates are “pure”, which means that their result only depends on their inputs. So make sure to set the pure argument to true when possible.

+ +

Use custom aggregates in the query interface:

+
// SELECT maxLength("name") FROM player
+let request = Player.select(maxLength.apply(nameColumn))
+try Int.fetchOne(db, request) // Int?
+
+

Database Schema Introspection

+ +

GRDB comes with a set of schema introspection methods:

+
try dbQueue.read { db in
+    // Bool, true if the table exists
+    try db.tableExists("player")
+
+    // [ColumnInfo], the columns in the table
+    try db.columns(in: "player")
+
+    // PrimaryKeyInfo
+    try db.primaryKey("player")
+
+    // [ForeignKeyInfo], the foreign keys defined on the table
+    try db.foreignKeys(on: "player")
+
+    // [IndexInfo], the indexes defined on the table
+    try db.indexes(on: "player")
+
+    // Bool, true if column(s) is a unique key (primary key or unique index)
+    try db.table("player", hasUniqueKey: ["email"])
+}
+
+// Bool, true if argument is the name of an internal SQLite table
+Database.isSQLiteInternalTable(...)
+
+// Bool, true if argument is the name of an internal GRDB table
+Database.isGRDBInternalTable(...)
+
+

Row Adapters

+ +

Row adapters let you present database rows in the way expected by the row consumers.

+ +

They basically help two incompatible row interfaces to work together. For example, a row consumer expects a column named “consumed”, but the produced row has a column named “produced”.

+ +

In this case, the ColumnMapping row adapter comes in handy:

+
// Fetch a 'produced' column, and consume a 'consumed' column:
+let adapter = ColumnMapping(["consumed": "produced"])
+let row = try Row.fetchOne(db, sql: "SELECT 'Hello' AS produced", adapter: adapter)!
+row["consumed"] // "Hello"
+row["produced"] // nil
+
+ +

Row adapters are values that adopt the RowAdapter protocol. You can implement your own custom adapters (:fire: EXPERIMENTAL), or use one of the four built-in adapters, described below.

+ +

To see how row adapters can be used, see Joined Queries Support.

+

ColumnMapping

+ +

ColumnMapping renames columns. Build one with a dictionary whose keys are adapted column names, and values the column names in the raw row:

+
// [newName:"Hello"]
+let adapter = ColumnMapping(["newName": "oldName"])
+let row = try Row.fetchOne(db, sql: "SELECT 'Hello' AS oldName", adapter: adapter)!
+
+

SuffixRowAdapter

+ +

SuffixRowAdapter hides the first columns in a row:

+
// [b:1 c:2]
+let adapter = SuffixRowAdapter(fromIndex: 1)
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c", adapter: adapter)!
+
+

RangeRowAdapter

+ +

RangeRowAdapter only exposes a range of columns.

+
// [b:1]
+let adapter = RangeRowAdapter(1..<2)
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c", adapter: adapter)!
+
+

EmptyRowAdapter

+ +

EmptyRowAdapter hides all columns.

+
let adapter = EmptyRowAdapter()
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c", adapter: adapter)!
+row.isEmpty // true
+
+ +

This limit adapter may turn out useful in some narrow use cases. You’ll be happy to find it when you need it.

+

ScopeAdapter

+ +

ScopeAdapter defines row scopes:

+
let adapter = ScopeAdapter([
+    "left": RangeRowAdapter(0..<2),
+    "right": RangeRowAdapter(2..<4)])
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c, 3 AS d", adapter: adapter)!
+
+ +

ScopeAdapter does not change the columns and values of the fetched row. Instead, it defines scopes, which you access through the Row.scopes property:

+
row                   // [a:0 b:1 c:2 d:3]
+row.scopes["left"]    // [a:0 b:1]
+row.scopes["right"]   // [c:2 d:3]
+row.scopes["missing"] // nil
+
+ +

Scopes can be nested:

+
let adapter = ScopeAdapter([
+    "left": ScopeAdapter([
+        "left": RangeRowAdapter(0..<1),
+        "right": RangeRowAdapter(1..<2)]),
+    "right": ScopeAdapter([
+        "left": RangeRowAdapter(2..<3),
+        "right": RangeRowAdapter(3..<4)])
+    ])
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c, 3 AS d", adapter: adapter)!
+
+let leftRow = row.scopes["left"]!
+leftRow.scopes["left"]  // [a:0]
+leftRow.scopes["right"] // [b:1]
+
+let rightRow = row.scopes["right"]!
+rightRow.scopes["left"]  // [c:2]
+rightRow.scopes["right"] // [d:3]
+
+ +

Any adapter can be extended with scopes:

+
let baseAdapter = RangeRowAdapter(0..<2)
+let adapter = ScopeAdapter(base: baseAdapter, scopes: [
+    "remainder": SuffixRowAdapter(fromIndex: 2)])
+let row = try Row.fetchOne(db, sql: "SELECT 0 AS a, 1 AS b, 2 AS c, 3 AS d", adapter: adapter)!
+
+row // [a:0 b:1]
+row.scopes["remainder"] // [c:2 d:3]
+
+

Raw SQLite Pointers

+ +

If not all SQLite APIs are exposed in GRDB, you can still use the SQLite C Interface and call SQLite C functions.

+ +

Those functions are embedded right into the GRDBCustom module. Otherwise, you’ll need to import SQLite3, SQLCipher, or CSQLite, depending on the GRDB flavor you are using:

+
// Swift Package Manager
+import CSQLite
+
+// SQLCipher
+import SQLCipher
+
+// System SQLite
+import SQLite3
+
+let sqliteVersion = String(cString: sqlite3_libversion())
+
+ +

Raw pointers to database connections and statements are available through the Database.sqliteConnection and Statement.sqliteStatement properties:

+
try dbQueue.read { db in
+    // The raw pointer to a database connection:
+    let sqliteConnection = db.sqliteConnection
+
+    // The raw pointer to a statement:
+    let statement = try db.makeSelectStatement(sql: "SELECT ...")
+    let sqliteStatement = statement.sqliteStatement
+}
+
+ +
+

:point_up: Notes

+ +
    +
  • Those pointers are owned by GRDB: don’t close connections or finalize statements created by GRDB.
  • +
  • GRDB opens SQLite connections in the “multi-thread mode”, which (oddly) means that they are not thread-safe. Make sure you touch raw databases and statements inside their dedicated dispatch queues.
  • +
  • Use the raw SQLite C Interface at your own risk. GRDB won’t prevent you from shooting yourself in the foot.
  • +
+
+

Records

+ +

On top of the SQLite API, GRDB provides protocols and a class that help manipulating database rows as regular objects named “records”:

+
try dbQueue.write { db in
+    if var place = try Place.fetchOne(db, key: 1) {
+        place.isFavorite = true
+        try place.update(db)
+    }
+}
+
+ +

Of course, you need to open a database connection, and create database tables first.

+ +

To define your custom records, you subclass the ready-made Record class, or you extend your structs and classes with protocols that come with focused sets of features: fetching methods, persistence methods, record comparison…

+ +

Extending structs with record protocols is more “swifty”. Subclassing the Record class is more “classic”. You can choose either way. See some examples of record definitions, and the list of record methods for an overview.

+ +
+

:point_up: Note: if you are familiar with Core Data’s NSManagedObject or Realm’s Object, you may experience a cultural shock: GRDB records are not uniqued, do not auto-update, and do not lazy-load. This is both a purpose, and a consequence of protocol-oriented programming. You should read How to build an iOS application with SQLite and GRDB.swift for a general introduction.

+ +

:bulb: Tip: after you have read this chapter, check the Good Practices for Designing Record Types Guide.

+ +

:bulb: Tip: see the Demo Application for a sample app that uses records.

+
+ +

Overview

+ + + +

Protocols and the Record Class

+ + + +

Records in a Glance

+ + +

Inserting Records

+ +

To insert a record in the database, call the insert method:

+
let player = Player(name: "Arthur", email: "arthur@example.com")
+try player.insert(db)
+
+ +

:point_right: insert is available for subclasses of the Record class, and types that adopt the PersistableRecord protocol.

+

Fetching Records

+ +

To fetch records from the database, call a fetching method:

+
let arthur = try Player.fetchOne(db,            // Player?
+    sql: "SELECT * FROM players WHERE name = ?",
+    arguments: ["Arthur"])
+
+let bestPlayers = try Player                    // [Player]
+    .order(Column("score").desc)
+    .limit(10)
+    .fetchAll(db)
+
+let spain = try Country.fetchOne(db, key: "ES") // Country?
+
+ +

:point_right: Fetching from raw SQL is available for subclasses of the Record class, and types that adopt the FetchableRecord protocol.

+ +

:point_right: Fetching without SQL, using the query interface, is available for subclasses of the Record class, and types that adopt both FetchableRecord and TableRecord protocol.

+

Updating Records

+ +

To update a record in the database, call the update method:

+
if let player = try Player.fetchOne(db, key: 1) 
+    player.score = 1000
+    try player.update(db)
+}
+
+ +

It is possible to avoid useless updates:

+
if var player = try Player.fetchOne(db, key: 1) {
+    // does not hit the database if score has not changed
+    try player.updateChanges(db) {
+        $0.score = 1000
+    }
+}
+
+ +

For batch updates, execute an SQL query, or see the query interface:

+
try db.execute(sql: "UPDATE player SET score = score + 1 WHERE team = 'red'")
+try Player
+    .filter(Column("team") == "red")
+    .updateAll(db, scoreColumn += 1)
+
+ +

:point_right: update methods are available for subclasses of the Record class, and types that adopt the PersistableRecord protocol.

+

Deleting Records

+ +

To delete a record in the database, call the delete method:

+
if let player = try Player.fetchOne(db, key: 1) {
+    try player.delete(db)
+}
+
+ +

You can also delete by primary key, or any unique index:

+
try Player.deleteOne(db, key: 1)
+try Player.deleteOne(db, key: ["email": "arthur@example.com"])
+try Country.deleteAll(db, keys: ["FR", "US"])
+
+ +

For batch deletes, execute an SQL query, or see the query interface:

+
try db.execute(sql: "DELETE player WHERE email IS NULL")
+try Player
+    .filter(Column("email") == nil)
+    .deleteAll(db)
+
+ +

:point_right: delete methods are available for subclasses of the Record class, and types that adopt the PersistableRecord protocol.

+

Counting Records

+ +

To count records, call the fetchCount method:

+
let playerCount: Int = try Player.fetchCount(db)
+
+let playerWithEmailCount: Int = try Player
+    .filter(Column("email") == nil)
+    .fetchCount(db)
+
+ +

:point_right: fetchCount is available for subclasses of the Record class, and types that adopt the TableRecord protocol.

+ +

Details follow:

+ + +

Record Protocols Overview

+ +

GRDB ships with three record protocols. Your own types will adopt one or several of them, according to the abilities you want to extend your types with.

+ +
    +
  • FetchableRecord is able to decode database rows.

    + +

    It is always possible to decode rows without this protocol:

    +
    struct Place { ... }
    +try dbQueue.read { db in
    +    let rows = try Row.fetchAll(db, sql: "SELECT * FROM place")
    +    let places: [Place] = rows.map { row in
    +        return Place(
    +            id: row["id"],
    +            title: row["title"],
    +            coordinate: CLLocationCoordinate2D(
    +                latitude: row["latitude"],
    +                longitude: row["longitude"]))
    +        )
    +    }
    +}
    +
    + +

    But FetchableRecord lets you write code that is easier to read, and more efficient as well, both in terms of performance and memory usage:

    +
    struct Place: FetchableRecord { ... }
    +try dbQueue.read { db in
    +    let places = try Place.fetchAll(db, sql: "SELECT * FROM place")
    +}
    +
    + +
    +

    :bulb: Tip: FetchableRecord can derive its implementation from the standard Decodable protocol. See Codable Records for more information.

    +
    + +

    FetchableRecord can decode database rows, but it is not able to build SQL requests for you. For that, you also need TableRecord:

  • +
  • TableRecord is able to generate SQL queries:

    +
    struct Place: TableRecord { ... }
    +// SELECT * FROM place ORDER BY title
    +let request = Place.order(Column("title"))
    +
    + +

    When a type adopts both TableRecord and FetchableRecord, it can load from those requests:

    +
    struct Place: TableRecord, FetchableRecord { ... }
    +try dbQueue.read { db in
    +    let places = try Place.order(Column("title")).fetchAll(db)
    +    let paris = try Place.fetchOne(key: 1)
    +}
    +
  • +
  • PersistableRecord is able to write: it can create, update, and delete rows in the database:

    +
    struct Place : PersistableRecord { ... }
    +try dbQueue.write { db in
    +    try Place.delete(db, key: 1)
    +    try Place(...).insert(db)
    +}
    +
    + +

    A persistable record can also compare itself against other records, and avoid useless database updates.

    + +
    +

    :bulb: Tip: PersistableRecord can derive its implementation from the standard Encodable protocol. See Codable Records for more information.

    +
  • +
+

FetchableRecord Protocol

+ +

The FetchableRecord protocol grants fetching methods to any type that can be built from a database row:

+
protocol FetchableRecord {
+    /// Row initializer
+    init(row: Row)
+}
+
+ +

To use FetchableRecord, subclass the Record class, or adopt it explicitly. For example:

+
struct Place {
+    var id: Int64?
+    var title: String
+    var coordinate: CLLocationCoordinate2D
+}
+
+extension Place : FetchableRecord {
+    init(row: Row) {
+        id = row["id"]
+        title = row["title"]
+        coordinate = CLLocationCoordinate2D(
+            latitude: row["latitude"],
+            longitude: row["longitude"])
+    }
+}
+
+ +

Rows also accept column enums:

+
extension Place : FetchableRecord {
+    enum Columns: String, ColumnExpression {
+        case id, title, latitude, longitude
+    }
+
+    init(row: Row) {
+        id = row[Columns.id]
+        title = row[Columns.title]
+        coordinate = CLLocationCoordinate2D(
+            latitude: row[Columns.latitude],
+            longitude: row[Columns.longitude])
+    }
+}
+
+ +

See column values for more information about the row[] subscript.

+ +

When your record type adopts the standard Decodable protocol, you don’t have to provide the implementation for init(row:). See Codable Records for more information:

+
// That's all
+struct Player: Decodable, FetchableRecord {
+    var id: Int64
+    var name: String
+    var score: Int
+}
+
+ +

FetchableRecord allows adopting types to be fetched from SQL queries:

+
try Place.fetchCursor(db, sql: "SELECT ...", arguments:...) // A Cursor of Place
+try Place.fetchAll(db, sql: "SELECT ...", arguments:...)    // [Place]
+try Place.fetchOne(db, sql: "SELECT ...", arguments:...)    // Place?
+
+ +

See fetching methods for information about the fetchCursor, fetchAll and fetchOne methods. See StatementArguments for more information about the query arguments.

+ +
+

:point_up: Note: for performance reasons, the same row argument to init(row:) is reused during the iteration of a fetch query. If you want to keep the row for later use, make sure to store a copy: self.row = row.copy().

+ +

:point_up: Note: The FetchableRecord.init(row:) initializer fits the needs of most applications. But some application are more demanding than others. When FetchableRecord does not exactly provide the support you need, have a look at the Beyond FetchableRecord chapter.

+
+

TableRecord Protocol

+ +

The TableRecord protocol generates SQL for you. To use TableRecord, subclass the Record class, or adopt it explicitly:

+
protocol TableRecord {
+    static var databaseTableName: String { get }
+    static var databaseSelection: [SQLSelectable] { get }
+}
+
+ +

The databaseSelection type property is optional, and documented in the Columns Selected by a Request chapter.

+ +

The databaseTableName type property is the name of a database table. By default, it is derived from the type name:

+
struct Place: TableRecord { }
+print(Place.databaseTableName) // prints "place"
+
+ +

For example:

+ +
    +
  • Place: place
  • +
  • Country: country
  • +
  • PostalAddress: postalAddress
  • +
  • HTTPRequest: httpRequest
  • +
  • TOEFL: toefl
  • +
+ +

You can still provide a custom table name:

+
struct Place: TableRecord {
+    static let databaseTableName = "location"
+}
+print(Place.databaseTableName) // prints "location"
+
+ +

Subclasses of the Record class must always override their superclass’s databaseTableName property:

+
class Place: Record {
+    override class var databaseTableName: String {
+        return "place"
+    }
+}
+print(Place.databaseTableName) // prints "place"
+
+ +

When a type adopts both TableRecord and FetchableRecord, it can be fetched using the query interface:

+
// SELECT * FROM place WHERE name = 'Paris'
+let paris = try Place.filter(nameColumn == "Paris").fetchOne(db)
+
+ +

TableRecord can also fetch records by primary key:

+
try Player.fetchOne(db, key: 1)              // Player?
+try Player.fetchAll(db, keys: [1, 2, 3])     // [Player]
+
+try Country.fetchOne(db, key: "FR")          // Country?
+try Country.fetchAll(db, keys: ["FR", "US"]) // [Country]
+
+ +

When the table has no explicit primary key, GRDB uses the hidden “rowid” column:

+
// SELECT * FROM document WHERE rowid = 1
+try Document.fetchOne(db, key: 1)            // Document?
+
+ +

For multiple-column primary keys and unique keys defined by unique indexes, provide a dictionary:

+
// SELECT * FROM citizenship WHERE citizenId = 1 AND countryCode = 'FR'
+try Citizenship.fetchOne(db, key: ["citizenId": 1, "countryCode": "FR"]) // Citizenship?
+
+

PersistableRecord Protocol

+ +

GRDB record types can create, update, and delete rows in the database.

+ +

Those abilities are granted by three protocols:

+
// Defines how a record encodes itself into the database
+protocol EncodableRecord {
+    /// Defines the values persisted in the database
+    func encode(to container: inout PersistenceContainer)
+}
+
+// Adds persistence methods
+protocol MutablePersistableRecord: TableRecord, EncodableRecord {
+    /// Optional method that lets your adopting type store its rowID upon
+    /// successful insertion. Don't call it directly: it is called for you.
+    mutating func didInsert(with rowID: Int64, for column: String?)
+}
+
+// Adds immutability
+protocol PersistableRecord: MutablePersistableRecord {
+    /// Non-mutating version of the optional didInsert(with:for:)
+    func didInsert(with rowID: Int64, for column: String?)
+}
+
+ +

Yes, three protocols instead of one. Here is how you pick one or the other:

+ +
    +
  • If your type is a class, choose PersistableRecord. On top of that, implement didInsert(with:for:) if the database table has an auto-incremented primary key.

  • +
  • If your type is a struct, and the database table has an auto-incremented primary key, choose MutablePersistableRecord, and implement didInsert(with:for:).

  • +
  • Otherwise, choose PersistableRecord, and ignore didInsert(with:for:).

  • +
+ +

The encode(to:) method defines which values (Bool, Int, String, Date, Swift enums, etc.) are assigned to database columns.

+ +

The optional didInsert method lets the adopting type store its rowID after successful insertion, and is only useful for tables that have an auto-incremented primary key. It is called from a protected dispatch queue, and serialized with all database updates.

+ +

To use the persistable protocols, subclass the Record class, or adopt one of them explicitly. For example:

+
extension Place : MutablePersistableRecord {
+    /// The values persisted in the database
+    func encode(to container: inout PersistenceContainer) {
+        container["id"] = id
+        container["title"] = title
+        container["latitude"] = coordinate.latitude
+        container["longitude"] = coordinate.longitude
+    }
+
+    // Update auto-incremented id upon successful insertion
+    mutating func didInsert(with rowID: Int64, for column: String?) {
+        id = rowID
+    }
+}
+
+var paris = Place(
+    id: nil,
+    title: "Paris",
+    coordinate: CLLocationCoordinate2D(latitude: 48.8534100, longitude: 2.3488000))
+
+try paris.insert(db)
+paris.id   // some value
+
+ +

Persistence containers also accept column enums:

+
extension Place : MutablePersistableRecord {
+    enum Columns: String, ColumnExpression {
+        case id, title, latitude, longitude
+    }
+
+    func encode(to container: inout PersistenceContainer) {
+        container[Columns.id] = id
+        container[Columns.title] = title
+        container[Columns.latitude] = coordinate.latitude
+        container[Columns.longitude] = coordinate.longitude
+    }
+}
+
+ +

When your record type adopts the standard Encodable protocol, you don’t have to provide the implementation for encode(to:). See Codable Records for more information:

+
// That's all
+struct Player: Encodable, MutablePersistableRecord {
+    var id: Int64?
+    var name: String
+    var score: Int
+
+    // Update auto-incremented id upon successful insertion
+    mutating func didInsert(with rowID: Int64, for column: String?) {
+        id = rowID
+    }
+}
+
+

Persistence Methods

+ +

Record subclasses and types that adopt PersistableRecord are given default implementations for methods that insert, update, and delete:

+
// Instance methods
+try place.save(db)                     // INSERT or UPDATE
+try place.insert(db)                   // INSERT
+try place.update(db)                   // UPDATE
+try place.update(db, columns: ...)     // UPDATE
+try place.updateChanges(db, from: ...) // Maybe UPDATE
+try place.updateChanges(db) { ... }    // Maybe UPDATE
+try place.updateChanges(db)            // Maybe UPDATE (Record class only)
+try place.delete(db)                   // DELETE
+try place.exists(db)
+
+// Type methods
+try Place.updateAll(db, ...)               // UPDATE
+try Place.deleteAll(db)                    // DELETE
+try Place.deleteAll(db, keys:...)          // DELETE
+try Place.deleteOne(db, key:...)           // DELETE
+
+ +
    +
  • insert, update, save and delete can throw a DatabaseError.

  • +
  • update and updateChanges can also throw a PersistenceError, should the update fail because there is no matching row in the database.

    + +

    When saving an object that may or may not already exist in the database, prefer the save method:

  • +
  • updateAll performs a batch update. See Update Requests.

  • +
  • save makes sure your values are stored in the database.

    + +

    It performs an UPDATE if the record has a non-null primary key, and then, if no row was modified, an INSERT. It directly perfoms an INSERT if the record has no primary key, or a null primary key.

    + +

    Despite the fact that it may execute two SQL statements, save behaves as an atomic operation: GRDB won’t allow any concurrent thread to sneak in (see concurrency).

  • +
  • delete returns whether a database row was deleted or not.

  • +
+ +

All primary keys are supported, including composite primary keys that span several columns, and the implicit rowid primary key.

+

Customizing the Persistence Methods

+ +

Your custom type may want to perform extra work when the persistence methods are invoked.

+ +

For example, it may want to have its UUID automatically set before inserting. Or it may want to validate its values before saving.

+ +

When you subclass Record, you simply have to override the customized method, and call super:

+
class Player : Record {
+    var uuid: UUID?
+
+    override func insert(_ db: Database) throws {
+        if uuid == nil {
+            uuid = UUID()
+        }
+        try super.insert(db)
+    }
+}
+
+ +

If you use the raw PersistableRecord protocol, use one of the special methods performInsert, performUpdate, performSave, performDelete, or performExists:

+
struct Link : PersistableRecord {
+    var url: URL
+
+    func insert(_ db: Database) throws {
+        try validate()
+        try performInsert(db)
+    }
+
+    func update(_ db: Database, columns: Set<String>) throws {
+        try validate()
+        try performUpdate(db, columns: columns)
+    }
+
+    func validate() throws {
+        if url.host == nil {
+            throw ValidationError("url must be absolute.")
+        }
+    }
+}
+
+ +
+

:point_up: Note: the special methods performInsert, performUpdate, etc. are reserved for your custom implementations. Do not use them elsewhere. Do not provide another implementation for those methods.

+ +

:point_up: Note: it is recommended that you do not implement your own version of the save method. Its default implementation forwards the job to update or insert: these are the methods that may need customization, not save.

+
+

Codable Records

+ +

Record types that adopt an archival protocol (Codable, Encodable or Decodable) get free database support just by declaring conformance to the desired record protocols:

+
// Declare a record...
+struct Player: Codable, FetchableRecord, PersistableRecord {
+    var name: String
+    var score: Int
+}
+
+// ...and there you go:
+try dbQueue.write { db in
+    try Player(name: "Arthur", score: 100).insert(db)
+    let players = try Player.fetchAll(db)
+}
+
+ +

Codable records encode and decode their properties according to their own implementation of the Encodable and Decodable protocols. Yet databases have specific requirements:

+ +
    +
  • Properties are always coded according to their preferred database representation, when they have one (all values that adopt the DatabaseValueConvertible protocol).
  • +
  • You can customize the encoding and decoding of dates and uuids.
  • +
  • Complex properties (arrays, dictionaries, nested structs, etc.) are stored as JSON.
  • +
+ +

For more information about Codable records, see:

+ + + +
+

:bulb: Tip: see the Demo Application for a sample app that uses Codable records.

+
+

JSON Columns

+ +

When a Codable record contains a property that is not a simple value (Bool, Int, String, Date, Swift enums, etc.), that value is encoded and decoded as a JSON string. For example:

+
enum AchievementColor: String, Codable {
+    case bronze, silver, gold
+}
+
+struct Achievement: Codable {
+    var name: String
+    var color: AchievementColor
+}
+
+struct Player: Codable, FetchableRecord, PersistableRecord {
+    var name: String
+    var score: Int
+    var achievements: [Achievement] // stored in a JSON column
+}
+
+try! dbQueue.write { db in
+    // INSERT INTO player (name, score, achievements)
+    // VALUES (
+    //   'Arthur',
+    //   100,
+    //   '[{"color":"gold","name":"Use Codable Records"}]')
+    let achievement = Achievement(name: "Use Codable Records", color: .gold)
+    let player = Player(name: "Arthur", score: 100, achievements: [achievement])
+    try player.insert(db)
+}
+
+ +

GRDB uses the standard JSONDecoder and JSONEncoder from Foundation. By default, Data values are handled with the .base64 strategy, Date with the .millisecondsSince1970 strategy, and non conforming floats with the .throw strategy.

+ +

You can customize the JSON format by implementing those methods:

+
protocol FetchableRecord {
+    static func databaseJSONDecoder(for column: String) -> JSONDecoder
+}
+
+protocol EncodableRecord {
+    static func databaseJSONEncoder(for column: String) -> JSONEncoder
+}
+
+ +
+

:bulb: Tip: Make sure you set the JSONEncoder sortedKeys option, available from iOS 11.0+, macOS 10.13+, tvOS 9.0+ and watchOS 4.0+. This option makes sure that the JSON output is stable. This stability is required for Record Comparison to work as expected, and database observation tools such as ValueObservation to accurately recognize changed records.

+
+

Date and UUID Coding Strategies

+ +

By default, Codable Records encode and decode their Date and UUID properties as described in the general Date and DateComponents and UUID chapters.

+ +

To sum up: dates encode themselves in the “YYYY-MM-DD HH:MM:SS.SSS” format, in the UTC time zone, and decode a variety of date formats and timestamps. UUIDs encode themselves as 16-bytes data blobs, and decode both 16-bytes data blobs and strings such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”.

+ +

Those behaviors can be overridden:

+
protocol FetchableRecord {
+    static var databaseDateDecodingStrategy: DatabaseDateDecodingStrategy { get }
+}
+
+protocol EncodableRecord {
+    static var databaseDateEncodingStrategy: DatabaseDateEncodingStrategy { get }
+    static var databaseUUIDEncodingStrategy: DatabaseUUIDEncodingStrategy { get }
+}
+
+ +

See DatabaseDateDecodingStrategy, DatabaseDateEncodingStrategy, and DatabaseUUIDEncodingStrategy to learn about all available strategies.

+ +
+

:point_up: Note: there is no customization of uuid decoding, because UUID can already decode all its encoded variants (16-bytes blobs, and uuid strings).

+
+

The userInfo Dictionary

+ +

Your Codable Records can be stored in the database, but they may also have other purposes. In this case, you may need to customize their implementations of Decodable.init(from:) and Encodable.encode(to:), depending on the context.

+ +

The standard way to provide such context is the userInfo dictionary. Implement those properties:

+
protocol FetchableRecord {
+    static var databaseDecodingUserInfo: [CodingUserInfoKey: Any] { get }
+}
+
+protocol EncodableRecord {
+    static var databaseEncodingUserInfo: [CodingUserInfoKey: Any] { get }
+}
+
+ +

For example, here is a Player type that customizes its decoding:

+
// A key that holds a decoder's name
+let decoderName = CodingUserInfoKey(rawValue: "decoderName")!
+
+struct Player: FetchableRecord, Decodable {
+    init(from decoder: Decoder) throws {
+        // Print the decoder name
+        let decoderName = decoder.userInfo[decoderName] as? String
+        print("Decoded from \(decoderName ?? "unknown decoder")")
+        ...
+    }
+}
+
+ +

You can have a specific decoding from JSON…

+
// prints "Decoded from JSON"
+let decoder = JSONDecoder()
+decoder.userInfo = [decoderName: "JSON"]
+let player = try decoder.decode(Player.self, from: jsonData)
+
+ +

… and another one from database rows:

+
extension Player: FetchableRecord {
+    static let databaseDecodingUserInfo: [CodingUserInfoKey: Any] = [decoderName: "database row"]
+}
+
+// prints "Decoded from database row"
+let player = try Player.fetchOne(db, ...)
+
+ +
+

:point_up: Note: make sure the databaseDecodingUserInfo and databaseEncodingUserInfo properties are explicitly declared as [CodingUserInfoKey: Any]. If they are not, the Swift compiler may silently miss the protocol requirement, resulting in sticky empty userInfo.

+
+

Tip: Derive Columns from Coding Keys

+ +

Codable types are granted with a CodingKeys enum. You can use them to safely define database columns:

+
struct Player: Codable {
+    var id: Int64
+    var name: String
+    var score: Int
+}
+
+extension Player: FetchableRecord, PersistableRecord {
+    enum Columns {
+        static let id = Column(CodingKeys.id)
+        static let name = Column(CodingKeys.name)
+        static let score = Column(CodingKeys.score)
+    }
+}
+
+ +

See the query interface and Good Practices for Designing Record Types for further information.

+

Record Class

+ +

Record is a class that is designed to be subclassed. It inherits its features from the FetchableRecord, TableRecord, and PersistableRecord protocols. On top of that, Record instances can compare against previous versions of themselves in order to avoid useless updates.

+ +

Record subclasses define their custom database relationship by overriding database methods. For example:

+
class Place: Record {
+    var id: Int64?
+    var title: String
+    var isFavorite: Bool
+    var coordinate: CLLocationCoordinate2D
+
+    init(id: Int64?, title: String, isFavorite: Bool, coordinate: CLLocationCoordinate2D) {
+        self.id = id
+        self.title = title
+        self.isFavorite = isFavorite
+        self.coordinate = coordinate
+        super.init()
+    }
+
+    /// The table name
+    override class var databaseTableName: String {
+        return "place"
+    }
+
+    /// The table columns
+    enum Columns: String, ColumnExpression {
+        case id, title, favorite, latitude, longitude
+    }
+
+    /// Creates a record from a database row
+    required init(row: Row) {
+        id = row[Columns.id]
+        title = row[Columns.title]
+        isFavorite = row[Columns.favorite]
+        coordinate = CLLocationCoordinate2D(
+            latitude: row[Columns.latitude],
+            longitude: row[Columns.longitude])
+        super.init(row: row)
+    }
+
+    /// The values persisted in the database
+    override func encode(to container: inout PersistenceContainer) {
+        container[Columns.id] = id
+        container[Columns.title] = title
+        container[Columns.favorite] = isFavorite
+        container[Columns.latitude] = coordinate.latitude
+        container[Columns.longitude] = coordinate.longitude
+    }
+
+    /// Update record ID after a successful insertion
+    override func didInsert(with rowID: Int64, for column: String?) {
+        id = rowID
+    }
+}
+
+

Record Comparison

+ +

Records that adopt the EncodableRecord protocol can compare against other records, or against previous versions of themselves.

+ +

This helps avoiding costly UPDATE statements when a record has not been edited.

+ + +

The updateChanges Methods

+ +

The updateChanges methods perform a database update of the changed columns only (and does nothing if record has no change).

+ +
    +
  • updateChanges(_:from:)

    + +

    This method lets you compare two records:

    +
    if let oldPlayer = try Player.fetchOne(db, key: 42) {
    +    var newPlayer = oldPlayer
    +    newPlayer.score = 100
    +    if try newPlayer.updateChanges(db, from: oldPlayer) {
    +        print("player was modified, and updated in the database")
    +    } else {
    +        print("player was not modified, and database was not hit")
    +    }
    +}
    +
  • +
  • updateChanges(_:with:)

    + +

    This method lets you update a record in place:

    +
    if var player = try Player.fetchOne(db, key: 42) {
    +    let modified = try player.updateChanges(db) {
    +        $0.score = 100
    +    }
    +    if modified {
    +        print("player was modified, and updated in the database")
    +    } else {
    +        print("player was not modified, and database was not hit")
    +    }
    +}
    +
  • +
  • updateChanges(_:) (Record class only)

    + +

    Instances of the Record class are able to compare against themselves, and know if they have changes that have not been saved since the last fetch or saving:

    +
    // Record class only
    +if let player = try Player.fetchOne(db, key: 42) {
    +    player.score = 100
    +    if try player.updateChanges(db) {
    +        print("player was modified, and updated in the database")
    +    } else {
    +        print("player was not modified, and database was not hit")
    +    }
    +}
    +
  • +
+

The databaseEquals Method

+ +

This method returns whether two records have the same database representation:

+
let oldPlayer: Player = ...
+var newPlayer: Player = ...
+if newPlayer.databaseEquals(oldPlayer) == false {
+    try newPlayer.save(db)
+}
+
+ +
+

:point_up: Note: The comparison is performed on the database representation of records. As long as your record type adopts the EncodableRecord protocol, you don’t need to care about Equatable.

+
+

The databaseChanges and hasDatabaseChanges Methods

+ +

databaseChanges(from:) returns a dictionary of differences between two records:

+
let oldPlayer = Player(id: 1, name: "Arthur", score: 100)
+let newPlayer = Player(id: 1, name: "Arthur", score: 1000)
+for (column, oldValue) in newPlayer.databaseChanges(from: oldPlayer) {
+    print("\(column) was \(oldValue)")
+}
+// prints "score was 100"
+
+ +

The Record class is able to compare against itself:

+
// Record class only
+let player = Player(id: 1, name: "Arthur", score: 100)
+try player.insert(db)
+player.score = 1000
+for (column, oldValue) in player.databaseChanges {
+    print("\(column) was \(oldValue)")
+}
+// prints "score was 100"
+
+ +

Record instances also have a hasDatabaseChanges property:

+
// Record class only
+player.score = 1000
+if player.hasDatabaseChanges {
+    try player.save(db)
+}
+
+ +

Record.hasDatabaseChanges is false after a Record instance has been fetched or saved into the database. Subsequent modifications may set it, or not: hasDatabaseChanges is based on value comparison. Setting a property to the same value does not set the changed flag:

+
let player = Player(name: "Barbara", score: 750)
+player.hasDatabaseChanges // true
+
+try player.insert(db)
+player.hasDatabaseChanges // false
+
+player.name = "Barbara"
+player.hasDatabaseChanges // false
+
+player.score = 1000
+player.hasDatabaseChanges // true
+player.databaseChanges    // ["score": 750]
+
+ +

For an efficient algorithm which synchronizes the content of a database table with a JSON payload, check JSONSynchronization.playground.

+

Record Customization Options

+ +

GRDB records come with many default behaviors, that are designed to fit most situations. Many of those defaults can be customized for your specific needs:

+ + + +

Codable Records have a few extra options:

+ + +

Conflict Resolution

+ +

Insertions and updates can create conflicts: for example, a query may attempt to insert a duplicate row that violates a unique index.

+ +

Those conflicts normally end with an error. Yet SQLite let you alter the default behavior, and handle conflicts with specific policies. For example, the INSERT OR REPLACE statement handles conflicts with the “replace” policy which replaces the conflicting row instead of throwing an error.

+ +

The five different policies are: abort (the default), replace, rollback, fail, and ignore.

+ +

SQLite let you specify conflict policies at two different places:

+ +
    +
  • In the definition of the database table:

    +
    // CREATE TABLE player (
    +//     id INTEGER PRIMARY KEY AUTOINCREMENT,
    +//     email TEXT UNIQUE ON CONFLICT REPLACE
    +// )
    +try db.create(table: "player") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("email", .text).unique(onConflict: .replace) // <--
    +}
    +
    +// Despite the unique index on email, both inserts succeed.
    +// The second insert replaces the first row:
    +try db.execute(sql: "INSERT INTO player (email) VALUES (?)", arguments: ["arthur@example.com"])
    +try db.execute(sql: "INSERT INTO player (email) VALUES (?)", arguments: ["arthur@example.com"])
    +
  • +
  • In each modification query:

    +
    // CREATE TABLE player (
    +//     id INTEGER PRIMARY KEY AUTOINCREMENT,
    +//     email TEXT UNIQUE
    +// )
    +try db.create(table: "player") { t in
    +    t.autoIncrementedPrimaryKey("id")
    +    t.column("email", .text).unique()
    +}
    +
    +// Again, despite the unique index on email, both inserts succeed.
    +try db.execute(sql: "INSERT OR REPLACE INTO player (email) VALUES (?)", arguments: ["arthur@example.com"])
    +try db.execute(sql: "INSERT OR REPLACE INTO player (email) VALUES (?)", arguments: ["arthur@example.com"])
    +
  • +
+ +

When you want to handle conflicts at the query level, specify a custom persistenceConflictPolicy in your type that adopts the PersistableRecord protocol. It will alter the INSERT and UPDATE queries run by the insert, update and save persistence methods:

+
protocol MutablePersistableRecord {
+    /// The policy that handles SQLite conflicts when records are
+    /// inserted or updated.
+    ///
+    /// This property is optional: its default value uses the ABORT
+    /// policy for both insertions and updates, so that GRDB generate
+    /// regular INSERT and UPDATE queries.
+    static var persistenceConflictPolicy: PersistenceConflictPolicy { get }
+}
+
+struct Player : MutablePersistableRecord {
+    static let persistenceConflictPolicy = PersistenceConflictPolicy(
+        insert: .replace,
+        update: .replace)
+}
+
+// INSERT OR REPLACE INTO player (...) VALUES (...)
+try player.insert(db)
+
+ +
+

:point_up: Note: the ignore policy does not play well at all with the didInsert method which notifies the rowID of inserted records. Choose your poison:

+ +
    +
  • if you specify the ignore policy in the database table definition, don’t implement the didInsert method: it will be called with some random id in case of failed insert.
  • +
  • if you specify the ignore policy at the query level, the didInsert method is never called.
  • +
+ +

:point_up: Note: The replace policy may have to delete rows so that inserts and updates can succeed. Those deletions are not reported to transaction observers (this might change in a future release of SQLite).

+
+

The Implicit RowID Primary Key

+ +

All SQLite tables have a primary key. Even when the primary key is not explicit:

+
// No explicit primary key
+try db.create(table: "event") { t in
+    t.column("message", .text)
+    t.column("date", .datetime)
+}
+
+// No way to define an explicit primary key
+try db.create(virtualTable: "book", using: FTS4()) { t in
+    t.column("title")
+    t.column("author")
+    t.column("body")
+}
+
+ +

The implicit primary key is stored in the hidden column rowid. Hidden means that SELECT * does not select it, and yet it can be selected and queried: SELECT *, rowid ... WHERE rowid = 1.

+ +

Some GRDB methods will automatically use this hidden column when a table has no explicit primary key:

+
// SELECT * FROM event WHERE rowid = 1
+let event = try Event.fetchOne(db, key: 1)
+
+// DELETE FROM book WHERE rowid = 1
+try Book.deleteOne(db, key: 1)
+
+

Exposing the RowID Column

+ +

By default, a record type that wraps a table without any explicit primary key doesn’t know about the hidden rowid column.

+ +

Without primary key, records don’t have any identity, and the persistence method can behave in undesired fashion: update() throws errors, save() always performs insertions and may break constraints, exists() is always false.

+ +

When SQLite won’t let you provide an explicit primary key (as in full-text tables, for example), you may want to make your record type fully aware of the hidden rowid column:

+ +
    +
  1. Have the databaseSelection static property (from the TableRecord protocol) return the hidden rowid column:

    +
    struct Event : TableRecord {
    +    static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID]
    +}
    +
    +// When you subclass Record, you need an override:
    +class Book : Record {
    +    override class var databaseSelection: [SQLSelectable] {
    +        return [AllColums(), Column.rowID]
    +    }
    +}
    +
    + +

    GRDB will then select the rowid column by default:

    +
    // SELECT *, rowid FROM event
    +let events = try Event.fetchAll(db)
    +
  2. +
  3. Have init(row:) from the FetchableRecord protocol consume the “rowid” column:

    +
    struct Event : FetchableRecord {
    +    var id: Int64?
    +
    +    init(row: Row) {
    +        id = row[Column.rowID]
    +    }
    +}
    +
    + +

    Your fetched records will then know their ids:

    +
    let event = try Event.fetchOne(db)!
    +event.id // some value
    +
  4. +
  5. Encode the rowid in encode(to:), and keep it in the didInsert(with:for:) method (both from the PersistableRecord and MutablePersistableRecord protocols):

    +
    struct Event : MutablePersistableRecord {
    +    var id: Int64?
    +
    +    func encode(to container: inout PersistenceContainer) {
    +        container[Column.rowID] = id
    +        container["message"] = message
    +        container["date"] = date
    +    }
    +
    +    // Update auto-incremented id upon successful insertion
    +    mutating func didInsert(with rowID: Int64, for column: String?) {
    +        id = rowID
    +    }
    +}
    +
    + +

    You will then be able to track your record ids, update them, or check for their existence:

    +
    let event = Event(message: "foo", date: Date())
    +
    +// Insertion sets the record id:
    +try event.insert(db)
    +event.id // some value
    +
    +// Record can be updated:
    +event.message = "bar"
    +try event.update(db)
    +
    +// Record knows if it exists:
    +event.exists(db) // true
    +
  6. +
+

Beyond FetchableRecord

+ +

Some GRDB users eventually discover that the FetchableRecord protocol does not fit all situations. Use cases that are not well handled by FetchableRecord include:

+ +
    +
  • Your application needs polymorphic row decoding: it decodes some type or another, depending on the values contained in a database row.

  • +
  • Your application needs to decode rows with a context: each decoded value should be initialized with some extra value that does not come from the database.

  • +
  • Your application needs a record type that supports untrusted databases, and may fail at decoding database rows (throw an error when a row contains invalid values).

  • +
+ +

Since those use cases are not well handled by FetchableRecord, don’t try to implement them on top of this protocol: you’ll just fight the framework.

+ +

Instead, please have a look at the CustomizedDecodingOfDatabaseRows playground. You’ll run some sample code, and learn how to escape FetchableRecord when you need. And remember that leaving FetchableRecord will not deprive you of query interface requests and generally all SQL generation features of the TableRecord and PersistableRecord protocols.

+

Examples of Record Definitions

+ +

We will show below how to declare a record type for the following database table:

+
try dbQueue.write { db in
+    try db.create(table: "place") { t in
+        t.autoIncrementedPrimaryKey("id")
+        t.column("title", .text).notNull()
+        t.column("isFavorite", .boolean).notNull().defaults(to: false)
+        t.column("longitude", .double).notNull()
+        t.column("latitude", .double).notNull()
+    }
+}
+
+ +

Each one of the three examples below is correct. You will pick one or the other depending on your personal preferences and the requirements of your application:

+ +
+ Define a Codable struct, and adopt the record protocols you need + +This is the shortest way to define a record type. + +See the [Record Protocols Overview](#record-protocols-overview), and [Codable Records] for more information. + +“`swift +struct Place: Codable { + var id: Int64? + var title: String + var isFavorite: Bool + private var latitude: CLLocationDegrees + private var longitude: CLLocationDegrees + + var coordinate: CLLocationCoordinate2D { + get { + return CLLocationCoordinate2D( + latitude: latitude, + longitude: longitude) + } + set { + latitude = newValue.latitude + longitude = newValue.longitude + } + } +} + +// SQL generation +extension Place: TableRecord { + /// The table columns + enum Columns { + static let id = Column(CodingKeys.id) + static let title = Column(CodingKeys.title) + static let isFavorite = Column(CodingKeys.isFavorite) + static let latitude = Column(CodingKeys.latitude) + static let longitude = Column(CodingKeys.longitude) + } +} + +// Fetching methods +extension Place: FetchableRecord { } + +// Persistence methods +extension Place: MutablePersistableRecord { + // Update auto-incremented id upon successful insertion + mutating func didInsert(with rowID: Int64, for column: String?) { + id = rowID + } +} +”` + +
+ +
+ Define a plain struct, and adopt the record protocols you need + +See the [Record Protocols Overview](#record-protocols-overview) for more information. + +“`swift +struct Place { + var id: Int64? + var title: String + var isFavorite: Bool + var coordinate: CLLocationCoordinate2D +} + +// SQL generation +extension Place: TableRecord { + /// The table columns + enum Columns: String, ColumnExpression { + case id, title, isFavorite, latitude, longitude + } +} + +// Fetching methods +extension Place: FetchableRecord { + /// Creates a record from a database row + init(row: Row) { + id = row[Columns.id] + title = row[Columns.title] + isFavorite = row[Columns.isFavorite] + coordinate = CLLocationCoordinate2D( + latitude: row[Columns.latitude], + longitude: row[Columns.longitude]) + } +} + +// Persistence methods +extension Place: MutablePersistableRecord { + /// The values persisted in the database + func encode(to container: inout PersistenceContainer) { + container[Columns.id] = id + container[Columns.title] = title + container[Columns.isFavorite] = isFavorite + container[Columns.latitude] = coordinate.latitude + container[Columns.longitude] = coordinate.longitude + } + + // Update auto-incremented id upon successful insertion + mutating func didInsert(with rowID: Int64, for column: String?) { + id = rowID + } +} +”` + +
+ +
+ Define a plain struct optimized for fetching performance + +This struct derives is persistence methpds from the standard Encodable protocol (see [Codable Records]), but performs optimized row decoding by accessing database columns with numeric indexes. + +See the [Record Protocols Overview](#record-protocols-overview) for more information. + +“`swift +struct Place: Encodable { + var id: Int64? + var title: String + var isFavorite: Bool + private var latitude: CLLocationDegrees + private var longitude: CLLocationDegrees + + var coordinate: CLLocationCoordinate2D { + get { + return CLLocationCoordinate2D( + latitude: latitude, + longitude: longitude) + } + set { + latitude = newValue.latitude + longitude = newValue.longitude + } + } +} + +// SQL generation +extension Place: TableRecord { + /// The table columns + enum Columns { + static let id = Column(CodingKeys.id) + static let title = Column(CodingKeys.title) + static let isFavorite = Column(CodingKeys.isFavorite) + static let latitude = Column(CodingKeys.latitude) + static let longitude = Column(CodingKeys.longitude) + } + + /// Arrange the selected columns and lock their order + static let databaseSelection: [SQLSelectable] = [ + Columns.id, + Columns.title, + Columns.favorite, + Columns.latitude, + Columns.longitude] +} + +// Fetching methods +extension Place: FetchableRecord { + /// Creates a record from a database row + init(row: Row) { + // For high performance, use numeric indexes that match the + // order of Place.databaseSelection + id = row[0] + title = row[1] + isFavorite = row[2] + coordinate = CLLocationCoordinate2D( + latitude: row[3], + longitude: row[4]) + } +} + +// Persistence methods +extension Place: MutablePersistableRecord { + // Update auto-incremented id upon successful insertion + mutating func didInsert(with rowID: Int64, for column: String?) { + id = rowID + } +} +”` + +
+ +
+ Subclass the Record class + +See the [Record class](#record-class) for more information. + +“`swift +class Place: Record { + var id: Int64? + var title: String + var isFavorite: Bool + var coordinate: CLLocationCoordinate2D + + init(id: Int64?, title: String, isFavorite: Bool, coordinate: CLLocationCoordinate2D) { + self.id = id + self.title = title + self.isFavorite = isFavorite + self.coordinate = coordinate + super.init() + } + + /// The table name + override class var databaseTableName: String { + return "place” + } + + /// The table columns + enum Columns: String, ColumnExpression { + case id, title, isFavorite, latitude, longitude + } + + /// Creates a record from a database row + required init(row: Row) { + id = row[Columns.id] + title = row[Columns.title] + isFavorite = row[Columns.isFavorite] + coordinate = CLLocationCoordinate2D( + latitude: row[Columns.latitude], + longitude: row[Columns.longitude]) + super.init(row: row) + } + + /// The values persisted in the database + override func encode(to container: inout PersistenceContainer) { + container[Columns.id] = id + container[Columns.title] = title + container[Columns.isFavorite] = isFavorite + container[Columns.latitude] = coordinate.latitude + container[Columns.longitude] = coordinate.longitude + } + + // Update auto-incremented id upon successful insertion + override func didInsert(with rowID: Int64, for column: String?) { + id = rowID + } +} +“` + +
+

List of Record Methods

+ +

This is the list of record methods, along with their required protocols. The Record class adopts all these protocols, and adds a few extra methods.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodProtocolsNotes
Core Methods
init(row:)FetchableRecord
Type.databaseTableNameTableRecord
Type.databaseSelectionTableRecord*
Type.persistenceConflictPolicyPersistableRecord*
record.encode(to:)EncodableRecord
record.didInsert(with:for:)PersistableRecord
Insert and Update Records
record.insert(db)PersistableRecord
record.save(db)PersistableRecord
record.update(db)PersistableRecord
record.update(db, columns:...)PersistableRecord
record.updateChanges(db, from:...)PersistableRecord*
record.updateChanges(db) { ... }PersistableRecord*
record.updateChanges(db)Record*
Type.updateAll(db, ...)PersistableRecord
Type.filter(...).updateAll(db, ...)PersistableRecord²
Delete Records
record.delete(db)PersistableRecord
Type.deleteOne(db, key:...)PersistableRecord¹
Type.deleteAll(db)PersistableRecord
Type.deleteAll(db, keys:...)PersistableRecord¹
Type.filter(...).deleteAll(db)PersistableRecord²
Check Record Existence
record.exists(db)PersistableRecord
Convert Record to Dictionary
record.databaseDictionaryEncodableRecord
Count Records
Type.fetchCount(db)TableRecord
Type.filter(...).fetchCount(db)TableRecord²
Fetch Record Cursors
Type.fetchCursor(db)FetchableRecord & TableRecord
Type.fetchCursor(db, keys:...)FetchableRecord & TableRecord¹
Type.fetchCursor(db, sql: sql)FetchableRecord³
Type.fetchCursor(statement)FetchableRecord⁴
Type.filter(...).fetchCursor(db)FetchableRecord & TableRecord²
Fetch Record Arrays
Type.fetchAll(db)FetchableRecord & TableRecord
Type.fetchAll(db, keys:...)FetchableRecord & TableRecord¹
Type.fetchAll(db, sql: sql)FetchableRecord³
Type.fetchAll(statement)FetchableRecord⁴
Type.filter(...).fetchAll(db)FetchableRecord & TableRecord²
Fetch Individual Records
Type.fetchOne(db)FetchableRecord & TableRecord
Type.fetchOne(db, key:...)FetchableRecord & TableRecord¹
Type.fetchOne(db, sql: sql)FetchableRecord³
Type.fetchOne(statement)FetchableRecord⁴
Type.filter(...).fetchOne(db)FetchableRecord & TableRecord²
Codable Records
Type.databaseDecodingUserInfoFetchableRecord*
Type.databaseJSONDecoder(for:)FetchableRecord*
Type.databaseDateDecodingStrategyFetchableRecord*
Type.databaseEncodingUserInfoEncodableRecord*
Type.databaseJSONEncoder(for:)EncodableRecord*
Type.databaseDateEncodingStrategyEncodableRecord*
Type.databaseUUIDEncodingStrategyEncodableRecord*
Define Associations
Type.belongsTo(...)TableRecord*
Type.hasMany(...)TableRecord*
Type.hasOne(...)TableRecord*
Type.hasManyThrough(...)TableRecord*
Type.hasOneThrough(...)TableRecord*
Building Query Interface Requests
record.request(for:...)TableRecord & EncodableRecord*
Type.all()TableRecord²
Type.none()TableRecord²
Type.select(...)TableRecord²
Type.select(..., as:...)TableRecord²
Type.annotated(with:...)TableRecord²
Type.filter(...)TableRecord²
Type.matching(...)TableRecord²
Type.including(all:)TableRecord²
Type.including(optional:)TableRecord²
Type.including(required:)TableRecord²
Type.joining(optional:)TableRecord²
Type.joining(required:)TableRecord²
Type.order(...)TableRecord²
Type.orderByPrimaryKey()TableRecord²
Type.having(...)TableRecord²
Type.limit(...)TableRecord²
Record Comparison
record.databaseEquals(...)EncodableRecord
record.databaseChanges(from:...)EncodableRecord
record.updateChanges(db, from:...)PersistableRecord
record.updateChanges(db) { ... }PersistableRecord
record.hasDatabaseChangesRecord
record.databaseChangesRecord
record.updateChanges(db)Record
+ +

¹ All unique keys are supported: primary keys (single-column, composite, implicit RowID) and unique indexes:

+
try Player.fetchOne(db, key: 1)                               // Player?
+try Player.fetchOne(db, key: ["email": "arthur@example.com"]) // Player?
+try Country.fetchAll(db, keys: ["FR", "US"])                  // [Country]
+
+ +

² See Fetch Requests:

+
let request = Player.filter(emailColumn != nil).order(nameColumn)
+let players = try request.fetchAll(db)  // [Player]
+let count = try request.fetchCount(db)  // Int
+
+ +

³ See SQL queries:

+
let player = try Player.fetchOne(db, sql: "SELECT * FROM player WHERE id = ?", arguments: [1]) // Player?
+
+ +

⁴ See Prepared Statements:

+
let statement = try db.makeSelectStatement(sql: "SELECT * FROM player WHERE id = ?")
+let player = try Player.fetchOne(statement, arguments: [1])  // Player?
+
+

The Query Interface

+ +

The query interface lets you write pure Swift instead of SQL:

+
try dbQueue.write { db in
+    // Update database schema
+    try db.create(table: "wine") { t in ... }
+
+    // Fetch records
+    let wines = try Wine
+        .filter(originColumn == "Burgundy")
+        .order(priceColumn)
+        .fetchAll(db)
+
+    // Count
+    let count = try Wine
+        .filter(colorColumn == Color.red)
+        .fetchCount(db)
+
+    // Update
+    try Wine
+        .filter(originColumn == "Burgundy")
+        .updateAll(db, priceColumn *= 0.75)
+
+    // Delete
+    try Wine
+        .filter(corkedColumn == true)
+        .deleteAll(db)
+}
+
+ +

You need to open a database connection before you can query the database.

+ +

Please bear in mind that the query interface can not generate all possible SQL queries. You may also prefer writing SQL, and this is just OK. From little snippets to full queries, your SQL skills are welcome:

+
try dbQueue.write { db in
+    // Update database schema (with SQL)
+    try db.execute(sql: "CREATE TABLE wine (...)")
+
+    // Fetch records (with SQL)
+    let wines = try Wine.fetchAll(db,
+        sql: "SELECT * FROM wine WHERE origin = ? ORDER BY price",
+        arguments: ["Burgundy"])
+
+    // Count (with an SQL snippet)
+    let count = try Wine
+        .filter(sql: "color = ?", arguments: [Color.red])
+        .fetchCount(db)
+
+    // Update (with SQL)
+    try db.execute(sql: "UPDATE wine SET price = price * 0.75 WHERE origin = 'Burgundy'")
+
+    // Delete (with SQL)
+    try db.execute(sql: "DELETE FROM wine WHERE corked")
+}
+
+ +

So don’t miss the SQL API.

+ +
+

:point_up: Note: the generated SQL may change between GRDB releases, without notice: don’t have your application rely on any specific SQL output.

+
+ + +

Database Schema

+ +

Once granted with a database connection, you can setup your database schema without writing SQL:

+ + +

Create Tables

+
// CREATE TABLE place (
+//   id INTEGER PRIMARY KEY AUTOINCREMENT,
+//   title TEXT,
+//   favorite BOOLEAN NOT NULL DEFAULT 0,
+//   latitude DOUBLE NOT NULL,
+//   longitude DOUBLE NOT NULL
+// )
+try db.create(table: "place") { t in
+    t.autoIncrementedPrimaryKey("id")
+    t.column("title", .text)
+    t.column("favorite", .boolean).notNull().defaults(to: false)
+    t.column("longitude", .double).notNull()
+    t.column("latitude", .double).notNull()
+}
+
+ +

The create(table:) method covers nearly all SQLite table creation features. For virtual tables, see Full-Text Search, or use raw SQL.

+ +

SQLite itself has many reference documents about table creation: CREATE TABLE, Datatypes In SQLite Version 3, SQLite Foreign Key Support, ON CONFLICT, The WITHOUT ROWID Optimization.

+ +

Configure table creation:

+
// CREATE TABLE example ( ... )
+try db.create(table: "example") { t in ... }
+
+// CREATE TEMPORARY TABLE example IF NOT EXISTS (
+try db.create(table: "example", temporary: true, ifNotExists: true) { t in ... }
+
+ +
+

:bulb: Tip: database table names should be singular, and camel-cased. Make them look like Swift identifiers: place, country, postalAddress, ‘httpRequest’.

+ +

This will help you using Associations when you need them. Database table names that follow another naming convention are totally OK, but you will need to perform extra configuration.

+
+ +

Add regular columns with their name and eventual type (text, integer, double, numeric, boolean, blob, date and datetime) - see SQLite data types:

+
// CREATE TABLE example (
+//   a,
+//   name TEXT,
+//   creationDate DATETIME,
+try db.create(table: "example") { t in
+    t.column("a")
+    t.column("name", .text)
+    t.column("creationDate", .datetime)
+
+ +

Define not null columns, and set default values:

+
    // email TEXT NOT NULL,
+    t.column("email", .text).notNull()
+
+    // name TEXT NOT NULL DEFAULT 'Anonymous',
+    t.column("name", .text).notNull().defaults(to: "Anonymous")
+
+ +

Use an individual column as primary, unique, or foreign key. When defining a foreign key, the referenced column is the primary key of the referenced table (unless you specify otherwise):

+
    // id INTEGER PRIMARY KEY AUTOINCREMENT,
+    t.autoIncrementedPrimaryKey("id")
+
+    // uuid TEXT PRIMARY KEY,
+    t.column("uuid", .text).primaryKey()
+
+    // email TEXT UNIQUE,
+    t.column("email", .text).unique()
+
+    // countryCode TEXT REFERENCES country(code) ON DELETE CASCADE,
+    t.column("countryCode", .text).references("country", onDelete: .cascade)
+
+ +
+

:bulb: Tip: when you need an integer primary key that automatically generates unique values, it is highly recommended that you use the autoIncrementedPrimaryKey method:

+
try db.create(table: "example") { t in
+    t.autoIncrementedPrimaryKey("id")
+    ...
+}
+
+ +

The reason for this recommendation is that auto-incremented primary keys prevent the reuse of ids. This prevents your app or database observation tools to think that a row was updated, when it was actually deleted, then replaced. Depending on your application needs, this may be acceptable. But usually it is not.

+
+ +

Create an index on the column:

+
    t.column("score", .integer).indexed()
+
+ +

For extra index options, see Create Indexes below.

+ +

Perform integrity checks on individual columns, and SQLite will only let conforming rows in. In the example below, the $0 closure variable is a column which lets you build any SQL expression.

+
    // name TEXT CHECK (LENGTH(name) > 0)
+    // score INTEGER CHECK (score > 0)
+    t.column("name", .text).check { length($0) > 0 }
+    t.column("score", .integer).check(sql: "score > 0")
+
+ +

Other table constraints can involve several columns:

+
    // PRIMARY KEY (a, b),
+    t.primaryKey(["a", "b"])
+
+    // UNIQUE (a, b) ON CONFLICT REPLACE,
+    t.uniqueKey(["a", "b"], onConfict: .replace)
+
+    // FOREIGN KEY (a, b) REFERENCES parents(c, d),
+    t.foreignKey(["a", "b"], references: "parents")
+
+    // CHECK (a + b < 10),
+    t.check(Column("a") + Column("b") < 10)
+
+    // CHECK (a + b < 10)
+    t.check(sql: "a + b < 10")
+}
+
+

Modify Tables

+ +

SQLite lets you rename tables, and add columns to existing tables:

+
// ALTER TABLE referer RENAME TO referrer
+try db.rename(table: "referer", to: "referrer")
+
+// ALTER TABLE player ADD COLUMN url TEXT
+try db.alter(table: "player") { t in
+    t.add(column: "url", .text)
+}
+
+ +
+

:point_up: Note: SQLite restricts the possible table alterations, and may require you to recreate dependent triggers or views. See the documentation of the ALTER TABLE for details. See Advanced Database Schema Changes for a way to lift restrictions.

+
+

Drop Tables

+ +

Drop tables with the drop(table:) method:

+
try db.drop(table: "obsolete")
+
+

Create Indexes

+ +

Create indexes with the create(index:) method:

+
// CREATE UNIQUE INDEX byEmail ON users(email)
+try db.create(index: "byEmail", on: "users", columns: ["email"], unique: true)
+
+ +

Relevant SQLite documentation:

+ + +

Requests

+ +

The query interface requests let you fetch values from the database:

+
let request = Player.filter(emailColumn != nil).order(nameColumn)
+let players = try request.fetchAll(db)  // [Player]
+let count = try request.fetchCount(db)  // Int
+
+ +

All requests start from a type that adopts the TableRecord protocol, such as a Record subclass (see Records):

+
class Player : Record { ... }
+
+ +

Declare the table columns that you want to use for filtering, or sorting:

+
let idColumn = Column("id")
+let nameColumn = Column("name")
+
+ +

You can also declare column enums, if you prefer:

+
// Columns.id and Columns.name can be used just as
+// idColumn and nameColumn declared above.
+enum Columns: String, ColumnExpression {
+    case id
+    case name
+}
+
+ +

You can now build requests with the following methods: all, none, select, distinct, filter, matching, group, having, order, reversed, limit, joining, including. All those methods return another request, which you can further refine by applying another method: Player.select(...).filter(...).order(...).

+ +
    +
  • all(), none(): the requests for all rows, or no row.

    +
    // SELECT * FROM player
    +Player.all()
    +
    + +

    By default, all columns are selected. See Columns Selected by a Request.

  • +
  • select(...) and select(..., as:) define the selected columns. See Columns Selected by a Request.

    +
    // SELECT name FROM player
    +Player.select(nameColumn, as: String.self)
    +
  • +
  • annotated(with: expression...) extends the selection.

    +
    // SELECT *, (score + bonus) AS total FROM player
    +Player.annotated(with: (scoreColumn + bonusColumn).forKey("total"))
    +
    + +

    Such annotations can help using Associations:

    +
    // SELECT player.*, team.name
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +let teamAlias = TableAlias()
    +let request = Player
    +    .annotated(with: teamAlias[nameColumn])
    +    .joining(required: Player.team.aliased(teamAlias))
    +
  • +
  • annotated(with: aggregate) extends the selection with association aggregates.

    +
    // SELECT team.*, COUNT(DISTINCT player.rowid) AS playerCount
    +// FROM team
    +// LEFT JOIN player ON player.teamId = team.id
    +// GROUP BY team.id
    +Team.annotated(with: Team.players.count)
    +
  • +
  • distinct() performs uniquing.

    +
    // SELECT DISTINCT name FROM player
    +Player.select(nameColumn, as: String.self).distinct()
    +
  • +
  • filter(expression) applies conditions.

    +
    // SELECT * FROM player WHERE id IN (1, 2, 3)
    +Player.filter([1,2,3].contains(idColumn))
    +
    +// SELECT * FROM player WHERE (name IS NOT NULL) AND (height > 1.75)
    +Player.filter(nameColumn != nil && heightColumn > 1.75)
    +
  • +
  • filter(key:) and filter(keys:) apply conditions on primary keys and unique keys:

    +
    // SELECT * FROM player WHERE id = 1
    +Player.filter(key: 1)
    +
    +// SELECT * FROM country WHERE isoCode IN ('FR', 'US')
    +Country.filter(keys: ["FR", "US"])
    +
    +// SELECT * FROM citizenship WHERE citizenId = 1 AND countryCode = 'FR'
    +Citizenship.filter(key: ["citizenId": 1, "countryCode": "FR"])
    +
    +// SELECT * FROM player WHERE email = 'arthur@example.com'
    +Player.filter(key: ["email": "arthur@example.com"])
    +
  • +
  • matching(pattern) performs full-text search.

    +
    // SELECT * FROM document WHERE document MATCH 'sqlite database'
    +let pattern = FTS3Pattern(matchingAllTokensIn: "SQLite database")
    +Document.matching(pattern)
    +
    + +

    When the pattern is nil, no row will match.

  • +
  • group(expression, ...) groups rows.

    +
    // SELECT name, MAX(score) FROM player GROUP BY name
    +Player
    +    .select(nameColumn, max(scoreColumn))
    +    .group(nameColumn)
    +
  • +
  • having(expression) applies conditions on grouped rows.

    +
    // SELECT team, MAX(score) FROM player GROUP BY team HAVING MIN(score) >= 1000
    +Player
    +    .select(teamColumn, max(scoreColumn))
    +    .group(teamColumn)
    +    .having(min(scoreColumn) >= 1000)
    +
  • +
  • having(aggregate) applies conditions on grouped rows, according to an association aggregate.

    +
    // SELECT team.*
    +// FROM team
    +// LEFT JOIN player ON player.teamId = team.id
    +// GROUP BY team.id
    +// HAVING COUNT(DISTINCT player.rowid) >= 5
    +Team.having(Team.players.count >= 5)
    +
  • +
  • order(ordering, ...) sorts.

    +
    // SELECT * FROM player ORDER BY name
    +Player.order(nameColumn)
    +
    +// SELECT * FROM player ORDER BY score DESC, name
    +Player.order(scoreColumn.desc, nameColumn)
    +
    + +

    SQLite considers NULL values to be smaller than any other values for sorting purposes. Hence, NULLs naturally appear at the beginning of an ascending ordering and at the end of a descending ordering. With a custom SQLite build, this can be changed using .ascNullsLast and .descNullsFirst:

    +
    // SELECT * FROM player ORDER BY score ASC NULLS LAST
    +Player.order(nameColumn.ascNullsLast)
    +
    + +

    Each order call clears any previous ordering:

    +
    // SELECT * FROM player ORDER BY name
    +Player.order(scoreColumn).order(nameColumn)
    +
  • +
  • orderByPrimaryKey() sorts by primary key:

    +
    // SELECT * FROM player ORDER BY id
    +Player.orderByPrimaryKey()
    +
    +// SELECT * FROM country ORDER BY code
    +Country.orderByPrimaryKey()
    +
    +// SELECT * FROM citizenship ORDER BY citizenId, countryCode
    +Citizenship.orderByPrimaryKey()
    +
  • +
  • reversed() reverses the eventual orderings.

    +
    // SELECT * FROM player ORDER BY score ASC, name DESC
    +Player.order(scoreColumn.desc, nameColumn).reversed()
    +
    + +

    If no ordering was already specified, this method has no effect:

    +
    // SELECT * FROM player
    +Player.all().reversed()
    +
  • +
  • limit(limit, offset: offset) limits and pages results.

    +
    // SELECT * FROM player LIMIT 5
    +Player.limit(5)
    +
    +// SELECT * FROM player LIMIT 5 OFFSET 10
    +Player.limit(5, offset: 10)
    +
  • +
  • joining(...) and including(...) fetch and join records through Associations.

    +
    // SELECT player.*, team.*
    +// FROM player
    +// JOIN team ON team.id = player.teamId
    +Player.including(required: Player.team)
    +
  • +
+ +

You can refine requests by chaining those methods:

+
// SELECT * FROM player WHERE (email IS NOT NULL) ORDER BY name
+Player.order(nameColumn).filter(emailColumn != nil)
+
+ +

The select, order, group, and limit methods ignore and replace previously applied selection, orderings, grouping, and limits. On the opposite, filter, matching, and having methods extend the query:

+
Player                          // SELECT * FROM player
+    .filter(nameColumn != nil)  // WHERE (name IS NOT NULL)
+    .filter(emailColumn != nil) //        AND (email IS NOT NULL)
+    .order(nameColumn)          // - ignored -
+    .reversed()                 // - ignored -
+    .order(scoreColumn)         // ORDER BY score
+    .limit(20, offset: 40)      // - ignored -
+    .limit(10)                  // LIMIT 10
+
+ +

Raw SQL snippets are also accepted, with eventual arguments:

+
// SELECT DATE(creationDate), COUNT(*) FROM player WHERE name = 'Arthur' GROUP BY date(creationDate)
+Player
+    .select(sql: "DATE(creationDate), COUNT(*)")
+    .filter(sql: "name = ?", arguments: ["Arthur"])
+    .group(sql: "DATE(creationDate)")
+
+

Columns Selected by a Request

+ +

By default, query interface requests select all columns:

+
// SELECT * FROM player
+let request = Player.all()
+
+ +

The selection can be changed for each individual requests, or for all requests built from a given type.

+ +

The select(...) and select(..., as:) methods change the selection of a single request (see Fetching from Requests for detailed information):

+
let request = Player.select(max(scoreColumn))
+let maxScore: Int? = try Int.fetchOne(db, request)
+
+ +

The default selection for a record type is controlled by the databaseSelection property:

+
struct RestrictedPlayer : TableRecord {
+    static let databaseTableName = "player"
+    static let databaseSelection: [SQLSelectable] = [Column("id"), Column("name")]
+}
+
+struct ExtendedPlayer : TableRecord {
+    static let databaseTableName = "player"
+    static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID]
+}
+
+// SELECT id, name FROM player
+let request = RestrictedPlayer.all()
+
+// SELECT *, rowid FROM player
+let request = ExtendedPlayer.all()
+
+ +
+

:point_up: Note: make sure the databaseSelection property is explicitly declared as [SQLSelectable]. If it is not, the Swift compiler may silently miss the protocol requirement, resulting in sticky SELECT * requests. To verify your setup, see the How do I print a request as SQL? FAQ.

+
+

Expressions

+ +

Feed requests with SQL expressions built from your Swift code:

+

SQL Operators

+ +
    +
  • =, <>, <, <=, >, >=, IS, IS NOT

    + +

    Comparison operators are based on the Swift operators ==, !=, ===, !==, <, <=, >, >=:

    +
    // SELECT * FROM player WHERE (name = 'Arthur')
    +Player.filter(nameColumn == "Arthur")
    +
    +// SELECT * FROM player WHERE (name IS NULL)
    +Player.filter(nameColumn == nil)
    +
    +// SELECT * FROM player WHERE (score IS 1000)
    +Player.filter(scoreColumn === 1000)
    +
    +// SELECT * FROM rectangle WHERE width < height
    +Rectangle.filter(widthColumn < heightColumn)
    +
    + +
    +

    :point_up: Note: SQLite string comparison, by default, is case-sensitive and not Unicode-aware. See string comparison if you need more control.

    +
  • +
  • *, /, +, -

    + +

    SQLite arithmetic operators are derived from their Swift equivalent:

    +
    // SELECT ((temperature * 1.8) + 32) AS farenheit FROM planet
    +Planet.select((temperatureColumn * 1.8 + 32).forKey("farenheit"))
    +
    + +
    +

    :point_up: Note: an expression like nameColumn + "rrr" will be interpreted by SQLite as a numerical addition (with funny results), not as a string concatenation.

    +
  • +
  • AND, OR, NOT

    + +

    The SQL logical operators are derived from the Swift &&, || and !:

    +
    // SELECT * FROM player WHERE ((NOT verified) OR (score < 1000))
    +Player.filter(!verifiedColumn || scoreColumn < 1000)
    +
    + +

    When you want to join a sequence of expressions with AND or OR operators, use joined(operator:):

    +
    // SELECT * FROM player WHERE (verified AND (score >= 1000) AND (name IS NOT NULL))
    +let conditions = [
    +    verifiedColumn,
    +    scoreColumn >= 1000,
    +    nameColumn != nil]
    +Player.filter(conditions.joined(operator: .and))
    +
    + +

    When the sequence is empty, joined(operator: .and) returns true, and joined(operator: .or) returns false:

    +
    // SELECT * FROM player WHERE 1
    +Player.filter([].joined(operator: .and))
    +
    +// SELECT * FROM player WHERE 0
    +Player.filter([].joined(operator: .or))
    +
  • +
  • BETWEEN, IN, NOT IN

    + +

    To check inclusion in a Swift sequence (array, set, range…), call the contains method:

    +
    // SELECT * FROM player WHERE id IN (1, 2, 3)
    +Player.filter([1, 2, 3].contains(idColumn))
    +
    +// SELECT * FROM player WHERE id NOT IN (1, 2, 3)
    +Player.filter(![1, 2, 3].contains(idColumn))
    +
    +// SELECT * FROM player WHERE score BETWEEN 0 AND 1000
    +Player.filter((0...1000).contains(scoreColumn))
    +
    +// SELECT * FROM player WHERE (score >= 0) AND (score < 1000)
    +Player.filter((0..<1000).contains(scoreColumn))
    +
    +// SELECT * FROM player WHERE initial BETWEEN 'A' AND 'N'
    +Player.filter(("A"..."N").contains(initialColumn))
    +
    +// SELECT * FROM player WHERE (initial >= 'A') AND (initial < 'N')
    +Player.filter(("A"..<"N").contains(initialColumn))
    +
    + +
    +

    :point_up: Note: SQLite string comparison, by default, is case-sensitive and not Unicode-aware. See string comparison if you need more control.

    +
  • +
  • LIKE

    + +

    The SQLite LIKE operator is available as the like method:

    +
    // SELECT * FROM player WHERE (email LIKE '%@example.com')
    +Player.filter(emailColumn.like("%@example.com"))
    +
    + +
    +

    :point_up: Note: the SQLite LIKE operator is case-insensitive but not Unicode-aware. For example, the expression 'a' LIKE 'A' is true but 'æ' LIKE 'Æ' is false.

    +
  • +
  • MATCH

    + +

    The full-text MATCH operator is available through FTS3Pattern (for FTS3 and FTS4 tables) and FTS5Pattern (for FTS5):

    + +

    FTS3 and FTS4:

    +
    let pattern = FTS3Pattern(matchingAllTokensIn: "SQLite database")
    +
    +// SELECT * FROM document WHERE document MATCH 'sqlite database'
    +Document.matching(pattern)
    +
    +// SELECT * FROM document WHERE content MATCH 'sqlite database'
    +Document.filter(contentColumn.match(pattern))
    +
    + +

    FTS5:

    +
    let pattern = FTS5Pattern(matchingAllTokensIn: "SQLite database")
    +
    +// SELECT * FROM document WHERE document MATCH 'sqlite database'
    +Document.matching(pattern)
    +
  • +
+

SQL Functions

+ +
    +
  • ABS, AVG, COUNT, LENGTH, MAX, MIN, SUM:

    + +

    Those are based on the abs, average, count, length, max, min and sum Swift functions:

    +
    // SELECT MIN(score), MAX(score) FROM player
    +Player.select(min(scoreColumn), max(scoreColumn))
    +
    +// SELECT COUNT(name) FROM player
    +Player.select(count(nameColumn))
    +
    +// SELECT COUNT(DISTINCT name) FROM player
    +Player.select(count(distinct: nameColumn))
    +
  • +
  • IFNULL

    + +

    Use the Swift ?? operator:

    +
    // SELECT IFNULL(name, 'Anonymous') FROM player
    +Player.select(nameColumn ?? "Anonymous")
    +
    +// SELECT IFNULL(name, email) FROM player
    +Player.select(nameColumn ?? emailColumn)
    +
  • +
  • LOWER, UPPER

    + +

    The query interface does not give access to those SQLite functions. Nothing against them, but they are not unicode aware.

    + +

    Instead, GRDB extends SQLite with SQL functions that call the Swift built-in string functions capitalized, lowercased, uppercased, localizedCapitalized, localizedLowercased and localizedUppercased:

    +
    Player.select(nameColumn.uppercased())
    +
    + +
    +

    :point_up: Note: When comparing strings, you’d rather use a collation:

    +
    let name: String = ...
    +
    +// Not recommended
    +nameColumn.uppercased() == name.uppercased()
    +
    +// Better
    +nameColumn.collating(.caseInsensitiveCompare) == name
    +
    +
  • +
  • Custom SQL functions and aggregates

    + +

    You can apply your own custom SQL functions and aggregates:

    +
    let f = DatabaseFunction("f", ...)
    +
    +// SELECT f(name) FROM player
    +Player.select(f.apply(nameColumn))
    +
  • +
+

Fetching from Requests

+ +

Once you have a request, you can fetch the records at the origin of the request:

+
// Some request based on `Player`
+let request = Player.filter(...)... // QueryInterfaceRequest<Player>
+
+// Fetch players:
+try request.fetchCursor(db) // A Cursor of Player
+try request.fetchAll(db)    // [Player]
+try request.fetchOne(db)    // Player?
+
+ +

For example:

+
let allPlayers = try Player.fetchAll(db)                            // [Player]
+let arthur = try Player.filter(nameColumn == "Arthur").fetchOne(db) // Player?
+
+ +

See fetching methods for information about the fetchCursor, fetchAll and fetchOne methods.

+ +

You sometimes want to fetch other values.

+ +

The simplest way is to use the request as an argument to a fetching method of the desired type:

+
// Fetch an Int
+let request = Player.select(max(scoreColumn))
+let maxScore = try Int.fetchOne(db, request) // Int?
+
+// Fetch a Row
+let request = Player.select(min(scoreColumn), max(scoreColumn))
+let row = try Row.fetchOne(db, request)!     // Row
+let minScore = row[0] as Int?
+let maxScore = row[1] as Int?
+
+ +

You can also change the request so that it knows the type it has to fetch:

+ +
    +
  • With asRequest(of:), useful when you use Associations:

    +
    struct BookInfo: FetchableRecord, Decodable {
    +    var book: Book
    +    var author: Author
    +}
    +
    +// A request of BookInfo
    +let request = Book
    +    .including(required: Book.author)
    +    .asRequest(of: BookInfo.self)
    +
    +let bookInfos = try dbQueue.read { db in
    +    try request.fetchAll(db) // [BookInfo]
    +}
    +
  • +
  • With select(..., as:), which is handy when you change the selection:

    +
    // A request of Int
    +let request = Player.select(max(scoreColumn), as: Int.self)
    +
    +let maxScore = try dbQueue.read { db in
    +    try request.fetchOne(db) // Int?
    +}
    +
  • +
+

Fetching By Key

+ +

Fetching records according to their primary key is a very common task. It has a shortcut which accepts any single-column primary key:

+
// SELECT * FROM player WHERE id = 1
+try Player.fetchOne(db, key: 1)              // Player?
+
+// SELECT * FROM player WHERE id IN (1, 2, 3)
+try Player.fetchAll(db, keys: [1, 2, 3])     // [Player]
+
+// SELECT * FROM country WHERE isoCode = 'FR'
+try Country.fetchOne(db, key: "FR")          // Country?
+
+// SELECT * FROM country WHERE isoCode IN ('FR', 'US')
+try Country.fetchAll(db, keys: ["FR", "US"]) // [Country]
+
+ +

When the table has no explicit primary key, GRDB uses the hidden "rowid” column:

+
// SELECT * FROM document WHERE rowid = 1
+try Document.fetchOne(db, key: 1)            // Document?
+
+ +

For multiple-column primary keys and unique keys defined by unique indexes, provide a dictionary:

+
// SELECT * FROM citizenship WHERE citizenId = 1 AND countryCode = 'FR'
+try Citizenship.fetchOne(db, key: ["citizenId": 1, "countryCode": "FR"]) // Citizenship?
+
+// SELECT * FROM player WHERE email = 'arthur@example.com'
+try Player.fetchOne(db, key: ["email": "arthur@example.com"])              // Player?
+
+ +

When you want to build a request and plan to fetch from it later, use the filter(key:) and filter(keys:) methods:

+
// SELECT * FROM player WHERE id = 1
+let request = Player.filter(key: 1)
+let player = try request.fetchOne(db)    // Player?
+
+// SELECT * FROM player WHERE id IN (1, 2, 3)
+let request = Player.filter(keys: [1, 2, 3])
+let players = try request.fetchAll(db)   // [Player]
+
+// SELECT * FROM country WHERE isoCode = 'FR'
+let request = Country.filter(key: "FR")
+let country = try request.fetchOne(db)   // Country?
+
+// SELECT * FROM country WHERE isoCode IN ('FR', 'US')
+let request = Country.filter(keys: ["FR", "US"])
+let countries = try request.fetchAll(db) // [Country]
+
+// SELECT * FROM citizenship WHERE citizenId = 1 AND countryCode = 'FR'
+let request = Citizenship.filter(key: ["citizenId": 1, "countryCode": "FR"])
+let citizenship = request.fetchOne(db)   // Citizenship?
+
+// SELECT * FROM player WHERE email = 'arthur@example.com'
+let request = Player.filter(key: ["email": "arthur@example.com"])
+let player = try request.fetchOne(db)    // Player?
+
+

Fetching Aggregated Values

+ +

Requests can count. The fetchCount() method returns the number of rows that would be returned by a fetch request:

+
// SELECT COUNT(*) FROM player
+let count = try Player.fetchCount(db) // Int
+
+// SELECT COUNT(*) FROM player WHERE email IS NOT NULL
+let count = try Player.filter(emailColumn != nil).fetchCount(db)
+
+// SELECT COUNT(DISTINCT name) FROM player
+let count = try Player.select(nameColumn).distinct().fetchCount(db)
+
+// SELECT COUNT(*) FROM (SELECT DISTINCT name, score FROM player)
+let count = try Player.select(nameColumn, scoreColumn).distinct().fetchCount(db)
+
+ +

Other aggregated values can also be selected and fetched (see SQL Functions):

+
let request = Player.select(max(scoreColumn))
+let maxScore = try Int.fetchOne(db, request) // Int?
+
+let request = Player.select(min(scoreColumn), max(scoreColumn))
+let row = try Row.fetchOne(db, request)!     // Row
+let minScore = row[0] as Int?
+let maxScore = row[1] as Int?
+
+

Delete Requests

+ +

Requests can delete records, with the deleteAll() method:

+
// DELETE FROM player
+try Player.deleteAll(db)
+
+// DELETE FROM player WHERE team = 'red'
+try Player
+    .filter(teamColumn == "red")
+    .deleteAll(db)
+
+// DELETE FROM player ORDER BY score LIMIT 10
+try Player
+    .order(scoreColumn)
+    .limit(10)
+    .deleteAll(db)
+
+ +
+

:point_up: Note Deletion methods are only available for records that adopts the PersistableRecord protocol.

+
+ +

Deleting records according to their primary key is also quite common. It has a shortcut which accepts any single-column primary key:

+
// DELETE FROM player WHERE id = 1
+try Player.deleteOne(db, key: 1)
+
+// DELETE FROM player WHERE id IN (1, 2, 3)
+try Player.deleteAll(db, keys: [1, 2, 3])
+
+// DELETE FROM country WHERE isoCode = 'FR'
+try Country.deleteOne(db, key: "FR")
+
+// DELETE FROM country WHERE isoCode IN ('FR', 'US')
+try Country.deleteAll(db, keys: ["FR", "US"])
+
+ +

When the table has no explicit primary key, GRDB uses the hidden “rowid” column:

+
// DELETE FROM document WHERE rowid = 1
+try Document.deleteOne(db, key: 1)
+
+ +

For multiple-column primary keys and unique keys defined by unique indexes, provide a dictionary:

+
// DELETE FROM citizenship WHERE citizenId = 1 AND countryCode = 'FR'
+try Citizenship.deleteOne(db, key: ["citizenId": 1, "countryCode": "FR"])
+
+// DELETE FROM player WHERE email = 'arthur@example.com'
+Player.deleteOne(db, key: ["email": "arthur@example.com"])
+
+

Update Requests

+ +

Requests can batch update records. The updateAll() method accepts column assignments defined with the <- operator:

+
// UPDATE player SET score = 0, isHealthy = 1
+try Player.updateAll(db, scoreColumn <- 0, isHealthyColumn <- true)
+
+// UPDATE player SET score = 0 WHERE team = 'red'
+try Player
+    .filter(teamColumn == "red")
+    .updateAll(db, scoreColumn <- 0)
+
+// UPDATE player SET top = 1 ORDER BY score DESC LIMIT 10
+try Player
+    .order(scoreColumn.desc)
+    .limit(10)
+    .updateAll(db, topColumn <- true)
+
+ +

Column assignments accept any expression:

+
// UPDATE player SET score = score + (bonus * 2)
+try Player.updateAll(db, scoreColumn <- scoreColumn + bonusColumn * 2)
+
+ +

As a convenience, you can also use the +=, -=, *=, or /= operators:

+
// UPDATE player SET score = score + (bonus * 2)
+try Player.updateAll(db, scoreColumn += bonusColumn * 2)
+
+ +

Default Conflict Resolution rules apply, and you may also provide a specific one:

+
// UPDATE OR IGNORE player SET ...
+try Player.updateAll(db, onConflict: .ignore, /* assignments... */)
+
+ +
+

:point_up: Note The updateAll method is only available for records that adopts the PersistableRecord protocol.

+
+

Custom Requests

+ +

Until now, we have seen requests created from any type that adopts the TableRecord protocol:

+
let request = Player.all()  // QueryInterfaceRequest<Player>
+
+ +

Those requests of type QueryInterfaceRequest can fetch and count:

+
try request.fetchCursor(db) // A Cursor of Player
+try request.fetchAll(db)    // [Player]
+try request.fetchOne(db)    // Player?
+try request.fetchCount(db)  // Int
+
+ +

When the query interface can not generate the SQL you need, you can still fallback to raw SQL:

+
// Custom SQL is always welcome
+try Player.fetchAll(db, sql: "SELECT ...")   // [Player]
+
+ +

But you may prefer to bring some elegance back in, and build custom requests:

+
// No custom SQL in sight
+try Player.customRequest().fetchAll(db) // [Player]
+
+ + +

FetchRequest Protocol

+ +

FetchRequest is the protocol for all requests that run from a single select statement, and know how fetched rows should be interpreted:

+
protocol FetchRequest: DatabaseRegionConvertible {
+    /// The type that tells how fetched rows should be decoded
+    associatedtype RowDecoder
+
+    /// Returns a PreparedRequest made of a prepared statement that is ready to
+    /// be executed, and an eventual row adapter.
+    func makePreparedRequest(_ db: Database, forSingleResult singleResult: Bool) throws -> PreparedRequest
+
+    /// The number of rows fetched by the request.
+    func fetchCount(_ db: Database) throws -> Int
+}
+
+ +

When the RowDecoder associated type is Row, or a value, or a type that conforms to FetchableRecord, the request can fetch: see Fetching From Custom Requests below.

+ +

The makePreparedRequest(_:forSingleResult:) method accepts a database connection, a singleResult hint, and returns a “prepared request” made of a prepared statement and an optional row adapter. Conforming types can use the singleResult hint as an optimization opportunity, and return a statement that fetches at most one row, with a LIMIT SQL clause, when possible.

+ +

The fetchCount method has a default implementation that builds a correct but naive SQL query from the statement returned by prepare: SELECT COUNT(*) FROM (...). Adopting types can refine the counting SQL by customizing their fetchCount implementation.

+ +

The base DatabaseRegionConvertible protocol is involved in database observation. For more information, see DatabaseRegion, DatabaseRegionObservation, and ValueObservation.

+ +

The FetchRequest protocol is adopted, for example, by query interface requests:

+
// A FetchRequest whose RowDecoder associated type is Player:
+let request = Player.all()
+
+

Building Custom Requests

+ +

To build custom requests, you can use one of the built-in requests, derive requests from other requests, or create your own request type that adopts the FetchRequest protocol.

+ +
    +
  • SQLRequest is a fetch request built from raw SQL. For example:

    +
    extension Player {
    +    static func filter(color: Color) -> SQLRequest<Player> {
    +        return SQLRequest<Player>(
    +            sql: "SELECT * FROM player WHERE color = ?"
    +            arguments: [color])
    +    }
    +}
    +
    +// [Player]
    +try Player.filter(color: .red).fetchAll(db)
    +
    + +

    In Swift 5, you can build SQLRequest with SQL Interpolation:

    +
    // Swift 5
    +extension Player {
    +    static func filter(color: Color) -> SQLRequest<Player> {
    +        return "SELECT * FROM player WHERE color = \(color)"
    +    }
    +}
    +
  • +
  • The asRequest(of:) method changes the type fetched by the request. It is useful, for example, when you use Associations:

    +
    struct BookInfo: FetchableRecord, Decodable {
    +    var book: Book
    +    var author: Author
    +}
    +
    +let request = Book
    +    .including(required: Book.author)
    +    .asRequest(of: BookInfo.self)
    +
    +// [BookInfo]
    +try request.fetchAll(db)
    +
  • +
  • The adapted(_:) method eases the consumption of complex rows with row adapters. See Joined Queries Support for some sample code that uses this method.

  • +
  • AnyFetchRequest: a type-erased request.

  • +
+

Fetching From Custom Requests

+ +

A type adopting FetchRequest knows exactly what it has to do when its RowDecoder associated type can decode database rows (Row itself, values, or FetchableRecord):

+
let rowRequest = ...        // Some FetchRequest that fetches Row
+try request.fetchCursor(db) // A cursor of rows
+
+let playerRequest = ...     // Some FetchRequest that fetches Player
+try request.fetchAll(db)    // [Player]
+
+let intRequest = ...        // Some FetchRequest that fetches Int
+try request.fetchOne(db)    // Int?
+
+ +

For example:

+
let playerRequest = SQLRequest<Player>(
+    sql: "SELECT * FROM player WHERE color = ?"
+    arguments: [color])
+try request.fetchAll(db)    // [Player]
+
+ +

See fetching methods for information about the fetchCursor, fetchAll and fetchOne methods.

+ +

The RowDecoder type associated with the FetchRequest does not have to be Row, DatabaseValueConvertible, or FetchableRecord. See the Beyond FetchableRecord chapter for more information.

+

Migrations

+ +

Migrations are a convenient way to alter your database schema over time in a consistent and easy way.

+ +

Migrations run in order, once and only once. When a user upgrades your application, only non-applied migrations are run.

+ +

Inside each migration, you typically define and update your database tables according to your evolving application needs:

+
var migrator = DatabaseMigrator()
+
+// 1st migration
+migrator.registerMigration("v1") { db in
+    try db.create(table: "author") { t in ... }
+    try db.create(table: "book") { t in ... }
+    try db.create(index: ...)
+}
+
+// 2nd migration
+migrator.registerMigration("v2") { db in
+    try db.alter(table: "author") { t in ... }
+}
+
+// Migrations for future versions will be inserted here:
+//
+// // 3rd migration
+// migrator.registerMigration("...") { db in
+//     ...
+// }
+
+ +

Each migration runs in a separate transaction. Should one throw an error, its transaction is rollbacked, subsequent migrations do not run, and the error is eventually thrown by migrator.migrate(dbQueue).

+ +

The memory of applied migrations is stored in the database itself (in a reserved table).

+ +

You migrate the database up to the latest version with the migrate(_:) method:

+
try migrator.migrate(dbQueue) // or migrator.migrate(dbPool)
+
+ +

To migrate a database up to a specific version, use migrate(_:upTo:):

+
try migrator.migrate(dbQueue, upTo: "v2")
+
+ +

Migrations can only run forward:

+
try migrator.migrate(dbQueue, upTo: "v2")
+try migrator.migrate(dbQueue, upTo: "v1")
+// fatal error: database is already migrated beyond migration "v1"
+
+ +

Check if a migration has been applied:

+
let appliedMigrations = try migrator.appliedMigrations(in: dbQueue)
+if appliedMigrations.contains("v2") {
+    // "v2" migration has been applied
+}
+
+

The eraseDatabaseOnSchemaChange Option

+ +

A DatabaseMigrator can automatically wipe out the full database content, and recreate the whole database from scratch, if it detects that a migration has changed its definition:

+
var migrator = DatabaseMigrator()
+migrator.eraseDatabaseOnSchemaChange = true
+
+ +

Beware! This flag can destroy your precious users’ data!

+ +

Yet it may be useful in those two situations:

+ +
    +
  1. During application development, as you are still designing migrations, and the schema changes often.

    + +

    In this case, it is recommended that this flag does not ship in the distributed application:

    +
    var migrator = DatabaseMigrator()
    +#if DEBUG
    +// Speed up development by nuking the database when migrations change
    +migrator.eraseDatabaseOnSchemaChange = true
    +#endif
    +
  2. +
  3. When the database content can easily be recreated, such as a cache for some downloaded data.

  4. +
+ +

The eraseDatabaseOnSchemaChange option triggers a recreation of the database if the migrator detects a schema change. A schema change is any difference in the sqlite_master table, which contains the SQL used to create database tables, indexes, triggers, and views.

+

Advanced Database Schema Changes

+ +

SQLite does not support many schema changes, and won’t let you drop a table column with “ALTER TABLE … DROP COLUMN …”, for example.

+ +

Yet any kind of schema change is still possible. The SQLite documentation explains in detail how to do so: https://www.sqlite.org/lang_altertable.html#otheralter. This technique requires the temporary disabling of foreign key checks, and is supported by the registerMigrationWithDeferredForeignKeyCheck function:

+
// Add a NOT NULL constraint on player.name:
+migrator.registerMigrationWithDeferredForeignKeyCheck("AddNotNullCheckOnName") { db in
+    try db.create(table: "new_player") { t in
+        t.autoIncrementedPrimaryKey("id")
+        t.column("name", .text).notNull()
+    }
+    try db.execute(sql: "INSERT INTO new_player SELECT * FROM player")
+    try db.drop(table: "player")
+    try db.rename(table: "new_player", to: "player")
+}
+
+ +

While your migration code runs with disabled foreign key checks, those are re-enabled and checked at the end of the migration, regardless of eventual errors.

+

Joined Queries Support

+ +

GRDB helps consuming joined queries with complex selection.

+ +

In this chapter, we will focus on the extraction of information from complex rows, such as the ones fetched by the query below:

+
-- How to consume the left, middle, and right parts of those rows?
+SELECT player.*, team.*, MAX(round.score) AS maxScore
+FROM player
+LEFT JOIN team ON ...
+LEFT JOIN round ON ...
+GROUP BY ...
+
+ +

We will not talk about the generation of joined queries, which is covered in Associations.

+ +

So what are we talking about?

+ +

It is difficult to consume rows fetched from complex joined queries, because they often contain several columns with the same name: id from table player, id from table team, etc.

+ +

When such ambiguity happens, GRDB row accessors always favor the leftmost matching column. This means that row["id"] would give a player id, whithout any obvious way to access the team id.

+ +

A classical technique to avoid this ambiguity is to give each column a unique name. For example:

+
-- A classical technique
+SELECT player.id AS player_id, player.name AS player_name, team.id AS team_id, team.name AS team_name, team.color AS team_color, MAX(round.score) AS maxScore
+FROM player
+LEFT JOIN team ON ...
+LEFT JOIN round ON ...
+GROUP BY ...
+
+ +

This technique works pretty well, but it has three drawbacks:

+ +
    +
  1. The selection becomes hard to read and understand.
  2. +
  3. Such queries are difficult to write by hand.
  4. +
  5. The mangled names are a very bad fit for FetchableRecord types that expect specific column names. After all, if the Team record type can read SELECT * FROM team ..., it should be able to read SELECT ..., team.*, ... as well.
  6. +
+ +

We thus need another technique. Below we’ll see how to split rows into slices, and preserve column names.

+ +

SELECT player.*, team.*, MAX(round.score) AS maxScore FROM ... will be splitted into three slices: one that contains player’s columns, one that contains team’s columns, and a remaining slice that contains remaining column(s). The Player record type will be able to read the first slice, which contains the colums expected by the Player.init(row:) initializer. In the same way, the Team record type could read the second slice.

+ +

Unlike the name-mangling technique, splitting rows keeps SQL legible, accepts your hand-crafted SQL queries, and plays as nicely as possible with your existing record types.

+ + +

Splitting Rows, an Introduction

+ +

Let’s first write some introductory code, hoping that this chapter will make you understand how pieces fall together. We’ll see later how records will help us streamline the initial approach, how to track changes in joined requests, and how we can use the standard Decodable protocol.

+ +

To split rows, we will use row adapters. Row adapters adapt rows so that row consumers see exactly the columns they want. Among other things, row adapters can define several row scopes that give access to as many row slices. Sounds like a perfect match.

+ +

At the very beginning, there is an SQL query:

+
try dbQueue.read { db in
+    let sql = """
+        SELECT player.*, team.*, MAX(round.score) AS maxScore
+        FROM player
+        LEFT JOIN team ON ...
+        LEFT JOIN round ON ...
+        GROUP BY ...
+        """
+
+ +

We need an adapter that extracts player columns, in a slice that has as many columns as there are columns in the player table. That’s RangeRowAdapter:

+
    // SELECT player.*, team.*, ...
+    //        <------>
+    let playerWidth = try db.columns(in: "player").count
+    let playerAdapter = RangeRowAdapter(0 ..< playerWidth)
+
+ +

We also need an adapter that extracts team columns:

+
    // SELECT player.*, team.*, ...
+    //                  <---->
+    let teamWidth = try db.columns(in: "team").count
+    let teamAdapter = RangeRowAdapter(playerWidth ..< (playerWidth + teamWidth))
+
+ +

We merge those two adapters in a single ScopeAdapter that will allow us to access both sliced rows:

+
    let playerScope = "player"
+    let teamScope = "team"
+    let adapter = ScopeAdapter([
+        playerScope: playerAdapter,
+        teamScope: teamAdapter])
+
+ +

And now we can fetch, and start consuming our rows. You already know row cursors:

+
    let rows = try Row.fetchCursor(db, sql: sql, adapter: adapter)
+    while let row = try rows.next() {
+
+ +

From a fetched row, we can build a player:

+
        let player: Player = row[playerScope]
+
+ +

In the SQL query, the team is joined with the LEFT JOIN operator. This means that the team may be missing: its slice may contain team values, or it may only contain NULLs. When this happens, we don’t want to build a Team record, and we thus load an optional Team:

+
        let team: Team? = row[teamScope]
+
+ +

And finally, we can load the maximum score, assuming that the “maxScore” column is not ambiguous:

+
        let maxScore: Int = row["maxScore"]
+
+        print("player: \(player)")
+        print("team: \(team)")
+        print("maxScore: \(maxScore)")
+    }
+}
+
+ +
+

:bulb: In this chapter, we have learned:

+ +
    +
  • how to use RangeRowAdapter to extract a specific table’s columns into a row slice.
  • +
  • how to use ScopeAdapter to gives access to several row slices through named scopes.
  • +
  • how to use Row subscripting to extract records from rows, or optional records in order to deal with left joins.
  • +
+
+

Splitting Rows, the Record Way

+ +

Our introduction above has introduced important techniques. It uses row adapters in order to split rows. It uses Row subscripting in order to extract records from row slices.

+ +

But we may want to make it more usable and robust:

+ +
    +
  1. It’s generally easier to consume records than raw rows.
  2. +
  3. Joined records not always need all columns from a table (see TableRecord.databaseSelection in Columns Selected by a Request).
  4. +
  5. Building row adapters is long and error prone.
  6. +
+ +

To address the first bullet, let’s define a record that holds our player, optional team, and maximum score. Since it can decode database rows, it adopts the FetchableRecord protocol:

+
struct PlayerInfo {
+    var player: Player
+    var team: Team?
+    var maxScore: Int
+}
+
+/// PlayerInfo can decode rows:
+extension PlayerInfo: FetchableRecord {
+    private enum Scopes {
+        static let player = "player"
+        static let team = "team"
+    }
+
+    init(row: Row) {
+        player = row[Scopes.player]
+        team = row[Scopes.team]
+        maxScore = row["maxScore"]
+    }
+}
+
+ +

Let’s now write the method that fetches PlayerInfo records:

+
extension PlayerInfo {
+    static func fetchAll(_ db: Database) throws -> [PlayerInfo] {
+
+ +

To acknowledge that both Player and Team records may customize their selection of the “player” and “team” columns, we’ll write our SQL in a slightly different way:

+
        // Let Player and Team customize their selection:
+        let sql = """
+            SELECT
+                \(Player.selectionSQL()), -- instead of player.*
+                \(Team.selectionSQL()),   -- instead of team.*
+                MAX(round.score) AS maxScore
+            FROM player
+            LEFT JOIN team ON ...
+            LEFT JOIN round ON ...
+            GROUP BY ...
+            """
+
+ +

Player.selectionSQL() will output player.*, unless Player defines a customized selection.

+ +
+

:point_up: Note: you may also use SQL table aliases:

+
let sql = """
+    SELECT
+        \(Player.selectionSQL(alias: "p")),
+        \(Team.selectionSQL(alias: "t")),
+        MAX(r.score) AS maxScore
+    FROM player p
+    LEFT JOIN team t ON ...
+    LEFT JOIN round r ON ...
+    GROUP BY ...
+    """
+
+
+ +

Now is the time to build adapters (taking in account the customized selection of both player and team). We use the splittingRowAdapters global function, which builds row adapters of desired widths:

+
        let adapters = try splittingRowAdapters(columnCounts: [
+            Player.numberOfSelectedColumns(db),
+            Team.numberOfSelectedColumns(db)])
+
+        let adapter = ScopeAdapter([
+            Scopes.player: adapters[0],
+            Scopes.team: adapters[1]])
+
+ +
+

:point_up: Note: splittingRowAdapters returns as many adapters as necessary to fully split a row. In the example above, it returns three adapters: one for player, one for team, and one for the remaining columns.

+
+ +

And finally, we can fetch player infos:

+
        return try PlayerInfo.fetchAll(db, sql: sql, adapter: adapter)
+    }
+}
+
+ +

And when your app needs to fetch player infos, it now reads:

+
// Fetch player infos
+let playerInfos = try dbQueue.read { db in
+    try PlayerInfo.fetchAll(db)
+}
+
+ +
+

:bulb: In this chapter, we have learned:

+ +
    +
  • how to define a FetchableRecord record that consumes rows fetched from a joined query.
  • +
  • how to use selectionSQL and numberOfSelectedColumns in order to deal with nested record types that define custom selection.
  • +
  • how to use splittingRowAdapters in order to streamline the definition of row slices.
  • +
  • how to gather all relevant methods and constants in a record type, fully responsible of its relationship with the database.
  • +
+
+

Splitting Rows, the Request Way

+ +

The PlayerInfo.fetchAll method above directly fetches records. It’s all good, but in order to profit from database observation, you’ll need a custom request that defines a database query.

+ +

It is recommended that you read the previous paragraphs before you dive in this sample code. We start with the same PlayerInfo record as above:

+
struct PlayerInfo {
+    var player: Player
+    var team: Team?
+    var maxScore: Int
+}
+
+/// PlayerInfo can decode rows:
+extension PlayerInfo: FetchableRecord {
+    private enum Scopes {
+        static let player = "player"
+        static let team = "team"
+    }
+
+    init(row: Row) {
+        player = row[Scopes.player]
+        team = row[Scopes.team]
+        maxScore = row["maxScore"]
+    }
+}
+
+ +

Now we write a method that returns a request, and build the fetching method on top of that request:

+
extension PlayerInfo {
+    /// The request for all player infos
+    static func all() -> AdaptedFetchRequest<SQLRequest<PlayerInfo>> {
+        let sql = """
+            SELECT
+                \(Player.selectionSQL()),
+                \(Team.selectionSQL()),
+                MAX(round.score) AS maxScore
+            FROM player
+            LEFT JOIN team ON ...
+            LEFT JOIN round ON ...
+            GROUP BY ...
+            """
+        return SQLRequest<PlayerInfo>(sql: sql).adapted { db in
+            let adapters = try splittingRowAdapters(columnCounts: [
+                Player.numberOfSelectedColumns(db),
+                Team.numberOfSelectedColumns(db)])
+            return ScopeAdapter([
+                Scopes.player: adapters[0],
+                Scopes.team: adapters[1]])
+        }
+    }
+
+    /// Fetches all player infos
+    static func fetchAll(_ db: Database) throws -> [PlayerInfo] {
+        return try all().fetchAll(db)
+    }
+}
+
+ +

It is now time to use our request:

+
// Fetch player infos
+let playerInfos = try dbQueue.read { db in
+    try PlayerInfo.fetchAll(db)
+}
+
+// Track player infos with RxRGDB:
+PlayerInfo.all()
+    .rx.fetchAll(in: dbQueue)
+    .subscribe(onNext: { (playerInfos: [PlayerInfo]) in
+        print("Player infos have changed")
+    })
+
+ +
+

:bulb: In this chapter, we have learned how to define a custom request that can both fetch records from joined queries, and feed database observation tools.

+
+

Splitting Rows, the Codable Way

+ +

Codable Records build on top of the standard Decodable protocol in order to decode database rows.

+ +

You can consume complex joined queries with Codable records as well. As a demonstration, we’ll rewrite the above sample code:

+
struct Player: Decodable, FetchableRecord, TableRecord {
+    var id: Int64
+    var name: String
+}
+struct Team: Decodable, FetchableRecord, TableRecord {
+    var id: Int64
+    var name: String
+    var color: Color
+}
+struct PlayerInfo: Decodable, FetchableRecord {
+    var player: Player
+    var team: Team?
+    var maxScore: Int
+}
+
+extension PlayerInfo {
+    /// The request for all player infos
+    static func all() -> AdaptedFetchRequest<SQLRequest<PlayerInfo>> {
+        let sql = """
+            SELECT
+                \(Player.selectionSQL()),
+                \(Team.selectionSQL()),
+                MAX(round.score) AS maxScore
+            FROM player
+            LEFT JOIN team ON ...
+            LEFT JOIN round ON ...
+            GROUP BY ...
+            """
+        return SQLRequest<PlayerInfo>(sql: sql).adapted { db in
+            let adapters = try splittingRowAdapters(columnCounts: [
+                Player.numberOfSelectedColumns(db),
+                Team.numberOfSelectedColumns(db)])
+            return ScopeAdapter([
+                CodingKeys.player.stringValue: adapters[0],
+                CodingKeys.team.stringValue: adapters[1]])
+        }
+    }
+
+    /// Fetches all player infos
+    static func fetchAll(_ db: Database) throws -> [PlayerInfo] {
+        return try all().fetchAll(db)
+    }
+}
+
+// Fetch player infos
+let playerInfos = try dbQueue.read { db in
+    try PlayerInfo.fetchAll(db)
+}
+
+// Track player infos with RxRGDB:
+PlayerInfo.all()
+    .rx.fetchAll(in: dbQueue)
+    .subscribe(onNext: { (playerInfos: [PlayerInfo]) in
+        print("Player infos have changed")
+    })
+
+ +
+

:bulb: In this chapter, we have learned how to use the Decodable protocol and its associated CodingKeys enum in order to dry up our code.

+
+

Database Changes Observation

+ +

SQLite notifies its host application of changes performed to the database, as well of transaction commits and rollbacks.

+ +

GRDB puts this SQLite feature to some good use, and lets you observe the database in various ways:

+ + + +

Database observation requires that a single database queue or pool is kept open for all the duration of the database usage.

+

After Commit Hook

+ +

When your application needs to make sure a specific database transaction has been successfully committed before it executes some work, use the Database.afterNextTransactionCommit(_:) method.

+ +

Its closure argument is called right after database changes have been successfully written to disk:

+
try dbQueue.write { db in
+    db.afterNextTransactionCommit { db in
+        print("success")
+    }
+    ...
+} // prints "success"
+
+ +

The closure runs in a protected dispatch queue, serialized with all database updates.

+ +

This “after commit hook” helps synchronizing the database with other resources, such as files, or system sensors.

+ +

In the example below, a location manager starts monitoring a CLRegion if and only if it has successfully been stored in the database:

+
/// Inserts a region in the database, and start monitoring upon
+/// successful insertion.
+func startMonitoring(_ db: Database, region: CLRegion) throws {
+    // Make sure database is inside a transaction
+    try db.inSavepoint {
+
+        // Save the region in the database
+        try insert(...)
+
+        // Start monitoring if and only if the insertion is
+        // eventually committed
+        db.afterNextTransactionCommit { _ in
+            // locationManager prefers the main queue:
+            DispatchQueue.main.async {
+                locationManager.startMonitoring(for: region)
+            }
+        }
+
+        return .commit
+    }
+}
+
+ +

The method above won’t trigger the location manager if the transaction is eventually rollbacked (explicitly, or because of an error), as in the sample code below:

+
try dbQueue.write { db in
+    // success
+    try startMonitoring(db, region)
+
+    // On error, the transaction is rollbacked, the region is not inserted, and
+    // the location manager is not invoked.
+    try failableMethod(db)
+}
+
+

ValueObservation and DatabaseRegionObservation

+ +

ValueObservation and DatabaseRegionObservation are two database observations tools that track changes in database requests.

+
// Let's observe all players!
+let request = Player.all()
+
+ +

ValueObservation notifies your application with fresh values (this is what most applications need :+1:):

+
let observation = ValueObservation.tracking { db in
+    try request.fetchAll(db)
+}
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in
+        print("fresh players could not be fetched")
+    },
+    onChange: { (players: [Player]) in
+        let names = players.map { $0.name }.joined(separator: ", ")
+        print("Fresh players: \(names)")
+    })
+
+try dbQueue.write { db in
+    try Player(name: "Arthur").insert(db)
+}
+// Prints "Fresh players: Arthur, ..."
+
+ +

DatabaseRegionObservation notifies your application with database connections, right after an impactful database transaction has been committed (reserved for more advanced use cases :nerd_face:):

+
let observation = DatabaseRegionObservation(tracking: request)
+let observer = try observation.start(in: dbQueue) { (db: Database) in
+    print("Players have changed.")
+}
+
+try dbQueue.write { db in
+    try Player(name: "Barbara").insert(db)
+}
+// Prints "Players have changed."
+
+ + +

ValueObservation

+ +

ValueObservation tracks changes in the results of database requests, and notifies fresh values whenever the database changes.

+ +

Changes are only notified after they have been committed in the database. No insertion, update, or deletion in tracked tables is missed. This includes indirect changes triggered by foreign keys or SQL triggers.

+ + +

ValueObservation Usage

+ +

Here is a typical UIViewController which observes the database in order to keep its view up-to-date:

+
class PlayerViewController: UIViewController {
+    @IBOutlet weak var nameLabel: UILabel!
+    private var observer: TransactionObserver?
+
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+
+        // Define a ValueObservation which tracks a player
+        let observation = ValueObservation.tracking { db in
+            try Player.fetchOne(db, key: 42)
+        }
+
+        // Start observing the database
+        observer = observation.start(
+            in: dbQueue,
+            onError: { error in
+                print("player could not be fetched")
+            },
+            onChange: { [weak self] (player: Player?) in
+                // Player has been refreshed: update view
+                guard let self = self else { return }
+                self.nameLabel.text = player?.name
+            })
+    }
+
+    override func viewWillDisappear(_ animated: Bool) {
+        super.viewWillDisappear(animated)
+
+        // Stop observing the database
+        observer = nil
+    }
+}
+
+ +

By default, all values and errors are notified on the main queue. Views can be updated right from the onChange callback.

+ +

By default, an initial fetch is performed as soon as the observation starts: the view is set up and ready when the viewWillAppear method returns.

+ +

The observer returned by the start method is stored in a property of the view controller. This allows the view controller to control the duration of the observation. When the observer is deallocated, the observation stops. Meanwhile, all transactions that modify the observed player are notified, and the nameLabel is kept up-to-date.

+ +
+

:bulb: Tip: see the Demo Application for a sample app that uses ValueObservation.

+ +

:bulb: Tip: When fetching values is slow, and should never ever block the main queue, opt in for async notifications:

+
override func viewWillAppear(_ animated: Bool) {
+    super.viewWillAppear(animated)
+
+    // Define a ValueObservation which tracks a player
+    let observation = ValueObservation.tracking { db in
+        try Player.fetchOne(db, key: 42)
+    }
+
+    // Observation is asynchronous
+    observation.scheduling = .async(onQueue: .main, startImmediately: true)
+
+    // Start observing the database
+    observer = observation.start(
+        in: dbQueue,
+        onError: { error in
+            print("player could not be fetched")
+        },
+        onChange: { [weak self] (player: Player?) in
+            // Player has been refreshed: update view
+            guard let self = self else { return }
+            self.activityIndicator.stopAnimating()
+            self.nameLabel.text = player?.name
+        })
+
+    // Wait for player
+    activityIndicator.startAnimating()
+    nameLabel.text = nil
+}
+
+ +

See ValueObservation.scheduling for more information.

+
+

ValueObservation.tracking(value:)

+ +

In order to observe database values, you will generally define a ValueObservation which tracks the value you are interested in, and then start the observation.

+ +

For example:

+
// Track changes in a single player
+let observation = ValueObservation.tracking { db in
+    try Player.fetchOne(db, key: 42)
+}
+
+observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (player: Player?) in
+        print("Fresh player: \(player)")
+    })
+
+ +

You can observe several requests and several tables if you need: all writes that have an impact on the fetched values will trigger the observation, and call the onChange function.

+ +

It may happen that such an observation notifies identical consecutive values. This is because it will fetch a fresh value whenever a change could happen. For example, the observation for the maximum player score will notify a fresh value everytime a score is changed, inserted, or deleted, even if the maximum score is unchanged:

+
// Track changes in the maximum player score
+// This observation may notify duplicate values
+let observation = ValueObservation.tracking { db in
+    try Player.select(max(Column("score")), as: Int.self).fetchOne(db)
+}
+
+ +

You can filter out those duplicates with the ValueObservation.removeDuplicates method. It requires the observed value to adopt the Equatable protocol:

+
let observation = ValueObservation
+    .tracking { db in
+        try Player.select(max(Column("score")), as: Int.self).fetchOne(db)
+    }
+    .removeDuplicates()
+
+ +

We will see below other ways to define observations. They all add a little convenience, or optimization.

+

ValueObservation.tracking(_:fetch:)

+ +

The ValueObservation.tracking(_:fetch:) method is an optimized version of the ValueObservation.tracking(value:) method seen above.

+ +

The returned observation ouputs exactly the same results, but it can perform better when you use a database pool, and the fetch is slow. It reduces write contention by fetching fresh values without blocking write accesses. When you use a database queue, no optimization is applied.

+ +

It accepts two arguments:

+ +
    +
  1. A list of observed requests.
  2. +
  3. A closure that fetches a fresh value whenever one of the observed requests are modified.
  4. +
+ +

Changes that happen outside of the observed requests are ignored, so make sure you fully cover the database region you want to observe. This is the price you pay for the optimization.

+ +

Let’s give a practical example, and observe the “Hall of Fame”:

+
struct HallOfFame {
+    var totalPlayerCount: Int
+    var bestPlayers: [Player]
+}
+
+extension HallOfFame {
+    /// Fetch the HallOfFame
+    static fetch(_ db: Database) throws -> HallOfFame {
+        let totalPlayerCount = try Player.fetchCount(db)
+        let bestPlayers = try Player
+            .order(Column("score").desc)
+            .limit(10)
+            .fetchAll(db)
+        return HallOfFame(
+            totalPlayerCount: totalPlayerCount,
+            bestPlayers: bestPlayers)
+    }
+}
+
+ +

In order to track changes in the Hall of Fame in an optimized way, we see that any change to the player table can impact the Hall of Fame. We thus track the request for all players, Player.all(), and fetch a new Hall of Fame whenever players change:

+
let observation = ValueObservation.tracking(Player.all(), fetch: { db in
+    try HallOfFame.fetch(db)
+})
+
+ +
+

:point_up: Note: the initial parameter of ValueObservation.tracking(_:fetch:) can be fed with requests, and generally speaking, values that adopt the DatabaseRegionConvertible protocol.

+
+

observationForCount, observationForAll, observationForFirst

+ +

Given a request, even a custom request, you can observe its number of results, all results, or the first one:

+
request.observationForCount()
+request.observationForAll()
+request.observationForFirst()
+
+ +

Those observations are equivalent to the following ones, defined with ValueObservation.tracking(value:):

+
ValueObservation.tracking { db in try request.fetchCount(db) }
+ValueObservation.tracking { db in try request.fetchAll(db) }
+ValueObservation.tracking { db in try request.fetchOne(db) }
+
+ +

Yet they are optimized:

+ +
    +
  • They perform a filtering of consecutive identical values, based on raw database values, so that you are not notified of database changes that do not impact the result of the request.
  • +
  • They can perform better when you use a database pool, and the fetch is slow.
  • +
+

ValueObservation Transformations

+ + +

ValueObservation.map

+ +

The map method lets you transform the values notified by a ValueObservation.

+ +

For example:

+
// Observe a player's profile image
+let observation = ValueObservation
+    .tracking { db in try Player.fetchOne(db, key: 42) }
+    .map { player in player?.image }
+
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (image: UIImage?) in
+        print("Player picture has changed")
+    })
+
+ +

The transformation closure does not run on the main queue, and is suitable for heavy computations.

+

ValueObservation.compactMap

+ +

The compactMap method lets you transform and filter the values notified by a ValueObservation. Only non-nil transformed values are notified.

+ +

For example:

+
// Observe a player
+let observation = ValueObservation
+    .tracking { db in try Player.fetchOne(db, key: 42) }
+    .compactMap { $0 }
+
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (player: Player) in
+        print("Player name: \(player.name)")
+    })
+
+ +

The transformation closure does not run on the main queue, and is suitable for heavy computations.

+

ValueObservation.removeDuplicates

+ +

The removeDuplicates method filters out the consecutive equal values notified by a ValueObservation. The observed values must adopt the standard Equatable protocol.

+ +

For example:

+
let observation = ValueObservation
+    .tracking { db in try Player.fetchOne(db, key: 42) }
+    .removeDuplicates()
+
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (player: Player) in
+        print("Player: \(player)")
+    })
+
+ +
+

:point_up: Note: the observations returned by the observationForCount, observationForAll, observationForFirst methods already perform a similar filtering, based on raw database values.

+
+

ValueObservation.combine(…)

+ +

The ValueObservation.combine(...) method builds a single observation from several:

+
// Two base observations
+let playerCountObservation = ValueObservation.tracking { db in
+    try Player.fetchCount(db)
+}
+let bestPlayersObservation = ValueObservation.tracking { db in
+    try Player
+        .limit(10)
+        .order(Column("score").desc)
+        .fetchAll(db)
+}
+
+// The combined observation
+let observation = ValueObservation.combine(
+    playerCountObservation, 
+    bestPlayersObservation)
+
+// Start tracking the hall of fame
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (totalPlayerCount, bestPlayers) in
+        print("""
+            Best players out of \(totalPlayerCount):
+            \(bestPlayers)
+            """)
+    })
+
+ +

combine also exists as an instance method:

+
struct HallOfFame {
+    var totalPlayerCount: Int
+    var bestPlayers: [Player]
+}
+
+let observation = playerCountObservation.combine(bestPlayersObservation) {
+    HallOfFame(totalPlayerCount: $0, bestPlayers: $1)
+}
+
+ +

You can combine up to eight observations together. They can feed from as many database tables as needed.

+ +

Combining observations provides the guarantee that notified values are consistent.

+ +
+

:point_up: Note: readers who are familiar with Reactive Programming will recognize the CombineLatest operator in the ValueObservation combine method. The reactive operator does not care about data consistency, though: if you use a Reactive layer such as GRDBCombine or RxGRDB, make sure you compose observations with ValueObservation.combine, not with the CombineLatest operator.

+
+

ValueObservation Error Handling

+ +

When you start an observation, the onError callback is called whenever fresh values could not be fetched. It is scheduled just like values (see ValueObservation.scheduling):

+
let observer = observation.start(
+    in: dbQueue,
+    onError: { error in
+        print("fresh value could not be fetched")
+    },
+    onChange: { value in
+        print("fresh value: \(value)")
+    })
+
+ +

An error does not stop the observation. After an error has been received, subsequent transactions may succeed in notifying fresh values. You may witness such temporary errors when the database becomes temporarily unreachable, for example due to data protection.

+ +

Depending on the way your application wants to deal with such errors, you may want to tighten your control on the scheduling of database accesses with DatabaseRegionObservation. See also the reactive companion libraries GRDBCombine and RxGRDB, which stop observation whenever a ValueObservation error happens.

+ +

The onError callback can be omitted, but this is not recommended:

+
// Not recommended: omitting the onError callback
+let observer = try observation.start(in: dbQueue) { value in
+    print("fresh value: \(value)")
+}
+
+

ValueObservation Options

+ +

Some behaviors of value observations can be configured:

+ + +

ValueObservation.scheduling

+ +

The scheduling property lets you control how fresh values are notified:

+ +
    +
  • .mainQueue (the default): all values are notified on the main queue.

    + +

    If the observation starts on the main queue, an initial value is notified right upon subscription, synchronously:

    +
    // On main queue
    +let observer = observation.start(
    +    in: dbQueue,
    +    onError: { error in ... },
    +    onChange: { value in
    +        // On main queue
    +        print("fresh value: \(value)")
    +    })
    +// <- Here "fresh value" is already printed.
    +
    + +

    If the observation does not start on the main queue, an initial value is also notified on the main queue, but asynchronously:

    +
    // Not on the main queue
    +let observer = observation.start(
    +    in: dbQueue,
    +    onError: { error in ... },
    +    onChange: { value in
    +        // On main queue
    +        print("fresh value: \(value)")
    +    })
    +
    + +

    After the initial value has been notified, all subsequent values are notified asynchronously:

    +
    try dbQueue.write { db in ... }
    +// <- Eventually prints "fresh value" on the main queue
    +
  • +
  • .async(onQueue:startImmediately:): all values are asychronously notified on the specified queue.

    + +

    An initial value is fetched and notified if startImmediately is true.

    + +

    For example:

    +
    // On main queue
    +var observation = ...
    +observation.scheduling = .async(onQueue: .main, startImmediately: true)
    +let observer = observation.start(
    +    in: dbQueue,
    +    onError: { error in ... },
    +    onChange: { value in
    +        // On main queue
    +        print("fresh value: \(value)")
    +    })
    +// <- Eventually prints "fresh value"
    +
  • +
  • unsafe(startImmediately:): values are not all notified on the same dispatch queue.

    + +

    If startImmediately is true, an initial value is notified right upon subscription, synchronously, on the dispatch queue which starts the observation.

    +
    // On any queue
    +var observation = ...
    +observation.scheduling = .unsafe(startImmediately: true)
    +let observer = observation.start(
    +    in: dbQueue,
    +    onError: { error in ... },
    +    onChange: { value in
    +        print("fresh value: \(value)")
    +    })
    +// <- Here "fresh value" is already printed.
    +
    + +

    After the initial value has been notified, all subsequent values are notified on unspecified queues.

    + +
    +

    :point_up: Note: this unsafe mode is intended for third-party libraries that provide their own scheduling engine.

    +
  • +
+

ValueObservation.requiresWriteAccess

+ +

The requiresWriteAccess property is false by default. When true, a ValueObservation has a write access to the database, and its fetches are automatically wrapped in a savepoint:

+
var observation = ValueObservation.tracking { db in
+    // write access allowed
+    ...
+}
+observation.requiresWriteAccess = true
+
+ +

When you use a database pool, don’t use this flag unless you really need it. Observations with write access are less efficient because they block all writes for the whole duration of a fetch.

+

Advanced: ValueObservation.tracking(_:reducer:)

+ +

The most low-level way to define a ValueObservation is to create one from an observed database region (see above), and a reducer that adopts the ValueReducer protocol (:fire: EXPERIMENTAL):

+
protocol ValueReducer {
+    associatedtype Fetched
+    associatedtype Value
+
+    /// Fetches a database value
+    func fetch(_ db: Database) throws -> Fetched
+
+    /// Returns a notified value
+    mutating func value(_ fetched: Fetched) -> Value?
+}
+
+ +

The fetch method is called upon changes in the observed database region. It runs inside a protected dispatch queue and is guaranteed an immutable view of the last committed state of the database.

+ +

The value method transforms a fetched value into a notified value. It returns nil if the observer should not be notified. It runs inside a dispatch queue called the “reduce queue”, which is not the main queue, and not a database queue.

+ +

The sample code below counts the number of times the player table is modified:

+
var count = 0
+let reducer = AnyValueReducer(
+    fetch: { _ in /* don't fetch anything */ },
+    value: { _ -> Int? in
+        defer { count += 1 }
+        return count })
+let observation = ValueObservation.tracking(Player.all(), reducer: { _ in reducer })
+let observer = observation.start(
+    in: dbQueue,
+    onError: { error in ... },
+    onChange: { (count: Int) in
+        print("Number of transactions that have modified players: \(count)")
+    })
+// Prints "Number of transactions that have modified players: 0"
+
+try dbQueue.write { db in
+    try Player(...).insert(db)
+}
+// Prints "Number of transactions that have modified players: 1"
+
+

DatabaseRegionObservation

+ +

DatabaseRegionObservation tracks changes in database requests, and notifies each impactful transaction.

+ +

No insertion, update, or deletion in the tracked tables is missed. This includes indirect changes triggered by foreign keys or SQL triggers.

+ +

DatabaseRegionObservation calls your application right after changes have been committed in the database, and before any other thread had any opportunity to perform further changes. This is a pretty strong guarantee, that most applications do not really need. Instead, most applications prefer to be notified with fresh values: make sure you check ValueObservation before using DatabaseRegionObservation.

+

DatabaseRegionObservation Usage

+ +

Define an observation by providing one or several requests to track:

+
// Track all players
+let observation = DatabaseRegionObservation(tracking: Player.all())
+
+ +

Then start the observation from a database queue or pool:

+
let observer = try observation.start(in: dbQueue) { (db: Database) in
+    print("Players were changed")
+}
+
+ +

And enjoy the changes notifications:

+
try dbQueue.write { db in
+    try Player(name: "Arthur").insert(db)
+}
+// Prints "Players were changed"
+
+ +

By default, the observation lasts until the observer returned by the start method is deallocated. See DatabaseRegionObservation.extent for more details.

+ +

You can also feed DatabaseRegionObservation with DatabaseRegion, or any type which conforms to the DatabaseRegionConvertible protocol. For example:

+
// Observe the full database
+let observation = DatabaseRegionObservation(tracking: DatabaseRegion.fullDatabase)
+let observer = try observation.start(in: dbQueue) { (db: Database) in
+    print("Database was changed")
+}
+
+

DatabaseRegionObservation Use Cases

+ +

There are very few use cases for DatabaseRegionObservation.

+ +

For example:

+ +
    +
  • One needs to write in the database after an impactful transaction.

  • +
  • One needs to synchronize the content of the database file with some external resources, like other files, or system sensors like CLRegion monitoring.

  • +
  • On iOS, one needs to process a database transaction before the operating system had any opportunity to put the application in the suspended state.

  • +
  • One wants to build a database snapshot with a guaranteed snapshot content.

  • +
+ +

Outside of those use cases, it is much likely wrong to use a DatabaseRegionObservation. Please check other Database Observation options.

+

DatabaseRegionObservation.extent

+ +

The extent property lets you specify the duration of the observation. See Observation Extent for more details:

+
// This observation lasts until the database connection is closed
+var observation = DatabaseRegionObservation...
+observation.extent = .databaseLifetime
+_ = try observation.start(in: dbQueue) { db in ... }
+
+ +

The default extent is .observerLifetime: the observation stops when the observer returned by start is deallocated.

+ +

Regardless of the extent of an observation, you can always stop observation with the remove(transactionObserver:) method:

+
// Start
+let observer = try observation.start(in: dbQueue) { db in ... }
+
+// Stop
+dbQueue.remove(transactionObserver: observer)
+
+

TransactionObserver Protocol

+ +

The TransactionObserver protocol lets you observe individual database changes and transactions:

+
protocol TransactionObserver : class {
+    /// Notifies a database change:
+    /// - event.kind (insert, update, or delete)
+    /// - event.tableName
+    /// - event.rowID
+    ///
+    /// For performance reasons, the event is only valid for the duration of
+    /// this method call. If you need to keep it longer, store a copy:
+    /// event.copy().
+    func databaseDidChange(with event: DatabaseEvent)
+
+    /// Filters the database changes that should be notified to the
+    /// `databaseDidChange(with:)` method.
+    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool
+
+    /// An opportunity to rollback pending changes by throwing an error.
+    func databaseWillCommit() throws
+
+    /// Database changes have been committed.
+    func databaseDidCommit(_ db: Database)
+
+    /// Database changes have been rollbacked.
+    func databaseDidRollback(_ db: Database)
+}
+
+ + +

Activate a Transaction Observer

+ +

To activate a transaction observer, add it to the database queue or pool:

+
let observer = MyObserver()
+dbQueue.add(transactionObserver: observer)
+
+ +

By default, database holds weak references to its transaction observers: they are not retained, and stop getting notifications after they are deallocated. See Observation Extent for more options.

+

Database Changes And Transactions

+ +

A transaction observer is notified of all database changes: inserts, updates and deletes. This includes indirect changes triggered by ON DELETE and ON UPDATE actions associated to foreign keys, and SQL triggers.

+ +
+

:point_up: Note: the changes that are not notified are changes to internal system tables (such as sqlite_master), changes to WITHOUT ROWID tables, and the deletion of duplicate rows triggered by ON CONFLICT REPLACE clauses (this last exception might change in a future release of SQLite).

+
+ +

Notified changes are not actually written to disk until the transaction commits, and the databaseDidCommit callback is called. On the other side, databaseDidRollback confirms their invalidation:

+
try dbQueue.write { db in
+    try db.execute(sql: "INSERT ...") // 1. didChange
+    try db.execute(sql: "UPDATE ...") // 2. didChange
+}                                     // 3. willCommit, 4. didCommit
+
+try dbQueue.inTransaction { db in
+    try db.execute(sql: "INSERT ...") // 1. didChange
+    try db.execute(sql: "UPDATE ...") // 2. didChange
+    return .rollback                  // 3. didRollback
+}
+
+try dbQueue.write { db in
+    try db.execute(sql: "INSERT ...") // 1. didChange
+    throw SomeError()
+}                                     // 2. didRollback
+
+ +

Database statements that are executed outside of any transaction do not drop off the radar:

+
try dbQueue.inDatabase { db in
+    try db.execute(sql: "INSERT ...") // 1. didChange, 2. willCommit, 3. didCommit
+    try db.execute(sql: "UPDATE ...") // 4. didChange, 5. willCommit, 6. didCommit
+}
+
+ +

Changes that are on hold because of a savepoint are only notified after the savepoint has been released. This makes sure that notified events are only events that have an opportunity to be committed:

+
try dbQueue.inTransaction { db in
+    try db.execute(sql: "INSERT ...")            // 1. didChange
+
+    try db.execute(sql: "SAVEPOINT foo")
+    try db.execute(sql: "UPDATE ...")            // delayed
+    try db.execute(sql: "UPDATE ...")            // delayed
+    try db.execute(sql: "RELEASE SAVEPOINT foo") // 2. didChange, 3. didChange
+
+    try db.execute(sql: "SAVEPOINT foo")
+    try db.execute(sql: "UPDATE ...")            // not notified
+    try db.execute(sql: "ROLLBACK TO SAVEPOINT foo")
+
+    return .commit                               // 4. willCommit, 5. didCommit
+}
+
+ +

Eventual errors thrown from databaseWillCommit are exposed to the application code:

+
do {
+    try dbQueue.inTransaction { db in
+        ...
+        return .commit           // 1. willCommit (throws), 2. didRollback
+    }
+} catch {
+    // 3. The error thrown by the transaction observer.
+}
+
+ +
+

:point_up: Note: all callbacks are called in a protected dispatch queue, and serialized with all database updates.

+ +

:point_up: Note: the databaseDidChange(with:) and databaseWillCommit() callbacks must not touch the SQLite database. This limitation does not apply to databaseDidCommit and databaseDidRollback which can use their database argument.

+
+ +

DatabaseRegionObservation, ValueObservation, GRDBCombine, and RxGRDB are all based on the TransactionObserver protocol.

+ +

See also TableChangeObserver.swift, which shows a transaction observer that notifies of modified database tables with NSNotificationCenter.

+

Filtering Database Events

+ +

Transaction observers can avoid being notified of database changes they are not interested in.

+ +

The filtering happens in the observes(eventsOfKind:) method, which tells whether the observer wants notification of specific kinds of changes, or not. For example, here is how an observer can focus on the changes that happen on the “player” database table:

+
class PlayerObserver: TransactionObserver {
+    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool {
+        // Only observe changes to the "player" table.
+        return eventKind.tableName == "player"
+    }
+
+    func databaseDidChange(with event: DatabaseEvent) {
+        // This method is only called for changes that happen to
+        // the "player" table.
+    }
+}
+
+ +

Generally speaking, the observes(eventsOfKind:) method can distinguish insertions from deletions and updates, and is also able to inspect the columns that are about to be changed:

+
class PlayerScoreObserver: TransactionObserver {
+    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool {
+        // Only observe changes to the "score" column of the "player" table.
+        switch eventKind {
+        case .insert(let tableName):
+            return tableName == "player"
+        case .delete(let tableName):
+            return tableName == "player"
+        case .update(let tableName, let columnNames):
+            return tableName == "player" && columnNames.contains("score")
+        }
+    }
+}
+
+ +

When the observes(eventsOfKind:) method returns false for all event kinds, the observer is still notified of commits and rollbacks:

+
class PureTransactionObserver: TransactionObserver {
+    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool {
+        // Ignore all individual changes
+        return false
+    }
+
+    func databaseDidChange(with event: DatabaseEvent) { /* Never called */ }
+    func databaseWillCommit() throws { /* Called before commit */ }
+    func databaseDidRollback(_ db: Database) { /* Called on rollback */ }
+    func databaseDidCommit(_ db: Database) { /* Called on commit */ }
+}
+
+ +

For more information about event filtering, see DatabaseRegion.

+

Observation Extent

+ +

You can specify how long an observer is notified of database changes and transactions.

+ +

The remove(transactionObserver:) method explicitly stops notifications, at any time:

+
// From a database queue or pool:
+dbQueue.remove(transactionObserver: observer)
+
+// From a database connection:
+dbQueue.inDatabase { db in
+    db.remove(transactionObserver: observer)
+}
+
+ +

Alternatively, use the extent parameter of the add(transactionObserver:extent:) method:

+
let observer = MyObserver()
+
+// On a database queue or pool:
+dbQueue.add(transactionObserver: observer) // default extent
+dbQueue.add(transactionObserver: observer, extent: .observerLifetime)
+dbQueue.add(transactionObserver: observer, extent: .nextTransaction)
+dbQueue.add(transactionObserver: observer, extent: .databaseLifetime)
+
+// On a database connection:
+dbQueue.inDatabase { db in
+    db.add(transactionObserver: ...)
+}
+
+ +
    +
  • The default extent is .observerLifetime: the database holds a weak reference to the observer, and the observation automatically ends when the observer is deallocated. Meanwhile, observer is notified of all changes and transactions.

  • +
  • .nextTransaction activates the observer until the current or next transaction completes. The database keeps a strong reference to the observer until its databaseDidCommit or databaseDidRollback method is eventually called. Hereafter the observer won’t get any further notification.

  • +
  • .databaseLifetime has the database retain and notify the observer until the database connection is closed.

  • +
+ +

Finally, an observer may ignore all database changes until the end of the current transaction:

+
class PlayerObserver: TransactionObserver {
+    var playerTableWasModified = false
+
+    func observes(eventsOfKind eventKind: DatabaseEventKind) -> Bool {
+        return eventKind.tableName == "player"
+    }
+
+    func databaseDidChange(with event: DatabaseEvent) {
+        playerTableWasModified = true
+
+        // It is pointless to keep on tracking further changes:
+        stopObservingDatabaseChangesUntilNextTransaction()
+    }
+}
+
+ +

After stopObservingDatabaseChangesUntilNextTransaction(), the databaseDidChange(with:) method will not be notified of any change for the remaining duration of the current transaction. This helps GRDB optimize database observation.

+

DatabaseRegion

+ +

DatabaseRegion is a type that helps observing changes in the results of a database request.

+ +

A request knows which database modifications can impact its results. It can communicate this information to transaction observers by the way of a DatabaseRegion.

+ +

DatabaseRegion fuels, for example, ValueObservation and DatabaseRegionObservation.

+ +

A region notifies potential changes, not actual changes in the results of a request. A change is notified if and only if a statement has actually modified the tracked tables and columns by inserting, updating, or deleting a row.

+ +

For example, if you observe the region of Player.select(max(Column("score"))), then you’ll get be notified of all changes performed on the score column of the player table (updates, insertions and deletions), even if they do not modify the value of the maximum score. However, you will not get any notification for changes performed on other database tables, or updates to other columns of the player table.

+ +

For more details, see the reference.

+

The DatabaseRegionConvertible Protocol

+ +

DatabaseRegionConvertible is a protocol for all types that can turn into a DatabaseRegion:

+
protocol DatabaseRegionConvertible {
+    func databaseRegion(_ db: Database) throws -> DatabaseRegion
+}
+
+ +

All requests adopt this protocol, and this allows them to be observed with DatabaseRegionObservation and ValueObservation.

+ +

Use this protocol when you want to encapsulate your complex requests in a dedicated type, and still profit from optimized observation APIs. See ValueObservation.tracking(_:fetch:) for more information.

+

Support for SQLite Pre-Update Hooks

+ +

When SQLite is built with the SQLITE_ENABLE_PREUPDATE_HOOK option, TransactionObserverType gets an extra callback which lets you observe individual column values in the rows modified by a transaction:

+
protocol TransactionObserverType : class {
+    #if SQLITE_ENABLE_PREUPDATE_HOOK
+    /// Notifies before a database change (insert, update, or delete)
+    /// with change information (initial / final values for the row's
+    /// columns).
+    ///
+    /// The event is only valid for the duration of this method call. If you
+    /// need to keep it longer, store a copy: event.copy().
+    func databaseWillChange(with event: DatabasePreUpdateEvent)
+    #endif
+}
+
+ +

This extra API can be activated in two ways:

+ +
    +
  1. Use the GRDB.swift CocoaPod with a custom compilation option, as below. It uses the system SQLite, which is compiled with SQLITE_ENABLE_PREUPDATE_HOOK support, but only on iOS 11.0+ (we don’t know the minimum version of macOS, tvOS, watchOS):

    +
    pod 'GRDB.swift'
    +platform :ios, '11.0' # or above
    +
    +post_install do |installer|
    +  installer.pods_project.targets.select { |target| target.name == "GRDB.swift" }.each do |target|
    +    target.build_configurations.each do |config|
    +      # Enable extra GRDB APIs
    +      config.build_settings['OTHER_SWIFT_FLAGS'] = "$(inherited) -D SQLITE_ENABLE_PREUPDATE_HOOK"
    +      # Enable extra SQLite APIs
    +      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = "$(inherited) GRDB_SQLITE_ENABLE_PREUPDATE_HOOK=1"
    +    end
    +  end
    +end
    +
    + +
    +

    :warning: Warning: make sure you use the right platform version! You will get runtime errors on devices with a lower version.

    + +

    :point_up: Note: the GRDB_SQLITE_ENABLE_PREUPDATE_HOOK=1 option in GCC_PREPROCESSOR_DEFINITIONS defines some C function prototypes that are lacking from the system <sqlite3.h> header. When Xcode eventually ships with an SDK that includes a complete header, you may get a compiler error about duplicate function definitions. When this happens, just remove this GRDB_SQLITE_ENABLE_PREUPDATE_HOOK=1 option.

    +
  2. +
  3. Use a custom SQLite build and activate the SQLITE_ENABLE_PREUPDATE_HOOK compilation option.

  4. +
+

Encryption

+ +

GRDB can encrypt your database with SQLCipher v3.4+.

+ +

Use CocoaPods, and specify in your Podfile:

+
# GRDB with SQLCipher 4
+pod 'GRDB.swift/SQLCipher'
+pod 'SQLCipher', '~> 4.0'
+
+# GRDB with SQLCipher 3
+pod 'GRDB.swift/SQLCipher'
+pod 'SQLCipher', '~> 3.4'
+
+ + +

Creating or Opening an Encrypted Database

+ +

You create and open an encrypted database by providing a passphrase to your database connection:

+
var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase("secret")
+}
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+ +

It is also in prepareDatabase that you perform other SQLCipher configuration steps that must happen early in the lifetime of a SQLCipher connection. For example:

+
var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase("secret")
+    try db.execute(sql: "PRAGMA cipher_page_size = ...")
+    try db.execute(sql: "PRAGMA kdf_iter = ...")
+}
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+ +

When you want to open an existing SQLCipher 3 database with SQLCipher 4, you may want to run the cipher_compatibility pragma:

+
// Open an SQLCipher 3 database with SQLCipher 4
+var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase("secret")
+    try db.execute(sql: "PRAGMA cipher_compatibility = 3")
+}
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+ +

See SQLCipher 4.0.0 Release and Upgrading to SQLCipher 4 for more information.

+

Changing the Passphrase of an Encrypted Database

+ +

You can change the passphrase of an already encrypted database.

+ +

When you use a database queue, open the database with the old passphrase, and then apply the new passphrase:

+
try dbQueue.write { db in
+    try db.changePassphrase("newSecret")
+}
+
+ +

When you use a database pool, make sure that no concurrent read can happen by changing the passphrase within the barrierWriteWithoutTransaction block. You must also ensure all future reads open a new database connection by calling the invalidateReadOnlyConnections method:

+
try dbPool.barrierWriteWithoutTransaction { db in
+    try db.changePassphrase("newSecret")
+    dbPool.invalidateReadOnlyConnections()
+}
+
+ +
+

:point_up: Note: When an application wants to keep on using a database queue or pool after the passphrase has changed, it is responsible for providing the correct passphrase to the usePassphrase method called in the database preparation function. Consider:

+
// WRONG: this won't work across a passphrase change
+let passphrase = try getPassphrase()
+var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase(passphrase)
+}
+
+// CORRECT: get the latest passphrase when it is needed
+var config = Configuration()
+config.prepareDatabase = { db in
+    let passphrase = try getPassphrase()
+    try db.usePassphrase(passphrase)
+}
+
+ +

:point_up: Note: The DatabasePool.barrierWriteWithoutTransaction method does not prevent database snapshots from accessing the database during the passphrase change, or after the new passphrase has been applied to the database. Those database accesses may throw errors. Applications should provide their own mechanism for invalidating open snapshots before the passphrase is changed.

+ +

:point_up: Note: Instead of changing the passphrase “in place” as described here, you can also export the database in a new encrypted database that uses the new passphrase. See Exporting a Database to an Encrypted Database.

+
+

Exporting a Database to an Encrypted Database

+ +

Providing a passphrase won’t encrypt a clear-text database that already exists, though. SQLCipher can’t do that, and you will get an error instead: SQLite error 26: file is encrypted or is not a database.

+ +

Instead, create a new encrypted database, at a distinct location, and export the content of the existing database. This can both encrypt a clear-text database, or change the passphrase of an encrypted databaase.

+ +

The technique to do that is documented by SQLCipher.

+ +

With GRDB, it gives:

+
// The existing database
+let existingDBQueue = try DatabaseQueue(path: "/path/to/existing.db")
+
+// The new encrypted database, at some distinct location:
+var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase("secret")
+}
+let newDBQueue = try DatabaseQueue(path: "/path/to/new.db", configuration: config)
+
+try existingDBQueue.inDatabase { db in
+    try db.execute(
+        sql: """
+            ATTACH DATABASE ? AS encrypted KEY ?;
+            SELECT sqlcipher_export('encrypted');
+            DETACH DATABASE encrypted;
+            """,
+        arguments: [newDBQueue.path, "secret"])
+}
+
+// Now the export is completed, and the existing database can be deleted.
+
+

Security Considerations

+

Managing the lifetime of the passphrase string

+ +

It is recommended to avoid keeping the passphrase in memory longer than necessary. To do this, make sure you load the passphrase from inside the prepareDatabase function:

+
// NOT RECOMMENDED: this keeps the passphrase in memory longer than necessary
+let passphrase = try getPassphrase()
+var config = Configuration()
+config.prepareDatabase = { db in
+    try db.usePassphrase(passphrase)
+}
+
+// RECOMMENDED: only load the passphrase when it is needed
+var config = Configuration()
+config.prepareDatabase = { db in
+    let passphrase = try getPassphrase()
+    try db.usePassphrase(passphrase)
+}
+
+ +

This technique manages the lifetime of the passphrase string. Some demanding users will want to go further, and manage the lifetime of the raw passphrase bytes. See below.

+

Managing the lifetime of the passphrase bytes

+ +

GRDB offers convenience methods for providing the database passphrases as Swift strings: usePassphrase(_:) and changePassphrase(_:). Those methods don’t keep the passphrase String in memory longer than necessary. But they are as secure as the standard String type: the lifetime of actual passphrase bytes in memory is not under control.

+ +

When you want to precisely manage the passphrase bytes, talk directly to SQLCipher, using its raw C functions.

+ +

For example:

+
import GRDB
+import SQLCipher
+
+var config = Configuration()
+config.prepareDatabase = { db in
+    ... // Carefully load passphrase bytes
+    let code = sqlite3_key(db.sqliteConnection, /* passphrase bytes */)
+    ... // Carefully dispose passphrase bytes
+    guard code == SQLITE_OK else {
+        throw DatabaseError(
+            resultCode: ResultCode(rawValue: code), 
+            message: db.lastErrorMessage)
+    }
+}
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+

Passphrase availability vs. Database availability

+ +

When the passphrase is securely stored in the system keychain, your application can protect it using the kSecAttrAccessible attribute.

+ +

Such protection prevents GRDB from creating SQLite connections when the passphrase is not available:

+
var config = Configuration()
+config.prepareDatabase = { db in
+    let passphrase = try loadPassphraseFromSystemKeychain()
+    try db.usePassphrase(passphrase)
+}
+
+// Success if and only if the passphrase is available
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+ +

For the same reason, database pools, which open SQLite connections on demand, may fail at any time as soon as the passphrase becomes unavailable:

+
// Success if and only if the passphrase is available
+let dbPool = try DatabasePool(path: dbPath, configuration: config)
+
+// May fail if passphrase has turned unavailable
+try dbPool.read { ... }
+
+// May trigger value observation failure if passphrase has turned unavailable
+try dbPool.write { ... }
+
+ +

Because DatabasePool maintains a pool of long-lived SQLite connections, some database accesses will use an existing connection, and succeed. And some other database accesses will fail, as soon as the pool wants to open a new connection. It is impossible to predict which accesses will succeed or fail.

+ +

For the same reason, a database queue, which also maintains a long-lived SQLite connection, will remain available even after the passphrase has turned unavailable.

+ +

Applications are thus responsible for protecting database accesses when the passphrase is unavailable. To this end, they can use Data Protection. They can also destroy their instances of database queue or pool when the passphrase becomes unavailable.

+

Backup

+ +

You can backup (copy) a database into another.

+ +

Backups can for example help you copying an in-memory database to and from a database file when you implement NSDocument subclasses.

+
let source: DatabaseQueue = ...      // or DatabasePool
+let destination: DatabaseQueue = ... // or DatabasePool
+try source.backup(to: destination)
+
+ +

The backup method blocks the current thread until the destination database contains the same contents as the source database.

+ +

When the source is a database pool, concurrent writes can happen during the backup. Those writes may, or may not, be reflected in the backup, but they won’t trigger any error.

+

Interrupt a Database

+ +

The interrupt() method causes any pending database operation to abort and return at its earliest opportunity.

+ +

It can be called from any thread.

+
dbQueue.interrupt()
+dbPool.interrupt()
+
+ +

A call to interrupt() that occurs when there are no running SQL statements is a no-op and has no effect on SQL statements that are started after interrupt() returns.

+ +

A database operation that is interrupted will throw a DatabaseError with code SQLITE_INTERRUPT. If the interrupted SQL operation is an INSERT, UPDATE, or DELETE that is inside an explicit transaction, then the entire transaction will be rolled back automatically. If the rolled back transaction was started by a transaction-wrapping method such as DatabaseWriter.write or Database.inTransaction, then all database accesses will throw a DatabaseError with code SQLITE_ABORT until the wrapping method returns.

+ +

For example:

+
try dbQueue.write { db in
+    try Player(...).insert(db)     // throws SQLITE_INTERRUPT
+    try Player(...).insert(db)     // not executed
+}                                  // throws SQLITE_INTERRUPT
+
+try dbQueue.write { db in
+    do {
+        try Player(...).insert(db) // throws SQLITE_INTERRUPT
+    } catch { }
+}                                  // throws SQLITE_ABORT
+
+try dbQueue.write { db in
+    do {
+        try Player(...).insert(db) // throws SQLITE_INTERRUPT
+    } catch { }
+    try Player(...).insert(db)     // throws SQLITE_ABORT
+}                                  // throws SQLITE_ABORT
+
+ +

You can catch both SQLITE_INTERRUPT and SQLITE_ABORT errors with the DatabaseError.isInterruptionError property:

+
do {
+    try dbPool.write { db in ... }
+} catch let error as DatabaseError where error.isInterruptionError {
+    // Oops, the database was interrupted.
+}
+
+ +

For more information, see Interrupt A Long-Running Query.

+

Avoiding SQL Injection

+ +

SQL injection is a technique that lets an attacker nuke your database.

+ +
+

XKCD: Exploits of a Mom

+ +

https://xkcd.com/327/

+
+ +

Here is an example of code that is vulnerable to SQL injection:

+
// BAD BAD BAD
+let id = 1
+let name = textField.text
+try dbQueue.write { db in
+    try db.execute(sql: "UPDATE students SET name = '\(name)' WHERE id = \(id)")
+}
+
+ +

If the user enters a funny string like Robert'; DROP TABLE students; --, SQLite will see the following SQL, and drop your database table instead of updating a name as intended:

+
UPDATE students SET name = 'Robert';
+DROP TABLE students;
+--' WHERE id = 1
+
+ +

To avoid those problems, never embed raw values in your SQL queries. The only correct technique is to provide arguments to your raw SQL queries:

+
let name = textField.text
+try dbQueue.write { db in
+    // Good
+    try db.execute(
+        sql: "UPDATE students SET name = ? WHERE id = ?",
+        arguments: [name, id])
+
+    // Just as good
+    try db.execute(
+        sql: "UPDATE students SET name = :name WHERE id = :id",
+        arguments: ["name": name, "id": id])
+}
+
+ +

When you use records and the query interface, GRDB always prevents SQL injection for you:

+
let id = 1
+let name = textField.text
+try dbQueue.write { db in
+    if var student = try Student.fetchOne(db, key: id) {
+        student.name = name
+        try student.update(db)
+    }
+}
+
+

Error Handling

+ +

GRDB can throw DatabaseError, PersistenceError, or crash your program with a fatal error.

+ +

Considering that a local database is not some JSON loaded from a remote server, GRDB focuses on trusted databases. Dealing with untrusted databases requires extra care.

+ + +

DatabaseError

+ +

DatabaseError are thrown on SQLite errors:

+
do {
+    try db.execute(
+        sql: "INSERT INTO pet (masterId, name) VALUES (?, ?)",
+        arguments: [1, "Bobby"])
+} catch let error as DatabaseError {
+    // The SQLite error code: 19 (SQLITE_CONSTRAINT)
+    error.resultCode
+
+    // The extended error code: 787 (SQLITE_CONSTRAINT_FOREIGNKEY)
+    error.extendedResultCode
+
+    // The eventual SQLite message: FOREIGN KEY constraint failed
+    error.message
+
+    // The eventual erroneous SQL query
+    // "INSERT INTO pet (masterId, name) VALUES (?, ?)"
+    error.sql
+
+    // Full error description:
+    // "SQLite error 19 with statement `INSERT INTO pet (masterId, name)
+    //  VALUES (?, ?)` arguments [1, "Bobby"]: FOREIGN KEY constraint failed""
+    error.description
+}
+
+ +

SQLite uses codes to distinguish between various errors:

+
do {
+    try ...
+} catch let error as DatabaseError where error.extendedResultCode == .SQLITE_CONSTRAINT_FOREIGNKEY {
+    // foreign key constraint error
+} catch let error as DatabaseError where error.resultCode == .SQLITE_CONSTRAINT {
+    // any other constraint error
+} catch let error as DatabaseError {
+    // any other database error
+}
+
+ +

In the example above, error.extendedResultCode is a precise extended result code, and error.resultCode is a less precise primary result code. Extended result codes are refinements of primary result codes, as SQLITE_CONSTRAINT_FOREIGNKEY is to SQLITE_CONSTRAINT, for example. See SQLite result codes for more information.

+ +

As a convenience, extended result codes match their primary result code in a switch statement:

+
do {
+    try ...
+} catch let error as DatabaseError {
+    switch error.extendedResultCode {
+    case ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY:
+        // foreign key constraint error
+    case ResultCode.SQLITE_CONSTRAINT:
+        // any other constraint error
+    default:
+        // any other database error
+    }
+}
+
+ +
+

:warning: Warning: SQLite has progressively introduced extended result codes accross its versions. The SQLite release notes are unfortunately not quite clear about that: write your handling of extended result codes with care.

+
+

PersistenceError

+ +

PersistenceError is thrown by the PersistableRecord protocol, in a single case: when the update method could not find any row to update:

+
do {
+    try player.update(db)
+} catch let PersistenceError.recordNotFound(databaseTableName: table, key: key) {
+    print("Key \(key) was not found in table \(table).")
+}
+
+

Fatal Errors

+ +

Fatal errors notify that the program, or the database, has to be changed.

+ +

They uncover programmer errors, false assumptions, and prevent misuses. Here are a few examples:

+ +
    +
  • The code asks for a non-optional value, when the database contains NULL:

    +
    // fatal error: could not convert NULL to String.
    +let name: String = row["name"]
    +
    + +

    Solution: fix the contents of the database, use NOT NULL constraints, or load an optional:

    +
    let name: String? = row["name"]
    +
  • +
  • Conversion from database value to Swift type fails:

    +
    // fatal error: could not convert "Mom’s birthday" to Date.
    +let date: Date = row["date"]
    +
    +// fatal error: could not convert "" to URL.
    +let url: URL = row["url"]
    +
    + +

    Solution: fix the contents of the database, or use DatabaseValue to handle all possible cases:

    +
    let dbValue: DatabaseValue = row["date"]
    +if dbValue.isNull {
    +    // Handle NULL
    +} else if let date = Date.fromDatabaseValue(dbValue) {
    +    // Handle valid date
    +} else {
    +    // Handle invalid date
    +}
    +
  • +
  • The database can’t guarantee that the code does what it says:

    +
    // fatal error: table player has no unique index on column email
    +try Player.deleteOne(db, key: ["email": "arthur@example.com"])
    +
    + +

    Solution: add a unique index to the player.email column, or use the deleteAll method to make it clear that you may delete more than one row:

    +
    try Player.filter(Column("email") == "arthur@example.com").deleteAll(db)
    +
  • +
  • Database connections are not reentrant:

    +
    // fatal error: Database methods are not reentrant.
    +dbQueue.write { db in
    +    dbQueue.write { db in
    +        ...
    +    }
    +}
    +
    + +

    Solution: avoid reentrancy, and instead pass a database connection along.

  • +
+

How to Deal with Untrusted Inputs

+ +

Let’s consider the code below:

+
let sql = "SELECT ..."
+
+// Some untrusted arguments for the query
+let arguments: [String: Any] = ...
+let rows = try Row.fetchCursor(db, sql: sql, arguments: StatementArguments(arguments))
+
+while let row = try rows.next() {
+    // Some untrusted database value:
+    let date: Date? = row[0]
+}
+
+ +

It has two opportunities to throw fatal errors:

+ +
    +
  • Untrusted arguments: The dictionary may contain values that do not conform to the DatabaseValueConvertible protocol, or may miss keys required by the statement.
  • +
  • Untrusted database content: The row may contain a non-null value that can’t be turned into a date.
  • +
+ +

In such a situation, you can still avoid fatal errors by exposing and handling each failure point, one level down in the GRDB API:

+
// Untrusted arguments
+if let arguments = StatementArguments(arguments) {
+    let statement = try db.makeSelectStatement(sql: sql)
+    try statement.validate(arguments: arguments)
+    statement.unsafeSetArguments(arguments)
+
+    var cursor = try Row.fetchCursor(statement)
+    while let row = try iterator.next() {
+        // Untrusted database content
+        let dbValue: DatabaseValue = row[0]
+        if dbValue.isNull {
+            // Handle NULL
+        if let date = Date.fromDatabaseValue(dbValue) {
+            // Handle valid date
+        } else {
+            // Handle invalid date
+        }
+    }
+}
+
+ +

See prepared statements and DatabaseValue for more information.

+

Error Log

+ +

SQLite can be configured to invoke a callback function containing an error code and a terse error message whenever anomalies occur.

+ +

This global error callback must be configured early in the lifetime of your application:

+
Database.logError = { (resultCode, message) in
+    NSLog("%@", "SQLite error \(resultCode): \(message)")
+}
+
+ +
+

:warning: Warning: Database.logError must be set before any database connection is opened. This includes the connections that your application opens with GRDB, but also connections opened by other tools, such as third-party libraries. Setting it after a connection has been opened is an SQLite misuse, and has no effect.

+
+ +

See The Error And Warning Log for more information.

+

Unicode

+ +

SQLite lets you store unicode strings in the database.

+ +

However, SQLite does not provide any unicode-aware string transformations or comparisons.

+

Unicode functions

+ +

The UPPER and LOWER built-in SQLite functions are not unicode-aware:

+
// "JéRôME"
+try String.fetchOne(db, sql: "SELECT UPPER('Jérôme')")
+
+ +

GRDB extends SQLite with SQL functions that call the Swift built-in string functions capitalized, lowercased, uppercased, localizedCapitalized, localizedLowercased and localizedUppercased:

+
// "JÉRÔME"
+let uppercased = DatabaseFunction.uppercase
+try String.fetchOne(db, sql: "SELECT \(uppercased.name)('Jérôme')")
+
+ +

Those unicode-aware string functions are also readily available in the query interface:

+
Player.select(nameColumn.uppercased)
+
+

String Comparison

+ +

SQLite compares strings in many occasions: when you sort rows according to a string column, or when you use a comparison operator such as = and <=.

+ +

The comparison result comes from a collating function, or collation. SQLite comes with three built-in collations that do not support Unicode: binary, nocase, and rtrim.

+ +

GRDB comes with five extra collations that leverage unicode-aware comparisons based on the standard Swift String comparison functions and operators:

+ +
    +
  • unicodeCompare (uses the built-in <= and == Swift operators)
  • +
  • caseInsensitiveCompare
  • +
  • localizedCaseInsensitiveCompare
  • +
  • localizedCompare
  • +
  • localizedStandardCompare
  • +
+ +

A collation can be applied to a table column. All comparisons involving this column will then automatically trigger the comparison function:

+
try db.create(table: "player") { t in
+    // Guarantees case-insensitive email unicity
+    t.column("email", .text).unique().collate(.nocase)
+
+    // Sort names in a localized case insensitive way
+    t.column("name", .text).collate(.localizedCaseInsensitiveCompare)
+}
+
+// Players are sorted in a localized case insensitive way:
+let players = try Player.order(nameColumn).fetchAll(db)
+
+ +
+

:warning: Warning: SQLite requires host applications to provide the definition of any collation other than binary, nocase and rtrim. When a database file has to be shared or migrated to another SQLite library of platform (such as the Android version of your application), make sure you provide a compatible collation.

+
+ +

If you can’t or don’t want to define the comparison behavior of a column (see warning above), you can still use an explicit collation in SQL requests and in the query interface:

+
let collation = DatabaseCollation.localizedCaseInsensitiveCompare
+let players = try Player.fetchAll(db,
+    sql: "SELECT * FROM player ORDER BY name COLLATE \(collation.name))")
+let players = try Player.order(nameColumn.collating(collation)).fetchAll(db)
+
+ +

You can also define your own collations:

+
let collation = DatabaseCollation("customCollation") { (lhs, rhs) -> NSComparisonResult in
+    // return the comparison of lhs and rhs strings.
+}
+dbQueue.add(collation: collation) // Or dbPool.add(collation: ...)
+
+

Memory Management

+ +

Both SQLite and GRDB use non-essential memory that help them perform better.

+ +

You can reclaim this memory with the releaseMemory method:

+
// Release as much memory as possible.
+dbQueue.releaseMemory()
+dbPool.releaseMemory()
+
+ +

This method blocks the current thread until all current database accesses are completed, and the memory collected.

+

Memory Management on iOS

+ +

The iOS operating system likes applications that do not consume much memory.

+ +

Database queues and pools can call the releaseMemory method for you, when application receives memory warnings, and when application enters background: call the setupMemoryManagement method after creating the queue or pool instance:

+
let dbQueue = try DatabaseQueue(...)
+dbQueue.setupMemoryManagement(in: UIApplication.shared)
+
+

Data Protection

+ +

Data Protection lets you protect files so that they are encrypted and unavailable until the device is unlocked.

+ +

Data protection can be enabled globally for all files created by an application.

+ +

You can also explicitly protect a database, by configuring its enclosing directory. This will not only protect the database file, but also all temporary files created by SQLite (including the persistent .shm and .wal files created by database pools).

+ +

For example, to explicitly use complete protection:

+
// Paths
+let fileManager = FileManager.default
+let directoryURL = try fileManager
+    .url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
+    .appendingPathComponent("database", isDirectory: true)
+let databaseURL = directoryURL.appendingPathComponent("db.sqlite")
+
+// Create directory if needed
+var isDirectory: ObjCBool = false
+if !fileManager.fileExists(atPath: directoryURL.path, isDirectory: &isDirectory) {
+    try fileManager.createDirectory(atPath: directoryURL.path, withIntermediateDirectories: false)
+} else if !isDirectory.boolValue {
+    throw NSError(domain: NSCocoaErrorDomain, code: NSFileWriteFileExistsError, userInfo: nil)
+}
+
+// Enable data protection
+try fileManager.setAttributes([.protectionKey : FileProtectionType.complete], ofItemAtPath: directoryURL.path)
+
+// Open database
+let dbQueue = try DatabaseQueue(path: databaseURL.path)
+
+ +

When a database is protected, an application that runs in the background on a locked device won’t be able to read or write from it. Instead, it will get DatabaseError with code SQLITE_IOERR (10) “disk I/O error”, or SQLITE_AUTH (23) “not authorized”.

+ +

You can catch those errors and wait for UIApplicationDelegate.applicationProtectedDataDidBecomeAvailable(_:) or UIApplicationProtectedDataDidBecomeAvailable notification in order to retry the failed database operation.

+

Concurrency

+ + +

Guarantees and Rules

+ +

GRDB ships with three concurrency modes:

+ +
    +
  • DatabaseQueue opens a single database connection, and serializes all database accesses.
  • +
  • DatabasePool manages a pool of several database connections, and allows concurrent reads and writes.
  • +
  • DatabaseSnapshot opens a single read-only database connection on an unchanging database content, and (currently) serializes all database accesses
  • +
+ +

All foster application safety: regardless of the concurrency mode you choose, GRDB provides you with the same guarantees, as long as you follow three rules.

+ +
    +
  • :bowtie: Guarantee 1: writes are always serialized. At every moment, there is no more than a single thread that is writing into the database.

    + +
    +

    Database writes always happen in a unique serial dispatch queue, named the writer protected dispatch queue.

    +
  • +
  • :bowtie: Guarantee 2: reads are always isolated. This means that they are guaranteed an immutable view of the database, and that you can perform subsequent fetches without fearing eventual concurrent writes to mess with your application logic:

    +
    try dbPool.read { db in // or dbQueue.read
    +    // Guaranteed to be equal
    +    let count1 = try Player.fetchCount(db)
    +    let count2 = try Player.fetchCount(db)
    +}
    +
    + +
    +

    In database queues, reads happen in the same protected dispatch queue as writes: isolation is just a consequence of the serialization of database accesses

    + +

    Database pools and snapshots both use the “snapshot isolation” made possible by SQLite’s WAL mode (see Isolation In SQLite).

    +
  • +
  • :bowtie: Guarantee 3: requests don’t fail, unless a database constraint violation, a programmer mistake, or a very low-level issue such as a disk error or an unreadable database file. GRDB grants correct use of SQLite, and particularly avoids locking errors and other SQLite misuses.

  • +
+ +

Those guarantees hold as long as you follow three rules:

+ +
    +
  • :point_up: Rule 1: Have a unique instance of DatabaseQueue or DatabasePool connected to any database file.

    + +

    This means that opening a new connection each time you access the database is a bad idea. Do share a single connection instead.

    + +

    See the Demo Application for a sample app that sets up a single database queue that is available throughout the application.

    + +

    See App Group Containers for the specific setup required by applications that share their database files.

    +
    // SAFE CONCURRENCY
    +func fetchCurrentUser(_ db: Database) throws -> User? {
    +    return try User.fetchOne(db)
    +}
    +// dbQueue is a singleton defined somewhere in your app
    +let user = try dbQueue.read { db in // or dbPool.read
    +    try fetchCurrentUser(db)
    +}
    +
    +// UNSAFE CONCURRENCY
    +// This method fails when some other thread is currently writing into
    +// the database.
    +func currentUser() throws -> User? {
    +    let dbQueue = try DatabaseQueue(...)
    +    return try dbQueue.read { db in
    +        try User.fetchOne(db)
    +    }
    +}
    +let user = try currentUser()
    +
  • +
  • :point_up: Rule 2: Group related statements within a single call to a DatabaseQueue or DatabasePool database access method (or use snapshots).

    + +

    Database access methods isolate your groups of related statements against eventual database updates performed by other threads, and guarantee a consistent view of the database. This isolation is only guaranteed inside the closure argument of those methods. Two consecutive calls do not guarantee isolation:

    +
    // SAFE CONCURRENCY
    +try dbPool.read { db in  // or dbQueue.read
    +    // Guaranteed to be equal:
    +    let count1 = try Place.fetchCount(db)
    +    let count2 = try Place.fetchCount(db)
    +}
    +
    +// UNSAFE CONCURRENCY
    +// Those two values may be different because some other thread may have
    +// modified the database between the two blocks:
    +let count1 = try dbPool.read { db in try Place.fetchCount(db) }
    +let count2 = try dbPool.read { db in try Place.fetchCount(db) }
    +
    + +

    In the same vein, when you fetch values that depends on some database updates, group them:

    +
    // SAFE CONCURRENCY
    +try dbPool.write { db in
    +    // The count is guaranteed to be non-zero
    +    try Place(...).insert(db)
    +    let count = try Place.fetchCount(db)
    +}
    +
    +// UNSAFE CONCURRENCY
    +// The count may be zero because some other thread may have performed
    +// a deletion between the two blocks:
    +try dbPool.write { db in try Place(...).insert(db) }
    +let count = try dbPool.read { db in try Place.fetchCount(db) }
    +
    + +

    On that last example, see Advanced DatabasePool if you look after extra performance.

  • +
  • :point_up: Rule 3: When you perform several modifications of the database that temporarily put the database in an inconsistent state, make sure those modifications are grouped within a transaction.

    +
    // SAFE CONCURRENCY
    +try dbPool.write { db in               // or dbQueue.write
    +    try Credit(destinationAccount, amount).insert(db)
    +    try Debit(sourceAccount, amount).insert(db)
    +}
    +
    +// SAFE CONCURRENCY
    +try dbPool.writeInTransaction { db in  // or dbQueue.inTransaction
    +    try Credit(destinationAccount, amount).insert(db)
    +    try Debit(sourceAccount, amount).insert(db)
    +    return .commit
    +}
    +
    +// UNSAFE CONCURRENCY
    +try dbPool.writeWithoutTransaction { db in
    +    try Credit(destinationAccount, amount).insert(db)
    +    // <- Concurrent dbPool.read sees a partial db update here
    +    try Debit(sourceAccount, amount).insert(db)
    +}
    +
    + +

    Without transaction, DatabasePool.read { ... } may see the first statement, but not the second, and access a database where the balance of accounts is not zero. A highly bug-prone situation.

    + +

    So do use transactions in order to guarantee database consistency accross your application threads: that’s what they are made for.

  • +
+

Differences between Database Queues and Pools

+ +

Despite the common guarantees and rules shared by database queues and pools, those two database accessors don’t have the same behavior.

+ +

Database queues serialize all database accesses, reads, and writes. There is never more than one thread that uses the database. In the image below, we see how three threads can see the database as time passes:

+ +

DatabaseQueueScheduling

+ +

Database pools also serialize all writes. But they allow concurrent reads and writes, and isolate reads so that they don’t see changes performed by other threads. This gives a very different picture:

+ +

DatabasePoolScheduling

+ +

See how, with database pools, two reads can see different database states at the same time.

+ +

For more information about database pools, grab information about SQLite WAL mode and snapshot isolation. See Database Observation when you look after automatic notifications of database changes.

+

Advanced DatabasePool

+ + +

The concurrentRead Method

+ +

Database pools are very concurrent, since all reads can run in parallel, and can even run during write operations. But writes are still serialized: at any given point in time, there is no more than a single thread that is writing into the database.

+ +

When your application modifies the database, and then reads some value that depends on those modifications, you may want to avoid locking the writer queue longer than necessary:

+
try dbPool.write { db in
+    // Increment the number of players
+    try Player(...).insert(db)
+
+    // Read the number of players. The writer queue is still locked :-(
+    let count = try Player.fetchCount(db)
+}
+
+ +

A wrong solution is to chain a write then a read, as below. Don’t do that, because another thread may modify the database in between, and make the read unreliable:

+
// WRONG
+try dbPool.write { db in
+    // Increment the number of players
+    try Player(...).insert(db)
+}
+// <- other threads can write in the database here
+try dbPool.read { db in
+    // Read some random value :-(
+    let count = try Player.fetchCount(db)
+}
+
+ +

The correct solution is the concurrentRead method, which must be called from within a write block, outside of any transaction.

+ +

concurrentRead returns a future value which you consume on any dispatch queue, with the wait() method:

+
// CORRECT
+let futureCount: DatabaseFuture<Int> = try dbPool.writeWithoutTransaction { db in
+    // increment the number of players
+    try Player(...).insert(db)
+
+    // <- not in a transaction here
+    let futureCount = dbPool.concurrentRead { db
+        return try Player.fetchCount(db)
+    }
+    return futureCount
+}
+// <- The writer queue has been unlocked :-)
+
+// Wait for the player count
+let count: Int = try futureCount.wait()
+
+ +

concurrentRead blocks until it can guarantee its closure argument an isolated access to the last committed state of the database. It then asynchronously executes the closure.

+ +

The closure can run concurrently with eventual updates performed after concurrentRead: those updates won’t be visible from within the closure. In the example below, the number of players is guaranteed to be non-zero, even though it is fetched concurrently with the player deletion:

+
try dbPool.writeWithoutTransaction { db in
+    // Increment the number of players
+    try Player(...).insert(db)
+
+    let futureCount = dbPool.concurrentRead { db
+        // Guaranteed to be non-zero
+        return try Player.fetchCount(db)
+    }
+
+    try Player.deleteAll(db)
+}
+
+ +

Transaction Observers can also use concurrentRead in their databaseDidCommit method in order to process database changes without blocking other threads that want to write into the database.

+

The barrierWriteWithoutTransaction Method

+
try dbPool.barrierWriteWithoutTransaction { db in
+    // Exclusive database access
+}
+
+ +

The barrier write guarantees exclusive access to the database: the method blocks until all concurrent database accesses are completed, reads and writes, and postpones all other accesses until it completes.

+ +

There is a known limitation: reads performed by database snapshots are out of scope, and may run concurrently with the barrier.

+

Database Snapshots

+ +

Database pool can take snapshots. A database snapshot sees an unchanging database content, as it existed at the moment it was created.

+ +

“Unchanging” means that a snapshot never sees any database modifications during all its lifetime. And yet it doesn’t prevent database updates. This “magic” is made possible by SQLite’s WAL mode (see Isolation In SQLite).

+ +

You create snapshots from a database pool:

+
let snapshot = try dbPool.makeSnapshot()
+
+ +

You can create as many snapshots as you need, regardless of the maximum number of readers in the pool. A snapshot database connection is closed when the snapshot gets deallocated.

+ +

A snapshot can be used from any thread. Its read methods is synchronous, and blocks the current thread until your database statements are executed:

+
// Read values:
+try snapshot.read { db in
+    let players = try Player.fetchAll(db)
+    let playerCount = try Player.fetchCount(db)
+}
+
+// Extract a value from the database:
+let playerCount = try snapshot.read { db in
+    try Player.fetchCount(db)
+}
+
+ +

When you want to control the latest committed changes seen by a snapshot, create the snapshot from the pool’s writer protected dispatch queue, outside of any transaction:

+
let snapshot1 = try dbPool.writeWithoutTransaction { db -> DatabaseSnapshot in
+    try db.inTransaction {
+        // delete all players
+        try Player.deleteAll()
+        return .commit
+    }
+
+    // <- not in a transaction here
+    return dbPool.makeSnapshot()
+}
+// <- Other threads may modify the database here
+let snapshot2 = try dbPool.makeSnapshot()
+
+try snapshot1.read { db in
+    // Guaranteed to be zero
+    try Player.fetchCount(db)
+}
+
+try snapshot2.read { db in
+    // Could be anything
+    try Player.fetchCount(db)
+}
+
+ +
+

:point_up: Note: snapshots currently serialize all database accesses. In the future, snapshots may allow concurrent reads.

+
+

DatabaseWriter and DatabaseReader Protocols

+ +

Both DatabaseQueue and DatabasePool adopt the DatabaseReader and DatabaseWriter protocols. DatabaseSnapshot adopts DatabaseReader only.

+ +

These protocols provide a unified API that let you write generic code that targets all concurrency modes. They fuel, for example:

+ + + +

Only five types adopt those protocols: DatabaseQueue, DatabasePool, DatabaseSnapshot, AnyDatabaseReader, and AnyDatabaseWriter. Expanding this set is not supported: any future GRDB release may break your custom writers and readers, without notice.

+ +

DatabaseReader and DatabaseWriter provide the smallest common guarantees: they don’t erase the differences between queues, pools, and snapshots. See for example Differences between Database Queues and Pools.

+ +

However, you can prevent some parts of your application from writing in the database by giving them a DatabaseReader:

+
// This class can read in the database, but can't write into it.
+class MyReadOnlyComponent {
+    let reader: DatabaseReader
+
+    init(reader: DatabaseReader) {
+        self.reader = reader
+    }
+}
+
+let dbQueue: DatabaseQueue = ...
+let component = MyReadOnlyComponent(reader: dbQueue)
+
+ +
+

:point_up: Note: DatabaseReader is not a secure way to prevent an application component from writing in the database, because write access is just a cast away:

+
if let dbQueue = reader as? DatabaseQueue {
+    try dbQueue.write { ... }
+}
+
+
+

Asynchronous APIs

+ +

Database queues, pools, snapshots, as well as their common protocols DatabaseReader and DatabaseWriter provide asynchronous database access methods.

+ + +

asyncRead

+ +

The asyncRead method can be used from any thread. It submits your database statements for asynchronous execution on a protected dispatch queue:

+
reader.asyncRead { (result: Result<Database, Error>) in
+    try {
+        let db = try result.get()
+        let players = try Player.fetchAll(db)
+    } catch {
+        // handle error
+    }
+}
+
+ +

The argument function accepts a standard Result<Database, Error> which may contain a failure if it was impossible to start a reading access to the database.

+ +

Any attempt at modifying the database throws an error.

+ +

When you use a database queue or a database snapshot, the read has to wait for any eventual concurrent database access performed by this queue or snapshot to complete.

+ +

When you use a database pool, reads are generally non-blocking, unless the maximum number of concurrent reads has been reached. In this case, a read has to wait for another read to complete. That maximum number can be configured.

+ +
+

:point_up: Note: because it uses the standard Result type, asyncRead is only available with a Swift 5+ compiler, starting Xcode 10.2.

+
+

asyncWrite

+ +

The asyncWrite method can be used from any thread. It submits your database statements for asynchronous execution on a protected dispatch queue, wrapped inside a database transaction:

+
writer.asyncWrite({ (db: Database) in
+    try Player(...).insert(db)
+}, completion: { (db: Database, result: Result<Void, Error>) in
+    switch result {
+    case let .success:
+        // handle transaction success
+    case let .failure(error):
+        // handle transaction error
+    }
+})
+
+ +

asyncWrite accepts two function arguments. The first one executes your database updates. The second one is a completion function which accepts a database connection and the result of the asynchronous transaction.

+ +

On the first unhandled error during database updates, all changes are reverted, the whole transaction is rollbacked, and the error is passed to the completion function.

+ +

When the transaction completes successfully, the result of the first function is contained in the standard Result passed to the completion function:

+
writer.asyncWrite({ (db: Database) -> Int in
+    try Player(...).insert(db)
+    return try Player.fetchCount(db)
+}, completion: { (db: Database, result: Result<Int, Error>) in
+    switch result {
+    case let .success(newPlayerCount):
+        print("new player count: \(newPlayerCount)")
+    case let .failure(error):
+        // handle transaction error
+    }
+})
+
+ +

The scheduled asynchronous transaction has to wait for any eventual concurrent database write to complete before it can start.

+ +
+

:point_up: Note: because it uses the standard Result type, asyncWrite is only available with a Swift 5+ compiler, starting Xcode 10.2.

+
+

asyncWriteWithoutTransaction

+ +

The asyncWriteWithoutTransaction method can be used from any thread. It submits your database statements for asynchronous execution on a protected dispatch queue, outside of any transaction:

+
writer.asyncWriteWithoutTransaction { (db: Database) in
+    try {
+        try Player(...).insert(db)
+    } catch {
+        // handle error
+    }
+}
+
+ +

Writing outside of any transaction is dangerous. You should almost always prefer the asyncWrite method described above. Please see Transactions and Savepoints for more information.

+ +

The scheduled asynchronous updates have to wait for any eventual concurrent database write to complete before they can start.

+

asyncConcurrentRead

+ +

The asyncConcurrentRead method is available on database pools only. It is the asynchronous equivalent of the concurrentRead described in the Advanced DatabasePool chapter.

+ +

It must be called from a writing dispatch queue, outside of any transaction. You’ll get a fatal error otherwise.

+ +

The closure argument is guaranteed to see the database in the last committed state at the moment this method is called. Eventual concurrent database updates are not visible inside the block.

+ +

asyncConcurrentRead blocks until it can guarantee its closure argument an isolated access to the last committed state of the database. It then asynchronously executes the closure.

+ +

In the example below, the number of players is fetched concurrently with the player insertion. Yet the future is guaranteed to return zero:

+
try writer.asyncWriteWithoutTransaction { db in
+    do {
+        // Delete all players
+        try Player.deleteAll()
+
+        // <- not in a transaction here
+        // Count players concurrently
+        writer.asyncConcurrentRead { (result: Result<Database, Error>) in
+            try {
+                let db = try result.get()
+                // Guaranteed to be zero
+                let count = try Player.fetchCount()
+            } catch {
+                // handle error
+            }
+        }
+
+        // Insert a player
+        try Player(...).insert(db)
+    } catch {
+        // handle error
+    }
+}
+
+ +
+

:point_up: Note: because it uses the standard Result type, asyncWriteWithoutTransaction is only available with a Swift 5+ compiler, starting Xcode 10.2.

+
+

Unsafe Concurrency APIs

+ +

Database queues, pools, snapshots, as well as their common protocols DatabaseReader and DatabaseWriter provide unsafe database access methods. Unsafe APIs lift concurrency guarantees, and allow advanced yet unsafe patterns.

+ +
    +
  • unsafeRead

    + +

    The unsafeRead method is synchronous, and blocks the current thread until your database statements are executed in a protected dispatch queue. GRDB does just the bare minimum to provide a database connection that can read.

    + +

    When used on a database pool, reads are no longer isolated:

    +
    dbPool.unsafeRead { db in
    +    // Those two values may be different because some other thread
    +    // may have inserted or deleted a player between the two requests:
    +    let count1 = try Player.fetchCount(db)
    +    let count2 = try Player.fetchCount(db)
    +}
    +
    + +

    When used on a database queue, the closure argument is allowed to write in the database.

  • +
  • unsafeReentrantRead

    + +

    The unsafeReentrantRead behaves just as unsafeRead (see above), and allows reentrant calls:

    +
    dbPool.read { db1 in
    +    // No "Database methods are not reentrant" fatal error:
    +    dbPool.unsafeReentrantRead { db2 in
    +        dbPool.unsafeReentrantRead { db3 in
    +            ...
    +        }
    +    }
    +}
    +
    + +

    Reentrant database accesses make it very easy to break the second safety rule, which says: “group related statements within a single call to a DatabaseQueue or DatabasePool database access method.”. Using a reentrant method is pretty much likely the sign of a wrong application architecture that needs refactoring.

    + +

    There is a single valid use case for reentrant methods, which is when you are unable to control database access scheduling.

  • +
  • unsafeReentrantWrite

    + +

    The unsafeReentrantWrite method is synchronous, and blocks the current thread until your database statements are executed in a protected dispatch queue. Writes are serialized: eventual concurrent database updates are postponed until the block has executed.

    + +

    Reentrant calls are allowed:

    +
    dbQueue.write { db1 in
    +    // No "Database methods are not reentrant" fatal error:
    +    dbQueue.unsafeReentrantWrite { db2 in
    +        dbQueue.unsafeReentrantWrite { db3 in
    +            ...
    +        }
    +    }
    +}
    +
    + +

    Reentrant database accesses make it very easy to break the second safety rule, which says: “group related statements within a single call to a DatabaseQueue or DatabasePool database access method.”. Using a reentrant method is pretty much likely the sign of a wrong application architecture that needs refactoring.

    + +

    There is a single valid use case for reentrant methods, which is when you are unable to control database access scheduling.

  • +
+

Performance

+ +

GRDB is a reasonably fast library, and can deliver quite efficient SQLite access. See Comparing the Performances of Swift SQLite libraries for an overview.

+ +

You’ll find below general advice when you do look after performance:

+ +
    +
  • Focus
  • +
  • Know your platform
  • +
  • Use transactions
  • +
  • Don’t do useless work
  • +
  • Learn about SQL strengths and weaknesses
  • +
  • Avoid strings & dictionaries
  • +
+

Performance tip: focus

+ +

You don’t know which part of your program needs improvement until you have run a benchmarking tool.

+ +

Don’t make any assumption, avoid optimizing code too early, and use Instruments.

+

Performance tip: know your platform

+ +

If your application processes a huge JSON file and inserts thousands of rows in the database right from the main thread, it will quite likely become unresponsive, and provide a sub-quality user experience.

+ +

If not done yet, read the Concurrency Programming Guide and learn how to perform heavy computations without blocking your application.

+ +

Most GRBD APIs are synchronous. Spawning them into parallel queues is as easy as:

+
DispatchQueue.global().async { 
+    dbQueue.write { db in
+        // Perform database work
+    }
+    DispatchQueue.main.async { 
+        // update your user interface
+    }
+}
+
+

Performance tip: use transactions

+ +

Performing multiple updates to the database is much faster when executed inside a transaction. This is because a transaction allows SQLite to postpone writing changes to disk until the final commit:

+
// Inefficient
+try dbQueue.inDatabase { db in // or dbPool.writeWithoutTransaction
+    for player in players {
+        try player.insert(db)
+    }
+}
+
+// Efficient
+try dbQueue.write { db in      // or dbPool.write
+    for player in players {
+        try player.insert(db)
+    }
+}
+
+// Efficient
+try dbQueue.inTransaction { db in // or dbPool.writeInTransaction
+    for player in players {
+        try player.insert(db)
+    }
+    return .commit
+}
+
+

Performance tip: don’t do useless work

+ +

Obviously, no code is faster than any code.

+ +

Don’t fetch columns you don’t use

+
// SELECT * FROM player
+try Player.fetchAll(db)
+
+// SELECT id, name FROM player
+try Player.select(idColumn, nameColumn).fetchAll(db)
+
+ +

If your Player type can’t be built without other columns (it has non-optional properties for other columns), do define and use a different type.

+ +

See Columns Selected by a Request for more information.

+ +

Don’t fetch rows you don’t use

+ +

Use fetchOne when you need a single value, and otherwise limit your queries at the database level:

+
// Wrong way: this code may discard hundreds of useless database rows
+let players = try Player.order(scoreColumn.desc).fetchAll(db)
+let hallOfFame = players.prefix(5)
+
+// Better way
+let hallOfFame = try Player.order(scoreColumn.desc).limit(5).fetchAll(db)
+
+ +

Don’t copy values unless necessary

+ +

Particularly: the Array returned by the fetchAll method, and the cursor returned by fetchCursor aren’t the same:

+ +

fetchAll copies all values from the database into memory, when fetchCursor iterates database results as they are generated by SQLite, taking profit from SQLite efficiency.

+ +

You should only load arrays if you need to keep them for later use (such as iterating their contents in the main thread). Otherwise, use fetchCursor.

+ +

See fetching methods for more information about fetchAll and fetchCursor. See also the Row.dataNoCopy method.

+ +

Don’t update rows unless necessary

+ +

An UPDATE statement is costly: SQLite has to look for the updated row, update values, and write changes to disk.

+ +

When the overwritten values are the same as the existing ones, it’s thus better to avoid performing the UPDATE statement:.

+
if player.hasDatabaseChanges {
+    try player.update(db)
+}
+
+ +

See Record Comparison for more information.

+

Performance tip: learn about SQL strengths and weaknesses

+ +

Consider a simple use case: your store application has to display a list of authors with the number of available books:

+ +
    +
  • J. M. Coetzee (6)
  • +
  • Herman Melville (1)
  • +
  • Alice Munro (3)
  • +
  • Kim Stanley Robinson (7)
  • +
  • Oliver Sacks (4)
  • +
+ +

The following code is inefficient. It is an example of the N+1 problem, because it performs one query to load the authors, and then N queries, as many as there are authors. This turns very inefficient as the number of authors grows:

+
// SELECT * FROM author
+let authors = try Author.fetchAll(db)
+for author in authors {
+    // SELECT COUNT(*) FROM book WHERE authorId = ...
+    author.bookCount = try Book.filter(authorIdColumn == author.id).fetchCount(db)
+}
+
+ +

Instead, perform a single query:

+
let sql = """
+    SELECT author.*, COUNT(book.id) AS bookCount
+    FROM author
+    LEFT JOIN book ON book.authorId = author.id
+    GROUP BY author.id
+    """
+let authors = try Author.fetchAll(db, sql: sql)
+
+ +

In the example above, consider extending your Author with an extra bookCount property, or define and use a different type.

+ +

Generally, define indexes on your database tables, and use SQLite’s efficient query planning:

+ + +

Performance tip: avoid strings & dictionaries

+ +

The String and Dictionary Swift types are better avoided when you look for the best performance.

+ +

Now GRDB records, for your convenience, do use strings and dictionaries:

+
class Player : Record {
+    var id: Int64?
+    var name: String
+    var email: String
+
+    required init(_ row: Row) {
+        id = row["id"]       // String
+        name = row["name"]   // String
+        email = row["email"] // String
+        super.init()
+    }
+
+    override func encode(to container: inout PersistenceContainer) {
+        container["id"] = id              // String
+        container["name"] = name          // String
+        container["email"] = email        // String
+    }
+}
+
+ +

When convenience hurts performance, you can still use records, but you have better avoiding their string and dictionary-based methods.

+ +

For example, when fetching values, prefer loading columns by index:

+
// Strings & dictionaries
+let players = try Player.fetchAll(db)
+
+// Column indexes
+// SELECT id, name, email FROM player
+let request = Player.select(idColumn, nameColumn, emailColumn)
+let rows = try Row.fetchCursor(db, request)
+while let row = try rows.next() {
+    let id: Int64 = row[0]
+    let name: String = row[1]
+    let email: String = row[2]
+    let player = Player(id: id, name: name, email: email)
+    ...
+}
+
+ +

When inserting values, use reusable prepared statements, and set statements values with an array:

+
// Strings & dictionaries
+for player in players {
+    try player.insert(db)
+}
+
+// Prepared statement
+let insertStatement = db.prepareStatement("INSERT INTO player (name, email) VALUES (?, ?)")
+for player in players {
+    // Only use the unsafe arguments setter if you are sure that you provide
+    // all statement arguments. A mistake can store unexpected values in
+    // the database.
+    insertStatement.unsafeSetArguments([player.name, player.email])
+    try insertStatement.execute()
+}
+
+

FAQ

+ + +

How do I create a database in my application?

+ +

This question assumes that your application has to create a new database from scratch. If your app has to open an existing database that is embedded inside your application as a resource, see How do I open a database stored as a resource of my application? instead.

+ +

The database has to be stored in a valid place where it can be created and modified. For example, in the Application Support directory:

+
let databaseURL = try FileManager.default
+    .url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
+    .appendingPathComponent("db.sqlite")
+let dbQueue = try DatabaseQueue(path: databaseURL.path)
+
+

How do I open a database stored as a resource of my application?

+ +

If your application does not need to modify the database, open a read-only connection to your resource:

+
var config = Configuration()
+config.readonly = true
+let dbPath = Bundle.main.path(forResource: "db", ofType: "sqlite")!
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+ +

If the application should modify the database, you need to copy it to a place where it can be modified. For example, in the Application Support directory. Only then, open a connection:

+
let fileManager = FileManager.default
+let dbPath = try fileManager
+    .url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
+    .appendingPathComponent("db.sqlite")
+    .path
+if !fileManager.fileExists(atPath: dbPath) {
+    let dbResourcePath = Bundle.main.path(forResource: "db", ofType: "sqlite")!
+    try fileManager.copyItem(atPath: dbResourcePath, toPath: dbPath)
+}
+let dbQueue = try DatabaseQueue(path: dbPath)
+
+

How do I close a database connection?

+ +

Database connections are managed by database queues and pools. A connection is closed when its database queue or pool is deallocated, and all usages of this connection are completed.

+ +

Database accesses that run in background threads postpone the closing of connections.

+

How do I print a request as SQL?

+ +

When you want to debug a request that does not deliver the expected results, you may want to print the SQL that is actually executed.

+ +

You can turn your request into a SQLRequest instance:

+
try dbQueue.read { db in
+    let request = Wine
+        .filter(originColumn == "Burgundy")
+        .order(priceColumn)
+
+    let sqlRequest = try SQLRequest(db, request: request)
+    print(sqlRequest.sql)
+    // Prints SELECT * FROM wine WHERE origin = ? ORDER BY price
+    print(sqlRequest.arguments)
+    // Prints ["Burgundy"]
+}
+
+ +

Another option is to setup a tracing function that will print out all SQL requests executed by your application. You provide the trace function when you connect to the database:

+
var config = Configuration()
+config.trace = { print($0) } // Prints all SQL statements
+let dbQueue = try DatabaseQueue(path: dbPath, configuration: config)
+
+try dbQueue.read { db in
+    let wines = Wine
+        .filter(originColumn == "Burgundy")
+        .order(priceColumn)
+        .fetchAll(db)
+    // Prints SELECT * FROM wine WHERE origin = 'Burgundy' ORDER BY price
+}
+
+ +
+

:point_up: Note: the generated SQL may change between GRDB releases, without notice: don’t have your application rely on any specific SQL output.

+
+

Generic parameter ‘T’ could not be inferred

+ +

You may get this error when using the read and write methods of database queues and pools:

+
// Generic parameter 'T' could not be inferred
+let string = try dbQueue.read { db in
+    let result = try String.fetchOne(db, ...)
+    return result
+}
+
+ +

This is a limitation of the Swift compiler.

+ +

The general workaround is to explicitly declare the type of the closure result:

+
// General Workaround
+let string = try dbQueue.read { db -> String? in
+    let result = try String.fetchOne(db, ...)
+    return result
+}
+
+ +

You can also, when possible, write a single-line closure:

+
// Single-line closure workaround:
+let string = try dbQueue.read { db in
+    try String.fetchOne(db, ...)
+}
+
+

SQLite error 10 “disk I/O error”, SQLite error 23 “not authorized”

+ +

Those errors may be the sign that SQLite can’t access the database due to data protection.

+ +

When your application should be able to run in the background on a locked device, it has to catch this error, and, for example, wait for UIApplicationDelegate.applicationProtectedDataDidBecomeAvailable(_:) or UIApplicationProtectedDataDidBecomeAvailable notification and retry the failed database operation.

+
do {
+    try ...
+} catch let error as DatabaseError where
+    error.resultCode == .SQLITE_IOERR ||
+    error.resultCode == .SQLITE_AUTH
+{
+    // Handle possible data protection error
+}
+
+ +

This error can also be prevented altogether by using a more relaxed file protection.

+

SQLite error 21 “wrong number of statement arguments” with LIKE queries

+ +

You may get the error “wrong number of statement arguments” when executing a LIKE query similar to:

+
let name = textField.text
+let players = try dbQueue.read { db in
+    try Player.fetchAll(db, sql: "SELECT * FROM player WHERE name LIKE '%?%'", arguments: [name])
+}
+
+ +

The problem lies in the '%?%' pattern.

+ +

SQLite only interprets ? as a parameter when it is a placeholder for a whole value (int, double, string, blob, null). In this incorrect query, ? is just a character in the '%?%' string: it is not a query parameter, and is not processed in any way. See https://www.sqlite.org/lang_expr.html#varparam for more information about SQLite parameters.

+ +

To fix the error, you can feed the request with the pattern itself, instead of the name:

+
let name = textField.text
+let players: [Player] = try dbQueue.read { db in
+    let pattern = "%\(name)%"
+    return try Player.fetchAll(db, sql: "SELECT * FROM player WHERE name LIKE ?", arguments: [pattern])
+}
+
+

What Are Experimental Features?

+ +

Since GRDB 1.0, all backwards compatibility guarantees of semantic versioning apply: no breaking change will happen until the next major version of the library.

+ +

There is an exception, though: experimental features, marked with the “:fire: EXPERIMENTAL” badge. Those are advanced features that are too young, or lack user feedback. They are not stabilized yet.

+ +

Those experimental features are not protected by semantic versioning, and may break between two minor releases of the library. To help them becoming stable, your feedback is greatly appreciated.

+

Sample Code

+ + + +
+ +

Thanks

+ + + +
+ +

URIs don’t change: people change them.

+

Changes Tracking

+ +

This chapter has been renamed Record Comparison.

+

FetchedRecordsController

+ +

This chapter has moved.

+

Persistable Protocol

+ +

This protocol has been renamed PersistableRecord in GRDB 3.0.

+

RowConvertible Protocol

+ +

This protocol has been renamed FetchableRecord in GRDB 3.0.

+

TableMapping Protocol

+ +

This protocol has been renamed TableRecord in GRDB 3.0.

+

Customized Decoding of Database Rows

+ +

This chapter has been renamed Beyond FetchableRecord.

+ + +

This chapter has moved.

+

Enabling FTS5 Support

+ +

This chapter has moved.

+

Dealing with External Connections

+ +

This chapter has been superseded by App Group Containers.

+ +
+
+ +
+
+ + + diff --git a/docs/4.8/js/jazzy.js b/docs/4.8/js/jazzy.js new file mode 100755 index 000000000..c31dc05e4 --- /dev/null +++ b/docs/4.8/js/jazzy.js @@ -0,0 +1,59 @@ +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +function toggleItem($link, $content) { + var animationDuration = 300; + $link.toggleClass('token-open'); + $content.slideToggle(animationDuration); +} + +function itemLinkToContent($link) { + return $link.parent().parent().next(); +} + +// On doc load + hash-change, open any targetted item +function openCurrentItemIfClosed() { + if (window.jazzy.docset) { + return; + } + var $link = $(`.token[href="${location.hash}"]`); + $content = itemLinkToContent($link); + if ($content.is(':hidden')) { + toggleItem($link, $content); + } +} + +$(openCurrentItemIfClosed); +$(window).on('hashchange', openCurrentItemIfClosed); + +// On item link ('token') click, toggle its discussion +$('.token').on('click', function(event) { + if (window.jazzy.docset) { + return; + } + var $link = $(this); + toggleItem($link, itemLinkToContent($link)); + + // Keeps the document from jumping to the hash. + var href = $link.attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Clicks on links to the current, closed, item need to open the item +$("a:not('.token')").on('click', function() { + if (location == this.href) { + openCurrentItemIfClosed(); + } +}); diff --git a/docs/4.8/js/jquery.min.js b/docs/4.8/js/jquery.min.js new file mode 100644 index 000000000..a1c07fd80 --- /dev/null +++ b/docs/4.8/js/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0A tracing function that takes an SQL string.

"},"Typealiases.html#/s:4GRDB16SQLiteConnectiona":{"name":"SQLiteConnection","abstract":"

A raw SQLite connection, suitable for the SQLite C API.

"},"Typealiases.html#/s:4GRDB15SQLiteStatementa":{"name":"SQLiteStatement","abstract":"

A raw SQLite statement, suitable for the SQLite C API.

"},"Typealiases.html#/FTS5TokenCallback":{"name":"FTS5TokenCallback","abstract":"

A low-level SQLite function that lets FTS5Tokenizer notify tokens.

"},"Typealiases.html#/FTS5WrapperTokenCallback":{"name":"FTS5WrapperTokenCallback","abstract":"

A function that lets FTS5WrapperTokenizer notify tokens.

"},"Typealiases.html#/s:4GRDB17FTS5TokenCallbacka":{"name":"FTS5TokenCallback","abstract":"

A low-level SQLite function that lets FTS5Tokenizer notify tokens.

"},"Typealiases.html#/s:4GRDB24FTS5WrapperTokenCallbacka":{"name":"FTS5WrapperTokenCallback","abstract":"

A function that lets FTS5WrapperTokenizer notify tokens.

"},"Structs/FTS5TokenFlags.html#/s:SY8rawValue03RawB0Qzvp":{"name":"rawValue","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenFlags.html#/s:s9OptionSetP8rawValuex03RawD0Qz_tcfc":{"name":"init(rawValue:)","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenFlags.html#/s:4GRDB14FTS5TokenFlagsV9colocatedACvpZ":{"name":"colocated","abstract":"

FTS5_TOKEN_COLOCATED

","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenizerDescriptor.html#/s:4GRDB23FTS5TokenizerDescriptorV10componentsSaySSGvp":{"name":"components","abstract":"

The tokenizer components

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/s:4GRDB23FTS5TokenizerDescriptorV10componentsACSaySSG_tcfc":{"name":"init(components:)","abstract":"

Creates an FTS5 tokenizer descriptor.

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/s:4GRDB23FTS5TokenizerDescriptorV5ascii10separatorsACShySJG_tFZ":{"name":"ascii(separators:)","abstract":"

The “ascii” tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/s:4GRDB23FTS5TokenizerDescriptorV6porter8wrappingA2CSg_tFZ":{"name":"porter(wrapping:)","abstract":"

See https://www.sqlite.org/fts5.html#porter_tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/s:4GRDB23FTS5TokenizerDescriptorV9unicode6110diacritics10separators15tokenCharactersAcA0B0V10DiacriticsO_ShySJGALtFZ":{"name":"unicode61(diacritics:separators:tokenCharacters:)","abstract":"

An “unicode61” tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5Tokenization.html#/s:SY8rawValue03RawB0Qzvp":{"name":"rawValue","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/s:s9OptionSetP8rawValuex03RawD0Qz_tcfc":{"name":"init(rawValue:)","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/s:4GRDB16FTS5TokenizationV5queryACvpZ":{"name":"query","abstract":"

FTS5_TOKENIZE_QUERY

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/s:4GRDB16FTS5TokenizationV6prefixACvpZ":{"name":"prefix","abstract":"

FTS5_TOKENIZE_PREFIX

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/s:4GRDB16FTS5TokenizationV8documentACvpZ":{"name":"document","abstract":"

FTS5_TOKENIZE_DOCUMENT

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/s:4GRDB16FTS5TokenizationV3auxACvpZ":{"name":"aux","abstract":"

FTS5_TOKENIZE_AUX

","parent_name":"FTS5Tokenization"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV03rawC0SSvp":{"name":"rawPattern","abstract":"

The raw pattern string. Guaranteed to be a valid FTS5 pattern.

","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV18matchingAnyTokenInACSgSS_tcfc":{"name":"init(matchingAnyTokenIn:)","abstract":"

Creates a pattern that matches any token found in the input string;","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV19matchingAllTokensInACSgSS_tcfc":{"name":"init(matchingAllTokensIn:)","abstract":"

Creates a pattern that matches all tokens found in the input string;","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV14matchingPhraseACSgSS_tcfc":{"name":"init(matchingPhrase:)","abstract":"

Creates a pattern that matches a contiguous string; returns nil if no","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV20matchingPrefixPhraseACSgSS_tcfc":{"name":"init(matchingPrefixPhrase:)","abstract":"

Creates a pattern that matches a contiguous string prefix; returns","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV13databaseValueAA08DatabaseE0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/s:4GRDB11FTS5PatternV17fromDatabaseValueyACSgAA0eF0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an FTS5Pattern initialized from dbValue, if it","parent_name":"FTS5Pattern"},"Structs/FTS5/Diacritics.html#/s:4GRDB4FTS5V10DiacriticsO4keepyA2EmF":{"name":"keep","abstract":"

Do not remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS5/Diacritics.html#/s:4GRDB4FTS5V10DiacriticsO12removeLegacyyA2EmF":{"name":"removeLegacy","abstract":"

Remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS5/Diacritics.html#/remove":{"name":"remove","abstract":"

Remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS5/Diacritics.html":{"name":"Diacritics","abstract":"

Options for Latin script characters. Matches the raw “remove_diacritics”","parent_name":"FTS5"},"Structs/FTS5.html#/s:4GRDB4FTS5VACycfc":{"name":"init()","abstract":"

Creates a FTS5 module suitable for the Database","parent_name":"FTS5"},"Structs/FTS5.html#/s:4GRDB4FTS5V10moduleNameSSvp":{"name":"moduleName","abstract":"

The virtual table module name

","parent_name":"FTS5"},"Structs/FTS5.html#/s:4GRDB4FTS5V19makeTableDefinitionAA0bdE0CyF":{"name":"makeTableDefinition()","abstract":"

Don’t use this method.

","parent_name":"FTS5"},"Structs/FTS5.html#/s:4GRDB4FTS5V15moduleArguments3for2inSaySSGAA0B15TableDefinitionC_AA8DatabaseCtKF":{"name":"moduleArguments(for:in:)","abstract":"

Don’t use this method.

","parent_name":"FTS5"},"Structs/FTS5.html#/s:4GRDB4FTS5V8database_9didCreate5usingyAA8DatabaseC_SSAA0B15TableDefinitionCtKF":{"name":"database(_:didCreate:using:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS5"},"Structs/AnyValueReducer.html#/s:4GRDB15AnyValueReducerV5fetch5valueACyxq_GxAA8DatabaseCKc_q_Sgxctcfc":{"name":"init(fetch:value:)","abstract":"

Creates a reducer whose fetch(_:) and value(_:) methods wrap and","parent_name":"AnyValueReducer"},"Structs/AnyValueReducer.html#/s:4GRDB15AnyValueReducerVyACyxq_Gqd__c7FetchedQyd__Rsz0C0Qyd__Rs_AA0cD0Rd__lufc":{"name":"init(_:)","abstract":"

Creates a reducer that wraps and forwards operations to reducer.

","parent_name":"AnyValueReducer"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationV19requiresWriteAccessSbvp":{"name":"requiresWriteAccess","abstract":"

Default is false. Set this property to true when the observation","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationV10schedulingAA0B10SchedulingOvp":{"name":"scheduling","abstract":"

scheduling controls how fresh values are notified. Default","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationV10mapReduceryACyqd__Gqd__AA8DatabaseC_xtKclF":{"name":"mapReducer(_:)","abstract":"

Experimental

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE13trackingCountyACyAA0B8ReducersO16RemoveDuplicatesVy_AF5FetchVy_SiGGGqd__AA0I7RequestRd__lFZ":{"name":"trackingCount(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies its","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingAllyACyAA0B8ReducersO0E6ValuesVy_10RowDecoderQyd__GGqd__AA12FetchRequestRd__AA08DatabaseB11ConvertibleAJRQlFZ":{"name":"trackingAll(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingOneyACyAA0B8ReducersO0eB0Vy_10RowDecoderQyd__GGqd__AA12FetchRequestRd__AA08DatabaseB11ConvertibleAJRQlFZ":{"name":"trackingOne(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingAllyACyAA0B8ReducersO0E14OptionalValuesVy_10RowDecoder_8_WrappedQYd__GGqd__AA12FetchRequestRd__AA01_G8ProtocolAIRpd__AA08DatabaseB11ConvertibleAKRQlFZ":{"name":"trackingAll(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingAllyACyAA0B8ReducersO0E7RecordsVy_10RowDecoderQyd__GGqd__AA12FetchRequestRd__AA15FetchableRecordAJRQlFZ":{"name":"trackingAll(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingOneyACyAA0B8ReducersO0E6RecordVy_10RowDecoderQyd__GGqd__AA12FetchRequestRd__AA09FetchableG0AJRQlFZ":{"name":"trackingOne(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingAllyACyAA0B8ReducersO0E4RowsVGqd__AA12FetchRequestRd__AA3RowC0J7DecoderRtd__lFZ":{"name":"trackingAll(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE11trackingOneyACyAA0B8ReducersO0E3RowVGqd__AA12FetchRequestRd__AA0G0C0G7DecoderRtd__lFZ":{"name":"trackingOne(_:)","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE5start2in8onChangeAA19TransactionObserver_pAA14DatabaseReader_p_y0B0QzctKF":{"name":"start(in:onChange:)","abstract":"

Starts the value observation in the provided database reader (such as","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE5start2in7onError0G6ChangeAA19TransactionObserver_pAA14DatabaseReader_p_ys0H0_pcy0B0QzctF":{"name":"start(in:onError:onChange:)","abstract":"

Starts the value observation in the provided database reader (such as","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE8tracking_7reducerACyxGAA25DatabaseRegionConvertible_pd_xAA0G0CKctFZ":{"name":"tracking(_:reducer:)","abstract":"

Returns a ValueObservation which observes regions, and notifies the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE8tracking_7reducerACyxGSayAA25DatabaseRegionConvertible_pG_xAA0G0CKctFZ":{"name":"tracking(_:reducer:)","abstract":"

Returns a ValueObservation which observes regions, and notifies the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE8tracking5valueACyAA0B8ReducersO5FetchVy_qd__GGqd__AA8DatabaseCKc_tlFZ":{"name":"tracking(value:)","abstract":"

Creates a ValueObservation which notifies the values returned by the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE8tracking_5fetchACyAA0B8ReducersO5FetchVy_qd__GGAA25DatabaseRegionConvertible_pd_qd__AA0H0CKctlFZ":{"name":"tracking(_:fetch:)","abstract":"

Creates a ValueObservation which observes regions, and notifies the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE8tracking_5fetchACyAA0B8ReducersO5FetchVy_qd__GGSayAA25DatabaseRegionConvertible_pG_qd__AA0H0CKctlFZ":{"name":"tracking(_:fetch:)","abstract":"

Creates a ValueObservation which observes regions, and notifies the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine2Vy_qd__qd_0_GGACyqd__G_ACyqd_0_GtAA0B7ReducerRd__AaMRd_0_r0_lFZ":{"name":"combine(_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE7combineyACyAA0B8ReducersO3MapVy_AG8Combine2Vy_xqd__Gqd_0_GGACyqd__G_qd_0_0B0Qz_APQyd__tctAaDRd__r0_lF":{"name":"combine(_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine3Vy_qd__qd_0_qd_1_GGACyqd__G_ACyqd_0_GACyqd_1_GtAA0B7ReducerRd__AaNRd_0_AaNRd_1_r1_lFZ":{"name":"combine(_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE7combineyACyAA0B8ReducersO3MapVy_AG8Combine3Vy_xqd__qd_0_Gqd_1_GGACyqd__G_ACyqd_0_Gqd_1_0B0Qz_AQQyd__AQQyd_0_tctAaDRd__AaDRd_0_r1_lF":{"name":"combine(_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine4Vy_qd__qd_0_qd_1_qd_2_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_GtAA0B7ReducerRd__AaORd_0_AaORd_1_AaORd_2_r2_lFZ":{"name":"combine(_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE7combineyACyAA0B8ReducersO3MapVy_AG8Combine4Vy_xqd__qd_0_qd_1_Gqd_2_GGACyqd__G_ACyqd_0_GACyqd_1_Gqd_2_0B0Qz_ARQyd__ARQyd_0_ARQyd_1_tctAaDRd__AaDRd_0_AaDRd_1_r2_lF":{"name":"combine(_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine5Vy_qd__qd_0_qd_1_qd_2_qd_3_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_GACyqd_3_GtAA0B7ReducerRd__AaPRd_0_AaPRd_1_AaPRd_2_AaPRd_3_r3_lFZ":{"name":"combine(_:_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE7combineyACyAA0B8ReducersO3MapVy_AG8Combine5Vy_xqd__qd_0_qd_1_qd_2_Gqd_3_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_Gqd_3_0B0Qz_ASQyd__ASQyd_0_ASQyd_1_ASQyd_2_tctAaDRd__AaDRd_0_AaDRd_1_AaDRd_2_r3_lF":{"name":"combine(_:_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine6Vy_qd__qd_0_qd_1_qd_2_qd_3_qd_4_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_GACyqd_3_GACyqd_4_GtAA0B7ReducerRd__AaQRd_0_AaQRd_1_AaQRd_2_AaQRd_3_AaQRd_4_r4_lFZ":{"name":"combine(_:_:_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine7Vy_qd__qd_0_qd_1_qd_2_qd_3_qd_4_qd_5_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_GACyqd_3_GACyqd_4_GACyqd_5_GtAA0B7ReducerRd__AaRRd_0_AaRRd_1_AaRRd_2_AaRRd_3_AaRRd_4_AaRRd_5_r5_lFZ":{"name":"combine(_:_:_:_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVAAytRszlE7combineyACyAA0B8ReducersO8Combine8Vy_qd__qd_0_qd_1_qd_2_qd_3_qd_4_qd_5_qd_6_GGACyqd__G_ACyqd_0_GACyqd_1_GACyqd_2_GACyqd_3_GACyqd_4_GACyqd_5_GACyqd_6_GtAA0B7ReducerRd__AaSRd_0_AaSRd_1_AaSRd_2_AaSRd_3_AaSRd_4_AaSRd_5_AaSRd_6_r6_lFZ":{"name":"combine(_:_:_:_:_:_:_:_:)","abstract":"

Undocumented

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE10compactMapyACyAA0B8ReducersO07CompactF0Vy_xqd__GGqd__Sg0B0QzclF":{"name":"compactMap(_:)","abstract":"

Returns a ValueObservation which notifies the non-nil results of calling","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzlE3mapyACyAA0B8ReducersO3MapVy_xqd__GGqd__0B0QzclF":{"name":"map(_:)","abstract":"

Returns a ValueObservation which notifies the results of calling the","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzSQ0B0RpzlE20distinctUntilChangedACyAA0B8ReducersO16RemoveDuplicatesVy_xGGyF":{"name":"distinctUntilChanged()","abstract":"

Returns a ValueObservation which filters out consecutive equal values.

","parent_name":"ValueObservation"},"Structs/ValueObservation.html#/s:4GRDB16ValueObservationVA2A0B7ReducerRzSQ0B0RpzlE16removeDuplicatesACyAA0B8ReducersO06RemoveF0Vy_xGGyF":{"name":"removeDuplicates()","abstract":"

Returns a ValueObservation which filters out consecutive equal values.

","parent_name":"ValueObservation"},"Structs/Inflections.html#/s:4GRDB11InflectionsVACycfc":{"name":"init()","abstract":"

Undocumented

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV6plural_7options_ySS_So26NSRegularExpressionOptionsVSStF":{"name":"plural(_:options:_:)","abstract":"

Appends a pluralization rule.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV8singular_7options_ySS_So26NSRegularExpressionOptionsVSStF":{"name":"singular(_:options:_:)","abstract":"

Appends a singularization rule.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV16uncountableWordsyySaySSGF":{"name":"uncountableWords(_:)","abstract":"

Appends uncountable words.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV15irregularSuffixyySS_SStF":{"name":"irregularSuffix(_:_:)","abstract":"

Appends an irregular singular/plural pair.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV9pluralizeyS2SF":{"name":"pluralize(_:)","abstract":"

Returns a pluralized string.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV11singularizeyS2SF":{"name":"singularize(_:)","abstract":"

Returns a singularized string.

","parent_name":"Inflections"},"Structs/Inflections.html#/s:4GRDB11InflectionsV7defaultACvpZ":{"name":"default","abstract":"

The default inflections

","parent_name":"Inflections"},"Structs/PersistenceConflictPolicy.html#/s:4GRDB25PersistenceConflictPolicyV27conflictResolutionForInsertAA8DatabaseC0cF0Ovp":{"name":"conflictResolutionForInsert","abstract":"

The conflict resolution algorithm for insertions

","parent_name":"PersistenceConflictPolicy"},"Structs/PersistenceConflictPolicy.html#/s:4GRDB25PersistenceConflictPolicyV27conflictResolutionForUpdateAA8DatabaseC0cF0Ovp":{"name":"conflictResolutionForUpdate","abstract":"

The conflict resolution algorithm for updates

","parent_name":"PersistenceConflictPolicy"},"Structs/PersistenceConflictPolicy.html#/s:4GRDB25PersistenceConflictPolicyV6insert6updateAcA8DatabaseC0C10ResolutionO_AItcfc":{"name":"init(insert:update:)","abstract":"

Creates a policy

","parent_name":"PersistenceConflictPolicy"},"Structs/FetchedRecordsSectionInfo.html#/s:4GRDB25FetchedRecordsSectionInfoV08numberOfC0Sivp":{"name":"numberOfRecords","abstract":"

The number of records (rows) in the section.

","parent_name":"FetchedRecordsSectionInfo"},"Structs/FetchedRecordsSectionInfo.html#/s:4GRDB25FetchedRecordsSectionInfoV7recordsSayxGvp":{"name":"records","abstract":"

The array of records in the section.

","parent_name":"FetchedRecordsSectionInfo"},"Structs/PersistenceContainer.html#/s:4GRDB20PersistenceContainerVyAA24DatabaseValueConvertible_pSgSScip":{"name":"subscript(_:)","abstract":"

Accesses the value associated with the given column.

","parent_name":"PersistenceContainer"},"Structs/PersistenceContainer.html#/s:4GRDB20PersistenceContainerVyAA24DatabaseValueConvertible_pSgxcAA16ColumnExpressionRzluip":{"name":"subscript(_:)","abstract":"

Accesses the value associated with the given column.

","parent_name":"PersistenceContainer"},"Structs/ForeignKey.html#/s:4GRDB10ForeignKeyV_2toACSaySSG_AESgtcfc":{"name":"init(_:to:)","abstract":"

Creates a ForeignKey intended to define a record association.

","parent_name":"ForeignKey"},"Structs/ForeignKey.html#/s:4GRDB10ForeignKeyV_2toACSayAA16ColumnExpression_pG_AFSgtcfc":{"name":"init(_:to:)","abstract":"

Creates a ForeignKey intended to define a record association.

","parent_name":"ForeignKey"},"Structs/AllColumns.html#/s:4GRDB10AllColumnsVACycfc":{"name":"init()","abstract":"

Undocumented

","parent_name":"AllColumns"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV3absACvpZ":{"name":"abs","abstract":"

The ABS function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV3avgACvpZ":{"name":"avg","abstract":"

The AVG function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV6ifNullACvpZ":{"name":"ifNull","abstract":"

The IFNULL function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV6lengthACvpZ":{"name":"length","abstract":"

The LENGTH function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV3maxACvpZ":{"name":"max","abstract":"

The MAX function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV3minACvpZ":{"name":"min","abstract":"

The MIN function name

","parent_name":"SQLFunctionName"},"Structs/SQLFunctionName.html#/s:4GRDB15SQLFunctionNameV3sumACvpZ":{"name":"sum","abstract":"

The SUM function name

","parent_name":"SQLFunctionName"},"Structs/SQLExpressionLiteral.html#/s:4GRDB20SQLExpressionLiteralV3sqlSSvp":{"name":"sql","abstract":"

Undocumented

","parent_name":"SQLExpressionLiteral"},"Structs/SQLExpressionLiteral.html#/s:4GRDB20SQLExpressionLiteralV9argumentsAA18StatementArgumentsVvp":{"name":"arguments","abstract":"

Undocumented

","parent_name":"SQLExpressionLiteral"},"Structs/SQLExpressionLiteral.html#/s:4GRDB20SQLExpressionLiteralV3sql9argumentsACSS_AA18StatementArgumentsVtcfc":{"name":"init(sql:arguments:)","abstract":"

Experimental

","parent_name":"SQLExpressionLiteral"},"Structs/SQLExpressionLiteral.html#/s:4GRDB20SQLExpressionLiteralV7literalAcA10SQLLiteralV_tcfc":{"name":"init(literal:)","abstract":"

Experimental

","parent_name":"SQLExpressionLiteral"},"Structs/Column.html#/s:4GRDB6ColumnV5rowIDACvpZ":{"name":"rowID","abstract":"

The hidden rowID column

","parent_name":"Column"},"Structs/Column.html#/s:4GRDB6ColumnV4nameSSvp":{"name":"name","abstract":"

The name of the column

","parent_name":"Column"},"Structs/Column.html#/s:4GRDB6ColumnVyACSScfc":{"name":"init(_:)","abstract":"

Creates a column given its name.

","parent_name":"Column"},"Structs/Column.html#/s:4GRDB6ColumnVyACs9CodingKey_pcfc":{"name":"init(_:)","abstract":"

Creates a column given a CodingKey.

","parent_name":"Column"},"Structs/Column.html#/s:4GRDB6ColumnV4rankACvpZ":{"name":"rank","abstract":"

The FTS5 rank column

","parent_name":"Column"},"Structs/QueryInterfaceRequest.html#/s:4GRDB12FetchRequestP10RowDecoderQa":{"name":"RowDecoder","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6selectyACyxGSayAA13SQLSelectable_pGF":{"name":"select(_:)","abstract":"

Creates a request which selects selection.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6select_2asACyqd__GSayAA13SQLSelectable_pG_qd__mtlF":{"name":"select(_:as:)","abstract":"

Creates a request which selects selection, and fetches values of","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6select_2asACyqd__GAA13SQLSelectable_pd_qd__mtlF":{"name":"select(_:as:)","abstract":"

Creates a request which selects selection, and fetches values of","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6select3sql9arguments2asACyqd__GSS_AA18StatementArgumentsVqd__mtlF":{"name":"select(sql:arguments:as:)","abstract":"

Creates a request which selects sql, and fetches values of","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6select7literal2asACyqd__GAA10SQLLiteralV_qd__mtlF":{"name":"select(literal:as:)","abstract":"

Creates a request which selects an SQL literal, and fetches values of","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV9annotated4withACyxGSayAA13SQLSelectable_pG_tF":{"name":"annotated(with:)","abstract":"

Creates a request which appends selection.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6filteryACyxGAA14SQLExpressible_pAA8DatabaseCKcF":{"name":"filter(_:)","abstract":"

Creates a request with the provided predicate promise added to the","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV5orderyACyxGSayAA15SQLOrderingTerm_pGAA8DatabaseCKcF":{"name":"order(_:)","abstract":"

Creates a request with the provided orderings promise.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV8reversedACyxGyF":{"name":"reversed()","abstract":"

Creates a request that reverses applied orderings.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV9unorderedACyxGyF":{"name":"unordered()","abstract":"

Creates a request without any ordering.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV5groupyACyxGSayAA14SQLExpressible_pGAA8DatabaseCKcF":{"name":"group(_:)","abstract":"

Creates a request grouped according to expressions promise.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV6havingyACyxGAA14SQLExpressible_pF":{"name":"having(_:)","abstract":"

Creates a request with the provided predicate added to the","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV8distinctACyxGyF":{"name":"distinct()","abstract":"

Creates a request which returns distinct rows.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV5limit_6offsetACyxGSi_SiSgtF":{"name":"limit(_:offset:)","abstract":"

Creates a request which fetches limit rows, starting at offset.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV7aliasedyACyxGAA10TableAliasCF":{"name":"aliased(_:)","abstract":"

Creates a request that allows you to define expressions that target","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestV02asD02ofACyqd__Gqd__m_tlF":{"name":"asRequest(of:)","abstract":"

Creates a request bound to type Target.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A11TableRecordRzlE9annotated4withACyxGAA20AssociationAggregateVyxGd_tF":{"name":"annotated(with:)","abstract":"

Creates a request which appends aggregates to the current selection.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A11TableRecordRzlE9annotated4withACyxGSayAA20AssociationAggregateVyxGG_tF":{"name":"annotated(with:)","abstract":"

Creates a request which appends aggregates to the current selection.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A11TableRecordRzlE6havingyACyxGAA20AssociationAggregateVyxGF":{"name":"having(_:)","abstract":"

Creates a request which appends the provided aggregate predicate to","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A24MutablePersistableRecordRzlE9deleteAllySiAA8DatabaseCKF":{"name":"deleteAll(_:)","abstract":"

Deletes matching rows; returns the number of deleted rows.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A24MutablePersistableRecordRzlE9updateAll_10onConflict_SiAA8DatabaseC_AH0K10ResolutionOSgSayAA16ColumnAssignmentVGtKF":{"name":"updateAll(_:onConflict:_:)","abstract":"

Updates matching rows; returns the number of updated rows.

","parent_name":"QueryInterfaceRequest"},"Structs/QueryInterfaceRequest.html#/s:4GRDB21QueryInterfaceRequestVA2A24MutablePersistableRecordRzlE9updateAll_10onConflict__SiAA8DatabaseC_AH0K10ResolutionOSgAA16ColumnAssignmentVAMdtKF":{"name":"updateAll(_:onConflict:_:_:)","abstract":"

Updates matching rows; returns the number of updated rows.

","parent_name":"QueryInterfaceRequest"},"Structs/AssociationAggregate.html#/s:4GRDB20AssociationAggregateV7aliasedyACyxGSSF":{"name":"aliased(_:)","abstract":"

Returns an aggregate that is selected in a column with the given name.

","parent_name":"AssociationAggregate"},"Structs/AssociationAggregate.html#/s:4GRDB20AssociationAggregateV6forKeyyACyxGSSF":{"name":"forKey(_:)","abstract":"

Returns an aggregate that is selected in a column with the given name.

","parent_name":"AssociationAggregate"},"Structs/AssociationAggregate.html#/s:4GRDB20AssociationAggregateV7aliasedyACyxGs9CodingKey_pF":{"name":"aliased(_:)","abstract":"

Returns an aggregate that is selected in a column named like the given","parent_name":"AssociationAggregate"},"Structs/AssociationAggregate.html#/s:4GRDB20AssociationAggregateV6forKeyyACyxGs06CodingE0_pF":{"name":"forKey(_:)","abstract":"

Returns an aggregate that is selected in a column named like the given","parent_name":"AssociationAggregate"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV05eraseB14OnSchemaChangeSbvp":{"name":"eraseDatabaseOnSchemaChange","abstract":"

When the eraseDatabaseOnSchemaChange flag is true, the migrator will","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorVACycfc":{"name":"init()","abstract":"

A new migrator.

","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV17registerMigration_7migrateySS_yAA0B0CKctF":{"name":"registerMigration(_:migrate:)","abstract":"

Registers a migration.

","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV44registerMigrationWithDeferredForeignKeyCheck_7migrateySS_yAA0B0CKctF":{"name":"registerMigrationWithDeferredForeignKeyCheck(_:migrate:)","abstract":"

Undocumented

","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV7migrateyyAA0B6Writer_pKF":{"name":"migrate(_:)","abstract":"

Iterate migrations in the same order as they were registered. If a","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV7migrate_4upToyAA0B6Writer_p_SStKF":{"name":"migrate(_:upTo:)","abstract":"

Iterate migrations in the same order as they were registered, up to the","parent_name":"DatabaseMigrator"},"Structs/DatabaseMigrator.html#/s:4GRDB16DatabaseMigratorV17appliedMigrations2inShySSGAA0B6Reader_p_tKF":{"name":"appliedMigrations(in:)","abstract":"

Returns the set of applied migration identifiers.

","parent_name":"DatabaseMigrator"},"Structs/FTS5TokenFlags.html#/rawValue":{"name":"rawValue","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenFlags.html#/init(rawValue:)":{"name":"init(rawValue:)","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenFlags.html#/colocated":{"name":"colocated","abstract":"

FTS5_TOKEN_COLOCATED

","parent_name":"FTS5TokenFlags"},"Structs/FTS5TokenizerDescriptor.html#/components":{"name":"components","abstract":"

The tokenizer components

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/init(components:)":{"name":"init(components:)","abstract":"

Creates an FTS5 tokenizer descriptor.

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/ascii(separators:)":{"name":"ascii(separators:)","abstract":"

The “ascii” tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/porter(wrapping:)":{"name":"porter(wrapping:)","abstract":"

See https://www.sqlite.org/fts5.html#porter_tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5TokenizerDescriptor.html#/unicode61(diacritics:separators:tokenCharacters:)":{"name":"unicode61(diacritics:separators:tokenCharacters:)","abstract":"

An “unicode61” tokenizer

","parent_name":"FTS5TokenizerDescriptor"},"Structs/FTS5Tokenization.html#/rawValue":{"name":"rawValue","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/init(rawValue:)":{"name":"init(rawValue:)","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/query":{"name":"query","abstract":"

FTS5_TOKENIZE_QUERY

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/prefix":{"name":"prefix","abstract":"

FTS5_TOKENIZE_PREFIX

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/document":{"name":"document","abstract":"

FTS5_TOKENIZE_DOCUMENT

","parent_name":"FTS5Tokenization"},"Structs/FTS5Tokenization.html#/aux":{"name":"aux","abstract":"

FTS5_TOKENIZE_AUX

","parent_name":"FTS5Tokenization"},"Structs/FTS5Pattern.html#/rawPattern":{"name":"rawPattern","abstract":"

The raw pattern string. Guaranteed to be a valid FTS5 pattern.

","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/init(matchingAnyTokenIn:)":{"name":"init(matchingAnyTokenIn:)","abstract":"

Creates a pattern that matches any token found in the input string;","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/init(matchingAllTokensIn:)":{"name":"init(matchingAllTokensIn:)","abstract":"

Creates a pattern that matches all tokens found in the input string;","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/init(matchingPhrase:)":{"name":"init(matchingPhrase:)","abstract":"

Creates a pattern that matches a contiguous string; returns nil if no","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/init(matchingPrefixPhrase:)":{"name":"init(matchingPrefixPhrase:)","abstract":"

Creates a pattern that matches a contiguous string prefix; returns","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/databaseValue":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"FTS5Pattern"},"Structs/FTS5Pattern.html#/fromDatabaseValue(_:)":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an FTS5Pattern initialized from dbValue, if it","parent_name":"FTS5Pattern"},"Structs/FTS5/Diacritics.html#/keep":{"name":"keep","abstract":"

Do not remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS5/Diacritics.html#/removeLegacy":{"name":"removeLegacy","abstract":"

Remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS5.html#/init()":{"name":"init()","abstract":"

Creates a FTS5 module suitable for the Database","parent_name":"FTS5"},"Structs/FTS5.html#/moduleName":{"name":"moduleName","abstract":"

The virtual table module name

","parent_name":"FTS5"},"Structs/FTS5.html#/makeTableDefinition()":{"name":"makeTableDefinition()","abstract":"

Don’t use this method.

","parent_name":"FTS5"},"Structs/FTS5.html#/moduleArguments(for:in:)":{"name":"moduleArguments(for:in:)","abstract":"

Don’t use this method.

","parent_name":"FTS5"},"Structs/FTS5.html#/database(_:didCreate:using:)":{"name":"database(_:didCreate:using:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS5"},"Structs/FTS4.html#/s:4GRDB4FTS4VACycfc":{"name":"init()","abstract":"

Creates a FTS4 module suitable for the Database","parent_name":"FTS4"},"Structs/FTS4.html#/s:4GRDB4FTS4V10moduleNameSSvp":{"name":"moduleName","abstract":"

The virtual table module name

","parent_name":"FTS4"},"Structs/FTS4.html#/s:4GRDB4FTS4V19makeTableDefinitionAA0bdE0CyF":{"name":"makeTableDefinition()","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS4"},"Structs/FTS4.html#/s:4GRDB4FTS4V15moduleArguments3for2inSaySSGAA0B15TableDefinitionC_AA8DatabaseCtF":{"name":"moduleArguments(for:in:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS4"},"Structs/FTS4.html#/s:4GRDB4FTS4V8database_9didCreate5usingyAA8DatabaseC_SSAA0B15TableDefinitionCtKF":{"name":"database(_:didCreate:using:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS4"},"Structs/FTS3TokenizerDescriptor.html#/s:4GRDB23FTS3TokenizerDescriptorV6simpleACvpZ":{"name":"simple","abstract":"

The “simple” tokenizer.

","parent_name":"FTS3TokenizerDescriptor"},"Structs/FTS3TokenizerDescriptor.html#/s:4GRDB23FTS3TokenizerDescriptorV6porterACvpZ":{"name":"porter","abstract":"

The “porter” tokenizer.

","parent_name":"FTS3TokenizerDescriptor"},"Structs/FTS3TokenizerDescriptor.html#/unicode61(diacritics:separators:tokenCharacters:)":{"name":"unicode61(diacritics:separators:tokenCharacters:)","abstract":"

The “unicode61” tokenizer.

","parent_name":"FTS3TokenizerDescriptor"},"Structs/FTS3TokenizerDescriptor.html#/s:4GRDB23FTS3TokenizerDescriptorV9unicode6110diacritics10separators15tokenCharactersAcA0B0V10DiacriticsO_ShySJGALtFZ":{"name":"unicode61(diacritics:separators:tokenCharacters:)","abstract":"

The “unicode61” tokenizer.

","parent_name":"FTS3TokenizerDescriptor"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV03rawC0SSvp":{"name":"rawPattern","abstract":"

The raw pattern string. Guaranteed to be a valid FTS3/4 pattern.

","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV03rawC0ACSS_tKcfc":{"name":"init(rawPattern:)","abstract":"

Creates a pattern from a raw pattern string; throws DatabaseError on","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/init(matchingAnyTokenIn:)":{"name":"init(matchingAnyTokenIn:)","abstract":"

Creates a pattern that matches any token found in the input string;","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/init(matchingAllTokensIn:)":{"name":"init(matchingAllTokensIn:)","abstract":"

Creates a pattern that matches all tokens found in the input string;","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/init(matchingPhrase:)":{"name":"init(matchingPhrase:)","abstract":"

Creates a pattern that matches a contiguous string; returns nil if no","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV18matchingAnyTokenInACSgSS_tcfc":{"name":"init(matchingAnyTokenIn:)","abstract":"

Creates a pattern that matches any token found in the input string;","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV19matchingAllTokensInACSgSS_tcfc":{"name":"init(matchingAllTokensIn:)","abstract":"

Creates a pattern that matches all tokens found in the input string;","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV14matchingPhraseACSgSS_tcfc":{"name":"init(matchingPhrase:)","abstract":"

Creates a pattern that matches a contiguous string; returns nil if no","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV13databaseValueAA08DatabaseE0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"FTS3Pattern"},"Structs/FTS3Pattern.html#/s:4GRDB11FTS3PatternV17fromDatabaseValueyACSgAA0eF0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an FTS3Pattern initialized from dbValue, if it contains","parent_name":"FTS3Pattern"},"Structs/FTS3/Diacritics.html#/s:4GRDB4FTS3V10DiacriticsO4keepyA2EmF":{"name":"keep","abstract":"

Do not remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS3/Diacritics.html#/s:4GRDB4FTS3V10DiacriticsO12removeLegacyyA2EmF":{"name":"removeLegacy","abstract":"

Remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS3/Diacritics.html#/remove":{"name":"remove","abstract":"

Remove diacritics from Latin script characters. This","parent_name":"Diacritics"},"Structs/FTS3/Diacritics.html":{"name":"Diacritics","abstract":"

Options for Latin script characters. Matches the raw “remove_diacritics”","parent_name":"FTS3"},"Structs/FTS3.html#/s:4GRDB4FTS3VACycfc":{"name":"init()","abstract":"

Creates a FTS3 module suitable for the Database","parent_name":"FTS3"},"Structs/FTS3.html#/s:4GRDB4FTS3V10moduleNameSSvp":{"name":"moduleName","abstract":"

The virtual table module name

","parent_name":"FTS3"},"Structs/FTS3.html#/s:4GRDB4FTS3V19makeTableDefinitionAA0bdE0CyF":{"name":"makeTableDefinition()","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS3"},"Structs/FTS3.html#/s:4GRDB4FTS3V15moduleArguments3for2inSaySSGAA0B15TableDefinitionC_AA8DatabaseCtF":{"name":"moduleArguments(for:in:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS3"},"Structs/FTS3.html#/s:4GRDB4FTS3V8database_9didCreate5usingyAA8DatabaseC_SSAA0B15TableDefinitionCtF":{"name":"database(_:didCreate:using:)","abstract":"

Reserved; part of the VirtualTableModule protocol.

","parent_name":"FTS3"},"Structs/DatabasePreUpdateEvent/Kind.html#/insert":{"name":"insert","abstract":"

SQLITE_INSERT

","parent_name":"Kind"},"Structs/DatabasePreUpdateEvent/Kind.html#/delete":{"name":"delete","abstract":"

SQLITE_DELETE

","parent_name":"Kind"},"Structs/DatabasePreUpdateEvent/Kind.html#/update":{"name":"update","abstract":"

SQLITE_UPDATE

","parent_name":"Kind"},"Structs/DatabasePreUpdateEvent/Kind.html":{"name":"Kind","abstract":"

An event kind

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/kind":{"name":"kind","abstract":"

The event kind

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/databaseName":{"name":"databaseName","abstract":"

The database name

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/tableName":{"name":"tableName","abstract":"

The table name

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/count":{"name":"count","abstract":"

The number of columns in the row that is being inserted, updated, or deleted.

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/depth":{"name":"depth","abstract":"

1 for inserts, updates, or deletes invoked by top-level triggers;","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/initialRowID":{"name":"initialRowID","abstract":"

The initial rowID of the row being changed for .Update and .Delete changes,","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/finalRowID":{"name":"finalRowID","abstract":"

The final rowID of the row being changed for .Update and .Insert changes,","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/initialDatabaseValues":{"name":"initialDatabaseValues","abstract":"

The initial database values in the row.

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/initialDatabaseValue(atIndex:)":{"name":"initialDatabaseValue(atIndex:)","abstract":"

Returns the initial DatabaseValue at given index.

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/finalDatabaseValues":{"name":"finalDatabaseValues","abstract":"

The final database values in the row.

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/finalDatabaseValue(atIndex:)":{"name":"finalDatabaseValue(atIndex:)","abstract":"

Returns the final DatabaseValue at given index.

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabasePreUpdateEvent.html#/copy()":{"name":"copy()","abstract":"

Returns an event that can be stored:

","parent_name":"DatabasePreUpdateEvent"},"Structs/DatabaseEvent/Kind.html#/s:4GRDB13DatabaseEventV4KindO6insertyA2EmF":{"name":"insert","abstract":"

SQLITE_INSERT

","parent_name":"Kind"},"Structs/DatabaseEvent/Kind.html#/s:4GRDB13DatabaseEventV4KindO6deleteyA2EmF":{"name":"delete","abstract":"

SQLITE_DELETE

","parent_name":"Kind"},"Structs/DatabaseEvent/Kind.html#/s:4GRDB13DatabaseEventV4KindO6updateyA2EmF":{"name":"update","abstract":"

SQLITE_UPDATE

","parent_name":"Kind"},"Structs/DatabaseEvent/Kind.html":{"name":"Kind","abstract":"

An event kind

","parent_name":"DatabaseEvent"},"Structs/DatabaseEvent.html#/s:4GRDB13DatabaseEventV4kindAC4KindOvp":{"name":"kind","abstract":"

The event kind

","parent_name":"DatabaseEvent"},"Structs/DatabaseEvent.html#/s:4GRDB13DatabaseEventV12databaseNameSSvp":{"name":"databaseName","abstract":"

The database name

","parent_name":"DatabaseEvent"},"Structs/DatabaseEvent.html#/s:4GRDB13DatabaseEventV9tableNameSSvp":{"name":"tableName","abstract":"

The table name

","parent_name":"DatabaseEvent"},"Structs/DatabaseEvent.html#/s:4GRDB13DatabaseEventV5rowIDs5Int64Vvp":{"name":"rowID","abstract":"

The rowID of the changed row.

","parent_name":"DatabaseEvent"},"Structs/DatabaseEvent.html#/s:4GRDB13DatabaseEventV4copyACyF":{"name":"copy()","abstract":"

Returns an event that can be stored:

","parent_name":"DatabaseEvent"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO3YMDyA2EmF":{"name":"YMD","abstract":"

The format “yyyy-MM-dd”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO6YMD_HMyA2EmF":{"name":"YMD_HM","abstract":"

The format “yyyy-MM-dd HH:mm”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO7YMD_HMSyA2EmF":{"name":"YMD_HMS","abstract":"

The format “yyyy-MM-dd HH:mm:ss”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO8YMD_HMSSyA2EmF":{"name":"YMD_HMSS","abstract":"

The format “yyyy-MM-dd HH:mm:ss.SSS”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO2HMyA2EmF":{"name":"HM","abstract":"

The format “HH:mm”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO3HMSyA2EmF":{"name":"HMS","abstract":"

The format “HH:mm:ss”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html#/s:4GRDB22DatabaseDateComponentsV6FormatO4HMSSyA2EmF":{"name":"HMSS","abstract":"

The format “HH:mm:ss.SSS”.

","parent_name":"Format"},"Structs/DatabaseDateComponents/Format.html":{"name":"Format","abstract":"

The available formats for reading and storing date components.

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV04dateD010Foundation0cD0Vvp":{"name":"dateComponents","abstract":"

The date components

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV6formatAC6FormatOvp":{"name":"format","abstract":"

The database format

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV_6formatAC10Foundation0cD0V_AC6FormatOtcfc":{"name":"init(_:format:)","abstract":"

Creates a DatabaseDateComponents from a DateComponents and a format.

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV15sqliteStatement5indexACs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV13databaseValueAA0bF0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"DatabaseDateComponents"},"Structs/DatabaseDateComponents.html#/s:4GRDB22DatabaseDateComponentsV04fromB5ValueyACSgAA0bF0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a DatabaseDateComponents if dbValue contains a","parent_name":"DatabaseDateComponents"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV7isEmptySbvp":{"name":"isEmpty","abstract":"

Undocumented

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVACycfc":{"name":"init()","abstract":"

Creates empty StatementArguments.

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACxcSTRzAA24DatabaseValueConvertible_pSg7ElementRtzlufc":{"name":"init(_:)","abstract":"

Creates statement arguments from a sequence of optional values.

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACxcSTRzAA24DatabaseValueConvertible7ElementRpzlufc":{"name":"init(_:)","abstract":"

Creates statement arguments from a sequence of optional values.

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACSgSayypGcfc":{"name":"init(_:)","abstract":"

Creates statement arguments from any array. The result is nil unless all","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACSDySSAA24DatabaseValueConvertible_pSgGcfc":{"name":"init(_:)","abstract":"

Creates statement arguments from a sequence of (key, value) dictionary,","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACxcSTRzSS_AA24DatabaseValueConvertible_pSgt7ElementRtzlufc":{"name":"init(_:)","abstract":"

Creates statement arguments from a sequence of (key, value) pairs, such","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsVyACSgSDys11AnyHashableVypGcfc":{"name":"init(_:)","abstract":"

Creates statement arguments from [AnyHashable: Any].

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV6append10contentsOfSDySSAA13DatabaseValueVGAC_tF":{"name":"append(contentsOf:)","abstract":"

Extends statement arguments with other arguments.

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV1poiyA2C_ACtFZ":{"name":"+(_:_:)","abstract":"

Creates a new StatementArguments by extending the left-hand size","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV2apoiyA2C_ACtFZ":{"name":"&+(_:_:)","abstract":"

Creates a new StatementArguments by extending the left-hand size","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV2peoiyyACz_ACtFZ":{"name":"+=(_:_:)","abstract":"

Extends the left-hand size arguments with the right-hand side arguments.

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV12arrayLiteralAcA24DatabaseValueConvertible_pSgd_tcfc":{"name":"init(arrayLiteral:)","abstract":"

Returns a StatementArguments from an array literal:

","parent_name":"StatementArguments"},"Structs/StatementArguments.html#/s:4GRDB18StatementArgumentsV17dictionaryLiteralACSS_AA24DatabaseValueConvertible_pSgtd_tcfc":{"name":"init(dictionaryLiteral:)","abstract":"

Returns a StatementArguments from a dictionary literal:

","parent_name":"StatementArguments"},"Structs/SQLRequest.html#/s:4GRDB12FetchRequestP10RowDecoderQa":{"name":"RowDecoder","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV3sqlSSvp":{"name":"sql","abstract":"

The raw SQL query

","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV9argumentsAA18StatementArgumentsVvp":{"name":"arguments","abstract":"

The request argument

","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV7adapterAA10RowAdapter_pSgvp":{"name":"adapter","abstract":"

The request adapter

","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV3sql9arguments7adapter6cachedACyxGSS_AA18StatementArgumentsVAA10RowAdapter_pSgSbtcfc":{"name":"init(sql:arguments:adapter:cached:)","abstract":"

Creates a request from an SQL string, optional arguments, and","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV7literal7adapter6cachedACyxGAA10SQLLiteralV_AA10RowAdapter_pSgSbtcfc":{"name":"init(literal:adapter:cached:)","abstract":"

Creates a request from an SQLLiteral, and optional row adapter.

","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV_7request6cachedACyxGAA8DatabaseC_qd__SbtKc10RowDecoderQyd__RszAA12FetchRequestRd__lufc":{"name":"init(_:request:cached:)","abstract":"

Creates an SQL request from any other fetch request.

","parent_name":"SQLRequest"},"Structs/SQLRequest.html#/s:4GRDB10SQLRequestV20unicodeScalarLiteralACyxGSS_tcfc":{"name":"init(unicodeScalarLiteral:)","abstract":"

:nodoc

","parent_name":"SQLRequest"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV3sqlSSvp":{"name":"sql","abstract":"

Undocumented

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV9argumentsAA18StatementArgumentsVvp":{"name":"arguments","abstract":"

Undocumented

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV3sql9argumentsACSS_AA18StatementArgumentsVtcfc":{"name":"init(sql:arguments:)","abstract":"

Creates an SQLLiteral from a plain SQL string, and eventual arguments.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV6mapSQLyACS2SKXEKF":{"name":"mapSQL(_:)","abstract":"

Returns a literal whose SQL is transformed by the given closure.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV1poiyA2C_ACtFZ":{"name":"+(_:_:)","abstract":"

Returns the SQLLiteral produced by the concatenation of two literals.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV2peoiyyACz_ACtFZ":{"name":"+=(_:_:)","abstract":"

Appends an SQLLiteral to the receiver.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV6append7literalyAC_tF":{"name":"append(literal:)","abstract":"

Appends an SQLLiteral to the receiver.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV6append3sql9argumentsySS_AA18StatementArgumentsVtF":{"name":"append(sql:arguments:)","abstract":"

Appends a plain SQL string to the receiver, and eventual arguments.

","parent_name":"SQLLiteral"},"Structs/SQLLiteral.html#/s:4GRDB10SQLLiteralV20unicodeScalarLiteralACSS_tcfc":{"name":"init(unicodeScalarLiteral:)","abstract":"

:nodoc

","parent_name":"SQLLiteral"},"Structs/ScopeAdapter.html#/s:4GRDB12ScopeAdapterVyACSDySSAA03RowC0_pGcfc":{"name":"init(_:)","abstract":"

Creates an adapter that preserves row contents and add scoped rows.

","parent_name":"ScopeAdapter"},"Structs/ScopeAdapter.html#/s:4GRDB12ScopeAdapterV4base6scopesAcA03RowC0_p_SDySSAaF_pGtcfc":{"name":"init(base:scopes:)","abstract":"

Creates an adapter based on the base adapter, and add scoped rows.

","parent_name":"ScopeAdapter"},"Structs/RangeRowAdapter.html#/s:4GRDB15RangeRowAdapterVyACSnySiGcfc":{"name":"init(_:)","abstract":"

Creates a RangeRowAdapter that only exposes a range of columns.

","parent_name":"RangeRowAdapter"},"Structs/RangeRowAdapter.html#/s:4GRDB15RangeRowAdapterVyACSNySiGcfc":{"name":"init(_:)","abstract":"

Creates a RangeRowAdapter that only exposes a range of columns.

","parent_name":"RangeRowAdapter"},"Structs/SuffixRowAdapter.html#/s:4GRDB16SuffixRowAdapterV9fromIndexACSi_tcfc":{"name":"init(fromIndex:)","abstract":"

Creates a SuffixRowAdapter that hides all columns before the","parent_name":"SuffixRowAdapter"},"Structs/ColumnMapping.html#/s:4GRDB13ColumnMappingVyACSDyS2SGcfc":{"name":"init(_:)","abstract":"

Creates a ColumnMapping with a dictionary from mapped column names to","parent_name":"ColumnMapping"},"Structs/EmptyRowAdapter.html#/s:4GRDB15EmptyRowAdapterVACycfc":{"name":"init()","abstract":"

Creates an EmptyRowAdapter

","parent_name":"EmptyRowAdapter"},"Structs/AnyFetchRequest.html#/s:4GRDB12FetchRequestP10RowDecoderQa":{"name":"RowDecoder","parent_name":"AnyFetchRequest"},"Structs/AnyFetchRequest.html#/s:4GRDB15AnyFetchRequestVyACyxGqd__cAA0cD0Rd__lufc":{"name":"init(_:)","abstract":"

Creates a request that wraps and forwards operations to request.

","parent_name":"AnyFetchRequest"},"Structs/AnyFetchRequest.html#/s:4GRDB15AnyFetchRequestVyACyxGAA15SelectStatementC_AA10RowAdapter_pSgtAA8DatabaseC_SbtKccfc":{"name":"init(_:)","abstract":"

Creates a request whose prepare() method wraps and forwards","parent_name":"AnyFetchRequest"},"Structs/AdaptedFetchRequest.html#/s:4GRDB12FetchRequestP10RowDecoderQa":{"name":"RowDecoder","parent_name":"AdaptedFetchRequest"},"Structs/PreparedRequest.html#/s:4GRDB15PreparedRequestV9statementAA15SelectStatementCvp":{"name":"statement","abstract":"

A prepared statement

","parent_name":"PreparedRequest"},"Structs/PreparedRequest.html#/s:4GRDB15PreparedRequestV7adapterAA10RowAdapter_pSgvp":{"name":"adapter","abstract":"

An eventual adapter for rows fetched by the select statement

","parent_name":"PreparedRequest"},"Structs/PreparedRequest.html#/s:4GRDB15PreparedRequestV9statement7adapterAcA15SelectStatementC_AA10RowAdapter_pSgtcfc":{"name":"init(statement:adapter:)","abstract":"

Creates a PreparedRequest.

","parent_name":"PreparedRequest"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO4nullyA2EmF":{"name":"null","abstract":"

The NULL storage class.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO5int64yAEs5Int64VcAEmF":{"name":"int64(_:)","abstract":"

The INTEGER storage class, wrapping an Int64.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO6doubleyAESdcAEmF":{"name":"double(_:)","abstract":"

The REAL storage class, wrapping a Double.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO6stringyAESScAEmF":{"name":"string(_:)","abstract":"

The TEXT storage class, wrapping a String.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO4blobyAE10Foundation4DataVcAEmF":{"name":"blob(_:)","abstract":"

The BLOB storage class, wrapping Data.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO5valueAA0bC11Convertible_pSgvp":{"name":"value","abstract":"

Returns Int64, Double, String, Data or nil.

","parent_name":"Storage"},"Structs/DatabaseValue/Storage.html#/s:4GRDB13DatabaseValueV7StorageO2eeoiySbAE_AEtFZ":{"name":"==(_:_:)","abstract":"

Return true if the storages are identical.

","parent_name":"Storage"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV7storageAC7StorageOvp":{"name":"storage","abstract":"

The SQLite storage

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV4nullACvpZ":{"name":"null","abstract":"

The NULL DatabaseValue.

","parent_name":"DatabaseValue"},"Structs/DatabaseValue/Storage.html":{"name":"Storage","abstract":"

An SQLite storage (NULL, INTEGER, REAL, TEXT, BLOB).

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV5valueACSgyp_tcfc":{"name":"init(value:)","abstract":"

Creates a DatabaseValue from Any.

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV6isNullSbvp":{"name":"isNull","abstract":"

Returns true if databaseValue is NULL.

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV2eeoiySbAC_ACtFZ":{"name":"==(_:_:)","abstract":"

Returns whether two DatabaseValues are equal.

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV08databaseC0ACvp":{"name":"databaseValue","abstract":"

Returns self

","parent_name":"DatabaseValue"},"Structs/DatabaseValue.html#/s:4GRDB13DatabaseValueV04frombC0yACSgACFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns the database value

","parent_name":"DatabaseValue"},"Structs/DatabaseRegionObservation.html#/s:4GRDB25DatabaseRegionObservationV6extentAA0B0C011TransactionD6ExtentOvp":{"name":"extent","abstract":"

The extent of the database observation. The default is","parent_name":"DatabaseRegionObservation"},"Structs/DatabaseRegionObservation.html#/s:4GRDB25DatabaseRegionObservationV8trackingAcA0bC11Convertible_pd_tcfc":{"name":"init(tracking:)","abstract":"

Creates a DatabaseRegionObservation which observes regions, and","parent_name":"DatabaseRegionObservation"},"Structs/DatabaseRegionObservation.html#/s:4GRDB25DatabaseRegionObservationV8trackingACSayAA0bC11Convertible_pG_tcfc":{"name":"init(tracking:)","abstract":"

Creates a DatabaseRegionObservation which observes regions, and","parent_name":"DatabaseRegionObservation"},"Structs/DatabaseRegionObservation.html#/s:4GRDB25DatabaseRegionObservationV5start2in8onChangeAA19TransactionObserver_pAA0B6Writer_p_yAA0B0CctKF":{"name":"start(in:onChange:)","abstract":"

Starts the observation in the provided database writer (such as","parent_name":"DatabaseRegionObservation"},"Structs/AnyDatabaseRegionConvertible.html#/s:4GRDB28AnyDatabaseRegionConvertibleVyAcA0cD0VAA0C0CKccfc":{"name":"init(_:)","abstract":"

Undocumented

","parent_name":"AnyDatabaseRegionConvertible"},"Structs/AnyDatabaseRegionConvertible.html#/s:4GRDB28AnyDatabaseRegionConvertibleVyAcA0cdE0_pcfc":{"name":"init(_:)","abstract":"

Undocumented

","parent_name":"AnyDatabaseRegionConvertible"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV7isEmptySbvp":{"name":"isEmpty","abstract":"

Returns whether the region is empty.

","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV04fullB0ACvpZ":{"name":"fullDatabase","abstract":"

The region that covers the full database: all columns and all rows","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionVACycfc":{"name":"init()","abstract":"

Creates an empty database region.

","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV5tableACSS_tcfc":{"name":"init(table:)","abstract":"

Creates a region that spans all rows and columns of a database table.

","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV5unionyA2CF":{"name":"union(_:)","abstract":"

Returns the union of this region and the given one.

","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV9formUnionyyACF":{"name":"formUnion(_:)","abstract":"

Inserts the given region into this region

","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV10isModified14byEventsOfKindSbAA0b5EventI0O_tF":{"name":"isModified(byEventsOfKind:)","abstract":"

Returns whether the content in the region would be impacted if the","parent_name":"DatabaseRegion"},"Structs/DatabaseRegion.html#/s:4GRDB14DatabaseRegionV10isModified2bySbAA0B5EventV_tF":{"name":"isModified(by:)","abstract":"

Returns whether the content in the region is impacted by this event.

","parent_name":"DatabaseRegion"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV10resultCodeAA06ResultE0Vvp":{"name":"resultCode","abstract":"

The SQLite error code (see","parent_name":"DatabaseError"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV18extendedResultCodeAA0eF0Vvp":{"name":"extendedResultCode","abstract":"

The SQLite extended error code (see","parent_name":"DatabaseError"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV7messageSSSgvp":{"name":"message","abstract":"

The SQLite error message.

","parent_name":"DatabaseError"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV3sqlSSSgvp":{"name":"sql","abstract":"

The SQL query that yielded the error (if relevant).

","parent_name":"DatabaseError"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV10resultCode7message3sql9argumentsAcA06ResultE0V_SSSgAjA18StatementArgumentsVSgtcfc":{"name":"init(resultCode:message:sql:arguments:)","abstract":"

Creates a Database Error

","parent_name":"DatabaseError"},"Structs/DatabaseError.html#/s:4GRDB13DatabaseErrorV014isInterruptionC0Sbvp":{"name":"isInterruptionError","abstract":"

Returns true if the error has code SQLITE_ABORT or SQLITE_INTERRUPT.

","parent_name":"DatabaseError"},"Structs/ResultCode.html#/s:SY8rawValue03RawB0Qzvp":{"name":"rawValue","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:SY8rawValuexSg03RawB0Qz_tcfc":{"name":"init(rawValue:)","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV07primarybC0ACvp":{"name":"primaryResultCode","abstract":"

A result code limited to the least significant 8 bits of the receiver.","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV2teoiySbAC_ACtFZ":{"name":"~=(_:_:)","abstract":"

Returns true if the code on the left matches the code on the right.

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV9SQLITE_OKACvpZ":{"name":"SQLITE_OK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_ERRORACvpZ":{"name":"SQLITE_ERROR","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_INTERNALACvpZ":{"name":"SQLITE_INTERNAL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV11SQLITE_PERMACvpZ":{"name":"SQLITE_PERM","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_ABORTACvpZ":{"name":"SQLITE_ABORT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV11SQLITE_BUSYACvpZ":{"name":"SQLITE_BUSY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_LOCKEDACvpZ":{"name":"SQLITE_LOCKED","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_NOMEMACvpZ":{"name":"SQLITE_NOMEM","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_READONLYACvpZ":{"name":"SQLITE_READONLY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV16SQLITE_INTERRUPTACvpZ":{"name":"SQLITE_INTERRUPT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_IOERRACvpZ":{"name":"SQLITE_IOERR","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV14SQLITE_CORRUPTACvpZ":{"name":"SQLITE_CORRUPT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_NOTFOUNDACvpZ":{"name":"SQLITE_NOTFOUND","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV11SQLITE_FULLACvpZ":{"name":"SQLITE_FULL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_CANTOPENACvpZ":{"name":"SQLITE_CANTOPEN","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_PROTOCOLACvpZ":{"name":"SQLITE_PROTOCOL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_EMPTYACvpZ":{"name":"SQLITE_EMPTY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_SCHEMAACvpZ":{"name":"SQLITE_SCHEMA","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_TOOBIGACvpZ":{"name":"SQLITE_TOOBIG","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_CONSTRAINTACvpZ":{"name":"SQLITE_CONSTRAINT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV15SQLITE_MISMATCHACvpZ":{"name":"SQLITE_MISMATCH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_MISUSEACvpZ":{"name":"SQLITE_MISUSE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_NOLFSACvpZ":{"name":"SQLITE_NOLFS","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV11SQLITE_AUTHACvpZ":{"name":"SQLITE_AUTH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_FORMATACvpZ":{"name":"SQLITE_FORMAT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV12SQLITE_RANGEACvpZ":{"name":"SQLITE_RANGE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_NOTADBACvpZ":{"name":"SQLITE_NOTADB","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV13SQLITE_NOTICEACvpZ":{"name":"SQLITE_NOTICE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV14SQLITE_WARNINGACvpZ":{"name":"SQLITE_WARNING","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV10SQLITE_ROWACvpZ":{"name":"SQLITE_ROW","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV11SQLITE_DONEACvpZ":{"name":"SQLITE_DONE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV28SQLITE_ERROR_MISSING_COLLSEQACvpZ":{"name":"SQLITE_ERROR_MISSING_COLLSEQ","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_ERROR_RETRYACvpZ":{"name":"SQLITE_ERROR_RETRY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV21SQLITE_ERROR_SNAPSHOTACvpZ":{"name":"SQLITE_ERROR_SNAPSHOT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_IOERR_READACvpZ":{"name":"SQLITE_IOERR_READ","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV23SQLITE_IOERR_SHORT_READACvpZ":{"name":"SQLITE_IOERR_SHORT_READ","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_WRITEACvpZ":{"name":"SQLITE_IOERR_WRITE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_FSYNCACvpZ":{"name":"SQLITE_IOERR_FSYNC","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV22SQLITE_IOERR_DIR_FSYNCACvpZ":{"name":"SQLITE_IOERR_DIR_FSYNC","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV21SQLITE_IOERR_TRUNCATEACvpZ":{"name":"SQLITE_IOERR_TRUNCATE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_FSTATACvpZ":{"name":"SQLITE_IOERR_FSTAT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_IOERR_UNLOCKACvpZ":{"name":"SQLITE_IOERR_UNLOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_IOERR_RDLOCKACvpZ":{"name":"SQLITE_IOERR_RDLOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_IOERR_DELETEACvpZ":{"name":"SQLITE_IOERR_DELETE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_IOERR_BLOCKEDACvpZ":{"name":"SQLITE_IOERR_BLOCKED","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_NOMEMACvpZ":{"name":"SQLITE_IOERR_NOMEM","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_IOERR_ACCESSACvpZ":{"name":"SQLITE_IOERR_ACCESS","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV30SQLITE_IOERR_CHECKRESERVEDLOCKACvpZ":{"name":"SQLITE_IOERR_CHECKRESERVEDLOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_IOERR_LOCKACvpZ":{"name":"SQLITE_IOERR_LOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_CLOSEACvpZ":{"name":"SQLITE_IOERR_CLOSE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV22SQLITE_IOERR_DIR_CLOSEACvpZ":{"name":"SQLITE_IOERR_DIR_CLOSE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_IOERR_SHMOPENACvpZ":{"name":"SQLITE_IOERR_SHMOPEN","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_IOERR_SHMSIZEACvpZ":{"name":"SQLITE_IOERR_SHMSIZE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_IOERR_SHMLOCKACvpZ":{"name":"SQLITE_IOERR_SHMLOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_IOERR_SHMMAPACvpZ":{"name":"SQLITE_IOERR_SHMMAP","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_IOERR_SEEKACvpZ":{"name":"SQLITE_IOERR_SEEK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_IOERR_DELETE_NOENTACvpZ":{"name":"SQLITE_IOERR_DELETE_NOENT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_IOERR_MMAPACvpZ":{"name":"SQLITE_IOERR_MMAP","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_IOERR_GETTEMPPATHACvpZ":{"name":"SQLITE_IOERR_GETTEMPPATH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV21SQLITE_IOERR_CONVPATHACvpZ":{"name":"SQLITE_IOERR_CONVPATH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_IOERR_VNODEACvpZ":{"name":"SQLITE_IOERR_VNODE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV17SQLITE_IOERR_AUTHACvpZ":{"name":"SQLITE_IOERR_AUTH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_IOERR_BEGIN_ATOMICACvpZ":{"name":"SQLITE_IOERR_BEGIN_ATOMIC","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV26SQLITE_IOERR_COMMIT_ATOMICACvpZ":{"name":"SQLITE_IOERR_COMMIT_ATOMIC","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV28SQLITE_IOERR_ROLLBACK_ATOMICACvpZ":{"name":"SQLITE_IOERR_ROLLBACK_ATOMIC","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_LOCKED_SHAREDCACHEACvpZ":{"name":"SQLITE_LOCKED_SHAREDCACHE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV18SQLITE_LOCKED_VTABACvpZ":{"name":"SQLITE_LOCKED_VTAB","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_BUSY_RECOVERYACvpZ":{"name":"SQLITE_BUSY_RECOVERY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV20SQLITE_BUSY_SNAPSHOTACvpZ":{"name":"SQLITE_BUSY_SNAPSHOT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_CANTOPEN_NOTEMPDIRACvpZ":{"name":"SQLITE_CANTOPEN_NOTEMPDIR","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV21SQLITE_CANTOPEN_ISDIRACvpZ":{"name":"SQLITE_CANTOPEN_ISDIR","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_CANTOPEN_FULLPATHACvpZ":{"name":"SQLITE_CANTOPEN_FULLPATH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_CANTOPEN_CONVPATHACvpZ":{"name":"SQLITE_CANTOPEN_CONVPATH","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_CANTOPEN_DIRTYWALACvpZ":{"name":"SQLITE_CANTOPEN_DIRTYWAL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV19SQLITE_CORRUPT_VTABACvpZ":{"name":"SQLITE_CORRUPT_VTAB","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV23SQLITE_CORRUPT_SEQUENCEACvpZ":{"name":"SQLITE_CORRUPT_SEQUENCE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_READONLY_RECOVERYACvpZ":{"name":"SQLITE_READONLY_RECOVERY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_READONLY_CANTLOCKACvpZ":{"name":"SQLITE_READONLY_CANTLOCK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_READONLY_ROLLBACKACvpZ":{"name":"SQLITE_READONLY_ROLLBACK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV23SQLITE_READONLY_DBMOVEDACvpZ":{"name":"SQLITE_READONLY_DBMOVED","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_READONLY_CANTINITACvpZ":{"name":"SQLITE_READONLY_CANTINIT","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_READONLY_DIRECTORYACvpZ":{"name":"SQLITE_READONLY_DIRECTORY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV21SQLITE_ABORT_ROLLBACKACvpZ":{"name":"SQLITE_ABORT_ROLLBACK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV23SQLITE_CONSTRAINT_CHECKACvpZ":{"name":"SQLITE_CONSTRAINT_CHECK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV28SQLITE_CONSTRAINT_COMMITHOOKACvpZ":{"name":"SQLITE_CONSTRAINT_COMMITHOOK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV28SQLITE_CONSTRAINT_FOREIGNKEYACvpZ":{"name":"SQLITE_CONSTRAINT_FOREIGNKEY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV26SQLITE_CONSTRAINT_FUNCTIONACvpZ":{"name":"SQLITE_CONSTRAINT_FUNCTION","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_CONSTRAINT_NOTNULLACvpZ":{"name":"SQLITE_CONSTRAINT_NOTNULL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV28SQLITE_CONSTRAINT_PRIMARYKEYACvpZ":{"name":"SQLITE_CONSTRAINT_PRIMARYKEY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_CONSTRAINT_TRIGGERACvpZ":{"name":"SQLITE_CONSTRAINT_TRIGGER","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_CONSTRAINT_UNIQUEACvpZ":{"name":"SQLITE_CONSTRAINT_UNIQUE","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV22SQLITE_CONSTRAINT_VTABACvpZ":{"name":"SQLITE_CONSTRAINT_VTAB","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV23SQLITE_CONSTRAINT_ROWIDACvpZ":{"name":"SQLITE_CONSTRAINT_ROWID","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV25SQLITE_NOTICE_RECOVER_WALACvpZ":{"name":"SQLITE_NOTICE_RECOVER_WAL","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV30SQLITE_NOTICE_RECOVER_ROLLBACKACvpZ":{"name":"SQLITE_NOTICE_RECOVER_ROLLBACK","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV24SQLITE_WARNING_AUTOINDEXACvpZ":{"name":"SQLITE_WARNING_AUTOINDEX","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV16SQLITE_AUTH_USERACvpZ":{"name":"SQLITE_AUTH_USER","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ResultCode.html#/s:4GRDB10ResultCodeV26SQLITE_OK_LOAD_PERMANENTLYACvpZ":{"name":"SQLITE_OK_LOAD_PERMANENTLY","abstract":"

Undocumented

","parent_name":"ResultCode"},"Structs/ForeignKeyInfo.html#/s:4GRDB14ForeignKeyInfoV16destinationTableSSvp":{"name":"destinationTable","abstract":"

The name of the destination table

","parent_name":"ForeignKeyInfo"},"Structs/ForeignKeyInfo.html#/s:4GRDB14ForeignKeyInfoV7mappingSaySS6origin_SS11destinationtGvp":{"name":"mapping","abstract":"

The column to column mapping

","parent_name":"ForeignKeyInfo"},"Structs/ForeignKeyInfo.html#/s:4GRDB14ForeignKeyInfoV13originColumnsSaySSGvp":{"name":"originColumns","abstract":"

The origin columns

","parent_name":"ForeignKeyInfo"},"Structs/ForeignKeyInfo.html#/s:4GRDB14ForeignKeyInfoV18destinationColumnsSaySSGvp":{"name":"destinationColumns","abstract":"

The destination columns

","parent_name":"ForeignKeyInfo"},"Structs/PrimaryKeyInfo.html#/s:4GRDB14PrimaryKeyInfoV7columnsSaySSGvp":{"name":"columns","abstract":"

The columns in the primary key; this array is never empty.

","parent_name":"PrimaryKeyInfo"},"Structs/PrimaryKeyInfo.html#/s:4GRDB14PrimaryKeyInfoV11rowIDColumnSSSgvp":{"name":"rowIDColumn","abstract":"

When not nil, the name of the column that contains the INTEGER PRIMARY KEY.

","parent_name":"PrimaryKeyInfo"},"Structs/PrimaryKeyInfo.html#/s:4GRDB14PrimaryKeyInfoV7isRowIDSbvp":{"name":"isRowID","abstract":"

When true, the primary key is the rowid:

","parent_name":"PrimaryKeyInfo"},"Structs/IndexInfo.html#/s:4GRDB9IndexInfoV4nameSSvp":{"name":"name","abstract":"

The name of the index

","parent_name":"IndexInfo"},"Structs/IndexInfo.html#/s:4GRDB9IndexInfoV7columnsSaySSGvp":{"name":"columns","abstract":"

The indexed columns

","parent_name":"IndexInfo"},"Structs/IndexInfo.html#/s:4GRDB9IndexInfoV8isUniqueSbvp":{"name":"isUnique","abstract":"

True if the index is unique

","parent_name":"IndexInfo"},"Structs/ColumnInfo.html#/s:4GRDB10ColumnInfoV4nameSSvp":{"name":"name","abstract":"

The column name

","parent_name":"ColumnInfo"},"Structs/ColumnInfo.html#/s:4GRDB10ColumnInfoV4typeSSvp":{"name":"type","abstract":"

The column data type

","parent_name":"ColumnInfo"},"Structs/ColumnInfo.html#/s:4GRDB10ColumnInfoV9isNotNullSbvp":{"name":"isNotNull","abstract":"

True if and only if the column is constrained to be not null.

","parent_name":"ColumnInfo"},"Structs/ColumnInfo.html#/s:4GRDB10ColumnInfoV15defaultValueSQLSSSgvp":{"name":"defaultValueSQL","abstract":"

The SQL snippet that defines the default value, if any.

","parent_name":"ColumnInfo"},"Structs/ColumnInfo.html#/s:4GRDB10ColumnInfoV15primaryKeyIndexSivp":{"name":"primaryKeyIndex","abstract":"

Zero for columns that are not part of the primary key.

","parent_name":"ColumnInfo"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV18foreignKeysEnabledSbvp":{"name":"foreignKeysEnabled","abstract":"

If true, foreign key constraints are checked.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV8readonlySbvp":{"name":"readonly","abstract":"

If true, database modifications are disallowed.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV5labelSSSgvp":{"name":"label","abstract":"

The database label.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV5traceySScSgvp":{"name":"trace","abstract":"

A function that is called on every statement executed by the database.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV33acceptsDoubleQuotedStringLiteralsSbvp":{"name":"acceptsDoubleQuotedStringLiterals","abstract":"

If false, SQLite from version 3.29.0 will not interpret a double-quoted","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV31observesSuspensionNotificationsSbvp":{"name":"observesSuspensionNotifications","abstract":"

When true, the Database.suspendNotification and","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV15prepareDatabaseyAA0D0CKcSgvp":{"name":"prepareDatabase","abstract":"

A function that is run when an SQLite connection is opened, before the","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV22defaultTransactionKindAA8DatabaseC0dE0Ovp":{"name":"defaultTransactionKind","abstract":"

The default kind of transaction.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV24allowsUnsafeTransactionsSbvp":{"name":"allowsUnsafeTransactions","abstract":"

If false, it is a programmer error to leave a transaction opened at the","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV8busyModeAA8DatabaseC04BusyD0Ovp":{"name":"busyMode","abstract":"

The behavior in case of SQLITE_BUSY error. See https://www.sqlite.org/rescode.html#busy

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV18maximumReaderCountSivp":{"name":"maximumReaderCount","abstract":"

The maximum number of concurrent readers (applies to database","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV3qos8Dispatch0D3QoSVvp":{"name":"qos","abstract":"

The quality of service class for the work performed by the database.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV11targetQueueSo17OS_dispatch_queueCSgvp":{"name":"targetQueue","abstract":"

The target queue for all database accesses.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationVACycfc":{"name":"init()","abstract":"

Creates a factory configuration

","parent_name":"Configuration"},"Structs/Configuration.html#/s:4GRDB13ConfigurationV10passphraseSSSgvp":{"name":"passphrase","abstract":"

The passphrase for the encrypted database.

","parent_name":"Configuration"},"Structs/Configuration.html":{"name":"Configuration","abstract":"

Configuration for a DatabaseQueue or DatabasePool.

"},"Structs/ColumnInfo.html":{"name":"ColumnInfo","abstract":"

A column of a database table.

"},"Structs/IndexInfo.html":{"name":"IndexInfo","abstract":"

An index on a database table.

"},"Structs/PrimaryKeyInfo.html":{"name":"PrimaryKeyInfo","abstract":"

Primary keys are returned from the Database.primaryKey(_:) method.

"},"Structs/ForeignKeyInfo.html":{"name":"ForeignKeyInfo","abstract":"

You get foreign keys from table names, with the"},"Structs/ResultCode.html":{"name":"ResultCode","abstract":"

Undocumented

"},"Structs/DatabaseError.html":{"name":"DatabaseError","abstract":"

DatabaseError wraps an SQLite error.

"},"Structs/DatabaseRegion.html":{"name":"DatabaseRegion","abstract":"

DatabaseRegion defines a region in the database. DatabaseRegion is dedicated"},"Structs/AnyDatabaseRegionConvertible.html":{"name":"AnyDatabaseRegionConvertible","abstract":"

A type-erased DatabaseRegionConvertible

"},"Structs/DatabaseRegionObservation.html":{"name":"DatabaseRegionObservation","abstract":"

DatabaseRegionObservation tracks changes in the results of database"},"Structs/DatabaseValue.html":{"name":"DatabaseValue","abstract":"

DatabaseValue is the intermediate type between SQLite and your values.

"},"Structs/PreparedRequest.html":{"name":"PreparedRequest","abstract":"

A PreparedRequest is a request that is ready to be executed.

"},"Structs/AdaptedFetchRequest.html":{"name":"AdaptedFetchRequest","abstract":"

An adapted request.

"},"Structs/AnyFetchRequest.html":{"name":"AnyFetchRequest","abstract":"

A type-erased FetchRequest.

"},"Structs.html#/s:4GRDB8RowIndexV":{"name":"RowIndex","abstract":"

Indexes to (ColumnName, DatabaseValue) pairs in a database row.

"},"Structs/EmptyRowAdapter.html":{"name":"EmptyRowAdapter","abstract":"

EmptyRowAdapter is a row adapter that hides all columns.

"},"Structs/ColumnMapping.html":{"name":"ColumnMapping","abstract":"

ColumnMapping is a row adapter that maps column names.

"},"Structs/SuffixRowAdapter.html":{"name":"SuffixRowAdapter","abstract":"

SuffixRowAdapter is a row adapter that hides the first columns in a row.

"},"Structs/RangeRowAdapter.html":{"name":"RangeRowAdapter","abstract":"

RangeRowAdapter is a row adapter that only exposes a range of columns.

"},"Structs/ScopeAdapter.html":{"name":"ScopeAdapter","abstract":"

ScopeAdapter is a row adapter that lets you define scopes on rows.

"},"Structs/SQLLiteral.html":{"name":"SQLLiteral","abstract":"

SQLLiteral is a type which support SQL"},"Structs/SQLRequest.html":{"name":"SQLRequest","abstract":"

A FetchRequest built from raw SQL.

"},"Structs/StatementArguments.html":{"name":"StatementArguments","abstract":"

StatementArguments provide values to argument placeholders in raw"},"Structs/DatabaseDateComponents.html":{"name":"DatabaseDateComponents","abstract":"

DatabaseDateComponents reads and stores DateComponents in the database.

"},"Structs/DatabaseEvent.html":{"name":"DatabaseEvent","abstract":"

A database event, notified to TransactionObserver.

"},"Structs/DatabasePreUpdateEvent.html":{"name":"DatabasePreUpdateEvent"},"Structs/FTS3.html":{"name":"FTS3","abstract":"

FTS3 lets you define “fts3” virtual tables.

"},"Structs/FTS3Pattern.html":{"name":"FTS3Pattern","abstract":"

A full text pattern that can query FTS3 and FTS4 virtual tables.

"},"Structs/FTS3TokenizerDescriptor.html":{"name":"FTS3TokenizerDescriptor","abstract":"

An FTS3 tokenizer, suitable for FTS3 and FTS4 table definitions:

"},"Structs/FTS4.html":{"name":"FTS4","abstract":"

FTS4 lets you define “fts4” virtual tables.

"},"Structs/FTS5.html":{"name":"FTS5","abstract":"

FTS5 lets you define “fts5” virtual tables.

"},"Structs/FTS5Pattern.html":{"name":"FTS5Pattern","abstract":"

A full text pattern that can query FTS5 virtual tables.

"},"Structs/FTS5Tokenization.html":{"name":"FTS5Tokenization","abstract":"

The reason why FTS5 is requesting tokenization.

"},"Structs/FTS5TokenizerDescriptor.html":{"name":"FTS5TokenizerDescriptor","abstract":"

An FTS5 tokenizer, suitable for FTS5 table definitions:

"},"Structs/FTS5TokenFlags.html":{"name":"FTS5TokenFlags","abstract":"

Flags that tell SQLite how to register a token.

"},"Structs/DatabaseMigrator.html":{"name":"DatabaseMigrator","abstract":"

A DatabaseMigrator registers and applies database migrations.

"},"Structs/AssociationAggregate.html":{"name":"AssociationAggregate","abstract":"

An AssociationAggregate is able to compute aggregated values from a"},"Structs.html#/s:4GRDB20BelongsToAssociationV":{"name":"BelongsToAssociation","abstract":"

The BelongsTo association sets up a one-to-one connection from a record"},"Structs.html#/s:4GRDB18HasManyAssociationV":{"name":"HasManyAssociation","abstract":"

The HasMany association indicates a one-to-many connection between two"},"Structs.html#/s:4GRDB25HasManyThroughAssociationV":{"name":"HasManyThroughAssociation","abstract":"

The HasManyThrough association is often used to set up a many-to-many"},"Structs.html#/s:4GRDB17HasOneAssociationV":{"name":"HasOneAssociation","abstract":"

The HasOne association indicates a one-to-one connection between two"},"Structs.html#/s:4GRDB24HasOneThroughAssociationV":{"name":"HasOneThroughAssociation","abstract":"

A HasOneThrough association sets up a one-to-one connection with"},"Structs/QueryInterfaceRequest.html":{"name":"QueryInterfaceRequest","abstract":"

QueryInterfaceRequest is a request that generates SQL for you.

"},"Structs.html#/s:4GRDB16ColumnAssignmentV":{"name":"ColumnAssignment","abstract":"

A ColumnAssignment can update rows in the database.

"},"Structs/Column.html":{"name":"Column","abstract":"

A column in a database table.

"},"Structs/SQLExpressionLiteral.html":{"name":"SQLExpressionLiteral","abstract":"

Experimental

"},"Structs/SQLFunctionName.html":{"name":"SQLFunctionName","abstract":"

Experimental

"},"Structs/AllColumns.html":{"name":"AllColumns","abstract":"

AllColumns is the * in SELECT *.

"},"Structs/ForeignKey.html":{"name":"ForeignKey","abstract":"

A ForeignKey helps building associations when GRDB can’t infer a foreign"},"Structs/PersistenceContainer.html":{"name":"PersistenceContainer","abstract":"

Use persistence containers in the encode(to:) method of your"},"Structs/FetchedRecordsSectionInfo.html":{"name":"FetchedRecordsSectionInfo","abstract":"

A section given by a FetchedRecordsController.

"},"Structs/PersistenceConflictPolicy.html":{"name":"PersistenceConflictPolicy","abstract":"

The MutablePersistableRecord protocol uses this type in order to handle SQLite"},"Structs/Inflections.html":{"name":"Inflections","abstract":"

Experimental

"},"Structs/ValueObservation.html":{"name":"ValueObservation","abstract":"

ValueObservation tracks changes in the results of database requests, and"},"Structs/AnyValueReducer.html":{"name":"AnyValueReducer","abstract":"

Experimental

"},"Protocols/FTS5WrapperTokenizer.html#/s:4GRDB20FTS5WrapperTokenizerP07wrappedD0AA0bD0_pvp":{"name":"wrappedTokenizer","abstract":"

The wrapped tokenizer

","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5WrapperTokenizer.html#/s:4GRDB20FTS5WrapperTokenizerP6accept5token5flags3for0F8CallbackySS_AA0B10TokenFlagsVAA0B12TokenizationVySS_AJtKXEtKF":{"name":"accept(token:flags:for:tokenCallback:)","abstract":"

Given a token produced by the wrapped tokenizer, notifies customized","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5WrapperTokenizer.html#/s:4GRDB20FTS5WrapperTokenizerPAAE8tokenize7context12tokenization5pText01nH013tokenCallbacks5Int32VSvSg_AA0B12TokenizationVSPys4Int8VGSgA2kL_Akr3KtXCtF":{"name":"tokenize(context:tokenization:pText:nText:tokenCallback:)","abstract":"

Default implementation

","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5Tokenizer.html#/s:4GRDB13FTS5TokenizerP8tokenize7context12tokenization5pText01nG013tokenCallbacks5Int32VSvSg_AA0B12TokenizationVSPys4Int8VGSgA2kL_Akr3KtXCtF":{"name":"tokenize(context:tokenization:pText:nText:tokenCallback:)","abstract":"

Tokenizes the text described by pText and nText, and","parent_name":"FTS5Tokenizer"},"Protocols/FTS5CustomTokenizer.html#/s:4GRDB19FTS5CustomTokenizerP4nameSSvpZ":{"name":"name","abstract":"

The name of the tokenizer; should uniquely identify your custom","parent_name":"FTS5CustomTokenizer"},"Protocols/FTS5CustomTokenizer.html#/s:4GRDB19FTS5CustomTokenizerP2db9argumentsxAA8DatabaseC_SaySSGtKcfc":{"name":"init(db:arguments:)","abstract":"

Creates a custom tokenizer.

","parent_name":"FTS5CustomTokenizer"},"Protocols/FTS5CustomTokenizer.html#/s:4GRDB19FTS5CustomTokenizerPAAE19tokenizerDescriptor9argumentsAA0bdF0VSaySSG_tFZ":{"name":"tokenizerDescriptor(arguments:)","abstract":"

Creates an FTS5 tokenizer descriptor.

","parent_name":"FTS5CustomTokenizer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","abstract":"

The type of fetched database values

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","abstract":"

The type of observed values

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","abstract":"

Feches database values upon changes in an observed database region.

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","abstract":"

Transforms a fetched value into an eventual observed value. Returns nil","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerPAAE10compactMapyAA0B8ReducersO07CompactE0Vy_xqd__Gqd__Sg0B0QzclF":{"name":"compactMap(_:)","abstract":"

Experimental

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerPAAE3mapyAA0B8ReducersO3MapVy_xqd__Gqd__0B0QzclF":{"name":"map(_:)","abstract":"

Experimental

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerPAASQ0B0RpzrlE20distinctUntilChangedAA0B8ReducersO16RemoveDuplicatesVy_xGyF":{"name":"distinctUntilChanged()","abstract":"

Experimental

","parent_name":"ValueReducer"},"Protocols/ValueReducer.html#/s:4GRDB12ValueReducerPAASQ0B0RpzrlE16removeDuplicatesAA0B8ReducersO06RemoveE0Vy_xGyF":{"name":"removeDuplicates()","abstract":"

Experimental

","parent_name":"ValueReducer"},"Protocols/PersistableRecord.html#/s:4GRDB17PersistableRecordP9didInsert4with3forys5Int64V_SSSgtF":{"name":"didInsert(with:for:)","abstract":"

Notifies the record that it was succesfully inserted.

","parent_name":"PersistableRecord"},"Protocols/PersistableRecord.html#/s:4GRDB17PersistableRecordP6insertyyAA8DatabaseCKF":{"name":"insert(_:)","abstract":"

Executes an INSERT statement.

","parent_name":"PersistableRecord"},"Protocols/PersistableRecord.html#/s:4GRDB17PersistableRecordP4saveyyAA8DatabaseCKF":{"name":"save(_:)","abstract":"

Executes an INSERT or an UPDATE statement so that self is saved in","parent_name":"PersistableRecord"},"Protocols/PersistableRecord.html#/s:4GRDB17PersistableRecordPAAE13performInsertyyAA8DatabaseCKF":{"name":"performInsert(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"PersistableRecord"},"Protocols/PersistableRecord.html#/s:4GRDB17PersistableRecordPAAE11performSaveyyAA8DatabaseCKF":{"name":"performSave(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"PersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP25persistenceConflictPolicyAA011PersistencefG0VvpZ":{"name":"persistenceConflictPolicy","abstract":"

The policy that handles SQLite conflicts when records are inserted","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP9didInsert4with3forys5Int64V_SSSgtF":{"name":"didInsert(with:for:)","abstract":"

Notifies the record that it was succesfully inserted.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP6insertyyAA8DatabaseCKF":{"name":"insert(_:)","abstract":"

Executes an INSERT statement.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP6update_7columnsyAA8DatabaseC_ShySSGtKF":{"name":"update(_:columns:)","abstract":"

Executes an UPDATE statement.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP4saveyyAA8DatabaseCKF":{"name":"save(_:)","abstract":"

Executes an INSERT or an UPDATE statement so that self is saved in","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP6deleteySbAA8DatabaseCKF":{"name":"delete(_:)","abstract":"

Executes a DELETE statement.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordP6existsySbAA8DatabaseCKF":{"name":"exists(_:)","abstract":"

Returns true if and only if the primary key matches a row in","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE6updateyyAA8DatabaseCKF":{"name":"update(_:)","abstract":"

Executes an UPDATE statement that updates all table columns.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13updateChanges_4fromSbAA8DatabaseC_qd__tKAaBRd__lF":{"name":"updateChanges(_:from:)","abstract":"

If the record has any difference from the other record, executes an","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13updateChanges_4withSbAA8DatabaseC_yxzKXEtKF":{"name":"updateChanges(_:with:)","abstract":"

Mutates the record according to the provided closure, and then, if the","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13performInsertyyAA8DatabaseCKF":{"name":"performInsert(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13performUpdate_7columnsyAA8DatabaseC_ShySSGtKF":{"name":"performUpdate(_:columns:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE11performSaveyyAA8DatabaseCKF":{"name":"performSave(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13performDeleteySbAA8DatabaseCKF":{"name":"performDelete(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE13performExistsySbAA8DatabaseCKF":{"name":"performExists(_:)","abstract":"

Don’t invoke this method directly: it is an internal method for types","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9deleteAllySiAA8DatabaseCKFZ":{"name":"deleteAll(_:)","abstract":"

Deletes all records; returns the number of deleted rows.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9updateAll_10onConflict_SiAA8DatabaseC_AG0H10ResolutionOSgSayAA16ColumnAssignmentVGtKFZ":{"name":"updateAll(_:onConflict:_:)","abstract":"

Updates all records; returns the number of updated records.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9updateAll_10onConflict__SiAA8DatabaseC_AG0H10ResolutionOSgAA16ColumnAssignmentVALdtKFZ":{"name":"updateAll(_:onConflict:_:_:)","abstract":"

Updates all records; returns the number of updated records.

","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9deleteAll_4keysSiAA8DatabaseC_qd__tKSTRd__AA0H16ValueConvertible7ElementRpd__lFZ":{"name":"deleteAll(_:keys:)","abstract":"

Delete records identified by their primary keys; returns the number of","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9deleteOne_3keySbAA8DatabaseC_qd__SgtKAA0H16ValueConvertibleRd__lFZ":{"name":"deleteOne(_:key:)","abstract":"

Delete a record, identified by its primary key; returns whether a","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9deleteAll_4keysSiAA8DatabaseC_SaySDySSAA0H16ValueConvertible_pSgGGtKFZ":{"name":"deleteAll(_:keys:)","abstract":"

Delete records identified by the provided unique keys (primary key or","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAAE9deleteOne_3keySbAA8DatabaseC_SDySSAA0H16ValueConvertible_pSgGtKFZ":{"name":"deleteOne(_:key:)","abstract":"

Delete a record, identified by a unique key (the primary key or any key","parent_name":"MutablePersistableRecord"},"Protocols/MutablePersistableRecord.html#/s:4GRDB24MutablePersistableRecordPAARlzCrlE13updateChanges_4withSbAA8DatabaseC_yxKXEtKF":{"name":"updateChanges(_:with:)","abstract":"

Mutates the record according to the provided closure, and then, if the","parent_name":"MutablePersistableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordP3rowxAA3RowC_tcfc":{"name":"init(row:)","abstract":"

Creates a record from row.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordP24databaseDecodingUserInfoSDys06CodingfG3KeyVypGvpZ":{"name":"databaseDecodingUserInfo","abstract":"

When the FetchableRecord type also adopts the standard Decodable","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordP19databaseJSONDecoder3for10Foundation0E0CSS_tFZ":{"name":"databaseJSONDecoder(for:)","abstract":"

When the FetchableRecord type also adopts the standard Decodable","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordP28databaseDateDecodingStrategyAA08DatabaseefG0OvpZ":{"name":"databaseDateDecodingStrategy","abstract":"

When the FetchableRecord type also adopts the standard Decodable","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE11fetchCursor_9arguments7adapterAA0cE0CyxGAA15SelectStatementC_AA0I9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

A cursor over records fetched from a prepared statement.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchAll_9arguments7adapterSayxGAA15SelectStatementC_AA0I9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of records fetched from a prepared statement.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchOne_9arguments7adapterxSgAA15SelectStatementC_AA0I9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:arguments:adapter:)","abstract":"

Returns a single record fetched from a prepared statement.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE11fetchCursor_3sql9arguments7adapterAA0cE0CyxGAA8DatabaseC_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over records fetched from an SQL query.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchAll_3sql9arguments7adapterSayxGAA8DatabaseC_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of records fetched from an SQL query.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchOne_3sql9arguments7adapterxSgAA8DatabaseC_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:sql:arguments:adapter:)","abstract":"

Returns a single record fetched from an SQL query.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE11fetchCursoryAA0cE0CyxGAA8DatabaseC_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over records fetched from a fetch request.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchAllySayxGAA8DatabaseC_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of records fetched from a fetch request.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPAAE8fetchOneyxSgAA8DatabaseC_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchOne(_:_:)","abstract":"

Returns a single record fetched from a fetch request.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE11fetchCursoryAA0cF0CyxGAA8DatabaseCKFZ":{"name":"fetchCursor(_:)","abstract":"

A cursor over all records fetched from the database.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchAllySayxGAA8DatabaseCKFZ":{"name":"fetchAll(_:)","abstract":"

An array of all records fetched from the database.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchOneyxSgAA8DatabaseCKFZ":{"name":"fetchOne(_:)","abstract":"

The first found record.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE11fetchCursor_4keysAA0cF0CyxGAA8DatabaseC_qd__tKSTRd__AA0H16ValueConvertible7ElementRpd__lFZ":{"name":"fetchCursor(_:keys:)","abstract":"

Returns a cursor over records, given their primary keys.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchAll_4keysSayxGAA8DatabaseC_qd__tKSTRd__AA0H16ValueConvertible7ElementRpd__lFZ":{"name":"fetchAll(_:keys:)","abstract":"

Returns an array of records, given their primary keys.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchOne_3keyxSgAA8DatabaseC_qd__SgtKAA0H16ValueConvertibleRd__lFZ":{"name":"fetchOne(_:key:)","abstract":"

Returns a single record given its primary key.

","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE11fetchCursor_4keysAA0cF0CyxGAA8DatabaseC_SaySDySSAA0H16ValueConvertible_pSgGGtKFZ":{"name":"fetchCursor(_:keys:)","abstract":"

Returns a cursor over records identified by the provided unique keys","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchAll_4keysSayxGAA8DatabaseC_SaySDySSAA0H16ValueConvertible_pSgGGtKFZ":{"name":"fetchAll(_:keys:)","abstract":"

Returns an array of records identified by the provided unique keys","parent_name":"FetchableRecord"},"Protocols/FetchableRecord.html#/s:4GRDB15FetchableRecordPA2A05TableC0RzrlE8fetchOne_3keyxSgAA8DatabaseC_SDySSAA0H16ValueConvertible_pSgGSgtKFZ":{"name":"fetchOne(_:key:)","abstract":"

Returns a single record identified by a unique key (the primary key or","parent_name":"FetchableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordP6encode2toyAA20PersistenceContainerVz_tF":{"name":"encode(to:)","abstract":"

Encodes the record into database values.

","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordP24databaseEncodingUserInfoSDys06CodingfG3KeyVypGvpZ":{"name":"databaseEncodingUserInfo","abstract":"

When the EncodableRecord type also adopts the standard Encodable","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordP19databaseJSONEncoder3for10Foundation0E0CSS_tFZ":{"name":"databaseJSONEncoder(for:)","abstract":"

When the EncodableRecord type also adopts the standard Encodable","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordP28databaseDateEncodingStrategyAA08DatabaseefG0OvpZ":{"name":"databaseDateEncodingStrategy","abstract":"

When the EncodableRecord type also adopts the standard Encodable","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordP28databaseUUIDEncodingStrategyAA08DatabaseeF0OvpZ":{"name":"databaseUUIDEncodingStrategy","abstract":"

When the EncodableRecord type also adopts the standard Encodable","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordPAAE18databaseDictionarySDySSAA13DatabaseValueVGvp":{"name":"databaseDictionary","abstract":"

A dictionary whose keys are the columns encoded in the encode(to:) method.

","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordPAAE14databaseEqualsySbxF":{"name":"databaseEquals(_:)","abstract":"

Returns a boolean indicating whether this record and the other record","parent_name":"EncodableRecord"},"Protocols/EncodableRecord.html#/s:4GRDB15EncodableRecordPAAE15databaseChanges4fromSDySSAA13DatabaseValueVGqd___tAaBRd__lF":{"name":"databaseChanges(from:)","abstract":"

A dictionary of values changed from the other record.

","parent_name":"EncodableRecord"},"Protocols/VirtualTableModule.html#/s:4GRDB18VirtualTableModuleP0C10DefinitionQa":{"name":"TableDefinition","abstract":"

The type of the closure argument in the","parent_name":"VirtualTableModule"},"Protocols/VirtualTableModule.html#/s:4GRDB18VirtualTableModuleP10moduleNameSSvp":{"name":"moduleName","abstract":"

The name of the module.

","parent_name":"VirtualTableModule"},"Protocols/VirtualTableModule.html#/s:4GRDB18VirtualTableModuleP04makeC10Definition0cF0QzyF":{"name":"makeTableDefinition()","abstract":"

Returns a table definition that is passed as the closure argument in the","parent_name":"VirtualTableModule"},"Protocols/VirtualTableModule.html#/s:4GRDB18VirtualTableModuleP15moduleArguments3for2inSaySSG0C10DefinitionQz_AA8DatabaseCtKF":{"name":"moduleArguments(for:in:)","abstract":"

Returns the module arguments for the CREATE VIRTUAL TABLE query.

","parent_name":"VirtualTableModule"},"Protocols/VirtualTableModule.html#/s:4GRDB18VirtualTableModuleP8database_9didCreate5usingyAA8DatabaseC_SS0C10DefinitionQztKF":{"name":"database(_:didCreate:using:)","abstract":"

Execute any relevant database statement after the virtual table has","parent_name":"VirtualTableModule"},"Protocols/AssociationToMany.html#/s:4GRDB11AssociationP6forKeyyxSSF":{"name":"forKey(_:)","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE5countAA0B9AggregateVy16OriginRowDecoderQzGvp":{"name":"count","abstract":"

The number of associated records.

","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE7isEmptyAA0B9AggregateVy16OriginRowDecoderQzGvp":{"name":"isEmpty","abstract":"

Creates an aggregate that is true if there exists no associated records.

","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE7averageyAA0B9AggregateVy16OriginRowDecoderQzGAA14SQLExpressible_pF":{"name":"average(_:)","abstract":"

Creates an aggregate which evaluate to the average value of the given","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE3maxyAA0B9AggregateVy16OriginRowDecoderQzGAA14SQLExpressible_pF":{"name":"max(_:)","abstract":"

Creates an aggregate which evaluate to the maximum value of the given","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE3minyAA0B9AggregateVy16OriginRowDecoderQzGAA14SQLExpressible_pF":{"name":"min(_:)","abstract":"

Creates an aggregate which evaluate to the minimum value of the given","parent_name":"AssociationToMany"},"Protocols/AssociationToMany.html#/s:4GRDB17AssociationToManyPAAE3sumyAA0B9AggregateVy16OriginRowDecoderQzGAA14SQLExpressible_pF":{"name":"sum(_:)","abstract":"

Creates an aggregate which evaluate to the sum of the given expression","parent_name":"AssociationToMany"},"Protocols/AssociationToOne.html#/s:4GRDB11AssociationP6forKeyyxSSF":{"name":"forKey(_:)","parent_name":"AssociationToOne"},"Protocols/Association.html#/s:4GRDB11AssociationP16OriginRowDecoderQa":{"name":"OriginRowDecoder","abstract":"

The record type at the origin of the association.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationP6forKeyyxSSF":{"name":"forKey(_:)","abstract":"

Creates an association with the given key.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE6selectyxSayAA13SQLSelectable_pGF":{"name":"select(_:)","abstract":"

Creates an association which selects selection.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE9annotated4withxSayAA13SQLSelectable_pG_tF":{"name":"annotated(with:)","abstract":"

Creates an association which appends selection.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE6filteryxAA14SQLExpressible_pAA8DatabaseCKcF":{"name":"filter(_:)","abstract":"

Creates an association with the provided predicate promise added to","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE5orderyxSayAA15SQLOrderingTerm_pGAA8DatabaseCKcF":{"name":"order(_:)","abstract":"

Creates an association with the provided orderings promise.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE8reversedxyF":{"name":"reversed()","abstract":"

Creates an association that reverses applied orderings.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE9unorderedxyF":{"name":"unordered()","abstract":"

Creates an association without any ordering.

","parent_name":"Association"},"Protocols/Association.html#/s:4GRDB11AssociationPAAE7aliasedyxAA10TableAliasCF":{"name":"aliased(_:)","abstract":"

Creates an association that allows you to define expressions that target","parent_name":"Association"},"Protocols/ColumnExpression.html#/s:4GRDB16ColumnExpressionP4nameSSvp":{"name":"name","abstract":"

The unqualified name of a database column.

","parent_name":"ColumnExpression"},"Protocols/ColumnExpression.html#/s:4GRDB16ColumnExpressionPAAE5matchyAA13SQLExpression_pAA11FTS3PatternVSgF":{"name":"match(_:)","abstract":"

A matching SQL expression with the MATCH SQL operator.

","parent_name":"ColumnExpression"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordP08databaseB4NameSSvpZ":{"name":"databaseTableName","abstract":"

The name of the database table used to build requests.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordP17databaseSelectionSayAA13SQLSelectable_pGvpZ":{"name":"databaseSelection","abstract":"

The default request selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE8matchingyAA21QueryInterfaceRequestVyxGAA11FTS3PatternVSgFZ":{"name":"matching(_:)","abstract":"

Returns a QueryInterfaceRequest with a matching predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9belongsTo_3key5usingAA07BelongsE11AssociationVyxqd__Gqd__m_SSSgAA10ForeignKeyVSgtAaBRd__lFZ":{"name":"belongsTo(_:key:using:)","abstract":"

Creates a “Belongs To” association between Self and the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE7hasMany_3key5usingAA03HasE11AssociationVyxqd__Gqd__m_SSSgAA10ForeignKeyVSgtAaBRd__lFZ":{"name":"hasMany(_:key:using:)","abstract":"

Creates a “Has many” association between Self and the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE7hasMany_7through5using3keyAA03HasE18ThroughAssociationVyx10RowDecoderQyd_0_GAKm_qd__qd_0_SSSgt06OriginlM0Qyd__RszAA0K0Rd__AaPRd_0_ANQyd_0_AJRtd__r0_lFZ":{"name":"hasMany(_:through:using:key:)","abstract":"

Creates a “Has Many Through” association between Self and the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6hasOne_3key5usingAA03HasE11AssociationVyxqd__Gqd__m_SSSgAA10ForeignKeyVSgtAaBRd__lFZ":{"name":"hasOne(_:key:using:)","abstract":"

Creates a “Has one” association between Self and the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6hasOne_7through5using3keyAA03HasE18ThroughAssociationVyx10RowDecoderQyd_0_GAKm_qd__qd_0_SSSgt06OriginlM0Qyd__RszAA0k2ToE0Rd__AaPRd_0_ANQyd_0_AJRtd__r0_lFZ":{"name":"hasOne(_:through:using:key:)","abstract":"

Creates a “Has One Through” association between Self and the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9including3allAA21QueryInterfaceRequestVyxGqd___t16OriginRowDecoderQyd__RszAA17AssociationToManyRd__lFZ":{"name":"including(all:)","abstract":"

Creates a request that prefetches an association.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9including8optionalAA21QueryInterfaceRequestVyxGqd___t16OriginRowDecoderQyd__RszAA11AssociationRd__lFZ":{"name":"including(optional:)","abstract":"

Creates a request that includes an association. The columns of the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9including8requiredAA21QueryInterfaceRequestVyxGqd___t16OriginRowDecoderQyd__RszAA11AssociationRd__lFZ":{"name":"including(required:)","abstract":"

Creates a request that includes an association. The columns of the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE7joining8optionalAA21QueryInterfaceRequestVyxGqd___t16OriginRowDecoderQyd__RszAA11AssociationRd__lFZ":{"name":"joining(optional:)","abstract":"

Creates a request that includes an association. The columns of the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE7joining8requiredAA21QueryInterfaceRequestVyxGqd___t16OriginRowDecoderQyd__RszAA11AssociationRd__lFZ":{"name":"joining(required:)","abstract":"

Creates a request that includes an association. The columns of the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9annotated4withAA21QueryInterfaceRequestVyxGAA20AssociationAggregateVyxGd_tFZ":{"name":"annotated(with:)","abstract":"

Creates a request with aggregates appended to the selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9annotated4withAA21QueryInterfaceRequestVyxGSayAA20AssociationAggregateVyxGG_tFZ":{"name":"annotated(with:)","abstract":"

Creates a request with aggregates appended to the selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6havingyAA21QueryInterfaceRequestVyxGAA20AssociationAggregateVyxGFZ":{"name":"having(_:)","abstract":"

Creates a request with the provided aggregate predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE3allAA21QueryInterfaceRequestVyxGyFZ":{"name":"all()","abstract":"

Creates a request which fetches all records.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE4noneAA21QueryInterfaceRequestVyxGyFZ":{"name":"none()","abstract":"

Creates a request which fetches no record.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6selectyAA21QueryInterfaceRequestVyxGAA13SQLSelectable_pd_tFZ":{"name":"select(_:)","abstract":"

Creates a request which selects selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6selectyAA21QueryInterfaceRequestVyxGSayAA13SQLSelectable_pGFZ":{"name":"select(_:)","abstract":"

Creates a request which selects selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select3sql9argumentsAA21QueryInterfaceRequestVyxGSS_AA18StatementArgumentsVtFZ":{"name":"select(sql:arguments:)","abstract":"

Creates a request which selects sql.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select7literalAA21QueryInterfaceRequestVyxGAA10SQLLiteralV_tFZ":{"name":"select(literal:)","abstract":"

Creates a request which selects an SQL literal.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select_2asAA21QueryInterfaceRequestVyqd__GSayAA13SQLSelectable_pG_qd__mtlFZ":{"name":"select(_:as:)","abstract":"

Creates a request which selects selection, and fetches values of","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select_2asAA21QueryInterfaceRequestVyqd__GAA13SQLSelectable_pd_qd__mtlFZ":{"name":"select(_:as:)","abstract":"

Creates a request which selects selection, and fetches values of","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select3sql9arguments2asAA21QueryInterfaceRequestVyqd__GSS_AA18StatementArgumentsVqd__mtlFZ":{"name":"select(sql:arguments:as:)","abstract":"

Creates a request which selects sql, and fetches values of","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6select7literal2asAA21QueryInterfaceRequestVyqd__GAA10SQLLiteralV_qd__mtlFZ":{"name":"select(literal:as:)","abstract":"

Creates a request which selects an SQL literal, and fetches values of","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9annotated4withAA21QueryInterfaceRequestVyxGSayAA13SQLSelectable_pG_tFZ":{"name":"annotated(with:)","abstract":"

Creates a request which appends selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE9annotated4withAA21QueryInterfaceRequestVyxGAA13SQLSelectable_pd_tFZ":{"name":"annotated(with:)","abstract":"

Creates a request which appends selection.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filteryAA21QueryInterfaceRequestVyxGAA14SQLExpressible_pFZ":{"name":"filter(_:)","abstract":"

Creates a request with the provided predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter3keyAA21QueryInterfaceRequestVyxGqd__Sg_tAA24DatabaseValueConvertibleRd__lFZ":{"name":"filter(key:)","abstract":"

Creates a request with the provided primary key predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter4keysAA21QueryInterfaceRequestVyxGqd___tSTRd__AA24DatabaseValueConvertible7ElementRpd__lFZ":{"name":"filter(keys:)","abstract":"

Creates a request with the provided primary key predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter3keyAA21QueryInterfaceRequestVyxGSDySSAA24DatabaseValueConvertible_pSgGSg_tFZ":{"name":"filter(key:)","abstract":"

Creates a request with the provided primary key predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter4keysAA21QueryInterfaceRequestVyxGSaySDySSAA24DatabaseValueConvertible_pSgGG_tFZ":{"name":"filter(keys:)","abstract":"

Creates a request with the provided primary key predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter3sql9argumentsAA21QueryInterfaceRequestVyxGSS_AA18StatementArgumentsVtFZ":{"name":"filter(sql:arguments:)","abstract":"

Creates a request with the provided predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE6filter7literalAA21QueryInterfaceRequestVyxGAA10SQLLiteralV_tFZ":{"name":"filter(literal:)","abstract":"

Creates a request with the provided predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE5orderyAA21QueryInterfaceRequestVyxGAA15SQLOrderingTerm_pd_tFZ":{"name":"order(_:)","abstract":"

Creates a request sorted according to the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE5orderyAA21QueryInterfaceRequestVyxGSayAA15SQLOrderingTerm_pGFZ":{"name":"order(_:)","abstract":"

Creates a request sorted according to the","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE17orderByPrimaryKeyAA21QueryInterfaceRequestVyxGyFZ":{"name":"orderByPrimaryKey()","abstract":"

Creates a request sorted by primary key.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE5order3sql9argumentsAA21QueryInterfaceRequestVyxGSS_AA18StatementArgumentsVtFZ":{"name":"order(sql:arguments:)","abstract":"

Creates a request sorted according to sql.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE5order7literalAA21QueryInterfaceRequestVyxGAA10SQLLiteralV_tFZ":{"name":"order(literal:)","abstract":"

Creates a request sorted according to an SQL literal.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE5limit_6offsetAA21QueryInterfaceRequestVyxGSi_SiSgtFZ":{"name":"limit(_:offset:)","abstract":"

Creates a request which fetches limit rows, starting at","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE7aliasedyAA21QueryInterfaceRequestVyxGAA0B5AliasCFZ":{"name":"aliased(_:)","abstract":"

Creates a request that allows you to define expressions that target","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE10fetchCountySiAA8DatabaseCKFZ":{"name":"fetchCount(_:)","abstract":"

The number of records.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE12selectionSQL5aliasS2SSg_tFZ":{"name":"selectionSQL(alias:)","abstract":"

The selection as an SQL String.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE23numberOfSelectedColumnsySiAA8DatabaseCKFZ":{"name":"numberOfSelectedColumns(_:)","abstract":"

Returns the number of selected columns.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE19observationForCountAA16ValueObservationVyAA0G8ReducersO16RemoveDuplicatesVy_AH5FetchVy_SiGGGyFZ":{"name":"observationForCount()","abstract":"

Creates a ValueObservation which observes the record table, and notifies","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPAAE8matchingyAA21QueryInterfaceRequestVyxGAA11FTS5PatternVSgFZ":{"name":"matching(_:)","abstract":"

Returns a QueryInterfaceRequest with a matching predicate.

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPA2A09EncodableC0RzrlE7request3forAA21QueryInterfaceRequestVy10RowDecoderQyd__Gqd___t06OriginjK0Qyd__RszAA11AssociationRd__lF":{"name":"request(for:)","abstract":"

Creates a request that fetches the associated record(s).

","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPA2A09FetchableC0RzrlE17observationForAllAA16ValueObservationVyAA0H8ReducersO0G7RecordsVy_xGGyFZ":{"name":"observationForAll()","abstract":"

Creates a ValueObservation which observes the record table, and notifies","parent_name":"TableRecord"},"Protocols/TableRecord.html#/s:4GRDB11TableRecordPA2A09FetchableC0RzrlE19observationForFirstAA16ValueObservationVyAA0H8ReducersO03OneC0Vy_xGGyFZ":{"name":"observationForFirst()","abstract":"

Creates a ValueObservation which observes the table record, and notifies","parent_name":"TableRecord"},"Protocols/FTS5WrapperTokenizer.html#/wrappedTokenizer":{"name":"wrappedTokenizer","abstract":"

The wrapped tokenizer

","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5WrapperTokenizer.html#/accept(token:flags:for:tokenCallback:)":{"name":"accept(token:flags:for:tokenCallback:)","abstract":"

Given a token produced by the wrapped tokenizer, notifies customized","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5WrapperTokenizer.html#/tokenize(context:tokenization:pText:nText:tokenCallback:)":{"name":"tokenize(context:tokenization:pText:nText:tokenCallback:)","abstract":"

Default implementation

","parent_name":"FTS5WrapperTokenizer"},"Protocols/FTS5Tokenizer.html#/tokenize(context:tokenization:pText:nText:tokenCallback:)":{"name":"tokenize(context:tokenization:pText:nText:tokenCallback:)","abstract":"

Tokenizes the text described by pText and nText, and","parent_name":"FTS5Tokenizer"},"Protocols/FTS5CustomTokenizer.html#/name":{"name":"name","abstract":"

The name of the tokenizer; should uniquely identify your custom","parent_name":"FTS5CustomTokenizer"},"Protocols/FTS5CustomTokenizer.html#/init(db:arguments:)":{"name":"init(db:arguments:)","abstract":"

Creates a custom tokenizer.

","parent_name":"FTS5CustomTokenizer"},"Protocols/FTS5CustomTokenizer.html#/tokenizerDescriptor(arguments:)":{"name":"tokenizerDescriptor(arguments:)","abstract":"

Creates an FTS5 tokenizer descriptor.

","parent_name":"FTS5CustomTokenizer"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverP8observes12eventsOfKindSbAA013DatabaseEventG0O_tF":{"name":"observes(eventsOfKind:)","abstract":"

Filters database changes that should be notified the the","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverP17databaseDidChange4withyAA13DatabaseEventV_tF":{"name":"databaseDidChange(with:)","abstract":"

Notifies a database change (insert, update, or delete).

","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverP18databaseWillCommityyKF":{"name":"databaseWillCommit()","abstract":"

When a transaction is about to be committed, the transaction observer","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverP17databaseDidCommityyAA8DatabaseCF":{"name":"databaseDidCommit(_:)","abstract":"

Database changes have been committed.

","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverP19databaseDidRollbackyyAA8DatabaseCF":{"name":"databaseDidRollback(_:)","abstract":"

Database changes have been rollbacked.

","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/databaseWillChange(with:)":{"name":"databaseWillChange(with:)","abstract":"

Notifies before a database change (insert, update, or delete)","parent_name":"TransactionObserver"},"Protocols/TransactionObserver.html#/s:4GRDB19TransactionObserverPAAE037stopObservingDatabaseChangesUntilNextB0yyF":{"name":"stopObservingDatabaseChangesUntilNextTransaction()","abstract":"

After this method has been called, the databaseDidChange(with:)","parent_name":"TransactionObserver"},"Protocols/StatementColumnConvertible.html#/s:4GRDB26StatementColumnConvertibleP06sqliteB05indexxs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Initializes a value from a raw SQLite statement pointer.

","parent_name":"StatementColumnConvertible"},"Protocols/RowAdapter.html#/s:4GRDB10RowAdapterP08layoutedC04fromAA08LayoutedbC0_pAA0B6Layout_p_tKF":{"name":"layoutedAdapter(from:)","abstract":"

Experimental

","parent_name":"RowAdapter"},"Protocols/RowAdapter.html#/s:4GRDB10RowAdapterPAAE12addingScopesyAaB_pSDySSAaB_pGF":{"name":"addingScopes(_:)","abstract":"

Returns an adapter based on self, with added scopes.

","parent_name":"RowAdapter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP5writeyqd__qd__AA0B0CKXEKlF":{"name":"write(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP23writeWithoutTransactionyqd__qd__AA0B0CKXEKlF":{"name":"writeWithoutTransaction(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP10asyncWrite_10completionyqd__AA0B0CKc_yAG_s6ResultOyqd__s5Error_pGtctlF":{"name":"asyncWrite(_:completion:)","abstract":"

Asynchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP28asyncWriteWithoutTransactionyyyAA0B0CcF":{"name":"asyncWriteWithoutTransaction(_:)","abstract":"

Asynchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP20unsafeReentrantWriteyqd__qd__AA0B0CKXEKlF":{"name":"unsafeReentrantWrite(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterP14concurrentReadyAA0B6FutureCyqd__Gqd__AA0B0CKclF":{"name":"concurrentRead(_:)","abstract":"

Concurrently executes a read-only block in a protected dispatch queue.

","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterPAAE3add19transactionObserver6extentyAA011TransactionF0_p_AA0B0C0H17ObservationExtentOtF":{"name":"add(transactionObserver:extent:)","abstract":"

Add a transaction observer, so that it gets notified of","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterPAAE5eraseyyKF":{"name":"erase()","abstract":"

Erases the content of the database.

","parent_name":"DatabaseWriter"},"Protocols/DatabaseWriter.html#/s:4GRDB14DatabaseWriterPAAE6vacuumyyKF":{"name":"vacuum()","abstract":"

Rebuilds the database file, repacking it into a minimal amount of","parent_name":"DatabaseWriter"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestP10RowDecoderQa":{"name":"RowDecoder","abstract":"

The type that tells how fetched database rows should be interpreted.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestP7prepare_15forSingleResultAA15SelectStatementC_AA10RowAdapter_pSgtAA8DatabaseC_SbtKF":{"name":"prepare(_:forSingleResult:)","abstract":"

This method is deprecated. Use","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestP012makePreparedC0_15forSingleResultAA0eC0VAA8DatabaseC_SbtKF":{"name":"makePreparedRequest(_:forSingleResult:)","abstract":"

Returns a PreparedRequest that is ready to be executed.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestP10fetchCountySiAA8DatabaseCKF":{"name":"fetchCount(_:)","abstract":"

Returns the number of rows fetched by the request.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPAAE7adaptedyAA07AdaptedbC0VyxGAA10RowAdapter_pAA8DatabaseCKcF":{"name":"adapted(_:)","abstract":"

Returns an adapted request.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPAAE14databaseRegionyAA08DatabaseE0VAA0F0CKF":{"name":"databaseRegion(_:)","abstract":"

Returns the database region that the request looks into.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPAAE19observationForCountAA16ValueObservationVyAA0G8ReducersO16RemoveDuplicatesVy_AH0B0Vy_SiGGGyF":{"name":"observationForCount()","abstract":"

Creates a ValueObservation which observes request, and notifies its","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzrlE11fetchCursoryAA0deJ0CyAFGAA0D0CKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzrlE8fetchAllySayAFGAA0D0CKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzrlE8fetchOneyAFSgAA0D0CKF":{"name":"fetchOne(_:)","abstract":"

The first fetched value.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzrlE11fetchCursoryAA08NullablehiM0CyAIGAA0H0CKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched optional values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzrlE8fetchAllySayAISgGAA0H0CKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched optional values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A3RowC0D7DecoderRtzrlE11fetchCursoryAA0dG0CAA8DatabaseCKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched rows.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A3RowC0D7DecoderRtzrlE8fetchAllySayAEGAA8DatabaseCKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched rows.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A3RowC0D7DecoderRtzrlE8fetchOneyAESgAA8DatabaseCKF":{"name":"fetchOne(_:)","abstract":"

The first fetched row.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzAA015StatementColumnF0AFRQrlE11fetchCursoryAA04FastdeL0CyAFGAA0D0CKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzAA015StatementColumnF0AFRQrlE8fetchAllySayAFGAA0D0CKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzAA015StatementColumnF0AFRQrlE8fetchOneyAFSgAA0D0CKF":{"name":"fetchOne(_:)","abstract":"

The first fetched value.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzAA015StatementColumnJ0AIRQrlE11fetchCursoryAA012FastNullablehiO0CyAIGAA0H0CKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched optional values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzAA015StatementColumnJ0AIRQrlE8fetchAllySayAISgGAA0H0CKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched optional values.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A15FetchableRecord10RowDecoderRpzrlE11fetchCursoryAA0eI0CyAFGAA8DatabaseCKF":{"name":"fetchCursor(_:)","abstract":"

A cursor over fetched records.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A15FetchableRecord10RowDecoderRpzrlE8fetchAllySayAFGAA8DatabaseCKF":{"name":"fetchAll(_:)","abstract":"

An array of fetched records.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A15FetchableRecord10RowDecoderRpzrlE8fetchOneyAFSgAA8DatabaseCKF":{"name":"fetchOne(_:)","abstract":"

The first fetched record.

","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzrlE17observationForAllAA0E11ObservationVyAA0E8ReducersO0K6ValuesVy_AFGGyF":{"name":"observationForAll()","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A24DatabaseValueConvertible10RowDecoderRpzrlE19observationForFirstAA0E11ObservationVyAA0E8ReducersO03OneE0Vy_AFGGyF":{"name":"observationForFirst()","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzrlE17observationForAllAA0I11ObservationVyAA0I8ReducersO0nD6ValuesVy_AIGGyF":{"name":"observationForAll()","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A17_OptionalProtocol10RowDecoderRpzAA24DatabaseValueConvertibleAE_8_WrappedRPzrlE19observationForFirstAA0I11ObservationVyAA0I8ReducersO03OneI0Vy_AIGGyF":{"name":"observationForFirst()","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A15FetchableRecord10RowDecoderRpzrlE17observationForAllAA16ValueObservationVyAA0K8ReducersO0J7RecordsVy_AFGGyF":{"name":"observationForAll()","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A15FetchableRecord10RowDecoderRpzrlE19observationForFirstAA16ValueObservationVyAA0K8ReducersO03OneE0Vy_AFGGyF":{"name":"observationForFirst()","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A3RowC0D7DecoderRtzrlE17observationForAllAA16ValueObservationVyAA0I8ReducersO0H4RowsVGyF":{"name":"observationForAll()","abstract":"

Creates a ValueObservation which observes request, and notifies","parent_name":"FetchRequest"},"Protocols/FetchRequest.html#/s:4GRDB12FetchRequestPA2A3RowC0D7DecoderRtzrlE19observationForFirstAA16ValueObservationVyAA0I8ReducersO03OneD0VGyF":{"name":"observationForFirst()","abstract":"

Creates a ValueObservation which observes request, and notifies a","parent_name":"FetchRequest"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertibleP08databaseC0AA0bC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertibleP04frombC0yxSgAA0bC0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a value initialized from dbValue, if possible.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE11fetchCursor_9arguments7adapterAA0bcF0CyxGAA15SelectStatementC_AA0J9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

Returns a cursor over values fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchAll_9arguments7adapterSayxGAA15SelectStatementC_AA0J9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of values fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchOne_9arguments7adapterxSgAA15SelectStatementC_AA0J9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:arguments:adapter:)","abstract":"

Returns a single value fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE11fetchCursor_3sql9arguments7adapterAA0bcF0CyxGAA0B0C_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over values fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchAll_3sql9arguments7adapterSayxGAA0B0C_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of values fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchOne_3sql9arguments7adapterxSgAA0B0C_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:sql:arguments:adapter:)","abstract":"

Returns a single value fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE11fetchCursoryAA0bcF0CyxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over values fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchAllySayxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of values fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAAE8fetchOneyxSgAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchOne(_:_:)","abstract":"

Returns a single value fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE11fetchCursor_9arguments7adapterAA04FastbcH0CyxGAA06SelectE0C_AA0E9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

Returns a cursor over values fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchAll_9arguments7adapterSayxGAA06SelectE0C_AA0E9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of values fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchOne_9arguments7adapterxSgAA06SelectE0C_AA0E9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:arguments:adapter:)","abstract":"

Returns a single value fetched from a prepared statement.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE11fetchCursor_3sql9arguments7adapterAA04FastbcH0CyxGAA0B0C_SSAA0E9ArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over values fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchAll_3sql9arguments7adapterSayxGAA0B0C_SSAA0E9ArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of values fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchOne_3sql9arguments7adapterxSgAA0B0C_SSAA0E9ArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchOne(_:sql:arguments:adapter:)","abstract":"

Returns a single value fetched from an SQL query.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE11fetchCursoryAA04FastbcH0CyxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over values fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchAllySayxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of values fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePA2A015StatementColumnD0RzrlE8fetchOneyxSgAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchOne(_:_:)","abstract":"

Returns a single value fetched from a fetch request.

","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAA10Foundation09ReferenceD0RzAaB0F4TypeAdEPRpzrlE08databaseC0AA0bC0Vvp":{"name":"databaseValue","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAA10Foundation09ReferenceD0RzAaB0F4TypeAdEPRpzrlE04frombC0yxSgAA0bC0VFZ":{"name":"fromDatabaseValue(_:)","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAASYRzAaB03RawC0SYRpzrlE08databaseC0AA0bC0Vvp":{"name":"databaseValue","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseValueConvertible.html#/s:4GRDB24DatabaseValueConvertiblePAASYRzAaB03RawC0SYRpzrlE04frombC0yxSgAA0bC0VFZ":{"name":"fromDatabaseValue(_:)","parent_name":"DatabaseValueConvertible"},"Protocols/DatabaseRegionConvertible.html#/s:4GRDB25DatabaseRegionConvertibleP08databaseC0yAA0bC0VAA0B0CKF":{"name":"databaseRegion(_:)","abstract":"

Returns a database region.

","parent_name":"DatabaseRegionConvertible"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP13configurationAA13ConfigurationVvp":{"name":"configuration","abstract":"

The database configuration

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP9interruptyyF":{"name":"interrupt()","abstract":"

This method causes any pending database operation to abort and return at","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP4readyqd__qd__AA0B0CKXEKlF":{"name":"read(_:)","abstract":"

Synchronously executes a read-only block that takes a database","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP9asyncReadyyys6ResultOyAA0B0Cs5Error_pGcF":{"name":"asyncRead(_:)","abstract":"

Asynchronously executes a read-only block that takes a","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP10unsafeReadyqd__qd__AA0B0CKXEKlF":{"name":"unsafeRead(_:)","abstract":"

Synchronously executes a read-only block that takes a database","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP19unsafeReentrantReadyqd__qd__AA0B0CKXEKlF":{"name":"unsafeReentrantRead(_:)","abstract":"

Synchronously executes a block that takes a database connection, and","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP3add8functionyAA0B8FunctionC_tF":{"name":"add(function:)","abstract":"

Add or redefine an SQL function.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP6remove8functionyAA0B8FunctionC_tF":{"name":"remove(function:)","abstract":"

Remove an SQL function.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP3add9collationyAA0B9CollationC_tF":{"name":"add(collation:)","abstract":"

Add or redefine a collation.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP6remove9collationyAA0B9CollationC_tF":{"name":"remove(collation:)","abstract":"

Remove a collation.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP3add11observation7onError0F6ChangeAA19TransactionObserver_pAA16ValueObservationVyqd__G_ys0G0_pcy0K0Qyd__ctAA0K7ReducerRd__lF":{"name":"add(observation:onError:onChange:)","abstract":"

Starts a value observation.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderP6remove19transactionObserveryAA011TransactionF0_p_tF":{"name":"remove(transactionObserver:)","abstract":"

Remove a transaction observer.

","parent_name":"DatabaseReader"},"Protocols/DatabaseReader.html#/s:4GRDB14DatabaseReaderPAAE6backup2toyAA0B6Writer_p_tKF":{"name":"backup(to:)","abstract":"

Copies the database contents into another database.

","parent_name":"DatabaseReader"},"Protocols/DatabaseAggregate.html#/s:4GRDB17DatabaseAggregatePxycfc":{"name":"init()","abstract":"

Creates an aggregate.

","parent_name":"DatabaseAggregate"},"Protocols/DatabaseAggregate.html#/s:4GRDB17DatabaseAggregateP4stepyySayAA0B5ValueVGKF":{"name":"step(_:)","abstract":"

This method is called at each step of the aggregation.

","parent_name":"DatabaseAggregate"},"Protocols/DatabaseAggregate.html#/s:4GRDB17DatabaseAggregateP8finalizeAA0B16ValueConvertible_pSgyKF":{"name":"finalize()","abstract":"

Returns the final result

","parent_name":"DatabaseAggregate"},"Protocols/Cursor.html#/s:4GRDB6CursorP7ElementQa":{"name":"Element","abstract":"

The type of element traversed by the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorP4next7ElementQzSgyKF":{"name":"next()","abstract":"

Advances to the next element and returns it, or nil if no next element","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE7isEmptySbyKF":{"name":"isEmpty()","abstract":"

Returns a Boolean value indicating whether the cursor contains","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE8contains5whereS2b7ElementQzKXE_tKF":{"name":"contains(where:)","abstract":"

Returns a Boolean value indicating whether the cursor contains an","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE10enumeratedAA010EnumeratedB0CyxGyF":{"name":"enumerated()","abstract":"

Returns a cursor of pairs (n, x), where n represents a consecutive","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6filteryAA06FilterB0CyxGSb7ElementQzKcF":{"name":"filter(_:)","abstract":"

Returns the elements of the cursor that satisfy the given predicate.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE5first5where7ElementQzSgSbAGKXE_tKF":{"name":"first(where:)","abstract":"

Returns the first element of the cursor that satisfies the given","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE10compactMapyAA0dB0CyAA06FilterB0CyAFyxqd__SgGGqd__GAI7ElementQzKclF":{"name":"compactMap(_:)","abstract":"

Returns a cursor over the concatenated non-nil results of mapping","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE4drop5whileAA09DropWhileB0CyxGSb7ElementQzKc_tF":{"name":"drop(while:)","abstract":"

Returns a cursor that skips any initial elements that satisfy","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE9dropFirstyAA04DropdB0CyxGSiF":{"name":"dropFirst(_:)","abstract":"

Returns a cursor containing all but the given number of initial","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE9dropFirstAA04DropdB0CyxGyF":{"name":"dropFirst()","abstract":"

Returns a cursor containing all but the first element of the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE8dropLastySay7ElementQzGSiKF":{"name":"dropLast(_:)","abstract":"

Returns an array containing all but the given number of final","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE8dropLastSay7ElementQzGyKF":{"name":"dropLast()","abstract":"

Returns an array containing all but the last element of the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE7flatMapyAA07FlattenB0CyAA0dB0CyxAA03AnyB0Cy7ElementQyd__GGGqd__AKQzKcSTRd__lF":{"name":"flatMap(_:)","abstract":"

Returns a cursor over the concatenated results of mapping transform","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE7flatMapyAA07FlattenB0CyAA0dB0Cyxqd__GGqd__7ElementQzKcAaBRd__lF":{"name":"flatMap(_:)","abstract":"

Returns a cursor over the concatenated results of mapping transform","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE7forEachyyy7ElementQzKXEKF":{"name":"forEach(_:)","abstract":"

Calls the given closure on each element in the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE3mapyAA03MapB0Cyxqd__Gqd__7ElementQzKclF":{"name":"map(_:)","abstract":"

Returns a cursor over the results of the transform function applied to","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE3max2by7ElementQzSgSbAG_AGtKXE_tKF":{"name":"max(by:)","abstract":"

Returns the maximum element in the cursor, using the given predicate as","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE3min2by7ElementQzSgSbAG_AGtKXE_tKF":{"name":"min(by:)","abstract":"

Returns the minimum element in the cursor, using the given predicate as","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6prefixyAA06PrefixB0CyxGSiF":{"name":"prefix(_:)","abstract":"

Returns a cursor, up to the specified maximum length, containing the","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6prefix5whileAA011PrefixWhileB0CyxGSb7ElementQzKc_tF":{"name":"prefix(while:)","abstract":"

Returns a cursor of the initial consecutive elements that satisfy","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6reduceyqd__qd___qd__qd___7ElementQztKXEtKlF":{"name":"reduce(_:_:)","abstract":"

Returns the result of calling the given combining closure with each","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6reduce4into_qd__qd___yqd__z_7ElementQztKXEtKlF":{"name":"reduce(into:_:)","abstract":"

Returns the result of calling the given combining closure with each","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAE6suffixySay7ElementQzGSiKF":{"name":"suffix(_:)","abstract":"

Returns an array, up to the given maximum length, containing the","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAASQ7ElementRpzrlE8containsySbAEKF":{"name":"contains(_:)","abstract":"

Returns a Boolean value indicating whether the cursor contains the","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAASL7ElementRpzrlE3maxAESgyKF":{"name":"max()","abstract":"

Returns the maximum element in the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAASL7ElementRpzrlE3minAESgyKF":{"name":"min()","abstract":"

Returns the minimum element in the cursor.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPA2aB7ElementRpzrlE6joinedAA07FlattenB0CyxGyF":{"name":"joined()","abstract":"

Returns the elements of this cursor of cursors, concatenated.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAAST7ElementRpzrlE6joinedAA07FlattenB0CyAA03MapB0CyxAA03AnyB0CyAD_ADQZGGGyF":{"name":"joined()","abstract":"

Returns the elements of this cursor of sequences, concatenated.

","parent_name":"Cursor"},"Protocols/Cursor.html#/s:4GRDB6CursorPAASy7ElementRpzrlE6joined9separatorS2S_tKF":{"name":"joined(separator:)","abstract":"

Returns the elements of this cursor of sequences, concatenated.

","parent_name":"Cursor"},"Protocols/Cursor.html":{"name":"Cursor","abstract":"

A type that supplies the values of some external resource, one at a time.

"},"Protocols/DatabaseAggregate.html":{"name":"DatabaseAggregate","abstract":"

The protocol for custom SQLite aggregates.

"},"Protocols/DatabaseReader.html":{"name":"DatabaseReader","abstract":"

The protocol for all types that can fetch values from a database.

"},"Protocols/DatabaseRegionConvertible.html":{"name":"DatabaseRegionConvertible","abstract":"

Undocumented

"},"Protocols/DatabaseValueConvertible.html":{"name":"DatabaseValueConvertible","abstract":"

Types that adopt DatabaseValueConvertible can be initialized from"},"Protocols/FetchRequest.html":{"name":"FetchRequest","abstract":"

The protocol for all requests that fetch database rows, and tell how those"},"Protocols/DatabaseWriter.html":{"name":"DatabaseWriter","abstract":"

The protocol for all types that can update a database.

"},"Protocols/RowAdapter.html":{"name":"RowAdapter","abstract":"

RowAdapter is a protocol that helps two incompatible row interfaces working"},"Protocols/StatementColumnConvertible.html":{"name":"StatementColumnConvertible","abstract":"

The StatementColumnConvertible protocol grants access to the low-level C"},"Protocols/TransactionObserver.html":{"name":"TransactionObserver","abstract":"

A transaction observer is notified of all changes and transactions committed"},"Protocols/FTS5CustomTokenizer.html":{"name":"FTS5CustomTokenizer","abstract":"

The protocol for custom FTS5 tokenizers.

"},"Protocols/FTS5Tokenizer.html":{"name":"FTS5Tokenizer","abstract":"

The protocol for FTS5 tokenizers

"},"Protocols/FTS5WrapperTokenizer.html":{"name":"FTS5WrapperTokenizer","abstract":"

The protocol for custom FTS5 tokenizers that wrap another tokenizer.

"},"Protocols/TableRecord.html":{"name":"TableRecord","abstract":"

Types that adopt TableRecord declare a particular relationship with"},"Protocols/ColumnExpression.html":{"name":"ColumnExpression","abstract":"

Adopt the ColumnExpression protocol when you define a column type.

"},"Protocols/Association.html":{"name":"Association","abstract":"

Experimental

"},"Protocols/AssociationToOne.html":{"name":"AssociationToOne","abstract":"

Experimental

"},"Protocols/AssociationToMany.html":{"name":"AssociationToMany","abstract":"

Experimental

"},"Protocols/VirtualTableModule.html":{"name":"VirtualTableModule","abstract":"

The protocol for SQLite virtual table modules. It lets you define a DSL for"},"Protocols/EncodableRecord.html":{"name":"EncodableRecord","abstract":"

Types that adopt EncodableRecord can be encoded into the database.

"},"Protocols/FetchableRecord.html":{"name":"FetchableRecord","abstract":"

Types that adopt FetchableRecord can be initialized from a database Row.

"},"Protocols/MutablePersistableRecord.html":{"name":"MutablePersistableRecord","abstract":"

Types that adopt MutablePersistableRecord can be inserted, updated, and deleted.

"},"Protocols/PersistableRecord.html":{"name":"PersistableRecord","abstract":"

Types that adopt PersistableRecord can be inserted, updated, and deleted.

"},"Protocols/ValueReducer.html":{"name":"ValueReducer","abstract":"

Experimental

"},"Functions.html#/s:4GRDB20splittingRowAdapters12columnCountsSayAA0C7Adapter_pGSaySiG_tF":{"name":"splittingRowAdapters(columnCounts:)","abstract":"

Returns an array of row adapters that split a row according to the input"},"Functions.html#/s:4GRDB1nopyAA20AssociationAggregateVyxGAElF":{"name":"!(_:)","abstract":"

Returns a logically negated aggregate.

"},"Functions.html#/s:4GRDB2aaoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"&&(_:_:)","abstract":"

Groups two aggregates with the AND SQL operator.

"},"Functions.html#/s:4GRDB2oooiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"||(_:_:)","abstract":"

Groups two aggregates with the OR SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"==(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"==(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"==(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA20AssociationAggregateVyxGAE_SbtlF":{"name":"==(_:_:)","abstract":"

Returns an aggregate that checks the boolean value of an aggregate.

"},"Functions.html#/s:4GRDB2eeoiyAA20AssociationAggregateVyxGSb_AEtlF":{"name":"==(_:_:)","abstract":"

Returns an aggregate that checks the boolean value of an aggregate.

"},"Functions.html#/s:4GRDB2neoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"!=(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"!=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"!=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA20AssociationAggregateVyxGAE_SbtlF":{"name":"!=(_:_:)","abstract":"

Returns an aggregate that checks the boolean value of an aggregate.

"},"Functions.html#/s:4GRDB2neoiyAA20AssociationAggregateVyxGSb_AEtlF":{"name":"!=(_:_:)","abstract":"

Returns an aggregate that checks the boolean value of an aggregate.

"},"Functions.html#/s:4GRDB3eeeoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"===(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"===(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"===(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the IS SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"!==(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"!==(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"!==(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"<=(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"<=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"<=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the <= SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"<(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"<(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"<(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the < SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":">(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":">(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":">(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the > SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":">=(_:_:)","abstract":"

Returns an aggregate that compares two aggregates with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":">=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":">=(_:_:)","abstract":"

Returns an aggregate that compares an aggregate with the >= SQL operator.

"},"Functions.html#/s:4GRDB1sopyAA20AssociationAggregateVyxGAElF":{"name":"-(_:)","abstract":"

Returns an arithmetically negated aggregate.

"},"Functions.html#/s:4GRDB1poiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"+(_:_:)","abstract":"

Returns an aggregate that sums two aggregates with the + SQL operator.

"},"Functions.html#/s:4GRDB1poiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"+(_:_:)","abstract":"

Returns an aggregate that sums an aggregate with the + SQL operator.

"},"Functions.html#/s:4GRDB1poiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"+(_:_:)","abstract":"

Returns an aggregate that sums an aggregate with the + SQL operator.

"},"Functions.html#/s:4GRDB1soiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"-(_:_:)","abstract":"

Returns an aggregate that substracts two aggregates with the - SQL operator.

"},"Functions.html#/s:4GRDB1soiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"-(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the - SQL operator.

"},"Functions.html#/s:4GRDB1soiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"-(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the - SQL operator.

"},"Functions.html#/s:4GRDB1moiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"*(_:_:)","abstract":"

Returns an aggregate that multiplies two aggregates with the * SQL operator.

"},"Functions.html#/s:4GRDB1moiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"*(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the * SQL operator.

"},"Functions.html#/s:4GRDB1moiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"*(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the * SQL operator.

"},"Functions.html#/s:4GRDB1doiyAA20AssociationAggregateVyxGAE_AEtlF":{"name":"/(_:_:)","abstract":"

Returns an aggregate that multiplies two aggregates with the / SQL operator.

"},"Functions.html#/s:4GRDB1doiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"/(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the / SQL operator.

"},"Functions.html#/s:4GRDB1doiyAA20AssociationAggregateVyxGAA14SQLExpressible_p_AEtlF":{"name":"/(_:_:)","abstract":"

Returns an aggregate that substracts an aggregate with the / SQL operator.

"},"Functions.html#/s:4GRDB2qqoiyAA20AssociationAggregateVyxGAE_AA14SQLExpressible_ptlF":{"name":"??(_:_:)","abstract":"

Returns an aggregate that evaluates the IFNULL SQL function.

"},"Functions.html#/s:4GRDB2lsoiyAA16ColumnAssignmentVAA0C10Expression_p_AA14SQLExpressible_ptF":{"name":"<-(_:_:)","abstract":"

Creates an assignment to a value.

"},"Functions.html#/s:4GRDB2peoiyAA16ColumnAssignmentVAA0C10Expression_p_AA14SQLExpressible_ptF":{"name":"+=(_:_:)","abstract":"

Creates an assignment that adds a value

"},"Functions.html#/s:4GRDB2seoiyAA16ColumnAssignmentVAA0C10Expression_p_AA14SQLExpressible_ptF":{"name":"-=(_:_:)","abstract":"

Creates an assignment that subtracts a value

"},"Functions.html#/s:4GRDB2meoiyAA16ColumnAssignmentVAA0C10Expression_p_AA14SQLExpressible_ptF":{"name":"*=(_:_:)","abstract":"

Creates an assignment that multiplies by a value

"},"Functions.html#/s:4GRDB2deoiyAA16ColumnAssignmentVAA0C10Expression_p_AA14SQLExpressible_ptF":{"name":"/=(_:_:)","abstract":"

Creates an assignment that divides by a value

"},"Functions.html#/s:4GRDB3absyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"abs(_:)","abstract":"

Returns an expression that evaluates the ABS SQL function.

"},"Functions.html#/s:4GRDB7averageyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"average(_:)","abstract":"

Returns an expression that evaluates the AVG SQL function.

"},"Functions.html#/s:4GRDB5countyAA13SQLExpression_pAA13SQLSelectable_pF":{"name":"count(_:)","abstract":"

Returns an expression that evaluates the COUNT SQL function.

"},"Functions.html#/s:4GRDB5count8distinctAA13SQLExpression_pAA22SQLSpecificExpressible_p_tF":{"name":"count(distinct:)","abstract":"

Returns an expression that evaluates the COUNT(DISTINCT) SQL function.

"},"Functions.html#/s:4GRDB2qqoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"??(_:_:)","abstract":"

Returns an expression that evaluates the IFNULL SQL function.

"},"Functions.html#/s:4GRDB6lengthyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"length(_:)","abstract":"

Returns an expression that evaluates the LENGTH SQL function.

"},"Functions.html#/s:4GRDB3maxyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"max(_:)","abstract":"

Returns an expression that evaluates the MAX SQL function.

"},"Functions.html#/s:4GRDB3minyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"min(_:)","abstract":"

Returns an expression that evaluates the MIN SQL function.

"},"Functions.html#/s:4GRDB3sumyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"sum(_:)","abstract":"

Returns an expression that evaluates the SUM SQL function.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_pSgtF":{"name":"==(_:_:)","abstract":"

An SQL expression that compares two expressions with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_pSgtF":{"name":"==(_:_:)","abstract":"

An SQL expression that compares two expressions with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_SbtF":{"name":"==(_:_:)","abstract":"

An SQL expression that checks the boolean value of an expression.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA22SQLSpecificExpressible_ptF":{"name":"==(_:_:)","abstract":"

An SQL expression that compares two expressions with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA21SQLCollatedExpressionVtF":{"name":"==(_:_:)","abstract":"

An SQL expression that compares two expressions with the = SQL operator.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pSb_AA22SQLSpecificExpressible_ptF":{"name":"==(_:_:)","abstract":"

An SQL expression that checks the boolean value of an expression.

"},"Functions.html#/s:4GRDB2eeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"==(_:_:)","abstract":"

An SQL expression that compares two expressions with the = SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_pSgtF":{"name":"!=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_pSgtF":{"name":"!=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_SbtF":{"name":"!=(_:_:)","abstract":"

An SQL expression that checks the boolean value of an expression.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA22SQLSpecificExpressible_ptF":{"name":"!=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA21SQLCollatedExpressionVtF":{"name":"!=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <> SQL operator.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pSb_AA22SQLSpecificExpressible_ptF":{"name":"!=(_:_:)","abstract":"

An SQL expression that checks the boolean value of an expression.

"},"Functions.html#/s:4GRDB2neoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"!=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <> SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_pSgtF":{"name":"===(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_pSgtF":{"name":"===(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA22SQLSpecificExpressible_ptF":{"name":"===(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA21SQLCollatedExpressionVtF":{"name":"===(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS SQL operator.

"},"Functions.html#/s:4GRDB3eeeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"===(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_pSgtF":{"name":"!==(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_pSgtF":{"name":"!==(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA22SQLSpecificExpressible_ptF":{"name":"!==(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA13SQLExpression_pAA14SQLExpressible_pSg_AA21SQLCollatedExpressionVtF":{"name":"!==(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB3neeoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"!==(_:_:)","abstract":"

An SQL expression that compares two expressions with the IS NOT SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"<(_:_:)","abstract":"

An SQL expression that compares two expressions with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_ptF":{"name":"<(_:_:)","abstract":"

An SQL expression that compares two expressions with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"<(_:_:)","abstract":"

An SQL expression that compares two expressions with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA13SQLExpression_pAA14SQLExpressible_p_AA21SQLCollatedExpressionVtF":{"name":"<(_:_:)","abstract":"

An SQL expression that compares two expressions with the < SQL operator.

"},"Functions.html#/s:4GRDB1loiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"<(_:_:)","abstract":"

An SQL expression that compares two expressions with the < SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"<=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_ptF":{"name":"<=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"<=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA13SQLExpression_pAA14SQLExpressible_p_AA21SQLCollatedExpressionVtF":{"name":"<=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <= SQL operator.

"},"Functions.html#/s:4GRDB2leoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"<=(_:_:)","abstract":"

An SQL expression that compares two expressions with the <= SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":">(_:_:)","abstract":"

An SQL expression that compares two expressions with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_ptF":{"name":">(_:_:)","abstract":"

An SQL expression that compares two expressions with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":">(_:_:)","abstract":"

An SQL expression that compares two expressions with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA13SQLExpression_pAA14SQLExpressible_p_AA21SQLCollatedExpressionVtF":{"name":">(_:_:)","abstract":"

An SQL expression that compares two expressions with the > SQL operator.

"},"Functions.html#/s:4GRDB1goiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":">(_:_:)","abstract":"

An SQL expression that compares two expressions with the > SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":">=(_:_:)","abstract":"

An SQL expression that compares two expressions with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA13SQLExpression_pAA21SQLCollatedExpressionV_AA14SQLExpressible_ptF":{"name":">=(_:_:)","abstract":"

An SQL expression that compares two expressions with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":">=(_:_:)","abstract":"

An SQL expression that compares two expressions with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA13SQLExpression_pAA14SQLExpressible_p_AA21SQLCollatedExpressionVtF":{"name":">=(_:_:)","abstract":"

An SQL expression that compares two expressions with the >= SQL operator.

"},"Functions.html#/s:4GRDB2geoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":">=(_:_:)","abstract":"

An SQL expression that compares two expressions with the >= SQL operator.

"},"Functions.html#/s:4GRDB1moiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"*(_:_:)","abstract":"

An SQL arithmetic multiplication.

"},"Functions.html#/s:4GRDB1moiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"*(_:_:)","abstract":"

An SQL arithmetic multiplication.

"},"Functions.html#/s:4GRDB1moiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"*(_:_:)","abstract":"

An SQL arithmetic multiplication.

"},"Functions.html#/s:4GRDB1doiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"/(_:_:)","abstract":"

An SQL arithmetic division.

"},"Functions.html#/s:4GRDB1doiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"/(_:_:)","abstract":"

An SQL arithmetic division.

"},"Functions.html#/s:4GRDB1doiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"/(_:_:)","abstract":"

An SQL arithmetic division.

"},"Functions.html#/s:4GRDB1poiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"+(_:_:)","abstract":"

An SQL arithmetic addition.

"},"Functions.html#/s:4GRDB1poiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"+(_:_:)","abstract":"

An SQL arithmetic addition.

"},"Functions.html#/s:4GRDB1poiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"+(_:_:)","abstract":"

An SQL arithmetic addition.

"},"Functions.html#/s:4GRDB1sopyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"-(_:)","abstract":"

A negated SQL arithmetic expression.

"},"Functions.html#/s:4GRDB1soiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"-(_:_:)","abstract":"

An SQL arithmetic substraction.

"},"Functions.html#/s:4GRDB1soiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"-(_:_:)","abstract":"

An SQL arithmetic substraction.

"},"Functions.html#/s:4GRDB1soiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"-(_:_:)","abstract":"

An SQL arithmetic substraction.

"},"Functions.html#/s:4GRDB2aaoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"&&(_:_:)","abstract":"

A logical SQL expression with the AND SQL operator.

"},"Functions.html#/s:4GRDB2aaoiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"&&(_:_:)","abstract":"

A logical SQL expression with the AND SQL operator.

"},"Functions.html#/s:4GRDB2aaoiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"&&(_:_:)","abstract":"

A logical SQL expression with the AND SQL operator.

"},"Functions.html#/s:4GRDB2oooiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AA14SQLExpressible_ptF":{"name":"||(_:_:)","abstract":"

A logical SQL expression with the OR SQL operator.

"},"Functions.html#/s:4GRDB2oooiyAA13SQLExpression_pAA14SQLExpressible_p_AA22SQLSpecificExpressible_ptF":{"name":"||(_:_:)","abstract":"

A logical SQL expression with the OR SQL operator.

"},"Functions.html#/s:4GRDB2oooiyAA13SQLExpression_pAA22SQLSpecificExpressible_p_AaD_ptF":{"name":"||(_:_:)","abstract":"

A logical SQL expression with the OR SQL operator.

"},"Functions.html#/s:4GRDB1nopyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"!(_:)","abstract":"

A negated logical SQL expression with the NOT SQL operator.

"},"Functions.html#/s:4GRDB21databaseQuestionMarks5countSSSi_tF":{"name":"databaseQuestionMarks(count:)","abstract":"

Return as many question marks separated with commas as the count argument.

"},"Extensions/CountableClosedRange.html#/s:SN4GRDBAA14SQLExpressibleRzSxRzSZ6StrideSxRpzrlE8containsyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"CountableClosedRange"},"Extensions/CountableRange.html#/s:Sn4GRDBAA14SQLExpressibleRzSxRzSZ6StrideSxRpzrlE8containsyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"CountableRange"},"Extensions/ClosedRange.html#/s:SN4GRDBAA14SQLExpressibleRzrlE8containsyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"ClosedRange"},"Extensions/ClosedRange.html#/s:SN4GRDBAA14SQLExpressibleRzrlE8containsyAA13SQLExpression_pAA21SQLCollatedExpressionVF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"ClosedRange"},"Extensions/Range.html#/s:Sn4GRDBAA14SQLExpressibleRzrlE8containsyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"Range"},"Extensions/Range.html#/s:Sn4GRDBAA14SQLExpressibleRzrlE8containsyAA13SQLExpression_pAA21SQLCollatedExpressionVF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in a range.

","parent_name":"Range"},"Extensions/TableRecord.html#/matching(_:)":{"name":"matching(_:)","abstract":"

Returns a QueryInterfaceRequest with a matching predicate.

","parent_name":"TableRecord"},"Extensions/TableRequest.html#/matching(_:)":{"name":"matching(_:)","abstract":"

Creates a request with a full-text predicate added to the eventual","parent_name":"TableRequest"},"Extensions/DatabaseQueue.html#/add(tokenizer:)":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"DatabaseQueue"},"Extensions/Column.html#/rank":{"name":"rank","abstract":"

The FTS5 rank column

","parent_name":"Column"},"Extensions/String.html#/s:SS4GRDBE15sqliteStatement5indexSSs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"String"},"Extensions/String.html#/s:SS4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"String"},"Extensions/String.html#/s:SS4GRDBE17fromDatabaseValueySSSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a String initialized from dbValue, if possible.

","parent_name":"String"},"Extensions/String.html#/s:SS4GRDBE24quotedDatabaseIdentifierSSvp":{"name":"quotedDatabaseIdentifier","abstract":"

Returns the receiver, quoted for safe insertion as an identifier in an","parent_name":"String"},"Extensions/Float.html#/s:Sf4GRDBE15sqliteStatement5indexSfs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Float"},"Extensions/Float.html#/s:Sf4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Float"},"Extensions/Float.html#/s:Sf4GRDBE17fromDatabaseValueySfSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a Float initialized from dbValue, if possible.

","parent_name":"Float"},"Extensions/Double.html#/s:Sd4GRDBE15sqliteStatement5indexSds13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Double"},"Extensions/Double.html#/s:Sd4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Double"},"Extensions/Double.html#/s:Sd4GRDBE17fromDatabaseValueySdSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a Double initialized from dbValue, if possible.

","parent_name":"Double"},"Extensions/UInt64.html#/s:s6UInt64V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"UInt64"},"Extensions/UInt64.html#/s:s6UInt64V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"UInt64"},"Extensions/UInt64.html#/s:s6UInt64V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an UInt64 initialized from dbValue, if possible.

","parent_name":"UInt64"},"Extensions/UInt32.html#/s:s6UInt32V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"UInt32"},"Extensions/UInt32.html#/s:s6UInt32V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"UInt32"},"Extensions/UInt32.html#/s:s6UInt32V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an UInt32 initialized from dbValue, if possible.

","parent_name":"UInt32"},"Extensions/UInt16.html#/s:s6UInt16V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"UInt16"},"Extensions/UInt16.html#/s:s6UInt16V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"UInt16"},"Extensions/UInt16.html#/s:s6UInt16V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an UInt16 initialized from dbValue, if possible.

","parent_name":"UInt16"},"Extensions/UInt8.html#/s:s5UInt8V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"UInt8"},"Extensions/UInt8.html#/s:s5UInt8V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"UInt8"},"Extensions/UInt8.html#/s:s5UInt8V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an UInt8 initialized from dbValue, if possible.

","parent_name":"UInt8"},"Extensions/UInt.html#/s:Su4GRDBE15sqliteStatement5indexSus13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"UInt"},"Extensions/UInt.html#/s:Su4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"UInt"},"Extensions/UInt.html#/s:Su4GRDBE17fromDatabaseValueySuSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int initialized from dbValue, if possible.

","parent_name":"UInt"},"Extensions/Int64.html#/s:s5Int64V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Int64"},"Extensions/Int64.html#/s:s5Int64V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Int64"},"Extensions/Int64.html#/s:s5Int64V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int64 initialized from dbValue, if possible.

","parent_name":"Int64"},"Extensions/Int32.html#/s:s5Int32V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_ABtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Int32"},"Extensions/Int32.html#/s:s5Int32V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Int32"},"Extensions/Int32.html#/s:s5Int32V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int32 initialized from dbValue, if possible.

","parent_name":"Int32"},"Extensions/Int16.html#/s:s5Int16V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Int16"},"Extensions/Int16.html#/s:s5Int16V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Int16"},"Extensions/Int16.html#/s:s5Int16V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int16 initialized from dbValue, if possible.

","parent_name":"Int16"},"Extensions/Int8.html#/s:s4Int8V4GRDBE15sqliteStatement5indexABs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Int8"},"Extensions/Int8.html#/s:s4Int8V4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Int8"},"Extensions/Int8.html#/s:s4Int8V4GRDBE17fromDatabaseValueyABSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int8 initialized from dbValue, if possible.

","parent_name":"Int8"},"Extensions/Int.html#/s:Si4GRDBE15sqliteStatement5indexSis13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Int"},"Extensions/Int.html#/s:Si4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Int"},"Extensions/Int.html#/s:Si4GRDBE17fromDatabaseValueySiSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an Int initialized from dbValue, if possible.

","parent_name":"Int"},"Extensions/Bool.html#/s:Sb4GRDBE15sqliteStatement5indexSbs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Bool"},"Extensions/Bool.html#/s:Sb4GRDBE13databaseValueAA08DatabaseC0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Bool"},"Extensions/Bool.html#/s:Sb4GRDBE17fromDatabaseValueySbSgAA0cD0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a Bool initialized from dbValue, if possible.

","parent_name":"Bool"},"Extensions/UUID.html#/s:4GRDB24DatabaseValueConvertibleP08databaseC0AA0bC0Vvp":{"name":"databaseValue","parent_name":"UUID"},"Extensions/UUID.html#/s:4GRDB24DatabaseValueConvertibleP04frombC0yxSgAA0bC0VFZ":{"name":"fromDatabaseValue(_:)","parent_name":"UUID"},"Extensions/UUID.html#/s:4GRDB26StatementColumnConvertibleP06sqliteB05indexxs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","parent_name":"UUID"},"Extensions/NSUUID.html#/s:4GRDB24DatabaseValueConvertibleP08databaseC0AA0bC0Vvp":{"name":"databaseValue","parent_name":"NSUUID"},"Extensions/NSUUID.html#/s:4GRDB24DatabaseValueConvertibleP04frombC0yxSgAA0bC0VFZ":{"name":"fromDatabaseValue(_:)","parent_name":"NSUUID"},"Extensions/NSURL.html#/s:So5NSURLC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.","parent_name":"NSURL"},"Extensions/NSURL.html#/s:So5NSURLC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an NSURL initialized from dbValue, if possible.

","parent_name":"NSURL"},"Extensions/NSString.html#/s:So8NSStringC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"NSString"},"Extensions/NSString.html#/s:So8NSStringC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an NSString initialized from dbValue, if possible.

","parent_name":"NSString"},"Extensions/NSNumber.html#/s:So8NSNumberC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"NSNumber"},"Extensions/NSNumber.html#/s:So8NSNumberC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an NSNumber initialized from dbValue, if possible.

","parent_name":"NSNumber"},"Extensions/NSNull.html#/s:So6NSNullC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns DatabaseValue.null.

","parent_name":"NSNull"},"Extensions/NSNull.html#/s:So6NSNullC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns nil.

","parent_name":"NSNull"},"Extensions/NSData.html#/s:So6NSDataC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"NSData"},"Extensions/NSData.html#/s:So6NSDataC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns an NSData initialized from dbValue, if it contains","parent_name":"NSData"},"Extensions/Date.html#/s:10Foundation4DateV4GRDBE13databaseValueAD08DatabaseE0Vvp":{"name":"databaseValue","abstract":"

Returns a database value that contains the date encoded as","parent_name":"Date"},"Extensions/Date.html#/s:10Foundation4DateV4GRDBE17fromDatabaseValueyACSgAD0eF0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a date initialized from dbValue, if possible.

","parent_name":"Date"},"Extensions/Date.html#/s:10Foundation4DateV4GRDBE9julianDayACSgSd_tcfc":{"name":"init(julianDay:)","abstract":"

Creates a date from a Julian Day.

","parent_name":"Date"},"Extensions/Date.html#/s:10Foundation4DateV4GRDBE15sqliteStatement5indexACs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","abstract":"

Returns a value initialized from a raw SQLite statement pointer.

","parent_name":"Date"},"Extensions/NSDate.html#/s:So6NSDateC4GRDBE13databaseValueAC08DatabaseD0Vvp":{"name":"databaseValue","abstract":"

Returns a database value that contains the date encoded as","parent_name":"NSDate"},"Extensions/NSDate.html#/s:So6NSDateC4GRDBE17fromDatabaseValueyABXDSgAC0dE0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a date initialized from dbValue, if possible.

","parent_name":"NSDate"},"Extensions/Data.html#/s:4GRDB26StatementColumnConvertibleP06sqliteB05indexxs13OpaquePointerV_s5Int32Vtcfc":{"name":"init(sqliteStatement:index:)","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV4GRDBE13databaseValueAD08DatabaseE0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"Data"},"Extensions/Data.html#/s:10Foundation4DataV4GRDBE17fromDatabaseValueyACSgAD0eF0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a Data initialized from dbValue, if it contains","parent_name":"Data"},"Extensions/CGFloat.html#/s:12CoreGraphics7CGFloatV4GRDBE13databaseValueAD08DatabaseF0Vvp":{"name":"databaseValue","abstract":"

Returns a value that can be stored in the database.

","parent_name":"CGFloat"},"Extensions/CGFloat.html#/s:12CoreGraphics7CGFloatV4GRDBE17fromDatabaseValueyACSgAD0fG0VFZ":{"name":"fromDatabaseValue(_:)","abstract":"

Returns a CGFloat initialized from dbValue, if possible.

","parent_name":"CGFloat"},"Extensions/Collection.html#/s:Sl4GRDBAA10SQLLiteralV7ElementRtzrlE6joined9separatorACSS_tF":{"name":"joined(separator:)","abstract":"

Returns the concatenated SQLLiteral of this collection of literals,","parent_name":"Collection"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE11fetchCursor_9arguments7adapterAA08NullablebcF0CyxGAA15SelectStatementC_AA0K9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

Returns a cursor over optional values fetched from a prepared statement.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE8fetchAll_9arguments7adapterSayxSgGAA15SelectStatementC_AA0J9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of optional values fetched from a prepared statement.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE11fetchCursor_3sql9arguments7adapterAA08NullablebcF0CyxGAA0B0C_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over optional values fetched from an SQL query.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE8fetchAll_3sql9arguments7adapterSayxSgGAA0B0C_SSAA18StatementArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of optional values fetched from an SQL query.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE11fetchCursoryAA08NullablebcF0CyxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over optional values fetched from a fetch request.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzlE8fetchAllySayxSgGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of optional values fetched from a fetch request.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE11fetchCursor_9arguments7adapterAA012FastNullablebcH0CyxGAA06SelectE0C_AA0E9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

Returns a cursor over optional values fetched from a prepared statement.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE8fetchAll_9arguments7adapterSayxSgGAA06SelectE0C_AA0E9ArgumentsVSgAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of optional values fetched from a prepared statement.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE11fetchCursor_3sql9arguments7adapterAA012FastNullablebcH0CyxGAA0B0C_SSAA0E9ArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over optional values fetched from an SQL query.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE8fetchAll_3sql9arguments7adapterSayxSgGAA0B0C_SSAA0E9ArgumentsVAA10RowAdapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of optional values fetched from an SQL query.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE11fetchCursoryAA012FastNullablebcH0CyxGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over optional values fetched from a fetch request.

","parent_name":"Optional"},"Extensions/Optional.html#/s:Sq4GRDBAA24DatabaseValueConvertibleRzAA015StatementColumnD0RzlE8fetchAllySayxSgGAA0B0C_qd__tKAA12FetchRequestRd__lFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of optional values fetched from a fetch request.

","parent_name":"Optional"},"Extensions/Database.html#/usePassphrase(_:)":{"name":"usePassphrase(_:)","abstract":"

Sets the passphrase used to crypt and decrypt an SQLCipher database.

","parent_name":"Database"},"Extensions/Database.html#/changePassphrase(_:)":{"name":"changePassphrase(_:)","abstract":"

Changes the passphrase used by an SQLCipher encrypted database.

","parent_name":"Database"},"Extensions/Database.html#/dropFTS5SynchronizationTriggers(forTable:)":{"name":"dropFTS5SynchronizationTriggers(forTable:)","abstract":"

Deletes the synchronization triggers for a synchronized FTS5 table

","parent_name":"Database"},"Extensions/Database.html#/add(tokenizer:)":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"Database"},"Extensions/Database.html#/makeFTS5Pattern(rawPattern:forTable:)":{"name":"makeFTS5Pattern(rawPattern:forTable:)","abstract":"

Creates a pattern from a raw pattern string; throws DatabaseError on","parent_name":"Database"},"Extensions/Database.html#/makeTokenizer(_:)":{"name":"makeTokenizer(_:)","abstract":"

Creates an FTS5 tokenizer, given its descriptor.

","parent_name":"Database"},"Extensions/Set.html#/s:Sh4GRDBEyShyxGqd__Kc7ElementQyd__RszAA6CursorRd__lufc":{"name":"init(_:)","abstract":"

Creates a set containing the elements of a cursor.

","parent_name":"Set"},"Extensions/Sequence.html#/s:ST4GRDBE7flatMapyAA13FlattenCursorCyAA0cE0CyAA03AnyE0Cy7ElementQzGqd__GGqd__AJKcAA0E0Rd__lF":{"name":"flatMap(_:)","abstract":"

Returns a cursor over the concatenated results of mapping transform","parent_name":"Sequence"},"Extensions/Sequence.html#/s:ST4GRDBAA10SQLLiteralV7ElementRtzrlE6joined9separatorACSS_tF":{"name":"joined(separator:)","abstract":"

Returns the concatenated SQLLiteral of this sequence of literals,","parent_name":"Sequence"},"Extensions/Sequence.html#/s:ST4GRDBAA14SQLExpressible7ElementRpzrlE8containsyAA13SQLExpression_pAA22SQLSpecificExpressible_pF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in","parent_name":"Sequence"},"Extensions/Sequence.html#/s:ST4GRDBAA14SQLExpressible7ElementRpzrlE8containsyAA13SQLExpression_pAA21SQLCollatedExpressionVF":{"name":"contains(_:)","abstract":"

An SQL expression that checks the inclusion of an expression in","parent_name":"Sequence"},"Extensions/Sequence.html#/s:ST4GRDBAA13SQLExpression_p7ElementRtzrlE6joined8operatorAaB_pAA24SQLLogicalBinaryOperatorO_tF":{"name":"joined(operator:)","abstract":"

Returns an expression by joining all elements with an SQL","parent_name":"Sequence"},"Extensions/Array.html#/s:Sa4GRDBEySayxGqd__Kc7ElementQyd__RszAA6CursorRd__lufc":{"name":"init(_:)","abstract":"

Creates an array containing the elements of a cursor.

","parent_name":"Array"},"Extensions/Array.html":{"name":"Array"},"Extensions/Sequence.html":{"name":"Sequence"},"Extensions/Set.html":{"name":"Set"},"Extensions/Database.html":{"name":"Database"},"Extensions/Optional.html":{"name":"Optional","abstract":"

Swift’s Optional comes with built-in methods that allow to fetch cursors"},"Extensions/Collection.html":{"name":"Collection"},"Extensions/CGFloat.html":{"name":"CGFloat","abstract":"

CGFloat adopts DatabaseValueConvertible

"},"Extensions/Data.html":{"name":"Data","abstract":"

Data is convertible to and from DatabaseValue.

"},"Extensions/NSDate.html":{"name":"NSDate","abstract":"

NSDate is stored in the database using the format"},"Extensions/Date.html":{"name":"Date","abstract":"

Date is stored in the database using the format"},"Extensions/NSData.html":{"name":"NSData","abstract":"

NSData is convertible to and from DatabaseValue.

"},"Extensions/NSNull.html":{"name":"NSNull","abstract":"

NSNull adopts DatabaseValueConvertible

"},"Extensions/NSNumber.html":{"name":"NSNumber","abstract":"

NSNumber adopts DatabaseValueConvertible

"},"Extensions/NSString.html":{"name":"NSString","abstract":"

NSString adopts DatabaseValueConvertible

"},"Extensions/NSURL.html":{"name":"NSURL","abstract":"

NSURL stores its absoluteString in the database.

"},"Extensions.html#/s:10Foundation3URLV":{"name":"URL","abstract":"

URL stores its absoluteString in the database.

"},"Extensions/NSUUID.html":{"name":"NSUUID","abstract":"

NSUUID adopts DatabaseValueConvertible

"},"Extensions/UUID.html":{"name":"UUID","abstract":"

UUID adopts DatabaseValueConvertible

"},"Extensions/Bool.html":{"name":"Bool","abstract":"

Bool adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Int.html":{"name":"Int","abstract":"

Int adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Int8.html":{"name":"Int8","abstract":"

Int8 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Int16.html":{"name":"Int16","abstract":"

Int16 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Int32.html":{"name":"Int32","abstract":"

Int32 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Int64.html":{"name":"Int64","abstract":"

Int64 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/UInt.html":{"name":"UInt","abstract":"

UInt adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/UInt8.html":{"name":"UInt8","abstract":"

UInt8 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/UInt16.html":{"name":"UInt16","abstract":"

UInt16 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/UInt32.html":{"name":"UInt32","abstract":"

UInt32 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/UInt64.html":{"name":"UInt64","abstract":"

UInt64 adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Double.html":{"name":"Double","abstract":"

Double adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Float.html":{"name":"Float","abstract":"

Float adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/String.html":{"name":"String","abstract":"

String adopts DatabaseValueConvertible and StatementColumnConvertible.

"},"Extensions/Column.html":{"name":"Column"},"Extensions/DatabaseQueue.html":{"name":"DatabaseQueue"},"Extensions/TableRequest.html":{"name":"TableRequest"},"Extensions/TableRecord.html":{"name":"TableRecord"},"Extensions/Range.html":{"name":"Range"},"Extensions/ClosedRange.html":{"name":"ClosedRange"},"Extensions/CountableRange.html":{"name":"CountableRange"},"Extensions/CountableClosedRange.html":{"name":"CountableClosedRange"},"Enums/ValueReducers/Combine8.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine8"},"Enums/ValueReducers/Combine8.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine8"},"Enums/ValueReducers/Combine8.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine8"},"Enums/ValueReducers/Combine8.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine8"},"Enums/ValueReducers/Combine7.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine7"},"Enums/ValueReducers/Combine7.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine7"},"Enums/ValueReducers/Combine7.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine7"},"Enums/ValueReducers/Combine7.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine7"},"Enums/ValueReducers/Combine6.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine6"},"Enums/ValueReducers/Combine6.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine6"},"Enums/ValueReducers/Combine6.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine6"},"Enums/ValueReducers/Combine6.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine6"},"Enums/ValueReducers/Combine5.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine5"},"Enums/ValueReducers/Combine5.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine5"},"Enums/ValueReducers/Combine5.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine5"},"Enums/ValueReducers/Combine5.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine5"},"Enums/ValueReducers/Combine4.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine4"},"Enums/ValueReducers/Combine4.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine4"},"Enums/ValueReducers/Combine4.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine4"},"Enums/ValueReducers/Combine4.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine4"},"Enums/ValueReducers/Combine3.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine3"},"Enums/ValueReducers/Combine3.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine3"},"Enums/ValueReducers/Combine3.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine3"},"Enums/ValueReducers/Combine3.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine3"},"Enums/ValueReducers/Combine2.html#/s:4GRDB12ValueReducerP7FetchedQa":{"name":"Fetched","parent_name":"Combine2"},"Enums/ValueReducers/Combine2.html#/s:4GRDB12ValueReducerP0B0Qa":{"name":"Value","parent_name":"Combine2"},"Enums/ValueReducers/Combine2.html#/s:4GRDB12ValueReducerP5fetchy7FetchedQzAA8DatabaseCKF":{"name":"fetch(_:)","parent_name":"Combine2"},"Enums/ValueReducers/Combine2.html#/s:4GRDB12ValueReducerP5valuey0B0QzSg7FetchedQzF":{"name":"value(_:)","parent_name":"Combine2"},"Enums/ValueReducers/Combine2.html":{"name":"Combine2","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine3.html":{"name":"Combine3","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine4.html":{"name":"Combine4","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine5.html":{"name":"Combine5","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine6.html":{"name":"Combine6","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine7.html":{"name":"Combine7","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueReducers/Combine8.html":{"name":"Combine8","abstract":"

Undocumented

","parent_name":"ValueReducers"},"Enums/ValueScheduling.html#/s:4GRDB15ValueSchedulingO9mainQueueyA2CmF":{"name":"mainQueue","abstract":"

All values are notified on the main queue.

","parent_name":"ValueScheduling"},"Enums/ValueScheduling.html#/s:4GRDB15ValueSchedulingO5asyncyACSo17OS_dispatch_queueC_SbtcACmF":{"name":"async(onQueue:startImmediately:)","abstract":"

All values are asychronously notified on the specified queue.

","parent_name":"ValueScheduling"},"Enums/ValueScheduling.html#/s:4GRDB15ValueSchedulingO6unsafeyACSb_tcACmF":{"name":"unsafe(startImmediately:)","abstract":"

Values are not all notified on the same dispatch queue.

","parent_name":"ValueScheduling"},"Enums/PersistenceError.html#/s:4GRDB16PersistenceErrorO14recordNotFoundyACSS_SDySSAA13DatabaseValueVGtcACmF":{"name":"recordNotFound(databaseTableName:key:)","abstract":"

Thrown by MutablePersistableRecord.update() when no matching row could be","parent_name":"PersistenceError"},"Enums/FetchedRecordChange.html#/s:4GRDB19FetchedRecordChangeO9insertionyAC10Foundation9IndexPathV_tcACmF":{"name":"insertion(indexPath:)","abstract":"

An insertion event, at given indexPath.

","parent_name":"FetchedRecordChange"},"Enums/FetchedRecordChange.html#/s:4GRDB19FetchedRecordChangeO8deletionyAC10Foundation9IndexPathV_tcACmF":{"name":"deletion(indexPath:)","abstract":"

A deletion event, at given indexPath.

","parent_name":"FetchedRecordChange"},"Enums/FetchedRecordChange.html#/s:4GRDB19FetchedRecordChangeO4moveyAC10Foundation9IndexPathV_AGSDySSAA13DatabaseValueVGtcACmF":{"name":"move(indexPath:newIndexPath:changes:)","abstract":"

A move event, from indexPath to newIndexPath. The changes are a","parent_name":"FetchedRecordChange"},"Enums/FetchedRecordChange.html#/s:4GRDB19FetchedRecordChangeO6updateyAC10Foundation9IndexPathV_SDySSAA13DatabaseValueVGtcACmF":{"name":"update(indexPath:changes:)","abstract":"

An update event, at given indexPath. The changes are a dictionary","parent_name":"FetchedRecordChange"},"Enums/FetchedRecordChange.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"FetchedRecordChange"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO010deferredToC0yA2CmF":{"name":"deferredToDate","abstract":"

The strategy that uses formatting from the Date structure.

","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO026timeIntervalSinceReferenceC0yA2CmF":{"name":"timeIntervalSinceReferenceDate","abstract":"

Decodes numeric values as a number of seconds between the date and","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO21timeIntervalSince1970yA2CmF":{"name":"timeIntervalSince1970","abstract":"

Decodes numeric values as a number of seconds between the date and","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO21millisecondsSince1970yA2CmF":{"name":"millisecondsSince1970","abstract":"

Decodes numeric values as a number of milliseconds between the date and","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO7iso8601yA2CmF":{"name":"iso8601","abstract":"

Decodes dates according to the ISO 8601 standards

","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO9formattedyACSo15NSDateFormatterCcACmF":{"name":"formatted(_:)","abstract":"

Decodes a String, according to the provided formatter

","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseDateDecodingStrategy.html#/s:4GRDB28DatabaseDateDecodingStrategyO6customyAC10Foundation0C0VSgAA0B5ValueVccACmF":{"name":"custom(_:)","abstract":"

Decodes according to the user-provided function.

","parent_name":"DatabaseDateDecodingStrategy"},"Enums/DatabaseUUIDEncodingStrategy.html#/s:4GRDB28DatabaseUUIDEncodingStrategyO14deferredToUUIDyA2CmF":{"name":"deferredToUUID","abstract":"

The strategy that uses formatting from the UUID type.

","parent_name":"DatabaseUUIDEncodingStrategy"},"Enums/DatabaseUUIDEncodingStrategy.html#/s:4GRDB28DatabaseUUIDEncodingStrategyO6stringyA2CmF":{"name":"string","abstract":"

Encodes UUIDs as strings such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”

","parent_name":"DatabaseUUIDEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO010deferredToC0yA2CmF":{"name":"deferredToDate","abstract":"

The strategy that uses formatting from the Date structure.

","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO026timeIntervalSinceReferenceC0yA2CmF":{"name":"timeIntervalSinceReferenceDate","abstract":"

Encodes a Double: the number of seconds between the date and","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO21timeIntervalSince1970yA2CmF":{"name":"timeIntervalSince1970","abstract":"

Encodes a Double: the number of seconds between the date and","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO16secondsSince1970yA2CmF":{"name":"secondsSince1970","abstract":"

Encodes an Int64: the number of seconds between the date and","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO21millisecondsSince1970yA2CmF":{"name":"millisecondsSince1970","abstract":"

Encodes an Int64: the number of milliseconds between the date and","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO7iso8601yA2CmF":{"name":"iso8601","abstract":"

Encodes dates according to the ISO 8601 and RFC 3339 standards

","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO9formattedyACSo15NSDateFormatterCcACmF":{"name":"formatted(_:)","abstract":"

Encodes a String, according to the provided formatter

","parent_name":"DatabaseDateEncodingStrategy"},"Enums/DatabaseDateEncodingStrategy.html#/s:4GRDB28DatabaseDateEncodingStrategyO6customyAcA0B16ValueConvertible_pSg10Foundation0C0VccACmF":{"name":"custom(_:)","abstract":"

Encodes the result of the user-provided function

","parent_name":"DatabaseDateEncodingStrategy"},"Enums/SQLLogicalBinaryOperator.html#/s:4GRDB24SQLLogicalBinaryOperatorO3andyA2CmF":{"name":"and","abstract":"

Undocumented

","parent_name":"SQLLogicalBinaryOperator"},"Enums/SQLLogicalBinaryOperator.html#/s:4GRDB24SQLLogicalBinaryOperatorO2oryA2CmF":{"name":"or","abstract":"

Undocumented

","parent_name":"SQLLogicalBinaryOperator"},"Enums/DatabaseEventKind.html#/s:4GRDB17DatabaseEventKindO6insertyACSS_tcACmF":{"name":"insert(tableName:)","abstract":"

The insertion of a row in a database table

","parent_name":"DatabaseEventKind"},"Enums/DatabaseEventKind.html#/s:4GRDB17DatabaseEventKindO6deleteyACSS_tcACmF":{"name":"delete(tableName:)","abstract":"

The deletion of a row in a database table

","parent_name":"DatabaseEventKind"},"Enums/DatabaseEventKind.html#/s:4GRDB17DatabaseEventKindO6updateyACSS_ShySSGtcACmF":{"name":"update(tableName:columnNames:)","abstract":"

The update of a set of columns in a database table

","parent_name":"DatabaseEventKind"},"Enums/DatabaseEventKind.html#/s:4GRDB17DatabaseEventKindO9tableNameSSvp":{"name":"tableName","abstract":"

The impacted database table

","parent_name":"DatabaseEventKind"},"Enums/DatabaseEventKind.html":{"name":"DatabaseEventKind","abstract":"

A kind of database event. See the TransactionObserver protocol for"},"Enums/SQLLogicalBinaryOperator.html":{"name":"SQLLogicalBinaryOperator","abstract":"

Undocumented

"},"Enums/DatabaseDateEncodingStrategy.html":{"name":"DatabaseDateEncodingStrategy","abstract":"

DatabaseDateEncodingStrategy specifies how EncodableRecord types that also"},"Enums/DatabaseUUIDEncodingStrategy.html":{"name":"DatabaseUUIDEncodingStrategy","abstract":"

DatabaseUUIDEncodingStrategy specifies how EncodableRecord types that also"},"Enums/DatabaseDateDecodingStrategy.html":{"name":"DatabaseDateDecodingStrategy","abstract":"

DatabaseDateDecodingStrategy specifies how FetchableRecord types that also"},"Enums/FetchedRecordChange.html":{"name":"FetchedRecordChange","abstract":"

A record change, given by a FetchedRecordsController to its change callback.

"},"Enums/PersistenceError.html":{"name":"PersistenceError","abstract":"

An error thrown by a type that adopts PersistableRecord.

"},"Enums/ValueScheduling.html":{"name":"ValueScheduling","abstract":"

ValueScheduling controls how ValueObservation schedules the notifications"},"Enums/ValueReducers.html":{"name":"ValueReducers","abstract":"

A namespace for types related to the ValueReducer protocol.

"},"Classes/FTS5ColumnDefinition.html#/s:4GRDB20FTS5ColumnDefinitionC10notIndexedACXDyF":{"name":"notIndexed()","abstract":"

Excludes the column from the full-text index.

","parent_name":"FTS5ColumnDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC9tokenizerAA0B19TokenizerDescriptorVSgvp":{"name":"tokenizer","abstract":"

The virtual table tokenizer

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC7contentSSSgvp":{"name":"content","abstract":"

The FTS5 content option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC12contentRowIDSSSgvp":{"name":"contentRowID","abstract":"

The FTS5 content_rowid option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC8prefixesShySiGSgvp":{"name":"prefixes","abstract":"

Support for the FTS5 prefix option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC10columnSizeSiSgvp":{"name":"columnSize","abstract":"

Support for the FTS5 columnsize option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC6detailSSSgvp":{"name":"detail","abstract":"

Support for the FTS5 detail option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC6columnyAA0b6ColumnD0CSSF":{"name":"column(_:)","abstract":"

Appends a table column.

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/s:4GRDB19FTS5TableDefinitionC11synchronize04withC0ySS_tF":{"name":"synchronize(withTable:)","abstract":"

Synchronizes the full-text table with the content of an external","parent_name":"FTS5TableDefinition"},"Classes/Record.html#/s:4GRDB6RecordCACycfc":{"name":"init()","abstract":"

Creates a Record.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC3rowAcA3RowC_tcfc":{"name":"init(row:)","abstract":"

Creates a Record from a row.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC17databaseTableNameSSvpZ":{"name":"databaseTableName","abstract":"

The name of a database table.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC25persistenceConflictPolicyAA011PersistencedE0VvpZ":{"name":"persistenceConflictPolicy","abstract":"

The policy that handles SQLite conflicts when records are inserted","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC17databaseSelectionSayAA13SQLSelectable_pGvpZ":{"name":"databaseSelection","abstract":"

The default request selection.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC6encode2toyAA20PersistenceContainerVz_tF":{"name":"encode(to:)","abstract":"

Defines the values persisted in the database.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC9didInsert4with3forys5Int64V_SSSgtF":{"name":"didInsert(with:for:)","abstract":"

Notifies the record that it was succesfully inserted.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC4copyACXDyF":{"name":"copy()","abstract":"

Returns a copy of self, initialized from all values encoded in the","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC18hasDatabaseChangesSbvp":{"name":"hasDatabaseChanges","abstract":"

A boolean that indicates whether the record has changes that have not","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC15databaseChangesSDySSAA13DatabaseValueVSgGvp":{"name":"databaseChanges","abstract":"

A dictionary of changes that have not been saved.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC6insertyyAA8DatabaseCKF":{"name":"insert(_:)","abstract":"

Executes an INSERT statement.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC6update_7columnsyAA8DatabaseC_ShySSGtKF":{"name":"update(_:columns:)","abstract":"

Executes an UPDATE statement.

","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC13updateChangesySbAA8DatabaseCKF":{"name":"updateChanges(_:)","abstract":"

If the record has been changed, executes an UPDATE statement so that","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC4saveyyAA8DatabaseCKF":{"name":"save(_:)","abstract":"

Executes an INSERT or an UPDATE statement so that self is saved in","parent_name":"Record"},"Classes/Record.html#/s:4GRDB6RecordC6deleteySbAA8DatabaseCKF":{"name":"delete(_:)","abstract":"

Executes a DELETE statement.

","parent_name":"Record"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC_3sql9arguments7adapter5queue12isSameRecordACyxGAA14DatabaseWriter_p_SSAA18StatementArgumentsVAA10RowAdapter_pSgSo012OS_dispatch_H0CSbx_xtcSgtKcfc":{"name":"init(_:sql:arguments:adapter:queue:isSameRecord:)","abstract":"

Creates a fetched records controller initialized from a SQL query and","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC_7request5queue12isSameRecordACyxGAA14DatabaseWriter_p_qd__So012OS_dispatch_F0CSbx_xtcSgtKc10RowDecoderQyd__RszAA12FetchRequestRd__lufc":{"name":"init(_:request:queue:isSameRecord:)","abstract":"

Creates a fetched records controller initialized from a fetch request","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC12performFetchyyKF":{"name":"performFetch()","abstract":"

Executes the controller’s fetch request.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC14databaseWriterAA08DatabaseF0_pvp":{"name":"databaseWriter","abstract":"

The database writer used to fetch records.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC5queueSo012OS_dispatch_E0Cvp":{"name":"queue","abstract":"

The dispatch queue on which the controller must be used.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC10setRequestyyqd__K10RowDecoderQyd__RszAA05FetchF0Rd__lF":{"name":"setRequest(_:)","abstract":"

Updates the fetch request, and eventually notifies the tracking","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC10setRequest3sql9arguments7adapterySS_AA18StatementArgumentsVAA10RowAdapter_pSgtKF":{"name":"setRequest(sql:arguments:adapter:)","abstract":"

Updates the fetch request, and eventually notifies the tracking","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC12trackChanges10willChange02onH003didH0yyACyxGcSg_yAH_xAA0b6RecordH0OtcSgAItF":{"name":"trackChanges(willChange:onChange:didChange:)","abstract":"

Registers changes notification callbacks.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC12trackChanges14fetchAlongside10willChange02onJ003didJ0yqd__AA8DatabaseCKc_yACyxG_qd__tcSgyAK_xAA0b6RecordJ0OtcSgALtlF":{"name":"trackChanges(fetchAlongside:willChange:onChange:didChange:)","abstract":"

Registers changes notification callbacks.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC11trackErrorsyyyACyxG_s5Error_ptcF":{"name":"trackErrors(_:)","abstract":"

Registers an error callback.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC30allowBackgroundChangesTracking2inySo13UIApplicationC_tF":{"name":"allowBackgroundChangesTracking(in:)","abstract":"

Call this method when changes performed while the application is","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC07fetchedC0SayxGvp":{"name":"fetchedRecords","abstract":"

The fetched records.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/allowBackgroundChangesTracking(in:)":{"name":"allowBackgroundChangesTracking(in:)","abstract":"

Call this method when changes performed while the application is","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC6record2atx10Foundation9IndexPathV_tF":{"name":"record(at:)","abstract":"

Returns the object at the given index path.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerC8sectionsSayAA0bC11SectionInfoVyxGGvp":{"name":"sections","abstract":"

The sections for the fetched records.

","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerCA2A11TableRecordRzrlE_3sql9arguments7adapter5queueACyxGAA14DatabaseWriter_p_SSAA18StatementArgumentsVAA10RowAdapter_pSgSo012OS_dispatch_J0CtKcfc":{"name":"init(_:sql:arguments:adapter:queue:)","abstract":"

Creates a fetched records controller initialized from a SQL query and","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerCA2A11TableRecordRzrlE_7request5queueACyxGAA14DatabaseWriter_p_qd__So012OS_dispatch_H0CtKc10RowDecoderQyd__RszAA12FetchRequestRd__lufc":{"name":"init(_:request:queue:)","abstract":"

Creates a fetched records controller initialized from a fetch request","parent_name":"FetchedRecordsController"},"Classes/FetchedRecordsController.html#/s:4GRDB24FetchedRecordsControllerCA2A15EncodableRecordRzrlE9indexPath3for10Foundation05IndexH0VSgx_tF":{"name":"indexPath(for:)","abstract":"

Returns the indexPath of a given record.

","parent_name":"FetchedRecordsController"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC10primaryKey10onConflict13autoincrementACXDAA8DatabaseC0G10ResolutionOSg_SbtF":{"name":"primaryKey(onConflict:autoincrement:)","abstract":"

Adds a primary key constraint on the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC7notNull10onConflictACXDAA8DatabaseC0G10ResolutionOSg_tF":{"name":"notNull(onConflict:)","abstract":"

Adds a NOT NULL constraint on the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC6unique10onConflictACXDAA8DatabaseC0F10ResolutionOSg_tF":{"name":"unique(onConflict:)","abstract":"

Adds a UNIQUE constraint on the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC7indexedACXDyF":{"name":"indexed()","abstract":"

Adds an index of the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC5checkyACXDAA14SQLExpressible_pAA0B0VXEF":{"name":"check(_:)","abstract":"

Adds a CHECK constraint on the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC5check3sqlACXDSS_tF":{"name":"check(sql:)","abstract":"

Adds a CHECK constraint on the column.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC8defaults2toACXDAA24DatabaseValueConvertible_p_tF":{"name":"defaults(to:)","abstract":"

Defines the default column value.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC8defaults3sqlACXDSS_tF":{"name":"defaults(sql:)","abstract":"

Defines the default column value.

","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC7collateyACXDAA8DatabaseC13CollationNameVF":{"name":"collate(_:)","abstract":"
try db.create(table: \"player\") { t in","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC7collateyACXDAA17DatabaseCollationCF":{"name":"collate(_:)","abstract":"
try db.create(table: \"player\") { t in","parent_name":"ColumnDefinition"},"Classes/ColumnDefinition.html#/s:4GRDB16ColumnDefinitionC10references_6column8onDelete0F6Update8deferredACXDSS_SSSgAA8DatabaseC16ForeignKeyActionOSgANSbtF":{"name":"references(_:column:onDelete:onUpdate:deferred:)","abstract":"

Defines a foreign key.

","parent_name":"ColumnDefinition"},"Classes/TableAlteration.html#/s:4GRDB15TableAlterationC3add6column_AA16ColumnDefinitionCSS_AA8DatabaseC0F4TypeVSgtF":{"name":"add(column:_:)","abstract":"

Appends a column to the table.

","parent_name":"TableAlteration"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC25autoIncrementedPrimaryKey_10onConflictAA06ColumnC0CSS_AA8DatabaseC0I10ResolutionOSgtF":{"name":"autoIncrementedPrimaryKey(_:onConflict:)","abstract":"

Defines the auto-incremented primary key.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC6columnyAA06ColumnC0CSS_AA8DatabaseC0E4TypeVSgtF":{"name":"column(_:_:)","abstract":"

Appends a table column.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC10primaryKey_10onConflictySaySSG_AA8DatabaseC0G10ResolutionOSgtF":{"name":"primaryKey(_:onConflict:)","abstract":"

Defines the table primary key.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC9uniqueKey_10onConflictySaySSG_AA8DatabaseC0G10ResolutionOSgtF":{"name":"uniqueKey(_:onConflict:)","abstract":"

Adds a unique key.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC10foreignKey_10references7columns8onDelete0H6Update8deferredySaySSG_SSAJSgAA8DatabaseC07ForeignE6ActionOSgAPSbtF":{"name":"foreignKey(_:references:columns:onDelete:onUpdate:deferred:)","abstract":"

Adds a foreign key.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC5checkyyAA14SQLExpressible_pF":{"name":"check(_:)","abstract":"

Adds a CHECK constraint.

","parent_name":"TableDefinition"},"Classes/TableDefinition.html#/s:4GRDB15TableDefinitionC5check3sqlySS_tF":{"name":"check(sql:)","abstract":"

Adds a CHECK constraint.

","parent_name":"TableDefinition"},"Classes/TableAlias.html#/s:4GRDB10TableAliasC4nameACSSSg_tcfc":{"name":"init(name:)","abstract":"

Undocumented

","parent_name":"TableAlias"},"Classes/TableAlias.html#/s:4GRDB10TableAliasCyAA13SQLSelectable_pAaD_pcip":{"name":"subscript(_:)","abstract":"

Returns a qualified value that is able to resolve ambiguities in","parent_name":"TableAlias"},"Classes/TableAlias.html#/s:4GRDB10TableAliasCyAA13SQLExpression_pAaD_pcip":{"name":"subscript(_:)","abstract":"

Returns a qualified expression that is able to resolve ambiguities in","parent_name":"TableAlias"},"Classes/FTS5ColumnDefinition.html#/notIndexed()":{"name":"notIndexed()","abstract":"

Excludes the column from the full-text index.

","parent_name":"FTS5ColumnDefinition"},"Classes/FTS5TableDefinition.html#/tokenizer":{"name":"tokenizer","abstract":"

The virtual table tokenizer

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/content":{"name":"content","abstract":"

The FTS5 content option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/contentRowID":{"name":"contentRowID","abstract":"

The FTS5 content_rowid option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/prefixes":{"name":"prefixes","abstract":"

Support for the FTS5 prefix option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/columnSize":{"name":"columnSize","abstract":"

Support for the FTS5 columnsize option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/detail":{"name":"detail","abstract":"

Support for the FTS5 detail option

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/column(_:)":{"name":"column(_:)","abstract":"

Appends a table column.

","parent_name":"FTS5TableDefinition"},"Classes/FTS5TableDefinition.html#/synchronize(withTable:)":{"name":"synchronize(withTable:)","abstract":"

Synchronizes the full-text table with the content of an external","parent_name":"FTS5TableDefinition"},"Classes/FTS4ColumnDefinition.html#/s:4GRDB20FTS4ColumnDefinitionC10notIndexedACXDyF":{"name":"notIndexed()","abstract":"

Excludes the column from the full-text index.

","parent_name":"FTS4ColumnDefinition"},"Classes/FTS4ColumnDefinition.html#/s:4GRDB20FTS4ColumnDefinitionC12asLanguageIdACXDyF":{"name":"asLanguageId()","abstract":"

Uses the column as the Int32 language id hidden column.

","parent_name":"FTS4ColumnDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC9tokenizerAA23FTS3TokenizerDescriptorVSgvp":{"name":"tokenizer","abstract":"

The virtual table tokenizer

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC7contentSSSgvp":{"name":"content","abstract":"

The FTS4 content option

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC8compressSSSgvp":{"name":"compress","abstract":"

The FTS4 compress option

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC10uncompressSSSgvp":{"name":"uncompress","abstract":"

The FTS4 uncompress option

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC9matchinfoSSSgvp":{"name":"matchinfo","abstract":"

The FTS4 matchinfo option

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC8prefixesShySiGSgvp":{"name":"prefixes","abstract":"

Support for the FTS5 prefix option

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC6columnyAA0b6ColumnD0CSSF":{"name":"column(_:)","abstract":"

Appends a table column.

","parent_name":"FTS4TableDefinition"},"Classes/FTS4TableDefinition.html#/s:4GRDB19FTS4TableDefinitionC11synchronize04withC0ySS_tF":{"name":"synchronize(withTable:)","abstract":"

Synchronizes the full-text table with the content of an external","parent_name":"FTS4TableDefinition"},"Classes/FTS3TableDefinition.html#/s:4GRDB19FTS3TableDefinitionC9tokenizerAA0B19TokenizerDescriptorVSgvp":{"name":"tokenizer","abstract":"

The virtual table tokenizer

","parent_name":"FTS3TableDefinition"},"Classes/FTS3TableDefinition.html#/s:4GRDB19FTS3TableDefinitionC6columnyySSF":{"name":"column(_:)","abstract":"

Appends a table column.

","parent_name":"FTS3TableDefinition"},"Classes/UpdateStatement.html#/s:4GRDB15UpdateStatementC7execute9argumentsyAA0C9ArgumentsVSg_tKF":{"name":"execute(arguments:)","abstract":"

Executes the SQL query.

","parent_name":"UpdateStatement"},"Classes/Statement.html#/s:4GRDB9StatementC06sqliteB0s13OpaquePointerVvp":{"name":"sqliteStatement","abstract":"

The raw SQLite statement, suitable for the SQLite C API.

","parent_name":"Statement"},"Classes/Statement.html#/s:4GRDB9StatementC3sqlSSvp":{"name":"sql","abstract":"

The SQL query

","parent_name":"Statement"},"Classes/Statement.html#/s:4GRDB9StatementC9argumentsAA0B9ArgumentsVvp":{"name":"arguments","abstract":"

The statement arguments.

","parent_name":"Statement"},"Classes/Statement.html#/s:4GRDB9StatementC8validate9argumentsyAA0B9ArgumentsV_tKF":{"name":"validate(arguments:)","abstract":"

Throws a DatabaseError of code SQLITE_ERROR if arguments don’t fill all","parent_name":"Statement"},"Classes/Statement.html#/s:4GRDB9StatementC18unsafeSetArgumentsyyAA0bE0VF":{"name":"unsafeSetArguments(_:)","abstract":"

Set arguments without any validation. Trades safety for performance.

","parent_name":"Statement"},"Classes/SelectStatement.html#/s:4GRDB15SelectStatementC14databaseRegionAA08DatabaseE0Vvp":{"name":"databaseRegion","abstract":"

The database region that the statement looks into.

","parent_name":"SelectStatement"},"Classes/SelectStatement.html#/s:4GRDB15SelectStatementC11columnCountSivp":{"name":"columnCount","abstract":"

The number of columns in the resulting rows.

","parent_name":"SelectStatement"},"Classes/SelectStatement.html#/s:4GRDB15SelectStatementC11columnNamesSaySSGvp":{"name":"columnNames","abstract":"

The column names, ordered from left to right.

","parent_name":"SelectStatement"},"Classes/SelectStatement.html#/s:4GRDB15SelectStatementC5index8ofColumnSiSgSS_tF":{"name":"index(ofColumn:)","abstract":"

Returns the index of the leftmost column named name, in a","parent_name":"SelectStatement"},"Classes/RowCursor.html#/s:4GRDB9RowCursorC9statementAA15SelectStatementCvp":{"name":"statement","abstract":"

Undocumented

","parent_name":"RowCursor"},"Classes/Row/PrefetchedRowsView.html#/s:4GRDB3RowC18PrefetchedRowsViewV7isEmptySbvp":{"name":"isEmpty","abstract":"

True if there is no prefetched associated rows.

","parent_name":"PrefetchedRowsView"},"Classes/Row/PrefetchedRowsView.html#/s:4GRDB3RowC18PrefetchedRowsViewV4keysShySSGvp":{"name":"keys","abstract":"

The keys for available prefetched rows

","parent_name":"PrefetchedRowsView"},"Classes/Row/PrefetchedRowsView.html#/s:4GRDB3RowC18PrefetchedRowsViewVySayACGSgSScip":{"name":"subscript(_:)","abstract":"

Returns the prefetched rows associated with the given key.

","parent_name":"PrefetchedRowsView"},"Classes/Row/ScopesTreeView.html#/s:4GRDB3RowC14ScopesTreeViewV5namesShySSGvp":{"name":"names","abstract":"

The scopes defined on this row, recursively.

","parent_name":"ScopesTreeView"},"Classes/Row/ScopesTreeView.html#/s:4GRDB3RowC14ScopesTreeViewVyACSgSScip":{"name":"subscript(_:)","abstract":"

Returns the row associated with the given scope.

","parent_name":"ScopesTreeView"},"Classes/Row/ScopesView.html#/s:Sl5IndexQa":{"name":"Index","parent_name":"ScopesView"},"Classes/Row/ScopesView.html#/s:4GRDB3RowC10ScopesViewV5namesSD4KeysVySSAA08LayoutedB7Adapter_p_Gvp":{"name":"names","abstract":"

The scopes defined on this row.

","parent_name":"ScopesView"},"Classes/Row/ScopesView.html#/s:4GRDB3RowC10ScopesViewVyACSgSScip":{"name":"subscript(_:)","abstract":"

Returns the row associated with the given scope, or nil if the","parent_name":"ScopesView"},"Classes/Row.html#/s:4GRDB3RowC5countSivp":{"name":"count","abstract":"

The number of columns in the row.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC14prefetchedRowsAC010PrefetchedD4ViewVvp":{"name":"prefetchedRows","abstract":"

A view on the prefetched associated rows.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCACycfc":{"name":"init()","abstract":"

Creates an empty row.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyACSDySSAA24DatabaseValueConvertible_pSgGcfc":{"name":"init(_:)","abstract":"

Creates a row from a dictionary of values.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyACSgSDys11AnyHashableVypGcfc":{"name":"init(_:)","abstract":"

Creates a row from [AnyHashable: Any].

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC4copyACyF":{"name":"copy()","abstract":"

Returns an immutable copy of the row.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC11columnNamess15LazyMapSequenceVyACSSGvp":{"name":"columnNames","abstract":"

The names of columns in the row.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC9hasColumnySbSSF":{"name":"hasColumn(_:)","abstract":"

Returns true if and only if the row has that column.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC20containsNonNullValueSbvp":{"name":"containsNonNullValue","abstract":"

Returns true if and only if one column contains a non-null value, or if","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC7hasNull7atIndexSbSi_tF":{"name":"hasNull(atIndex:)","abstract":"

Returns true if the row contains null at given index.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyAA24DatabaseValueConvertible_pSgSicip":{"name":"subscript(_:)","abstract":"

Returns Int64, Double, String, Data or nil, depending on the value","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgSicAA24DatabaseValueConvertibleRzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given index, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgSicAA24DatabaseValueConvertibleRzAA015StatementColumnE0Rzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given index, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSicAA24DatabaseValueConvertibleRzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given index, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSicAA24DatabaseValueConvertibleRzAA015StatementColumnE0Rzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given index, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyAA24DatabaseValueConvertible_pSgSScip":{"name":"subscript(_:)","abstract":"

Returns Int64, Double, String, Data or nil, depending on the value","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgSScAA24DatabaseValueConvertibleRzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgSScAA24DatabaseValueConvertibleRzAA015StatementColumnE0Rzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSScAA24DatabaseValueConvertibleRzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSScAA24DatabaseValueConvertibleRzAA015StatementColumnE0Rzluip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyAA24DatabaseValueConvertible_pSgxcAA16ColumnExpressionRzluip":{"name":"subscript(_:)","abstract":"

Returns Int64, Double, String, NSData or nil, depending on the value","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgq_cAA24DatabaseValueConvertibleRzAA16ColumnExpressionR_r0_luip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgq_cAA24DatabaseValueConvertibleRzAA015StatementColumnE0RzAA0G10ExpressionR_r0_luip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxq_cAA24DatabaseValueConvertibleRzAA16ColumnExpressionR_r0_luip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxq_cAA24DatabaseValueConvertibleRzAA015StatementColumnE0RzAA0G10ExpressionR_r0_luip":{"name":"subscript(_:)","abstract":"

Returns the value at given column, converted to the requested type.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC10dataNoCopy7atIndex10Foundation4DataVSgSi_tF":{"name":"dataNoCopy(atIndex:)","abstract":"

Returns the optional Data at given index.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC10dataNoCopy5named10Foundation4DataVSgSS_tF":{"name":"dataNoCopy(named:)","abstract":"

Returns the optional Data at given column.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC10dataNoCopyy10Foundation4DataVSgxAA16ColumnExpressionRzlF":{"name":"dataNoCopy(_:)","abstract":"

Returns the optional NSData at given column.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC14databaseValuess15LazyMapSequenceVyAcA13DatabaseValueVGvp":{"name":"databaseValues","abstract":"

The database values in the row.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSScAA15FetchableRecordRzluip":{"name":"subscript(_:)","abstract":"

Returns the record associated with the given scope.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSgSScAA15FetchableRecordRzluip":{"name":"subscript(_:)","abstract":"

Returns the eventual record associated with the given scope.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyxSScSmRzAA15FetchableRecord7ElementRpzluip":{"name":"subscript(_:)","abstract":"

Returns the records encoded in the given prefetched rows.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCyShyxGSScAA15FetchableRecordRzSHRzluip":{"name":"subscript(_:)","abstract":"

Returns the set of records encoded in the given prefetched rows.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC6scopesAC10ScopesViewVvp":{"name":"scopes","abstract":"

Returns a view on the scopes defined by row adapters.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC10scopesTreeAC06ScopesD4ViewVvp":{"name":"scopesTree","abstract":"

Returns a view on the scopes tree defined by row adapters.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8unscopedACvp":{"name":"unscoped","abstract":"

Returns a copy of the row, without any scopes.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC9unadaptedACvp":{"name":"unadapted","abstract":"

Return the raw row fetched from the database.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC11fetchCursor_9arguments7adapterAA0bD0CAA15SelectStatementC_AA0H9ArgumentsVSgAA0B7Adapter_pSgtKFZ":{"name":"fetchCursor(_:arguments:adapter:)","abstract":"

Returns a cursor over rows fetched from a prepared statement.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchAll_9arguments7adapterSayACGAA15SelectStatementC_AA0H9ArgumentsVSgAA0B7Adapter_pSgtKFZ":{"name":"fetchAll(_:arguments:adapter:)","abstract":"

Returns an array of rows fetched from a prepared statement.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchOne_9arguments7adapterACSgAA15SelectStatementC_AA0H9ArgumentsVSgAA0B7Adapter_pSgtKFZ":{"name":"fetchOne(_:arguments:adapter:)","abstract":"

Returns a single row fetched from a prepared statement.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC11fetchCursor_3sql9arguments7adapterAA0bD0CAA8DatabaseC_SSAA18StatementArgumentsVAA0B7Adapter_pSgtKFZ":{"name":"fetchCursor(_:sql:arguments:adapter:)","abstract":"

Returns a cursor over rows fetched from an SQL query.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchAll_3sql9arguments7adapterSayACGAA8DatabaseC_SSAA18StatementArgumentsVAA0B7Adapter_pSgtKFZ":{"name":"fetchAll(_:sql:arguments:adapter:)","abstract":"

Returns an array of rows fetched from an SQL query.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchOne_3sql9arguments7adapterACSgAA8DatabaseC_SSAA18StatementArgumentsVAA0B7Adapter_pSgtKFZ":{"name":"fetchOne(_:sql:arguments:adapter:)","abstract":"

Returns a single row fetched from an SQL query.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC11fetchCursoryAA0bD0CAA8DatabaseC_xtKAA12FetchRequestRzlFZ":{"name":"fetchCursor(_:_:)","abstract":"

Returns a cursor over rows fetched from a fetch request.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchAllySayACGAA8DatabaseC_xtKAA12FetchRequestRzlFZ":{"name":"fetchAll(_:_:)","abstract":"

Returns an array of rows fetched from a fetch request.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC8fetchOneyACSgAA8DatabaseC_xtKAA12FetchRequestRzlFZ":{"name":"fetchOne(_:_:)","abstract":"

Returns a single row fetched from a fetch request.

","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowC17dictionaryLiteralACSS_AA24DatabaseValueConvertible_pSgtd_tcfc":{"name":"init(dictionaryLiteral:)","abstract":"

Creates a row initialized with elements. Column order is preserved, and","parent_name":"Row"},"Classes/Row.html#/s:4GRDB3RowCySS_AA13DatabaseValueVtAA0B5IndexVcip":{"name":"subscript(_:)","abstract":"

Accesses the (ColumnName, DatabaseValue) pair at given index.

","parent_name":"Row"},"Classes/Row/ScopesView.html":{"name":"ScopesView","abstract":"

A view of the scopes defined by row adapters. It is a collection of","parent_name":"Row"},"Classes/Row/ScopesTreeView.html":{"name":"ScopesTreeView","abstract":"

A view on the scopes tree defined by row adapters.

","parent_name":"Row"},"Classes/Row/PrefetchedRowsView.html":{"name":"PrefetchedRowsView","abstract":"

A view on the prefetched associated rows.

","parent_name":"Row"},"Classes/AnyDatabaseWriter.html#/s:4GRDB17AnyDatabaseWriterCyAcA0cD0_pcfc":{"name":"init(_:)","abstract":"

Creates a database writer that wraps a base database writer.

","parent_name":"AnyDatabaseWriter"},"Classes/DatabaseFuture.html#/s:4GRDB14DatabaseFutureC4waitxyKF":{"name":"wait()","abstract":"

Blocks the current thread until the value is available, and returns it.

","parent_name":"DatabaseFuture"},"Classes/DatabaseSnapshot.html#/s:4GRDB16DatabaseSnapshotC13configurationAA13ConfigurationVvp":{"name":"configuration","abstract":"

The database configuration

","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP9interruptyyF":{"name":"interrupt()","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB16DatabaseSnapshotC4readyxxAA0B0CKXEKlF":{"name":"read(_:)","abstract":"

Synchronously executes a read-only block that takes a database","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB16DatabaseSnapshotC9asyncReadyyys6ResultOyAA0B0Cs5Error_pGcF":{"name":"asyncRead(_:)","abstract":"

Asynchronously executes a read-only block in a protected dispatch queue.

","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP3add8functionyAA0B8FunctionC_tF":{"name":"add(function:)","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP6remove8functionyAA0B8FunctionC_tF":{"name":"remove(function:)","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP3add9collationyAA0B9CollationC_tF":{"name":"add(collation:)","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP6remove9collationyAA0B9CollationC_tF":{"name":"remove(collation:)","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP3add11observation7onError0F6ChangeAA19TransactionObserver_pAA16ValueObservationVyqd__G_ys0G0_pcy0K0Qyd__ctAA0K7ReducerRd__lF":{"name":"add(observation:onError:onChange:)","parent_name":"DatabaseSnapshot"},"Classes/DatabaseSnapshot.html#/s:4GRDB14DatabaseReaderP6remove19transactionObserveryAA011TransactionF0_p_tF":{"name":"remove(transactionObserver:)","parent_name":"DatabaseSnapshot"},"Classes/AnyDatabaseReader.html#/s:4GRDB17AnyDatabaseReaderCyAcA0cD0_pcfc":{"name":"init(_:)","abstract":"

Creates a database reader that wraps a base database reader.

","parent_name":"AnyDatabaseReader"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC13configurationAA13ConfigurationVvp":{"name":"configuration","abstract":"

The database configuration

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC4pathSSvp":{"name":"path","abstract":"

The path to the database file; it is “:memory:” for in-memory databases.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC4path13configurationACSS_AA13ConfigurationVtKcfc":{"name":"init(path:configuration:)","abstract":"

Opens the SQLite database at path path.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC13configurationAcA13ConfigurationV_tcfc":{"name":"init(configuration:)","abstract":"

Opens an in-memory SQLite database.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC13releaseMemoryyyF":{"name":"releaseMemory()","abstract":"

Free as much memory as possible.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC21setupMemoryManagement2inySo13UIApplicationC_tF":{"name":"setupMemoryManagement(in:)","abstract":"

Listens to UIApplicationDidEnterBackgroundNotification and","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB14DatabaseReaderP9interruptyyF":{"name":"interrupt()","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC4readyxxAA0B0CKXEKlF":{"name":"read(_:)","abstract":"

Synchronously executes a read-only block in a protected dispatch queue,","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC9asyncReadyyys6ResultOyAA0B0Cs5Error_pGcF":{"name":"asyncRead(_:)","abstract":"

Asynchronously executes a read-only block in a protected dispatch queue.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB14DatabaseWriterP14concurrentReadyAA0B6FutureCyqd__Gqd__AA0B0CKclF":{"name":"concurrentRead(_:)","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC13inTransactionyyAA0B0C0E4KindOSg_AF0E10CompletionOAFKXEtKF":{"name":"inTransaction(_:_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC23writeWithoutTransactionyxxAA0B0CKXEKlF":{"name":"writeWithoutTransaction(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC02inB0yxxAA0B0CKXEKlF":{"name":"inDatabase(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC20unsafeReentrantWriteyxxAA0B0CKXEKlF":{"name":"unsafeReentrantWrite(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue, and","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC28asyncWriteWithoutTransactionyyyAA0B0CcF":{"name":"asyncWriteWithoutTransaction(_:)","abstract":"

Asynchronously executes database updates in a protected dispatch queue,","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC3add8functionyAA0B8FunctionC_tF":{"name":"add(function:)","abstract":"

Add or redefine an SQL function.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC6remove8functionyAA0B8FunctionC_tF":{"name":"remove(function:)","abstract":"

Remove an SQL function.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC3add9collationyAA0B9CollationC_tF":{"name":"add(collation:)","abstract":"

Add or redefine a collation.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC6remove9collationyAA0B9CollationC_tF":{"name":"remove(collation:)","abstract":"

Remove a collation.

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/setupMemoryManagement(in:)":{"name":"setupMemoryManagement(in:)","abstract":"

Listens to UIApplicationDidEnterBackgroundNotification and","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC6change10passphraseySS_tKF":{"name":"change(passphrase:)","abstract":"

Changes the passphrase of an encrypted database

","parent_name":"DatabaseQueue"},"Classes/DatabaseQueue.html#/s:4GRDB13DatabaseQueueC3add9tokenizeryxm_tAA19FTS5CustomTokenizerRzlF":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"DatabaseQueue"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC4pathSSvp":{"name":"path","abstract":"

The path to the database.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB14DatabaseReaderP13configurationAA13ConfigurationVvp":{"name":"configuration","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC4path13configurationACSS_AA13ConfigurationVtKcfc":{"name":"init(path:configuration:)","abstract":"

Opens the SQLite database at path path.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC10checkpointyyAA0B0C14CheckpointModeOKF":{"name":"checkpoint(_:)","abstract":"

Runs a WAL checkpoint

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC13releaseMemoryyyF":{"name":"releaseMemory()","abstract":"

Free as much memory as possible.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC21setupMemoryManagement2inySo13UIApplicationC_tF":{"name":"setupMemoryManagement(in:)","abstract":"

Listens to UIApplicationDidEnterBackgroundNotification and","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB14DatabaseReaderP9interruptyyF":{"name":"interrupt()","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC4readyxxAA0B0CKXEKlF":{"name":"read(_:)","abstract":"

Synchronously executes a read-only block in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC9asyncReadyyys6ResultOyAA0B0Cs5Error_pGcF":{"name":"asyncRead(_:)","abstract":"

Asynchronously executes a read-only block in a protected dispatch queue.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC10unsafeReadyxxAA0B0CKXEKlF":{"name":"unsafeRead(_:)","abstract":"

Synchronously executes a read-only block in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC19unsafeReentrantReadyxxAA0B0CKXEKlF":{"name":"unsafeReentrantRead(_:)","abstract":"

Synchronously executes a read-only block in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB14DatabaseWriterP14concurrentReadyAA0B6FutureCyqd__Gqd__AA0B0CKclF":{"name":"concurrentRead(_:)","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC19asyncConcurrentReadyyys6ResultOyAA0B0Cs5Error_pGcF":{"name":"asyncConcurrentRead(_:)","abstract":"

Asynchronously executes a read-only block in a protected dispatch queue.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC29invalidateReadOnlyConnectionsyyF":{"name":"invalidateReadOnlyConnections()","abstract":"

Invalidates open read-only SQLite connections.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC23writeWithoutTransactionyxxAA0B0CKXEKlF":{"name":"writeWithoutTransaction(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC30barrierWriteWithoutTransactionyxxAA0B0CKXEKlF":{"name":"barrierWriteWithoutTransaction(_:)","abstract":"

A barrier write ensures that no database access is executed until all","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC18writeInTransactionyyAA0B0C0F4KindOSg_AF0F10CompletionOAFKXEtKF":{"name":"writeInTransaction(_:_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC20unsafeReentrantWriteyxxAA0B0CKXEKlF":{"name":"unsafeReentrantWrite(_:)","abstract":"

Synchronously executes database updates in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC28asyncWriteWithoutTransactionyyyAA0B0CcF":{"name":"asyncWriteWithoutTransaction(_:)","abstract":"

Asynchronously executes database updates in a protected dispatch queue,","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC3add8functionyAA0B8FunctionC_tF":{"name":"add(function:)","abstract":"

Add or redefine an SQL function.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC6remove8functionyAA0B8FunctionC_tF":{"name":"remove(function:)","abstract":"

Remove an SQL function.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC3add9collationyAA0B9CollationC_tF":{"name":"add(collation:)","abstract":"

Add or redefine a collation.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC6remove9collationyAA0B9CollationC_tF":{"name":"remove(collation:)","abstract":"

Remove a collation.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/add(tokenizer:)":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC12makeSnapshotAA0bE0CyKF":{"name":"makeSnapshot()","abstract":"

Creates a database snapshot.

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/setupMemoryManagement(in:)":{"name":"setupMemoryManagement(in:)","abstract":"

Listens to UIApplicationDidEnterBackgroundNotification and","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC6change10passphraseySS_tKF":{"name":"change(passphrase:)","abstract":"

Changes the passphrase of an encrypted database

","parent_name":"DatabasePool"},"Classes/DatabasePool.html#/s:4GRDB12DatabasePoolC3add9tokenizeryxm_tAA19FTS5CustomTokenizerRzlF":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"DatabasePool"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC4nameSSvp":{"name":"name","abstract":"

Undocumented

","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC_13argumentCount4pure8functionACSS_s5Int32VSgSbAA0B16ValueConvertible_pSgSayAA0bI0VGKctcfc":{"name":"init(_:argumentCount:pure:function:)","abstract":"

Returns an SQL function.

","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC_13argumentCount4pure9aggregateACSS_s5Int32VSgSbxmtcAA0B9AggregateRzlufc":{"name":"init(_:argumentCount:pure:aggregate:)","abstract":"

Returns an SQL aggregate function.

","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC10capitalizeACvpZ":{"name":"capitalize","abstract":"

An SQL function that returns the Swift built-in capitalized","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC9lowercaseACvpZ":{"name":"lowercase","abstract":"

An SQL function that returns the Swift built-in lowercased","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC9uppercaseACvpZ":{"name":"uppercase","abstract":"

An SQL function that returns the Swift built-in uppercased","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC19localizedCapitalizeACvpZ":{"name":"localizedCapitalize","abstract":"

An SQL function that returns the Swift built-in","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC18localizedLowercaseACvpZ":{"name":"localizedLowercase","abstract":"

An SQL function that returns the Swift built-in","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC18localizedUppercaseACvpZ":{"name":"localizedUppercase","abstract":"

An SQL function that returns the Swift built-in","parent_name":"DatabaseFunction"},"Classes/DatabaseFunction.html#/s:4GRDB16DatabaseFunctionC5applyyAA13SQLExpression_pAA14SQLExpressible_pd_tF":{"name":"apply(_:)","abstract":"

Returns an SQL expression that applies the function.

","parent_name":"DatabaseFunction"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC4nameSSvp":{"name":"name","abstract":"

Undocumented

","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC_8functionACSS_So18NSComparisonResultVSS_SStctcfc":{"name":"init(_:function:)","abstract":"

Creates a collation.

","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC14unicodeCompareACvpZ":{"name":"unicodeCompare","abstract":"

A collation, or SQL string comparison function, that compares strings","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC22caseInsensitiveCompareACvpZ":{"name":"caseInsensitiveCompare","abstract":"

A collation, or SQL string comparison function, that compares strings","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC31localizedCaseInsensitiveCompareACvpZ":{"name":"localizedCaseInsensitiveCompare","abstract":"

A collation, or SQL string comparison function, that compares strings","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC16localizedCompareACvpZ":{"name":"localizedCompare","abstract":"

A collation, or SQL string comparison function, that compares strings","parent_name":"DatabaseCollation"},"Classes/DatabaseCollation.html#/s:4GRDB17DatabaseCollationC24localizedStandardCompareACvpZ":{"name":"localizedStandardCompare","abstract":"

A collation, or SQL string comparison function, that compares strings","parent_name":"DatabaseCollation"},"Classes/Database/TransactionObservationExtent.html#/s:4GRDB8DatabaseC28TransactionObservationExtentO16observerLifetimeyA2EmF":{"name":"observerLifetime","abstract":"

Observation lasts until observer is deallocated

","parent_name":"TransactionObservationExtent"},"Classes/Database/TransactionObservationExtent.html#/s:4GRDB8DatabaseC28TransactionObservationExtentO04nextC0yA2EmF":{"name":"nextTransaction","abstract":"

Observation lasts until the next transaction

","parent_name":"TransactionObservationExtent"},"Classes/Database/TransactionObservationExtent.html#/s:4GRDB8DatabaseC28TransactionObservationExtentO16databaseLifetimeyA2EmF":{"name":"databaseLifetime","abstract":"

Observation lasts until the database is closed

","parent_name":"TransactionObservationExtent"},"Classes/Database/TransactionKind.html#/s:4GRDB8DatabaseC15TransactionKindO8deferredyA2EmF":{"name":"deferred","abstract":"

Undocumented

","parent_name":"TransactionKind"},"Classes/Database/TransactionKind.html#/s:4GRDB8DatabaseC15TransactionKindO9immediateyA2EmF":{"name":"immediate","abstract":"

Undocumented

","parent_name":"TransactionKind"},"Classes/Database/TransactionKind.html#/s:4GRDB8DatabaseC15TransactionKindO9exclusiveyA2EmF":{"name":"exclusive","abstract":"

Undocumented

","parent_name":"TransactionKind"},"Classes/Database/TransactionCompletion.html#/s:4GRDB8DatabaseC21TransactionCompletionO6commityA2EmF":{"name":"commit","abstract":"

Undocumented

","parent_name":"TransactionCompletion"},"Classes/Database/TransactionCompletion.html#/s:4GRDB8DatabaseC21TransactionCompletionO8rollbackyA2EmF":{"name":"rollback","abstract":"

Undocumented

","parent_name":"TransactionCompletion"},"Classes/Database/ForeignKeyAction.html#/s:4GRDB8DatabaseC16ForeignKeyActionO7cascadeyA2EmF":{"name":"cascade","abstract":"

Undocumented

","parent_name":"ForeignKeyAction"},"Classes/Database/ForeignKeyAction.html#/s:4GRDB8DatabaseC16ForeignKeyActionO8restrictyA2EmF":{"name":"restrict","abstract":"

Undocumented

","parent_name":"ForeignKeyAction"},"Classes/Database/ForeignKeyAction.html#/s:4GRDB8DatabaseC16ForeignKeyActionO7setNullyA2EmF":{"name":"setNull","abstract":"

Undocumented

","parent_name":"ForeignKeyAction"},"Classes/Database/ForeignKeyAction.html#/s:4GRDB8DatabaseC16ForeignKeyActionO10setDefaultyA2EmF":{"name":"setDefault","abstract":"

Undocumented

","parent_name":"ForeignKeyAction"},"Classes/Database/ConflictResolution.html#/s:4GRDB8DatabaseC18ConflictResolutionO8rollbackyA2EmF":{"name":"rollback","abstract":"

Undocumented

","parent_name":"ConflictResolution"},"Classes/Database/ConflictResolution.html#/s:4GRDB8DatabaseC18ConflictResolutionO5abortyA2EmF":{"name":"abort","abstract":"

Undocumented

","parent_name":"ConflictResolution"},"Classes/Database/ConflictResolution.html#/s:4GRDB8DatabaseC18ConflictResolutionO4failyA2EmF":{"name":"fail","abstract":"

Undocumented

","parent_name":"ConflictResolution"},"Classes/Database/ConflictResolution.html#/s:4GRDB8DatabaseC18ConflictResolutionO6ignoreyA2EmF":{"name":"ignore","abstract":"

Undocumented

","parent_name":"ConflictResolution"},"Classes/Database/ConflictResolution.html#/s:4GRDB8DatabaseC18ConflictResolutionO7replaceyA2EmF":{"name":"replace","abstract":"

Undocumented

","parent_name":"ConflictResolution"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeVyAESScfc":{"name":"init(_:)","abstract":"

Undocumented

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV4textAEvpZ":{"name":"text","abstract":"

The TEXT SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV7integerAEvpZ":{"name":"integer","abstract":"

The INTEGER SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV6doubleAEvpZ":{"name":"double","abstract":"

The DOUBLE SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV7numericAEvpZ":{"name":"numeric","abstract":"

The NUMERIC SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV7booleanAEvpZ":{"name":"boolean","abstract":"

The BOOLEAN SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV4blobAEvpZ":{"name":"blob","abstract":"

The BLOB SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV4dateAEvpZ":{"name":"date","abstract":"

The DATE SQL column type

","parent_name":"ColumnType"},"Classes/Database/ColumnType.html#/s:4GRDB8DatabaseC10ColumnTypeV8datetimeAEvpZ":{"name":"datetime","abstract":"

The DATETIME SQL column type

","parent_name":"ColumnType"},"Classes/Database/CollationName.html#/s:4GRDB8DatabaseC13CollationNameVyAESScfc":{"name":"init(_:)","abstract":"

Undocumented

","parent_name":"CollationName"},"Classes/Database/CollationName.html#/s:4GRDB8DatabaseC13CollationNameV6binaryAEvpZ":{"name":"binary","abstract":"

The BINARY built-in SQL collation

","parent_name":"CollationName"},"Classes/Database/CollationName.html#/s:4GRDB8DatabaseC13CollationNameV6nocaseAEvpZ":{"name":"nocase","abstract":"

The NOCASE built-in SQL collation

","parent_name":"CollationName"},"Classes/Database/CollationName.html#/s:4GRDB8DatabaseC13CollationNameV5rtrimAEvpZ":{"name":"rtrim","abstract":"

The RTRIM built-in SQL collation

","parent_name":"CollationName"},"Classes/Database/CheckpointMode.html#/s:4GRDB8DatabaseC14CheckpointModeO7passiveyA2EmF":{"name":"passive","abstract":"

Undocumented

","parent_name":"CheckpointMode"},"Classes/Database/CheckpointMode.html#/s:4GRDB8DatabaseC14CheckpointModeO4fullyA2EmF":{"name":"full","abstract":"

Undocumented

","parent_name":"CheckpointMode"},"Classes/Database/CheckpointMode.html#/s:4GRDB8DatabaseC14CheckpointModeO7restartyA2EmF":{"name":"restart","abstract":"

Undocumented

","parent_name":"CheckpointMode"},"Classes/Database/CheckpointMode.html#/s:4GRDB8DatabaseC14CheckpointModeO8truncateyA2EmF":{"name":"truncate","abstract":"

Undocumented

","parent_name":"CheckpointMode"},"Classes/Database/BusyMode.html#/s:4GRDB8DatabaseC8BusyModeO14immediateErroryA2EmF":{"name":"immediateError","abstract":"

The SQLITE_BUSY error is immediately returned to the connection that","parent_name":"BusyMode"},"Classes/Database/BusyMode.html#/s:4GRDB8DatabaseC8BusyModeO7timeoutyAESdcAEmF":{"name":"timeout(_:)","abstract":"

The SQLITE_BUSY error will be returned only if the database remains","parent_name":"BusyMode"},"Classes/Database/BusyMode.html#/s:4GRDB8DatabaseC8BusyModeO8callbackyAESbSiccAEmF":{"name":"callback(_:)","abstract":"

A custom callback that is called when a database is locked.","parent_name":"BusyMode"},"Classes/Database.html#/s:4GRDB8DatabaseC16sqliteConnections13OpaquePointerVvp":{"name":"sqliteConnection","abstract":"

The raw SQLite connection, suitable for the SQLite C API.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC8logErroryAA10ResultCodeV_SStcSgvpZ":{"name":"logError","abstract":"

The error logging function.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13configurationAA13ConfigurationVvp":{"name":"configuration","abstract":"

The database configuration

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC17lastInsertedRowIDs5Int64Vvp":{"name":"lastInsertedRowID","abstract":"

The rowID of the most recently inserted row.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC12changesCountSivp":{"name":"changesCount","abstract":"

The number of rows modified, inserted or deleted by the most recent","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC17totalChangesCountSivp":{"name":"totalChangesCount","abstract":"

The total number of rows modified, inserted or deleted by all successful","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC19isInsideTransactionSbvp":{"name":"isInsideTransaction","abstract":"

True if the database connection is currently in a transaction.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13lastErrorCodeAA06ResultE0Vvp":{"name":"lastErrorCode","abstract":"

The last error code

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC16lastErrorMessageSSSgvp":{"name":"lastErrorMessage","abstract":"

The last error message

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC3add8functionyAA0B8FunctionC_tF":{"name":"add(function:)","abstract":"

Add or redefine an SQL function.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6remove8functionyAA0B8FunctionC_tF":{"name":"remove(function:)","abstract":"

Remove an SQL function.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC3add9collationyAA0B9CollationC_tF":{"name":"add(collation:)","abstract":"

Add or redefine a collation.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6remove9collationyAA0B9CollationC_tF":{"name":"remove(collation:)","abstract":"

Remove a collation.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC19suspendNotificationSo18NSNotificationNameavpZ":{"name":"suspendNotification","abstract":"

When this notification is posted, databases which were opened with the","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC18resumeNotificationSo18NSNotificationNameavpZ":{"name":"resumeNotification","abstract":"

When this notification is posted, databases which were opened with the","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13inTransactionyyAC0D4KindOSg_AC0D10CompletionOyKXEtKF":{"name":"inTransaction(_:_:)","abstract":"

Executes a block inside a database transaction.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC11inSavepointyyAC21TransactionCompletionOyKXEKF":{"name":"inSavepoint(_:)","abstract":"

Executes a block inside a savepoint.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC16beginTransactionyyAC0D4KindOSgKF":{"name":"beginTransaction(_:)","abstract":"

Begins a database transaction.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC8rollbackyyKF":{"name":"rollback()","abstract":"

Rollbacks a database transaction.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6commityyKF":{"name":"commit()","abstract":"

Commits a database transaction.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC16clearSchemaCacheyyF":{"name":"clearSchemaCache()","abstract":"

Clears the database schema cache.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC11tableExistsySbSSKF":{"name":"tableExists(_:)","abstract":"

Returns whether a table exists.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC21isSQLiteInternalTableySbSSF":{"name":"isSQLiteInternalTable(_:)","abstract":"

Returns whether a table is an internal SQLite table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC19isGRDBInternalTableySbSSF":{"name":"isGRDBInternalTable(_:)","abstract":"

Returns whether a table is an internal GRDB table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC10viewExistsySbSSKF":{"name":"viewExists(_:)","abstract":"

Returns whether a view exists.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13triggerExistsySbSSKF":{"name":"triggerExists(_:)","abstract":"

Returns whether a trigger exists.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC10primaryKeyyAA07PrimaryD4InfoVSSKF":{"name":"primaryKey(_:)","abstract":"

The primary key for table named tableName.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7indexes2onSayAA9IndexInfoVGSS_tKF":{"name":"indexes(on:)","abstract":"

The indexes on table named tableName; returns the empty array if the","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC5table_12hasUniqueKeySbSS_xtKSTRzSS7ElementRtzlF":{"name":"table(_:hasUniqueKey:)","abstract":"

True if a sequence of columns uniquely identifies a row, that is to say","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC11foreignKeys2onSayAA14ForeignKeyInfoVGSS_tKF":{"name":"foreignKeys(on:)","abstract":"

The foreign keys defined on table named tableName.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7columns2inSayAA10ColumnInfoVGSS_tKF":{"name":"columns(in:)","abstract":"

The columns in the table named tableName

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC19makeSelectStatement3sqlAA0dE0CSS_tKF":{"name":"makeSelectStatement(sql:)","abstract":"

Returns a new prepared statement that can be reused.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC21cachedSelectStatement3sqlAA0dE0CSS_tKF":{"name":"cachedSelectStatement(sql:)","abstract":"

Returns a prepared statement that can be reused.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC19makeUpdateStatement3sqlAA0dE0CSS_tKF":{"name":"makeUpdateStatement(sql:)","abstract":"

Returns a new prepared statement that can be reused.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC21cachedUpdateStatement3sqlAA0dE0CSS_tKF":{"name":"cachedUpdateStatement(sql:)","abstract":"

Returns a prepared statement that can be reused.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7execute3sql9argumentsySS_AA18StatementArgumentsVtKF":{"name":"execute(sql:arguments:)","abstract":"

Executes one or several SQL statements, separated by semi-colons.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7execute7literalyAA10SQLLiteralV_tKF":{"name":"execute(literal:)","abstract":"

Executes one or several SQL statements, separated by semi-colons.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC12BusyCallbacka":{"name":"BusyCallback","abstract":"

See BusyMode and https://www.sqlite.org/c3ref/busy_handler.html

","parent_name":"Database"},"Classes/Database/BusyMode.html":{"name":"BusyMode","abstract":"

When there are several connections to a database, a connection may try","parent_name":"Database"},"Classes/Database/CheckpointMode.html":{"name":"CheckpointMode","abstract":"

The available checkpoint modes.

","parent_name":"Database"},"Classes/Database/CollationName.html":{"name":"CollationName","abstract":"

A built-in SQLite collation.

","parent_name":"Database"},"Classes/Database/ColumnType.html":{"name":"ColumnType","abstract":"

An SQL column type.

","parent_name":"Database"},"Classes/Database/ConflictResolution.html":{"name":"ConflictResolution","abstract":"

An SQLite conflict resolution.

","parent_name":"Database"},"Classes/Database/ForeignKeyAction.html":{"name":"ForeignKeyAction","abstract":"

A foreign key action.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC16LogErrorFunctiona":{"name":"LogErrorFunction","abstract":"

log function that takes an error message.

","parent_name":"Database"},"Classes/Database/TransactionCompletion.html":{"name":"TransactionCompletion","abstract":"

The end of a transaction: Commit, or Rollback

","parent_name":"Database"},"Classes/Database/TransactionKind.html":{"name":"TransactionKind","abstract":"

An SQLite transaction kind. See https://www.sqlite.org/lang_transaction.html

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC3add19transactionObserver6extentyAA011TransactionE0_p_AC0G17ObservationExtentOtF":{"name":"add(transactionObserver:extent:)","abstract":"

Add a transaction observer, so that it gets notified of","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6remove19transactionObserveryAA011TransactionE0_p_tF":{"name":"remove(transactionObserver:)","abstract":"

Remove a transaction observer.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC26afterNextTransactionCommityyyACcF":{"name":"afterNextTransactionCommit(_:)","abstract":"

Registers a closure to be executed after the next or current","parent_name":"Database"},"Classes/Database/TransactionObservationExtent.html":{"name":"TransactionObservationExtent","abstract":"

The extent of a transaction observation

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC31dropFTS4SynchronizationTriggers8forTableySS_tKF":{"name":"dropFTS4SynchronizationTriggers(forTable:)","abstract":"

Deletes the synchronization triggers for a synchronized FTS4 table

","parent_name":"Database"},"Classes/Database.html#/create(table:temporary:ifNotExists:withoutRowID:body:)":{"name":"create(table:temporary:ifNotExists:withoutRowID:body:)","abstract":"

Creates a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create5table9temporary11ifNotExists12withoutRowID4bodyySS_S3byAA15TableDefinitionCXEtKF":{"name":"create(table:temporary:ifNotExists:withoutRowID:body:)","abstract":"

Creates a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create5table9temporary11ifNotExists4bodyySS_S2byAA15TableDefinitionCXEtKF":{"name":"create(table:temporary:ifNotExists:body:)","abstract":"

Creates a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6rename5table2toySS_SStKF":{"name":"rename(table:to:)","abstract":"

Renames a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC5alter5table4bodyySS_yAA15TableAlterationCXEtKF":{"name":"alter(table:body:)","abstract":"

Modifies a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC4drop5tableySS_tKF":{"name":"drop(table:)","abstract":"

Deletes a database table.

","parent_name":"Database"},"Classes/Database.html#/create(index:on:columns:unique:ifNotExists:condition:)":{"name":"create(index:on:columns:unique:ifNotExists:condition:)","abstract":"

Creates an index.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create5index2on7columns6unique11ifNotExistsySS_SSSaySSGS2btKF":{"name":"create(index:on:columns:unique:ifNotExists:)","abstract":"

Creates an index.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create5index2on7columns6unique11ifNotExists9conditionySS_SSSaySSGS2bAA14SQLExpressible_ptKF":{"name":"create(index:on:columns:unique:ifNotExists:condition:)","abstract":"

Creates a partial index.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC4drop5indexySS_tKF":{"name":"drop(index:)","abstract":"

Deletes a database index.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7reindex9collationyAC13CollationNameV_tKF":{"name":"reindex(collation:)","abstract":"

Delete and recreate from scratch all indices that use this collation.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC7reindex9collationyAA0B9CollationC_tKF":{"name":"reindex(collation:)","abstract":"

Delete and recreate from scratch all indices that use this collation.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create12virtualTable11ifNotExists5usingySS_SbSStKF":{"name":"create(virtualTable:ifNotExists:using:)","abstract":"

Creates a virtual database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create12virtualTable11ifNotExists5using_ySS_Sbxy0E10DefinitionQzcSgtKAA07VirtualE6ModuleRzlF":{"name":"create(virtualTable:ifNotExists:using:_:)","abstract":"

Creates a virtual database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13usePassphraseyySSKF":{"name":"usePassphrase(_:)","abstract":"

Sets the passphrase used to crypt and decrypt an SQLCipher database.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC16changePassphraseyySSKF":{"name":"changePassphrase(_:)","abstract":"

Changes the passphrase used by an SQLCipher encrypted database.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC31dropFTS5SynchronizationTriggers8forTableySS_tKF":{"name":"dropFTS5SynchronizationTriggers(forTable:)","abstract":"

Deletes the synchronization triggers for a synchronized FTS5 table

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC3add9tokenizeryxm_tAA19FTS5CustomTokenizerRzlF":{"name":"add(tokenizer:)","abstract":"

Add a custom FTS5 tokenizer.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC15makeFTS5Pattern03rawE08forTableAA0dE0VSS_SStKF":{"name":"makeFTS5Pattern(rawPattern:forTable:)","abstract":"

Creates a pattern from a raw pattern string; throws DatabaseError on","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC13makeTokenizeryAA04FTS5D0_pAA0eD10DescriptorVKF":{"name":"makeTokenizer(_:)","abstract":"

Creates an FTS5 tokenizer, given its descriptor.

","parent_name":"Database"},"Classes/Database.html#/create(table:temporary:ifNotExists:body:)":{"name":"create(table:temporary:ifNotExists:body:)","abstract":"

Creates a database table.

","parent_name":"Database"},"Classes/Database.html#/s:4GRDB8DatabaseC6create5index2on7columns6unique11ifNotExists9conditionySS_SSSaySSGS2bAA14SQLExpressible_pSgtKF":{"name":"create(index:on:columns:unique:ifNotExists:condition:)","abstract":"

Creates an index.

","parent_name":"Database"},"Classes/Database.html#/create(index:on:columns:unique:ifNotExists:)":{"name":"create(index:on:columns:unique:ifNotExists:)","abstract":"

Creates an index.

","parent_name":"Database"},"Classes/AnyCursor.html#/s:4GRDB9AnyCursorCyACyxGqd__c7ElementQyd__RszAA0C0Rd__lufc":{"name":"init(_:)","abstract":"

Creates a cursor that wraps a base cursor but whose type depends only on","parent_name":"AnyCursor"},"Classes/AnyCursor.html#/s:4GRDB9AnyCursorC8iteratorACyxGqd___tc7ElementQyd__RszStRd__lufc":{"name":"init(iterator:)","abstract":"

Creates a cursor that wraps a base iterator but whose type depends only","parent_name":"AnyCursor"},"Classes/AnyCursor.html#/s:4GRDB9AnyCursorCyACyxGqd__c7ElementQyd__RszSTRd__lufc":{"name":"init(_:)","abstract":"

Creates a cursor that wraps a base sequence but whose type depends only","parent_name":"AnyCursor"},"Classes/AnyCursor.html#/s:4GRDB9AnyCursorCyACyxGxSgyKccfc":{"name":"init(_:)","abstract":"

Creates a cursor that wraps the given closure in its next() method

","parent_name":"AnyCursor"},"Classes/AnyCursor.html":{"name":"AnyCursor","abstract":"

A type-erased cursor of Element.

"},"Classes/Database.html":{"name":"Database","abstract":"

A Database connection.

"},"Classes/DatabaseCollation.html":{"name":"DatabaseCollation","abstract":"

A Collation is a string comparison function used by SQLite.

"},"Classes/DatabaseFunction.html":{"name":"DatabaseFunction","abstract":"

An SQL function or aggregate.

"},"Classes/DatabasePool.html":{"name":"DatabasePool","abstract":"

A DatabasePool grants concurrent accesses to an SQLite database.

"},"Classes/DatabaseQueue.html":{"name":"DatabaseQueue","abstract":"

A DatabaseQueue serializes access to an SQLite database.

"},"Classes/AnyDatabaseReader.html":{"name":"AnyDatabaseReader","abstract":"

A type-erased DatabaseReader

"},"Classes/DatabaseSnapshot.html":{"name":"DatabaseSnapshot","abstract":"

A DatabaseSnapshot sees an unchanging database content, as it existed at the"},"Classes.html#/s:4GRDB19DatabaseValueCursorC":{"name":"DatabaseValueCursor","abstract":"

A cursor of database values extracted from a single column."},"Classes.html#/s:4GRDB27NullableDatabaseValueCursorC":{"name":"NullableDatabaseValueCursor","abstract":"

A cursor of optional database values extracted from a single column."},"Classes/DatabaseFuture.html":{"name":"DatabaseFuture","abstract":"

A future database value, returned by the DatabaseWriter.concurrentRead(_:)"},"Classes/AnyDatabaseWriter.html":{"name":"AnyDatabaseWriter","abstract":"

A type-erased DatabaseWriter

"},"Classes/Row.html":{"name":"Row","abstract":"

A database row.

"},"Classes/RowCursor.html":{"name":"RowCursor","abstract":"

A cursor of database rows. For example:

"},"Classes/SelectStatement.html":{"name":"SelectStatement","abstract":"

A subclass of Statement that fetches database rows.

"},"Classes/Statement.html":{"name":"Statement","abstract":"

A statement represents an SQL query.

"},"Classes/UpdateStatement.html":{"name":"UpdateStatement","abstract":"

A subclass of Statement that executes SQL queries.

"},"Classes.html#/s:4GRDB23FastDatabaseValueCursorC":{"name":"FastDatabaseValueCursor","abstract":"

A cursor of database values extracted from a single column."},"Classes.html#/s:4GRDB31FastNullableDatabaseValueCursorC":{"name":"FastNullableDatabaseValueCursor","abstract":"

A cursor of optional database values extracted from a single column."},"Classes/FTS3TableDefinition.html":{"name":"FTS3TableDefinition","abstract":"

The FTS3TableDefinition class lets you define columns of a FTS3 virtual table.

"},"Classes/FTS4TableDefinition.html":{"name":"FTS4TableDefinition","abstract":"

The FTS4TableDefinition class lets you define columns of a FTS4 virtual table.

"},"Classes/FTS4ColumnDefinition.html":{"name":"FTS4ColumnDefinition","abstract":"

The FTS4ColumnDefinition class lets you refine a column of an FTS4"},"Classes/FTS5TableDefinition.html":{"name":"FTS5TableDefinition","abstract":"

The FTS5TableDefinition class lets you define columns of a FTS5 virtual table.

"},"Classes/FTS5ColumnDefinition.html":{"name":"FTS5ColumnDefinition","abstract":"

The FTS5ColumnDefinition class lets you refine a column of an FTS5"},"Classes/TableAlias.html":{"name":"TableAlias","abstract":"

Experimental

"},"Classes/TableDefinition.html":{"name":"TableDefinition","abstract":"

The TableDefinition class lets you define table columns and constraints.

"},"Classes/TableAlteration.html":{"name":"TableAlteration","abstract":"

The TableAlteration class lets you alter database tables.

"},"Classes/ColumnDefinition.html":{"name":"ColumnDefinition","abstract":"

The ColumnDefinition class lets you refine a table column.

"},"Classes.html#/s:4GRDB12RecordCursorC":{"name":"RecordCursor","abstract":"

A cursor of records. For example:

"},"Classes/FetchedRecordsController.html":{"name":"FetchedRecordsController","abstract":"

You use FetchedRecordsController to track changes in the results of an"},"Classes/Record.html":{"name":"Record","abstract":"

Record is a class that wraps a table row, or the result of any query. It is"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Enums.html":{"name":"Enumerations","abstract":"

The following enumerations are available globally.

"},"Extensions.html":{"name":"Extensions","abstract":"

The following extensions are available globally.

"},"Functions.html":{"name":"Functions","abstract":"

The following functions are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"},"Structs.html":{"name":"Structures","abstract":"

The following structures are available globally.

"},"Typealiases.html":{"name":"Type Aliases","abstract":"

The following type aliases are available globally.

"}} \ No newline at end of file diff --git a/docs/4.8/undocumented.json b/docs/4.8/undocumented.json new file mode 100644 index 000000000..1402c4cd5 --- /dev/null +++ b/docs/4.8/undocumented.json @@ -0,0 +1,13333 @@ +{ + "warnings": [ + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1246, + "symbol": "Database.CheckpointMode.passive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1247, + "symbol": "Database.CheckpointMode.full", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1248, + "symbol": "Database.CheckpointMode.restart", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1249, + "symbol": "Database.CheckpointMode.truncate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1264, + "symbol": "Database.CollationName.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1295, + "symbol": "Database.ColumnType.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1328, + "symbol": "Database.ConflictResolution.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1329, + "symbol": "Database.ConflictResolution.abort", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1330, + "symbol": "Database.ConflictResolution.fail", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1331, + "symbol": "Database.ConflictResolution.ignore", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1332, + "symbol": "Database.ConflictResolution.replace", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1339, + "symbol": "Database.ForeignKeyAction.cascade", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1340, + "symbol": "Database.ForeignKeyAction.restrict", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1341, + "symbol": "Database.ForeignKeyAction.setNull", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1342, + "symbol": "Database.ForeignKeyAction.setDefault", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1350, + "symbol": "Database.TransactionCompletion.commit", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1351, + "symbol": "Database.TransactionCompletion.rollback", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1356, + "symbol": "Database.TransactionKind.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1357, + "symbol": "Database.TransactionKind.immediate", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Database.swift", + "line": 1358, + "symbol": "Database.TransactionKind.exclusive", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseCollation.swift", + "line": 12, + "symbol": "DatabaseCollation.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 10, + "symbol": "ResultCode", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 52, + "symbol": "ResultCode.SQLITE_OK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 53, + "symbol": "ResultCode.SQLITE_ERROR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 54, + "symbol": "ResultCode.SQLITE_INTERNAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 55, + "symbol": "ResultCode.SQLITE_PERM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 56, + "symbol": "ResultCode.SQLITE_ABORT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 57, + "symbol": "ResultCode.SQLITE_BUSY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 58, + "symbol": "ResultCode.SQLITE_LOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 59, + "symbol": "ResultCode.SQLITE_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 60, + "symbol": "ResultCode.SQLITE_READONLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 61, + "symbol": "ResultCode.SQLITE_INTERRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 62, + "symbol": "ResultCode.SQLITE_IOERR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 63, + "symbol": "ResultCode.SQLITE_CORRUPT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 64, + "symbol": "ResultCode.SQLITE_NOTFOUND", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 65, + "symbol": "ResultCode.SQLITE_FULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 66, + "symbol": "ResultCode.SQLITE_CANTOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 67, + "symbol": "ResultCode.SQLITE_PROTOCOL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 68, + "symbol": "ResultCode.SQLITE_EMPTY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 69, + "symbol": "ResultCode.SQLITE_SCHEMA", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 70, + "symbol": "ResultCode.SQLITE_TOOBIG", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 71, + "symbol": "ResultCode.SQLITE_CONSTRAINT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 72, + "symbol": "ResultCode.SQLITE_MISMATCH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 73, + "symbol": "ResultCode.SQLITE_MISUSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 74, + "symbol": "ResultCode.SQLITE_NOLFS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 75, + "symbol": "ResultCode.SQLITE_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 76, + "symbol": "ResultCode.SQLITE_FORMAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 77, + "symbol": "ResultCode.SQLITE_RANGE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 78, + "symbol": "ResultCode.SQLITE_NOTADB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 79, + "symbol": "ResultCode.SQLITE_NOTICE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 80, + "symbol": "ResultCode.SQLITE_WARNING", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 81, + "symbol": "ResultCode.SQLITE_ROW", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 82, + "symbol": "ResultCode.SQLITE_DONE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 89, + "symbol": "ResultCode.SQLITE_ERROR_MISSING_COLLSEQ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 90, + "symbol": "ResultCode.SQLITE_ERROR_RETRY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 91, + "symbol": "ResultCode.SQLITE_ERROR_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 92, + "symbol": "ResultCode.SQLITE_IOERR_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 93, + "symbol": "ResultCode.SQLITE_IOERR_SHORT_READ", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 94, + "symbol": "ResultCode.SQLITE_IOERR_WRITE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 95, + "symbol": "ResultCode.SQLITE_IOERR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 96, + "symbol": "ResultCode.SQLITE_IOERR_DIR_FSYNC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 97, + "symbol": "ResultCode.SQLITE_IOERR_TRUNCATE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 98, + "symbol": "ResultCode.SQLITE_IOERR_FSTAT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 99, + "symbol": "ResultCode.SQLITE_IOERR_UNLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 100, + "symbol": "ResultCode.SQLITE_IOERR_RDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 101, + "symbol": "ResultCode.SQLITE_IOERR_DELETE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 102, + "symbol": "ResultCode.SQLITE_IOERR_BLOCKED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 103, + "symbol": "ResultCode.SQLITE_IOERR_NOMEM", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 104, + "symbol": "ResultCode.SQLITE_IOERR_ACCESS", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 105, + "symbol": "ResultCode.SQLITE_IOERR_CHECKRESERVEDLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 106, + "symbol": "ResultCode.SQLITE_IOERR_LOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 107, + "symbol": "ResultCode.SQLITE_IOERR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 108, + "symbol": "ResultCode.SQLITE_IOERR_DIR_CLOSE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 109, + "symbol": "ResultCode.SQLITE_IOERR_SHMOPEN", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 110, + "symbol": "ResultCode.SQLITE_IOERR_SHMSIZE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 111, + "symbol": "ResultCode.SQLITE_IOERR_SHMLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 112, + "symbol": "ResultCode.SQLITE_IOERR_SHMMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 113, + "symbol": "ResultCode.SQLITE_IOERR_SEEK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 114, + "symbol": "ResultCode.SQLITE_IOERR_DELETE_NOENT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 115, + "symbol": "ResultCode.SQLITE_IOERR_MMAP", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 116, + "symbol": "ResultCode.SQLITE_IOERR_GETTEMPPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 117, + "symbol": "ResultCode.SQLITE_IOERR_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 118, + "symbol": "ResultCode.SQLITE_IOERR_VNODE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 119, + "symbol": "ResultCode.SQLITE_IOERR_AUTH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 120, + "symbol": "ResultCode.SQLITE_IOERR_BEGIN_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 121, + "symbol": "ResultCode.SQLITE_IOERR_COMMIT_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 122, + "symbol": "ResultCode.SQLITE_IOERR_ROLLBACK_ATOMIC", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 123, + "symbol": "ResultCode.SQLITE_LOCKED_SHAREDCACHE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 124, + "symbol": "ResultCode.SQLITE_LOCKED_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 125, + "symbol": "ResultCode.SQLITE_BUSY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 126, + "symbol": "ResultCode.SQLITE_BUSY_SNAPSHOT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 127, + "symbol": "ResultCode.SQLITE_CANTOPEN_NOTEMPDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 128, + "symbol": "ResultCode.SQLITE_CANTOPEN_ISDIR", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 129, + "symbol": "ResultCode.SQLITE_CANTOPEN_FULLPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 130, + "symbol": "ResultCode.SQLITE_CANTOPEN_CONVPATH", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 131, + "symbol": "ResultCode.SQLITE_CANTOPEN_DIRTYWAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 132, + "symbol": "ResultCode.SQLITE_CORRUPT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 133, + "symbol": "ResultCode.SQLITE_CORRUPT_SEQUENCE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 134, + "symbol": "ResultCode.SQLITE_READONLY_RECOVERY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 135, + "symbol": "ResultCode.SQLITE_READONLY_CANTLOCK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 136, + "symbol": "ResultCode.SQLITE_READONLY_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 137, + "symbol": "ResultCode.SQLITE_READONLY_DBMOVED", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 138, + "symbol": "ResultCode.SQLITE_READONLY_CANTINIT", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 139, + "symbol": "ResultCode.SQLITE_READONLY_DIRECTORY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 140, + "symbol": "ResultCode.SQLITE_ABORT_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 141, + "symbol": "ResultCode.SQLITE_CONSTRAINT_CHECK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 142, + "symbol": "ResultCode.SQLITE_CONSTRAINT_COMMITHOOK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 143, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FOREIGNKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 144, + "symbol": "ResultCode.SQLITE_CONSTRAINT_FUNCTION", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 145, + "symbol": "ResultCode.SQLITE_CONSTRAINT_NOTNULL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 146, + "symbol": "ResultCode.SQLITE_CONSTRAINT_PRIMARYKEY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 147, + "symbol": "ResultCode.SQLITE_CONSTRAINT_TRIGGER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 148, + "symbol": "ResultCode.SQLITE_CONSTRAINT_UNIQUE", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 149, + "symbol": "ResultCode.SQLITE_CONSTRAINT_VTAB", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 150, + "symbol": "ResultCode.SQLITE_CONSTRAINT_ROWID", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 151, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_WAL", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 152, + "symbol": "ResultCode.SQLITE_NOTICE_RECOVER_ROLLBACK", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 153, + "symbol": "ResultCode.SQLITE_WARNING_AUTOINDEX", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 154, + "symbol": "ResultCode.SQLITE_AUTH_USER", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseError.swift", + "line": 155, + "symbol": "ResultCode.SQLITE_OK_LOAD_PERMANENTLY", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseFunction.swift", + "line": 17, + "symbol": "DatabaseFunction.name", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 312, + "symbol": "DatabaseRegionConvertible", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 330, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/DatabaseRegion.swift", + "line": 334, + "symbol": "AnyDatabaseRegionConvertible.init(_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Row.swift", + "line": 770, + "symbol": "RowCursor.statement", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 13, + "symbol": "SQLLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/SQLLiteral.swift", + "line": 14, + "symbol": "SQLLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Core/Statement.swift", + "line": 608, + "symbol": "StatementArguments.isEmpty", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Migration/DatabaseMigrator.swift", + "line": 147, + "symbol": "DatabaseMigrator.registerMigrationWithDeferredForeignKeyCheck(_:migrate:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Migration/DatabaseMigrator.swift", + "line": 147, + "symbol": "DatabaseMigrator.registerMigrationWithDeferredForeignKeyCheck(_:migrate:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Migration/DatabaseMigrator.swift", + "line": 147, + "symbol": "DatabaseMigrator.registerMigrationWithDeferredForeignKeyCheck(_:migrate:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Migration/DatabaseMigrator.swift", + "line": 147, + "symbol": "DatabaseMigrator.registerMigrationWithDeferredForeignKeyCheck(_:migrate:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Migration/DatabaseMigrator.swift", + "line": 147, + "symbol": "DatabaseMigrator.registerMigrationWithDeferredForeignKeyCheck(_:migrate:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Migration/DatabaseMigrator.swift", + "line": 147, + "symbol": "DatabaseMigrator.registerMigrationWithDeferredForeignKeyCheck(_:migrate:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Migration/DatabaseMigrator.swift", + "line": 147, + "symbol": "DatabaseMigrator.registerMigrationWithDeferredForeignKeyCheck(_:migrate:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Migration/DatabaseMigrator.swift", + "line": 147, + "symbol": "DatabaseMigrator.registerMigrationWithDeferredForeignKeyCheck(_:migrate:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 38, + "symbol": "SQLExpressionLiteral.sql", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLExpression+QueryInterface.swift", + "line": 39, + "symbol": "SQLExpressionLiteral.arguments", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 747, + "symbol": "SQLLogicalBinaryOperator", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.and", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLOperators.swift", + "line": 748, + "symbol": "SQLLogicalBinaryOperator.or", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQL/SQLSelectable+QueryInterface.swift", + "line": 18, + "symbol": "AllColumns.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift", + "line": 178, + "symbol": "TableAlias.init(name:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 977, + "symbol": "InsertQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1014, + "symbol": "UpdateQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1050, + "symbol": "DeleteQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Record/PersistableRecord.swift", + "line": 1065, + "symbol": "ExistsQuery", + "symbol_kind": "source.lang.swift.decl.extension", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/Utils/Inflections.swift", + "line": 46, + "symbol": "Inflections.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 4, + "symbol": "ValueReducers.Combine2", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 46, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 69, + "symbol": "ValueObservation.combine(_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 83, + "symbol": "ValueReducers.Combine3", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 133, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 162, + "symbol": "ValueObservation.combine(_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 183, + "symbol": "ValueReducers.Combine4", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 241, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 276, + "symbol": "ValueObservation.combine(_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 300, + "symbol": "ValueReducers.Combine5", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 366, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 407, + "symbol": "ValueObservation.combine(_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 434, + "symbol": "ValueReducers.Combine6", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 508, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 557, + "symbol": "ValueReducers.Combine7", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 639, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 694, + "symbol": "ValueReducers.Combine8", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + }, + { + "file": "/Users/groue/Documents/git/groue/GRDB.swift/GRDB/ValueObservation/ValueReducer/Combine.swift", + "line": 785, + "symbol": "ValueObservation.combine(_:_:_:_:_:_:_:_:)", + "symbol_kind": "source.lang.swift.decl.function.method.static", + "warning": "undocumented" + } + ], + "source_directory": "/Users/groue/Documents/git/groue/GRDB.swift" +} \ No newline at end of file diff --git a/index.html b/index.html index 44273dcad..8c3ef5218 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@

- Latest release: December 18, 2019 • version 4.7.0 • Release Notes + Latest release: January 8, 2020 • version 4.8.0 • Release Notes

Requirements: iOS 9.0+ / OSX 10.9+ / watchOS 2.0+ • Swift 4.2+ / Xcode 10+ @@ -33,7 +33,7 @@ Features • Documentation • General Guides & Good Practices • - Reference + Reference

Contact: @groue