mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
jazzy 0.8.1
This commit is contained in:
1 parent
7e2b5236db
commit
71ba7d3ea3
311 files changed
+1338
-5908
No files matched your search
@@ -788,7 +788,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -804,7 +804,6 @@ cursor.</p>
|
||||
|
||||
<p>To create an instance of <code>EnumeratedCursor</code>, call the <code>enumerated()</code> method
|
||||
on a cursor:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let cursor = try String.fetchCursor(db, "SELECT 'foo' UNION ALL SELECT 'bar'")
|
||||
let c = cursor.enumerated()
|
||||
while let (n, x) = c.next() {
|
||||
@@ -982,7 +981,6 @@ transform function returning Element.</p>
|
||||
|
||||
<p>You don’t create a database directly. Instead, you use a DatabaseQueue, or
|
||||
a DatabasePool:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let dbQueue = DatabaseQueue(...)
|
||||
|
||||
// The Database is the `db` in the closure:
|
||||
@@ -1221,7 +1219,6 @@ more information.</p>
|
||||
|
||||
<p>You don’t create instances of this class. Instead, you use the Database
|
||||
<code>create(virtualTable:using:)</code> method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "documents", using: FTS3()) { t in // t is FTS3TableDefinition
|
||||
t.column("content")
|
||||
}
|
||||
@@ -1264,7 +1261,6 @@ more information.</p>
|
||||
|
||||
<p>You don’t create instances of this class. Instead, you use the Database
|
||||
<code>create(virtualTable:using:)</code> method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "documents", using: FTS4()) { t in // t is FTS4TableDefinition
|
||||
t.column("content")
|
||||
}
|
||||
@@ -1305,7 +1301,6 @@ more information.</p>
|
||||
virtual table.</p>
|
||||
|
||||
<p>You get instances of this class when you create an FTS4 table:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "persons", using: FTS4()) { t in
|
||||
t.column("content") // FTS4ColumnDefinition
|
||||
}
|
||||
@@ -1478,7 +1473,6 @@ designed to be subclassed.</p>
|
||||
<p>A subclass of Statement that fetches database rows.</p>
|
||||
|
||||
<p>You create SelectStatement with the Database.makeSelectStatement() method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbQueue.inDatabase { db in
|
||||
let statement = try db.makeSelectStatement("SELECT COUNT(*) FROM persons WHERE age > ?")
|
||||
let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
|
||||
@@ -1598,7 +1592,6 @@ and SelectStatement that fetches rows.</p>
|
||||
<p>A subclass of Statement that executes SQL queries.</p>
|
||||
|
||||
<p>You create UpdateStatement with the Database.makeUpdateStatement() method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbQueue.inTransaction { db in
|
||||
let statement = try db.makeUpdateStatement("INSERT INTO persons (name) VALUES (?)")
|
||||
try statement.execute(arguments: ["Arthur"])
|
||||
@@ -1644,7 +1637,6 @@ and SelectStatement that fetches rows.</p>
|
||||
|
||||
<p>You don’t create instances of this class. Instead, you use the Database
|
||||
<code>create(table:)</code> method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in // t is TableDefinition
|
||||
t.column(...)
|
||||
}
|
||||
@@ -1685,7 +1677,6 @@ and SelectStatement that fetches rows.</p>
|
||||
|
||||
<p>You don’t create instances of this class. Instead, you use the Database
|
||||
<code>alter(table:)</code> method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.alter(table: "persons") { t in // t is TableAlteration
|
||||
t.add(column: ...)
|
||||
}
|
||||
@@ -1725,7 +1716,6 @@ and SelectStatement that fetches rows.</p>
|
||||
<p>The ColumnDefinition class lets you refine a table column.</p>
|
||||
|
||||
<p>You get instances of this class when you create or alter a database table:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column(...) // ColumnDefinition
|
||||
}
|
||||
@@ -1760,7 +1750,7 @@ try db.alter(table: "persons") { t in
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -861,7 +861,7 @@ element exists.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -756,7 +756,6 @@
|
||||
<p>The ColumnDefinition class lets you refine a table column.</p>
|
||||
|
||||
<p>You get instances of this class when you create or alter a database table:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column(...) // ColumnDefinition
|
||||
}
|
||||
@@ -787,7 +786,6 @@ try db.alter(table: "persons") { t in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Adds a primary key constraint on the column.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("id", .integer).primaryKey()
|
||||
}
|
||||
@@ -817,8 +815,8 @@ try db.alter(table: "persons") { t in
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>An optional conflict resolution (see <a href="https://www.sqlite.org/lang_conflict.html">https://www.sqlite.org/lang_conflict.html</a>).</p>
|
||||
|
||||
<p>An optional conflict resolution
|
||||
(see <a href="https://www.sqlite.org/lang_conflict.html">https://www.sqlite.org/lang_conflict.html</a>).</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -831,7 +829,6 @@ try db.alter(table: "persons") { t in
|
||||
<td>
|
||||
<div>
|
||||
<p>If true, the primary key is autoincremented.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -841,7 +838,6 @@ try db.alter(table: "persons") { t in
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L552-L555">Show on GitHub</a>
|
||||
@@ -863,7 +859,6 @@ try db.alter(table: "persons") { t in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Adds a NOT NULL constraint on the column.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("name", .text).notNull()
|
||||
}
|
||||
@@ -892,8 +887,8 @@ try db.alter(table: "persons") { t in
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>An optional conflict resolution (see <a href="https://www.sqlite.org/lang_conflict.html">https://www.sqlite.org/lang_conflict.html</a>).</p>
|
||||
|
||||
<p>An optional conflict resolution
|
||||
(see <a href="https://www.sqlite.org/lang_conflict.html">https://www.sqlite.org/lang_conflict.html</a>).</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -903,7 +898,6 @@ try db.alter(table: "persons") { t in
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L569-L572">Show on GitHub</a>
|
||||
@@ -925,7 +919,6 @@ try db.alter(table: "persons") { t in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Adds a UNIQUE constraint on the column.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("email", .text).unique()
|
||||
}
|
||||
@@ -954,8 +947,8 @@ try db.alter(table: "persons") { t in
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>An optional conflict resolution (see <a href="https://www.sqlite.org/lang_conflict.html">https://www.sqlite.org/lang_conflict.html</a>).</p>
|
||||
|
||||
<p>An optional conflict resolution
|
||||
(see <a href="https://www.sqlite.org/lang_conflict.html">https://www.sqlite.org/lang_conflict.html</a>).</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -965,7 +958,6 @@ try db.alter(table: "persons") { t in
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L586-L589">Show on GitHub</a>
|
||||
@@ -987,7 +979,6 @@ try db.alter(table: "persons") { t in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Adds a CHECK constraint on the column.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("name", .text).check { length($0) > 0 }
|
||||
}
|
||||
@@ -1016,8 +1007,8 @@ try db.alter(table: "persons") { t in
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure whose argument is an Column that represents the defined column, and returns the expression to check.</p>
|
||||
|
||||
<p>A closure whose argument is an Column that
|
||||
represents the defined column, and returns the expression to check.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1027,7 +1018,6 @@ try db.alter(table: "persons") { t in
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L603-L606">Show on GitHub</a>
|
||||
@@ -1049,7 +1039,6 @@ try db.alter(table: "persons") { t in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Adds a CHECK constraint on the column.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("name", .text).check(sql: "LENGTH(name) > 0")
|
||||
}
|
||||
@@ -1079,7 +1068,6 @@ try db.alter(table: "persons") { t in
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL snippet.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1089,7 +1077,6 @@ try db.alter(table: "persons") { t in
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L619-L622">Show on GitHub</a>
|
||||
@@ -1111,7 +1098,6 @@ try db.alter(table: "persons") { t in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Defines the default column value.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("name", .text).defaults(to: "Anonymous")
|
||||
}
|
||||
@@ -1141,7 +1127,6 @@ try db.alter(table: "persons") { t in
|
||||
<td>
|
||||
<div>
|
||||
<p>A DatabaseValueConvertible value.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1151,7 +1136,6 @@ try db.alter(table: "persons") { t in
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L635-L638">Show on GitHub</a>
|
||||
@@ -1173,7 +1157,6 @@ try db.alter(table: "persons") { t in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Defines the default column value.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("creationDate", .DateTime).defaults(sql: "CURRENT_TIMESTAMP")
|
||||
}
|
||||
@@ -1203,7 +1186,6 @@ try db.alter(table: "persons") { t in
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL snippet.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1213,7 +1195,6 @@ try db.alter(table: "persons") { t in
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L651-L654">Show on GitHub</a>
|
||||
@@ -1263,7 +1244,6 @@ try db.alter(table: "persons") { t in
|
||||
<td>
|
||||
<div>
|
||||
<p>An Database.CollationName.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1273,7 +1253,6 @@ try db.alter(table: "persons") { t in
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L667-L670">Show on GitHub</a>
|
||||
@@ -1323,7 +1302,6 @@ try db.alter(table: "persons") { t in
|
||||
<td>
|
||||
<div>
|
||||
<p>A custom DatabaseCollation.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1333,7 +1311,6 @@ try db.alter(table: "persons") { t in
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L683-L686">Show on GitHub</a>
|
||||
@@ -1355,7 +1332,6 @@ try db.alter(table: "persons") { t in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Defines a foreign key.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "books") { t in
|
||||
t.column("authorId", .integer).references("authors", onDelete: .cascade)
|
||||
}
|
||||
@@ -1375,7 +1351,6 @@ try db.alter(table: "persons") { t in
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L706-L709">Show on GitHub</a>
|
||||
@@ -1389,7 +1364,7 @@ try db.alter(table: "persons") { t in
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,7 +757,6 @@
|
||||
|
||||
<p>You don’t create a database directly. Instead, you use a DatabaseQueue, or
|
||||
a DatabasePool:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let dbQueue = DatabaseQueue(...)
|
||||
|
||||
// The Database is the `db` in the closure:
|
||||
@@ -865,7 +864,6 @@ remains locked for more than the specified duration.</p></li>
|
||||
</ul>
|
||||
|
||||
<p>To set the busy mode of a database, use Configuration:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let configuration = Configuration(busyMode: .timeout(1))
|
||||
let dbQueue = DatabaseQueue(path: "...", configuration: configuration)
|
||||
</code></pre>
|
||||
@@ -1006,7 +1004,6 @@ let dbQueue = DatabaseQueue(path: "...", configuration: configuration)
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL column type.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("id", .integer).primaryKey()
|
||||
t.column("title", .text)
|
||||
@@ -1400,12 +1397,10 @@ opened.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a new prepared statement that can be reused.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT COUNT(*) FROM persons WHERE age > ?")
|
||||
let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
|
||||
let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever SQLite could not parse the sql query.
|
||||
@@ -1434,7 +1429,6 @@ let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1444,7 +1438,6 @@ let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A SelectStatement.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Database.swift#L622-L624">Show on GitHub</a>
|
||||
@@ -1466,7 +1459,6 @@ let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a prepared statement that can be reused.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.cachedSelectStatement("SELECT COUNT(*) FROM persons WHERE age > ?")
|
||||
let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
|
||||
let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
|
||||
@@ -1474,7 +1466,6 @@ let moreThanThirtyCount = try Int.fetchOne(statement, arguments: [30])!
|
||||
|
||||
<p>The returned statement may have already been used: it may or may not
|
||||
contain values for its eventual arguments.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever SQLite could not parse the sql query.
|
||||
@@ -1503,7 +1494,6 @@ contain values for its eventual arguments.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1513,7 +1503,6 @@ contain values for its eventual arguments.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An UpdateStatement.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Database.swift#L638-L640">Show on GitHub</a>
|
||||
@@ -1535,12 +1524,10 @@ contain values for its eventual arguments.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a new prepared statement that can be reused.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeUpdateStatement("INSERT INTO persons (name) VALUES (?)")
|
||||
try statement.execute(arguments: ["Arthur"])
|
||||
try statement.execute(arguments: ["Barbara"])
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever SQLite could not parse the sql query.
|
||||
@@ -1569,7 +1556,6 @@ try statement.execute(arguments: ["Barbara"])
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1579,7 +1565,6 @@ try statement.execute(arguments: ["Barbara"])
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An UpdateStatement.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Database.swift#L659-L661">Show on GitHub</a>
|
||||
@@ -1601,7 +1586,6 @@ try statement.execute(arguments: ["Barbara"])
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a prepared statement that can be reused.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.cachedUpdateStatement("INSERT INTO persons (name) VALUES (?)")
|
||||
try statement.execute(arguments: ["Arthur"])
|
||||
try statement.execute(arguments: ["Barbara"])
|
||||
@@ -1609,7 +1593,6 @@ try statement.execute(arguments: ["Barbara"])
|
||||
|
||||
<p>The returned statement may have already been used: it may or may not
|
||||
contain values for its eventual arguments.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever SQLite could not parse the sql query.
|
||||
@@ -1638,7 +1621,6 @@ contain values for its eventual arguments.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1648,7 +1630,6 @@ contain values for its eventual arguments.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An UpdateStatement.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Database.swift#L675-L677">Show on GitHub</a>
|
||||
@@ -1670,7 +1651,6 @@ contain values for its eventual arguments.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Executes one or several SQL statements, separated by semi-colons.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.execute(
|
||||
"INSERT INTO persons (name) VALUES (:name)",
|
||||
arguments: ["name": "Arthur"])
|
||||
@@ -1683,7 +1663,6 @@ try db.execute(
|
||||
</code></pre>
|
||||
|
||||
<p>This method may throw a DatabaseError.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -1712,7 +1691,6 @@ try db.execute(
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1725,7 +1703,6 @@ try db.execute(
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1756,7 +1733,6 @@ try db.execute(
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Add or redefine an SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let fn = DatabaseFunction("succ", argumentCount: 1) { databaseValues in
|
||||
let dbv = databaseValues.first!
|
||||
guard let int = dbv.value() as Int? else {
|
||||
@@ -1831,7 +1807,6 @@ try Int.fetchOne(db, "SELECT succ(1)")! // 2
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Add or redefine a collation.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let collation = DatabaseCollation("localized_standard") { (string1, string2) in
|
||||
return (string1 as NSString).localizedStandardCompare(string2)
|
||||
}
|
||||
@@ -1966,7 +1941,6 @@ modified by another connection.</p>
|
||||
<div class="abstract">
|
||||
<p>The primary key for table named <code>tableName</code>; nil if table has no
|
||||
primary key.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError if table does not exist.
|
||||
@@ -2002,7 +1976,6 @@ primary key.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The number of columns in the table named <code>tableName</code>.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError if table does not exist.
|
||||
@@ -2110,7 +2083,6 @@ if the columns are the primary key, or if there is a unique index on them.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Executes a block inside a database transaction.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbQueue.inDatabase do {
|
||||
try db.inTransaction {
|
||||
try db.execute("INSERT ...")
|
||||
@@ -2123,7 +2095,6 @@ if the columns are the primary key, or if there is a unique index on them.</p>
|
||||
error is rethrown.</p>
|
||||
|
||||
<p>This method is not reentrant: you can’t nest transactions.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block.
|
||||
@@ -2151,8 +2122,10 @@ error is rethrown.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The transaction type (default nil). If nil, the transaction type is configuration.defaultTransactionKind, which itself defaults to .immediate. See <a href="https://www.sqlite.org/lang_transaction.html">https://www.sqlite.org/lang_transaction.html</a> for more information.</p>
|
||||
|
||||
<p>The transaction type (default nil). If nil, the transaction
|
||||
type is configuration.defaultTransactionKind, which itself
|
||||
defaults to .immediate. See <a href="https://www.sqlite.org/lang_transaction.html">https://www.sqlite.org/lang_transaction.html</a>
|
||||
for more information.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2164,8 +2137,8 @@ error is rethrown.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A block that executes SQL statements and return either .commit or .rollback.</p>
|
||||
|
||||
<p>A block that executes SQL statements and return either
|
||||
.commit or .rollback.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2192,7 +2165,6 @@ error is rethrown.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Executes a block inside a savepoint.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbQueue.inDatabase do {
|
||||
try db.inSavepoint {
|
||||
try db.execute("INSERT ...")
|
||||
@@ -2205,7 +2177,6 @@ error is rethrown.</p>
|
||||
error is rethrown.</p>
|
||||
|
||||
<p>This method is reentrant: you can nest savepoints.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block.
|
||||
@@ -2233,8 +2204,8 @@ error is rethrown.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A block that executes SQL statements and return either .commit or .rollback.</p>
|
||||
|
||||
<p>A block that executes SQL statements and return
|
||||
either .commit or .rollback.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2288,7 +2259,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A transaction observer.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2383,7 +2353,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a database table.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "pointOfInterests") { t in
|
||||
t.column("id", .integer).primaryKey()
|
||||
t.column("title", .text)
|
||||
@@ -2395,7 +2364,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
|
||||
<p>See <a href="https://www.sqlite.org/lang_createtable.html">https://www.sqlite.org/lang_createtable.html</a> and
|
||||
<a href="https://www.sqlite.org/withoutrowid.html">https://www.sqlite.org/withoutrowid.html</a></p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -2424,7 +2392,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The table name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2437,7 +2404,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>If true, creates a temporary table.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2450,7 +2416,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>If false, no error is thrown if table already exists.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2463,7 +2428,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>If true, uses WITHOUT ROWID optimization.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2476,7 +2440,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that defines table columns and constraints.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2503,7 +2466,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a database table.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "pointOfInterests") { t in
|
||||
t.column("id", .integer).primaryKey()
|
||||
t.column("title", .text)
|
||||
@@ -2514,7 +2476,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
</code></pre>
|
||||
|
||||
<p>See <a href="https://www.sqlite.org/lang_createtable.html">https://www.sqlite.org/lang_createtable.html</a></p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -2543,7 +2504,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The table name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2556,7 +2516,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>If true, creates a temporary table.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2569,7 +2528,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>If false, no error is thrown if table already exists.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2582,7 +2540,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that defines table columns and constraints.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2611,7 +2568,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<p>Renames a database table.</p>
|
||||
|
||||
<p>See <a href="https://www.sqlite.org/lang_altertable.html">https://www.sqlite.org/lang_altertable.html</a></p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -2647,14 +2603,12 @@ stops getting notifications after it is deallocated.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Modifies a database table.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.alter(table: "persons") { t in
|
||||
t.add(column: "url", .text)
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<p>See <a href="https://www.sqlite.org/lang_altertable.html">https://www.sqlite.org/lang_altertable.html</a></p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -2683,7 +2637,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The table name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2696,7 +2649,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that defines table alterations.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2725,7 +2677,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<p>Deletes a database table.</p>
|
||||
|
||||
<p>See <a href="https://www.sqlite.org/lang_droptable.html">https://www.sqlite.org/lang_droptable.html</a></p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -2788,14 +2739,12 @@ stops getting notifications after it is deallocated.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates an index.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(index: "personByEmail", on: "person", columns: ["email"])
|
||||
</code></pre>
|
||||
|
||||
<p>SQLite can also index expressions (<a href="https://www.sqlite.org/expridx.html">https://www.sqlite.org/expridx.html</a>)
|
||||
and use specific collations. To create such an index, use a raw SQL
|
||||
query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.execute("CREATE INDEX ...")
|
||||
</code></pre>
|
||||
|
||||
@@ -2823,7 +2772,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The index name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2836,7 +2784,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The name of the indexed table.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2849,7 +2796,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The indexed columns.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2862,7 +2808,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>If true, creates a unique index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2875,7 +2820,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>If false, no error is thrown if index already exists.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2902,7 +2846,6 @@ query.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a partial index.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(index: "personByEmail", on: "person", columns: ["email"], condition: Column("email") != nil)
|
||||
</code></pre>
|
||||
|
||||
@@ -2931,7 +2874,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The index name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2944,7 +2886,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The name of the indexed table.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2957,7 +2898,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The indexed columns.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2970,7 +2910,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>If true, creates a unique index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2983,7 +2922,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>If false, no error is thrown if index already exists.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2996,7 +2934,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The condition that indexed rows must verify.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -3025,7 +2962,6 @@ query.</p>
|
||||
<p>Deletes a database index.</p>
|
||||
|
||||
<p>See <a href="https://www.sqlite.org/lang_dropindex.html">https://www.sqlite.org/lang_dropindex.html</a></p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -3072,12 +3008,10 @@ query.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a virtual database table.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "vocabulary", using: "spellfix1")
|
||||
</code></pre>
|
||||
|
||||
<p>See <a href="https://www.sqlite.org/lang_createtable.html">https://www.sqlite.org/lang_createtable.html</a></p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -3106,7 +3040,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The table name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -3119,7 +3052,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>If false, no error is thrown if table already exists.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -3132,7 +3064,6 @@ query.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The name of an SQLite virtual table module.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -3159,7 +3090,6 @@ query.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a virtual database table.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let module = ...
|
||||
try db.create(virtualTable: "pointOfInterests", using: module) { t in
|
||||
...
|
||||
@@ -3171,7 +3101,6 @@ argument: refer to this module’s documentation.</p>
|
||||
|
||||
<p>Use this method to create full-text tables using the FTS3, FTS4, or
|
||||
FTS5 modules:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "books", using: FTS4()) { t in
|
||||
t.column("title")
|
||||
t.column("author")
|
||||
@@ -3180,7 +3109,6 @@ FTS5 modules:</p>
|
||||
</code></pre>
|
||||
|
||||
<p>See <a href="https://www.sqlite.org/lang_createtable.html">https://www.sqlite.org/lang_createtable.html</a></p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -3209,7 +3137,6 @@ FTS5 modules:</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The table name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -3222,7 +3149,6 @@ FTS5 modules:</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>If false, no error is thrown if table already exists.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -3235,7 +3161,6 @@ FTS5 modules:</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>a VirtualTableModule</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -3248,7 +3173,6 @@ FTS5 modules:</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An optional closure that defines the virtual table.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -3267,7 +3191,7 @@ FTS5 modules:</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -768,7 +768,6 @@ remains locked for more than the specified duration.</p></li>
|
||||
</ul>
|
||||
|
||||
<p>To set the busy mode of a database, use Configuration:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let configuration = Configuration(busyMode: .timeout(1))
|
||||
let dbQueue = DatabaseQueue(path: "...", configuration: configuration)
|
||||
</code></pre>
|
||||
@@ -893,7 +892,7 @@ See <a href="https://www.sqlite.org/c3ref/busy_handler.html">https://www.sqlite.
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -897,7 +897,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -831,8 +831,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The raw value to use for the new instance.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1003,7 +1002,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -754,7 +754,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<p>An SQL column type.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("id", .integer).primaryKey()
|
||||
t.column("title", .text)
|
||||
@@ -781,7 +780,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL column type.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("id", .integer).primaryKey()
|
||||
t.column("title", .text)
|
||||
@@ -819,7 +817,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL column type.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("id", .integer).primaryKey()
|
||||
t.column("title", .text)
|
||||
@@ -849,8 +846,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The raw value to use for the new instance.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -907,7 +903,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL column type.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("id", .integer).primaryKey()
|
||||
t.column("title", .text)
|
||||
@@ -1177,7 +1172,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -933,7 +933,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -899,7 +899,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -829,7 +829,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -863,7 +863,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -803,7 +803,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a collation.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let collation = DatabaseCollation("localized_standard") { (string1, string2) in
|
||||
return (string1 as NSString).localizedStandardCompare(string2)
|
||||
}
|
||||
@@ -833,7 +832,6 @@ try db.execute("CREATE TABLE files (name TEXT COLLATE localized_standard")
|
||||
<td>
|
||||
<div>
|
||||
<p>The function name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -846,7 +844,6 @@ try db.execute("CREATE TABLE files (name TEXT COLLATE localized_standard")
|
||||
<td>
|
||||
<div>
|
||||
<p>A function that compares two strings.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -947,7 +944,6 @@ according to the the Swift built-in == and <= operators.</p>
|
||||
connections.</p>
|
||||
|
||||
<p>You can use it when creating database tables:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let collationName = DatabaseCollation.caseInsensitiveCompare.name
|
||||
dbQueue.execute(
|
||||
"CREATE TABLE persons (" +
|
||||
@@ -991,7 +987,6 @@ according to the the Swift built-in caseInsensitiveCompare(_:) method.</p>
|
||||
connections.</p>
|
||||
|
||||
<p>You can use it when creating database tables:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let collationName = DatabaseCollation.caseInsensitiveCompare.name
|
||||
dbQueue.execute(
|
||||
"CREATE TABLE persons (" +
|
||||
@@ -1035,7 +1030,6 @@ according to the the Swift built-in localizedCaseInsensitiveCompare(_:) method.<
|
||||
connections.</p>
|
||||
|
||||
<p>You can use it when creating database tables:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let collationName = DatabaseCollation.localizedCaseInsensitiveCompare.name
|
||||
dbQueue.execute(
|
||||
"CREATE TABLE persons (" +
|
||||
@@ -1079,7 +1073,6 @@ according to the the Swift built-in localizedCompare(_:) method.</p>
|
||||
connections.</p>
|
||||
|
||||
<p>You can use it when creating database tables:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let collationName = DatabaseCollation.localizedCompare.name
|
||||
dbQueue.execute(
|
||||
"CREATE TABLE persons (" +
|
||||
@@ -1123,7 +1116,6 @@ according to the the Swift built-in localizedStandardCompare(_:) method.</p>
|
||||
connections.</p>
|
||||
|
||||
<p>You can use it when creating database tables:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let collationName = DatabaseCollation.localizedStandardCompare.name
|
||||
dbQueue.execute(
|
||||
"CREATE TABLE persons (" +
|
||||
@@ -1153,7 +1145,7 @@ dbQueue.execute(
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -774,7 +774,6 @@
|
||||
<div class="abstract">
|
||||
<p>Advances to the next element and returns it, or <code>nil</code> if no next element
|
||||
exists. Once nil has been returned, all subsequent calls return nil.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let rows = try Row.fetchCursor(db, "SELECT ...") // DatabaseCursor<Row>
|
||||
while let row = try rows.next() { // Row
|
||||
let id: Int64 = row.value(atIndex: 0)
|
||||
@@ -803,7 +802,7 @@ while let row = try rows.next() { // Row
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -803,7 +803,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let fn = DatabaseFunction("succ", argumentCount: 1) { databaseValues in
|
||||
let dbv = databaseValues.first!
|
||||
guard let int = dbv.value() as Int? else {
|
||||
@@ -837,7 +836,6 @@ try Int.fetchOne(db, "SELECT succ(1)")! // 2
|
||||
<td>
|
||||
<div>
|
||||
<p>The function name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -849,8 +847,8 @@ try Int.fetchOne(db, "SELECT succ(1)")! // 2
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The number of arguments of the function. If omitted, or nil, the function accepts any number of arguments.</p>
|
||||
|
||||
<p>The number of arguments of the function. If
|
||||
omitted, or nil, the function accepts any number of arguments.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -862,8 +860,10 @@ try Int.fetchOne(db, "SELECT succ(1)")! // 2
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>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.</p>
|
||||
|
||||
<p>Whether the function is <q>pure</q>, 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.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -875,8 +875,11 @@ try Int.fetchOne(db, "SELECT succ(1)")! // 2
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>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 elements, provided is not nil.</p>
|
||||
|
||||
<p>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 <em>argumentCount</em> elements, provided <em>argumentCount</em> is
|
||||
not nil.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1014,7 +1017,6 @@ String property.</p>
|
||||
<p>This function is automatically added by GRDB to your database
|
||||
connections. It is the function used by the query interface’s
|
||||
capitalized:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.capitalized)
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -1056,7 +1058,6 @@ String property.</p>
|
||||
<p>This function is automatically added by GRDB to your database
|
||||
connections. It is the function used by the query interface’s
|
||||
lowercased:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.lowercased())
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -1098,7 +1099,6 @@ String property.</p>
|
||||
<p>This function is automatically added by GRDB to your database
|
||||
connections. It is the function used by the query interface’s
|
||||
uppercased:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.uppercased())
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -1144,7 +1144,6 @@ localizedCapitalized String property.</p>
|
||||
<p>This function is automatically added by GRDB to your database
|
||||
connections. It is the function used by the query interface’s
|
||||
localizedCapitalized:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.localizedCapitalized)
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -1186,7 +1185,6 @@ localizedLowercased String property.</p>
|
||||
<p>This function is automatically added by GRDB to your database
|
||||
connections. It is the function used by the query interface’s
|
||||
localizedLowercased:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.localizedLowercased)
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -1228,7 +1226,6 @@ localizedUppercased String property.</p>
|
||||
<p>This function is automatically added by GRDB to your database
|
||||
connections. It is the function used by the query interface’s
|
||||
localizedUppercased:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.localizedUppercased)
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -1255,7 +1252,7 @@ let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -780,12 +780,10 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Opens the SQLite database at path <em>path</em>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let dbPool = try DatabasePool(path: "/path/to/database.sqlite")
|
||||
</code></pre>
|
||||
|
||||
<p>Database connections get closed when the database pool gets deallocated.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -814,7 +812,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The path to the database file.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -827,7 +824,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>A configuration.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -840,7 +836,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The maximum number of readers. Default is 5.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -946,7 +941,6 @@ more information.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The checkpoint mode (default passive)</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1106,7 +1100,6 @@ enters background.</li>
|
||||
<div class="abstract">
|
||||
<p>Synchronously executes a read-only block in a protected dispatch queue,
|
||||
and returns its result. The block is wrapped in a deferred transaction.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let persons = try dbPool.read { db in
|
||||
try Person.fetchAll(...)
|
||||
}
|
||||
@@ -1114,7 +1107,6 @@ and returns its result. The block is wrapped in a deferred transaction.</p>
|
||||
|
||||
<p>The block is completely isolated. Eventual concurrent database updates
|
||||
are <em>not visible</em> inside the block:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbPool.read { db in
|
||||
// Those two values are guaranteed to be equal, even if the
|
||||
// `wines` table is modified between the two requests:
|
||||
@@ -1129,7 +1121,6 @@ try dbPool.read { db in
|
||||
</code></pre>
|
||||
|
||||
<p>This method is <em>not</em> reentrant.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block, or any DatabaseError that would
|
||||
@@ -1159,7 +1150,6 @@ happen while establishing the read access to the database.
|
||||
<td>
|
||||
<div>
|
||||
<p>A block that accesses the database.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1190,7 +1180,6 @@ and returns its result.</p>
|
||||
|
||||
<p>The block argument is not isolated: eventual concurrent database updates
|
||||
are visible inside the block:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>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:
|
||||
@@ -1200,7 +1189,6 @@ are visible inside the block:</p>
|
||||
</code></pre>
|
||||
|
||||
<p>Cursor iteration is safe, though:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbPool.unsafeRead { db in
|
||||
// No concurrent update can mess with this iteration:
|
||||
let rows = try Row.fetchCursor(db, "SELECT ...")
|
||||
@@ -1209,7 +1197,6 @@ are visible inside the block:</p>
|
||||
</code></pre>
|
||||
|
||||
<p>This method is <em>not</em> reentrant.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block, or any DatabaseError that would
|
||||
@@ -1239,7 +1226,6 @@ happen while establishing the read access to the database.
|
||||
<td>
|
||||
<div>
|
||||
<p>A block that accesses the database.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1277,7 +1263,6 @@ happen while establishing the read access to the database.
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Add or redefine an SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let fn = DatabaseFunction("succ", argumentCount: 1) { databaseValues in
|
||||
let dbv = databaseValues.first!
|
||||
guard let int = dbv.value() as Int? else {
|
||||
@@ -1361,7 +1346,6 @@ try dbPool.read { db in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Add or redefine a collation.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let collation = DatabaseCollation("localized_standard") { (string1, string2) in
|
||||
return (string1 as NSString).localizedStandardCompare(string2)
|
||||
}
|
||||
@@ -1445,7 +1429,6 @@ and returns its result.</p>
|
||||
|
||||
<p>Eventual concurrent database updates are postponed until the block
|
||||
has executed.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbPool.write { db in
|
||||
try db.execute(...)
|
||||
}
|
||||
@@ -1456,7 +1439,6 @@ from seeing an inconsistent database state, prefer the
|
||||
writeInTransaction method.</p>
|
||||
|
||||
<p>This method is <em>not</em> reentrant.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block.
|
||||
@@ -1500,7 +1482,6 @@ has executed.</p>
|
||||
<p>If the block throws an error, the transaction is rollbacked and the
|
||||
error is rethrown. If the block returns .rollback, the transaction is
|
||||
also rollbacked, but no error is thrown.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbPool.writeInTransaction { db in
|
||||
db.execute(...)
|
||||
return .commit
|
||||
@@ -1508,7 +1489,6 @@ also rollbacked, but no error is thrown.</p>
|
||||
</code></pre>
|
||||
|
||||
<p>Eventual concurrent readers do not see partial changes:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>dbPool.writeInTransaction { db in
|
||||
// Eventually preserve a zero balance
|
||||
try db.execute(db, "INSERT INTO credits ...", arguments: [amount])
|
||||
@@ -1521,7 +1501,6 @@ dbPool.read { db in
|
||||
</code></pre>
|
||||
|
||||
<p>This method is <em>not</em> reentrant.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block, or any error establishing the
|
||||
@@ -1550,8 +1529,10 @@ transaction.
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The transaction type (default nil). If nil, the transaction type is configuration.defaultTransactionKind, which itself defaults to .immediate. See <a href="https://www.sqlite.org/lang_transaction.html">https://www.sqlite.org/lang_transaction.html</a> for more information.</p>
|
||||
|
||||
<p>The transaction type (default nil). If nil, the transaction
|
||||
type is configuration.defaultTransactionKind, which itself
|
||||
defaults to .immediate. See <a href="https://www.sqlite.org/lang_transaction.html">https://www.sqlite.org/lang_transaction.html</a>
|
||||
for more information.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1563,8 +1544,8 @@ transaction.
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A block that executes SQL statements and return either .commit or .rollback.</p>
|
||||
|
||||
<p>A block that executes SQL statements and return either
|
||||
.commit or .rollback.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1640,7 +1621,6 @@ wrapped in a deferred transaction.</p>
|
||||
<p>The <em>block</em> argument is guaranteed to see the database in the last
|
||||
committed state at the moment this method is called. Eventual concurrent
|
||||
database updates are <em>not visible</em> inside the block.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbPool.write { db in
|
||||
try db.execute("DELETE FROM persons")
|
||||
try dbPool.readFromCurrentState { db in
|
||||
@@ -1653,7 +1633,6 @@ database updates are <em>not visible</em> inside the block.</p>
|
||||
|
||||
<p>This method blocks the current thread until the isolation guarantee has
|
||||
been established, and before the block argument has run.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block, or any DatabaseError that would
|
||||
@@ -1683,7 +1662,6 @@ happen while establishing the read access to the database.
|
||||
<td>
|
||||
<div>
|
||||
<p>A block that accesses the database.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1702,7 +1680,7 @@ happen while establishing the read access to the database.
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -780,12 +780,10 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Opens the SQLite database at path <em>path</em>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let dbQueue = try DatabaseQueue(path: "/path/to/database.sqlite")
|
||||
</code></pre>
|
||||
|
||||
<p>Database connections get closed when the database queue gets deallocated.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -814,7 +812,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The path to the database file.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -827,7 +824,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>A configuration.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -854,7 +850,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Opens an in-memory SQLite database.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let dbQueue = DatabaseQueue()
|
||||
</code></pre>
|
||||
|
||||
@@ -882,7 +877,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>A configuration.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -992,14 +986,12 @@
|
||||
<div class="abstract">
|
||||
<p>Synchronously executes a block in a protected dispatch queue, and
|
||||
returns its result.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let persons = try dbQueue.inDatabase { db in
|
||||
try Person.fetchAll(...)
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<p>This method is <em>not</em> reentrant.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block.
|
||||
@@ -1028,7 +1020,6 @@ returns its result.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A block that accesses the database.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1060,7 +1051,6 @@ inside a transaction.</p>
|
||||
<p>If the block throws an error, the transaction is rollbacked and the
|
||||
error is rethrown. If the block returns .rollback, the transaction is
|
||||
also rollbacked, but no error is thrown.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbQueue.inTransaction { db in
|
||||
db.execute(...)
|
||||
return .commit
|
||||
@@ -1068,7 +1058,6 @@ also rollbacked, but no error is thrown.</p>
|
||||
</code></pre>
|
||||
|
||||
<p>This method is <em>not</em> reentrant.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block.
|
||||
@@ -1096,8 +1085,10 @@ also rollbacked, but no error is thrown.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The transaction type (default nil). If nil, the transaction type is configuration.defaultTransactionKind, which itself defaults to .immediate. See <a href="https://www.sqlite.org/lang_transaction.html">https://www.sqlite.org/lang_transaction.html</a> for more information.</p>
|
||||
|
||||
<p>The transaction type (default nil). If nil, the transaction
|
||||
type is configuration.defaultTransactionKind, which itself
|
||||
defaults to .immediate. See <a href="https://www.sqlite.org/lang_transaction.html">https://www.sqlite.org/lang_transaction.html</a>
|
||||
for more information.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1109,8 +1100,8 @@ also rollbacked, but no error is thrown.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A block that executes SQL statements and return either .commit or .rollback.</p>
|
||||
|
||||
<p>A block that executes SQL statements and return either
|
||||
.commit or .rollback.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1270,7 +1261,6 @@ enters background.</li>
|
||||
<div class="abstract">
|
||||
<p>Synchronously executes a read-only block in a protected dispatch queue,
|
||||
and returns its result.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let persons = try dbQueue.read { db in
|
||||
try Person.fetchAll(...)
|
||||
}
|
||||
@@ -1281,7 +1271,6 @@ and returns its result.</p>
|
||||
<p>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 <code>SQLITE_READONLY</code>.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block.
|
||||
@@ -1310,7 +1299,6 @@ resultCode is <code>SQLITE_READONLY</code>.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A block that accesses the database.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1378,7 +1366,6 @@ resultCode is <code>SQLITE_READONLY</code>.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Add or redefine an SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let fn = DatabaseFunction("succ", argumentCount: 1) { databaseValues in
|
||||
let dbv = databaseValues.first!
|
||||
guard let int = dbv.value() as Int? else {
|
||||
@@ -1462,7 +1449,6 @@ try dbQueue.inDatabase { db in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Add or redefine a collation.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let collation = DatabaseCollation("localized_standard") { (string1, string2) in
|
||||
return (string1 as NSString).localizedStandardCompare(string2)
|
||||
}
|
||||
@@ -1632,7 +1618,7 @@ executing on the protected database dispatch queue.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,7 +757,6 @@
|
||||
|
||||
<p>To create an instance of <code>EnumeratedCursor</code>, call the <code>enumerated()</code> method
|
||||
on a cursor:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let cursor = try String.fetchCursor(db, "SELECT 'foo' UNION ALL SELECT 'bar'")
|
||||
let c = cursor.enumerated()
|
||||
while let (n, x) = c.next() {
|
||||
@@ -808,7 +807,7 @@ element exists.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,7 +757,6 @@
|
||||
|
||||
<p>You don’t create instances of this class. Instead, you use the Database
|
||||
<code>create(virtualTable:using:)</code> method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "documents", using: FTS3()) { t in // t is FTS3TableDefinition
|
||||
t.column("content")
|
||||
}
|
||||
@@ -781,7 +780,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The virtual table tokenizer</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "documents", using: FTS3()) { t in
|
||||
t.tokenizer = .porter
|
||||
}
|
||||
@@ -818,7 +816,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Appends a table column.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "documents", using: FTS3()) { t in
|
||||
t.column("content")
|
||||
}
|
||||
@@ -846,7 +843,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>the column name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -865,7 +861,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,7 +757,6 @@
|
||||
virtual table.</p>
|
||||
|
||||
<p>You get instances of this class when you create an FTS4 table:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "persons", using: FTS4()) { t in
|
||||
t.column("content") // FTS4ColumnDefinition
|
||||
}
|
||||
@@ -810,7 +809,6 @@ virtual table.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Excludes the column from the full-text index.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "persons", using: FTS4()) { t in
|
||||
t.column("a")
|
||||
t.column("b").notIndexed()
|
||||
@@ -831,7 +829,6 @@ virtual table.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/FTS/FTS4.swift#L297-L302">Show on GitHub</a>
|
||||
@@ -853,7 +850,6 @@ virtual table.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Uses the column as the Int32 language id hidden column.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "persons", using: FTS4()) { t in
|
||||
t.column("a")
|
||||
t.column("lid").asLanguageId()
|
||||
@@ -874,7 +870,6 @@ virtual table.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Self so that you can further refine the column definition.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/FTS/FTS4.swift#L316-L319">Show on GitHub</a>
|
||||
@@ -888,7 +883,7 @@ virtual table.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,7 +757,6 @@
|
||||
|
||||
<p>You don’t create instances of this class. Instead, you use the Database
|
||||
<code>create(virtualTable:using:)</code> method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "documents", using: FTS4()) { t in // t is FTS4TableDefinition
|
||||
t.column("content")
|
||||
}
|
||||
@@ -783,7 +782,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The virtual table tokenizer</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "documents", using: FTS4()) { t in
|
||||
t.tokenizer = .porter
|
||||
}
|
||||
@@ -955,7 +953,6 @@ established with the <code><a href="../Classes/FTS4TableDefinition.html#/s:FC4GR
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Support for the FTS5 <code>prefix</code> option</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// CREATE VIRTUAL TABLE documents USING FTS4(content, prefix='2 4');
|
||||
db.create(virtualTable: "documents", using:FTS4()) { t in
|
||||
t.prefixes = [2, 4]
|
||||
@@ -994,7 +991,6 @@ db.create(virtualTable: "documents", using:FTS4()) { t in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Appends a table column.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(virtualTable: "documents", using: FTS4()) { t in
|
||||
t.column("content")
|
||||
}
|
||||
@@ -1022,7 +1018,6 @@ db.create(virtualTable: "documents", using:FTS4()) { t in
|
||||
<td>
|
||||
<div>
|
||||
<p>the column name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1078,7 +1073,7 @@ full-text table is kept up to date with the external table.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -778,7 +778,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -911,7 +911,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -785,7 +785,6 @@ more information.</p>
|
||||
<div class="abstract">
|
||||
<p>Creates a fetched records controller initialized from a SQL query and
|
||||
its eventual arguments.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let controller = FetchedRecordsController<Wine>(
|
||||
dbQueue,
|
||||
sql: "SELECT * FROM wines WHERE color = ? ORDER BY name",
|
||||
@@ -815,7 +814,6 @@ its eventual arguments.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A DatabaseWriter (DatabaseQueue, or DatabasePool)</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -828,7 +826,6 @@ its eventual arguments.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -841,7 +838,6 @@ its eventual arguments.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -854,7 +850,6 @@ its eventual arguments.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -867,8 +862,10 @@ its eventual arguments.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A serial dispatch queue (defaults to the main queue)</p>
|
||||
<p>The fetched records controller tracking callbacks will be notified of changes in this queue. The controller itself must be used from this queue.</p>
|
||||
|
||||
<p>The fetched records controller tracking callbacks will be
|
||||
notified of changes in this queue. The controller itself must be
|
||||
used from this queue.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -881,8 +878,9 @@ its eventual arguments.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional function that compares two records.</p>
|
||||
<p>This function should return true if the two records have the same identity. For example, they have the same id.</p>
|
||||
|
||||
<p>This function should return true if the two records have the
|
||||
same identity. For example, they have the same id.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -910,7 +908,6 @@ its eventual arguments.</p>
|
||||
<div class="abstract">
|
||||
<p>Creates a fetched records controller initialized from a fetch request
|
||||
from the <a href="https://github.com/groue/GRDB.swift#the-query-interface">Query Interface</a>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let request = Wine.order(Column("name"))
|
||||
let controller = FetchedRecordsController(
|
||||
dbQueue,
|
||||
@@ -940,7 +937,6 @@ let controller = FetchedRecordsController(
|
||||
<td>
|
||||
<div>
|
||||
<p>A DatabaseWriter (DatabaseQueue, or DatabasePool)</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -953,7 +949,6 @@ let controller = FetchedRecordsController(
|
||||
<td>
|
||||
<div>
|
||||
<p>A fetch request.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -966,8 +961,10 @@ let controller = FetchedRecordsController(
|
||||
<td>
|
||||
<div>
|
||||
<p>A serial dispatch queue (defaults to the main queue)</p>
|
||||
<p>The fetched records controller tracking callbacks will be notified of changes in this queue. The controller itself must be used from this queue.</p>
|
||||
|
||||
<p>The fetched records controller tracking callbacks will be
|
||||
notified of changes in this queue. The controller itself must be
|
||||
used from this queue.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -980,8 +977,9 @@ let controller = FetchedRecordsController(
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional function that compares two records.</p>
|
||||
<p>This function should return true if the two records have the same identity. For example, they have the same id.</p>
|
||||
|
||||
<p>This function should return true if the two records have the
|
||||
same identity. For example, they have the same id.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1217,7 +1215,6 @@ main queue unless stated otherwise in the controller’s initializer).</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Invoked before records are updated.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1229,8 +1226,8 @@ main queue unless stated otherwise in the controller’s initializer).</p>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Invoked for each record that has been added, removed, moved, or updated.</p>
|
||||
|
||||
<p>Invoked for each record that has been added,
|
||||
removed, moved, or updated.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1243,7 +1240,6 @@ main queue unless stated otherwise in the controller’s initializer).</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Invoked after records have been updated.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1299,8 +1295,12 @@ main queue unless stated otherwise in the controller’s initializer).</p>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The value returned from this closure is given to willChange and didChange callbacks, as their <code>fetchedAlongside</code> 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.</p>
|
||||
|
||||
<p>The value returned from this closure is given to
|
||||
willChange and didChange callbacks, as their
|
||||
<code>fetchedAlongside</code> 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.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1313,7 +1313,6 @@ main queue unless stated otherwise in the controller’s initializer).</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Invoked before records are updated.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1325,8 +1324,8 @@ main queue unless stated otherwise in the controller’s initializer).</p>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Invoked for each record that has been added, removed, moved, or updated.</p>
|
||||
|
||||
<p>Invoked for each record that has been added,
|
||||
removed, moved, or updated.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1339,7 +1338,6 @@ main queue unless stated otherwise in the controller’s initializer).</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Invoked after records have been updated.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1544,7 +1542,6 @@ main queue unless stated otherwise in the controller’s initializer).</p>
|
||||
<div class="abstract">
|
||||
<p>Creates a fetched records controller initialized from a SQL query and
|
||||
its eventual arguments.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let controller = FetchedRecordsController<Wine>(
|
||||
dbQueue,
|
||||
sql: "SELECT * FROM wines WHERE color = ? ORDER BY name",
|
||||
@@ -1554,7 +1551,6 @@ its eventual arguments.</p>
|
||||
<p>The records are compared by primary key (single-column primary key,
|
||||
compound primary key, or implicit rowid). For a database table which
|
||||
has an <code>id</code> primary key, this initializer is equivalent to:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// Assuming the wines table has an `id` primary key:
|
||||
let controller = FetchedRecordsController<Wine>(
|
||||
dbQueue,
|
||||
@@ -1585,7 +1581,6 @@ let controller = FetchedRecordsController<Wine>(
|
||||
<td>
|
||||
<div>
|
||||
<p>A DatabaseWriter (DatabaseQueue, or DatabasePool)</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1598,7 +1593,6 @@ let controller = FetchedRecordsController<Wine>(
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1611,7 +1605,6 @@ let controller = FetchedRecordsController<Wine>(
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1624,7 +1617,6 @@ let controller = FetchedRecordsController<Wine>(
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1637,8 +1629,10 @@ let controller = FetchedRecordsController<Wine>(
|
||||
<td>
|
||||
<div>
|
||||
<p>A serial dispatch queue (defaults to the main queue)</p>
|
||||
<p>The fetched records controller tracking callbacks will be notified of changes in this queue. The controller itself must be used from this queue.</p>
|
||||
|
||||
<p>The fetched records controller tracking callbacks will be
|
||||
notified of changes in this queue. The controller itself must be
|
||||
used from this queue.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1666,7 +1660,6 @@ let controller = FetchedRecordsController<Wine>(
|
||||
<div class="abstract">
|
||||
<p>Creates a fetched records controller initialized from a fetch request
|
||||
from the <a href="https://github.com/groue/GRDB.swift#the-query-interface">Query Interface</a>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let request = Wine.order(Column("name"))
|
||||
let controller = FetchedRecordsController(
|
||||
dbQueue,
|
||||
@@ -1676,7 +1669,6 @@ let controller = FetchedRecordsController(
|
||||
<p>The records are compared by primary key (single-column primary key,
|
||||
compound primary key, or implicit rowid). For a database table which
|
||||
has an <code>id</code> primary key, this initializer is equivalent to:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// Assuming the wines table has an `id` primary key:
|
||||
let controller = FetchedRecordsController<Wine>(
|
||||
dbQueue,
|
||||
@@ -1706,7 +1698,6 @@ let controller = FetchedRecordsController<Wine>(
|
||||
<td>
|
||||
<div>
|
||||
<p>A DatabaseWriter (DatabaseQueue, or DatabasePool)</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1719,7 +1710,6 @@ let controller = FetchedRecordsController<Wine>(
|
||||
<td>
|
||||
<div>
|
||||
<p>A fetch request.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1732,8 +1722,10 @@ let controller = FetchedRecordsController<Wine>(
|
||||
<td>
|
||||
<div>
|
||||
<p>A serial dispatch queue (defaults to the main queue)</p>
|
||||
<p>The fetched records controller tracking callbacks will be notified of changes in this queue. The controller itself must be used from this queue.</p>
|
||||
|
||||
<p>The fetched records controller tracking callbacks will be
|
||||
notified of changes in this queue. The controller itself must be
|
||||
used from this queue.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1794,8 +1786,9 @@ let controller = FetchedRecordsController<Wine>(
|
||||
<td>
|
||||
<div>
|
||||
<p>An index path in the fetched records.</p>
|
||||
<p>If indexPath does not describe a valid index path in the fetched records, a fatal error is raised.</p>
|
||||
|
||||
<p>If indexPath does not describe a valid index path in the fetched
|
||||
records, a fatal error is raised.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1885,8 +1878,8 @@ records. In this case, there is a single empty section.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>The index path of in the fetched records, or nil if record could not be found.</p>
|
||||
|
||||
<p>The index path of <em>record</em> in the fetched records, or nil
|
||||
if record could not be found.</p>
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/FetchedRecordsController.swift#L818-L824">Show on GitHub</a>
|
||||
@@ -1900,7 +1893,7 @@ records. In this case, there is a single empty section.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -797,7 +797,7 @@ element exists.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -799,7 +799,7 @@ element exists.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -856,7 +856,7 @@ element exists.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -799,7 +799,7 @@ element exists.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -896,7 +896,6 @@ has been fetched from the database.</p>
|
||||
|
||||
<p>This table name is required by the insert, update, save, delete,
|
||||
and exists methods.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>class Person : Record {
|
||||
override class var databaseTableName: String {
|
||||
return "persons"
|
||||
@@ -918,7 +917,6 @@ and exists methods.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>The name of a database table.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/Record.swift#L57-L60">Show on GitHub</a>
|
||||
@@ -984,13 +982,11 @@ even if a row was actually inserted without any conflict.</p>
|
||||
with other columns.</p>
|
||||
|
||||
<p>Its default value is false:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT * FROM persons
|
||||
try Person.fetchAll(db)
|
||||
</code></pre>
|
||||
|
||||
<p>When true, the rowid column is fetched:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT *, rowid FROM persons
|
||||
try Person.fetchAll(db)
|
||||
</code></pre>
|
||||
@@ -1029,7 +1025,6 @@ try Person.fetchAll(db)
|
||||
target database table (see Record.databaseTableName()).</p>
|
||||
|
||||
<p>In particular, primary key columns, if any, must be included.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>class Person : Record {
|
||||
var id: Int64?
|
||||
var name: String?
|
||||
@@ -1077,7 +1072,6 @@ dispatch queue, with the inserted RowID and the eventual
|
||||
INTEGER PRIMARY KEY column name.</p>
|
||||
|
||||
<p>The implementation of the base Record class does nothing.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>class Person : Record {
|
||||
var id: Int64?
|
||||
var name: String?
|
||||
@@ -1110,7 +1104,6 @@ INTEGER PRIMARY KEY column name.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The inserted rowID.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1123,7 +1116,6 @@ INTEGER PRIMARY KEY column name.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The name of the eventual INTEGER PRIMARY KEY column.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1178,7 +1170,6 @@ hasPersistentChangedValues flag.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A copy of self.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/Record.swift#L149-L153">Show on GitHub</a>
|
||||
@@ -1314,7 +1305,6 @@ returns without error.</p>
|
||||
<p>Records whose primary key is declared as <q>INTEGER PRIMARY KEY</q> have
|
||||
their id automatically set after successful insertion, if it was nil
|
||||
before the insertion.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -1343,7 +1333,6 @@ before the insertion.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1376,7 +1365,6 @@ to false.</p>
|
||||
|
||||
<p>This method is guaranteed to have updated a row in the database if it
|
||||
returns without error.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1407,7 +1395,6 @@ match any row in the database and record could not be updated.
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1420,7 +1407,6 @@ match any row in the database and record could not be updated.
|
||||
<td>
|
||||
<div>
|
||||
<p>The columns to update.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1459,7 +1445,6 @@ to false.</p>
|
||||
|
||||
<p>This method is guaranteed to have inserted or updated a row in the
|
||||
database if it returns without error.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs, or errors
|
||||
@@ -1489,7 +1474,6 @@ thrown by update().
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1519,7 +1503,6 @@ thrown by update().
|
||||
|
||||
<p>On success, this method sets the <em>hasPersistentChangedValues</em> flag
|
||||
to true.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1548,7 +1531,6 @@ to true.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1558,7 +1540,6 @@ to true.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Whether a database row was deleted.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/Record.swift#L348-L356">Show on GitHub</a>
|
||||
@@ -1572,7 +1553,7 @@ to true.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -1745,7 +1745,6 @@ of column-value pairs in <code>self</code>.</p>
|
||||
<div class="abstract">
|
||||
<p>Returns a scoped row, if the row was fetched along with a row adapter
|
||||
that defines this scope.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// Two adapters
|
||||
let fooAdapter = ColumnMapping(["value": "foo"])
|
||||
let barAdapter = ColumnMapping(["value": "bar"])
|
||||
@@ -1808,7 +1807,6 @@ if let barRow = row.scopeed(on: "bar") {
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over rows fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT ...")
|
||||
let rows = try Row.fetchCursor(statement) // DatabaseCursor<Row>
|
||||
while let row = try rows.next() { // Row
|
||||
@@ -1829,7 +1827,6 @@ row for later use: <code>row.copy()</code>.</p>
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1858,7 +1855,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1871,7 +1867,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1884,7 +1879,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1897,7 +1891,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1907,7 +1900,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched rows.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Row.swift#L527-L531">Show on GitHub</a>
|
||||
@@ -1929,11 +1921,9 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of rows fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT ...")
|
||||
let rows = try Row.fetchAll(statement)
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1962,7 +1952,6 @@ let rows = try Row.fetchAll(statement)
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1975,7 +1964,6 @@ let rows = try Row.fetchAll(statement)
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1988,7 +1976,6 @@ let rows = try Row.fetchAll(statement)
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1998,7 +1985,6 @@ let rows = try Row.fetchAll(statement)
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array of rows.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Row.swift#L544-L547">Show on GitHub</a>
|
||||
@@ -2020,11 +2006,9 @@ let rows = try Row.fetchAll(statement)
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a single row fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT ...")
|
||||
let row = try Row.fetchOne(statement)
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2053,7 +2037,6 @@ let row = try Row.fetchOne(statement)
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2066,7 +2049,6 @@ let row = try Row.fetchOne(statement)
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2079,7 +2061,6 @@ let row = try Row.fetchOne(statement)
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2089,7 +2070,6 @@ let row = try Row.fetchOne(statement)
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An optional row.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Row.swift#L560-L563">Show on GitHub</a>
|
||||
@@ -2122,7 +2102,6 @@ let row = try Row.fetchOne(statement)
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over rows fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let idColumn = Column("id")
|
||||
let nameColumn = Column("name")
|
||||
let request = Person.select(idColumn, nameColumn)
|
||||
@@ -2145,7 +2124,6 @@ row for later use: <code>row.copy()</code>.</p>
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2174,7 +2152,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2187,7 +2164,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A fetch request.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2197,7 +2173,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched rows.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Row.swift#L599-L602">Show on GitHub</a>
|
||||
@@ -2219,13 +2194,11 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of rows fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let idColumn = Column("id")
|
||||
let nameColumn = Column("name")
|
||||
let request = Person.select(idColumn, nameColumn)
|
||||
let rows = try Row.fetchAll(db, request)
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2254,7 +2227,6 @@ let rows = try Row.fetchAll(db, request)
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2281,13 +2253,11 @@ let rows = try Row.fetchAll(db, request)
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a single row fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let idColumn = Column("id")
|
||||
let nameColumn = Column("name")
|
||||
let request = Person.select(idColumn, nameColumn)
|
||||
let row = try Row.fetchOne(db, request)
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2316,7 +2286,6 @@ let row = try Row.fetchOne(db, request)
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2354,7 +2323,6 @@ let row = try Row.fetchOne(db, request)
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over rows fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let rows = try Row.fetchCursor(db, "SELECT id, name FROM persons") // DatabaseCursor<Row>
|
||||
while let row = try rows.next() { // Row
|
||||
let id: Int64 = row.value(atIndex: 0)
|
||||
@@ -2374,7 +2342,6 @@ row for later use: <code>row.copy()</code>.</p>
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2403,7 +2370,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2416,7 +2382,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2429,7 +2394,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2442,7 +2406,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2452,7 +2415,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched rows.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Row.swift#L665-L667">Show on GitHub</a>
|
||||
@@ -2474,10 +2436,8 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of rows fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let rows = try Row.fetchAll(db, "SELECT ...")
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2506,7 +2466,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2519,7 +2478,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2532,7 +2490,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2545,7 +2502,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2555,7 +2511,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array of rows.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Row.swift#L680-L682">Show on GitHub</a>
|
||||
@@ -2577,10 +2532,8 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a single row fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let row = try Row.fetchOne(db, "SELECT ...")
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2609,7 +2562,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2622,7 +2574,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2635,7 +2586,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2648,7 +2598,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2658,7 +2607,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An optional row.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Row.swift#L695-L697">Show on GitHub</a>
|
||||
@@ -2685,7 +2633,6 @@ elements are undefined.</p>
|
||||
<div class="abstract">
|
||||
<p>Creates a row initialized with elements. Column order is preserved, and
|
||||
duplicated columns names are allowed.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let row: Row = ["foo": 1, "foo": "bar", "baz": nil]
|
||||
print(row)
|
||||
// Prints <Row foo:1 foo:"bar" baz:NULL>
|
||||
@@ -2852,7 +2799,6 @@ print(row)
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns the position immediately after <code>i</code>.</p>
|
||||
|
||||
<div class="aside aside-precondition">
|
||||
<p class="aside-title">Precondition</p>
|
||||
<code>(startIndex..<endIndex).contains(i)</code>
|
||||
@@ -3013,7 +2959,7 @@ in the same order. Columns are compared in a case-sensitive way.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -756,7 +756,6 @@
|
||||
<p>A subclass of Statement that fetches database rows.</p>
|
||||
|
||||
<p>You create SelectStatement with the Database.makeSelectStatement() method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbQueue.inDatabase { db in
|
||||
let statement = try db.makeSelectStatement("SELECT COUNT(*) FROM persons WHERE age > ?")
|
||||
let moreThanTwentyCount = try Int.fetchOne(statement, arguments: [20])!
|
||||
@@ -959,7 +958,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -795,7 +795,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -930,7 +930,7 @@ statement arguments.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,7 +757,6 @@
|
||||
|
||||
<p>You don’t create instances of this class. Instead, you use the Database
|
||||
<code>alter(table:)</code> method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.alter(table: "persons") { t in // t is TableAlteration
|
||||
t.add(column: ...)
|
||||
}
|
||||
@@ -783,7 +782,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Appends a column to the table.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.alter(table: "persons") { t in
|
||||
t.add(column: "url", .text)
|
||||
}
|
||||
@@ -813,7 +811,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>the column name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -826,7 +823,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>the column type.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -835,8 +831,8 @@
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An ColumnDefinition that allows you to refine the column definition.</p>
|
||||
|
||||
<p>An ColumnDefinition that allows you to refine the
|
||||
column definition.</p>
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L484-L488">Show on GitHub</a>
|
||||
@@ -850,7 +846,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,7 +757,6 @@
|
||||
|
||||
<p>You don’t create instances of this class. Instead, you use the Database
|
||||
<code>create(table:)</code> method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in // t is TableDefinition
|
||||
t.column(...)
|
||||
}
|
||||
@@ -783,7 +782,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Appends a table column.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("name", .text)
|
||||
}
|
||||
@@ -813,7 +811,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>the column name.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -826,7 +823,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>the column type.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -835,8 +831,8 @@
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An ColumnDefinition that allows you to refine the column definition.</p>
|
||||
|
||||
<p>An ColumnDefinition that allows you to refine the
|
||||
column definition.</p>
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/QueryInterface/TableDefinition.swift#L258-L262">Show on GitHub</a>
|
||||
@@ -858,7 +854,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Defines the table primary key.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "citizenships") { t in
|
||||
t.column("personID", .integer)
|
||||
t.column("countryCode", .text)
|
||||
@@ -891,7 +886,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The primary key columns.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -903,8 +897,8 @@
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>An optional conflict resolution (see <a href="https://www.sqlite.org/lang_conflict.html">https://www.sqlite.org/lang_conflict.html</a>).</p>
|
||||
|
||||
<p>An optional conflict resolution
|
||||
(see <a href="https://www.sqlite.org/lang_conflict.html">https://www.sqlite.org/lang_conflict.html</a>).</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -931,7 +925,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Adds a unique key.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "pointOfInterests") { t in
|
||||
t.column("latitude", .double)
|
||||
t.column("longitude", .double)
|
||||
@@ -963,7 +956,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The unique key columns.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -975,8 +967,8 @@
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>An optional conflict resolution (see <a href="https://www.sqlite.org/lang_conflict.html">https://www.sqlite.org/lang_conflict.html</a>).</p>
|
||||
|
||||
<p>An optional conflict resolution
|
||||
(see <a href="https://www.sqlite.org/lang_conflict.html">https://www.sqlite.org/lang_conflict.html</a>).</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1003,7 +995,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Adds a foreign key.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "passport") { t in
|
||||
t.column("issueDate", .date)
|
||||
t.column("personID", .integer)
|
||||
@@ -1036,7 +1027,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The foreign key columns.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1049,7 +1039,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The referenced table.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1061,8 +1050,9 @@
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The columns in the referenced table. If not specified, the columns of the primary key of the referenced table are used.</p>
|
||||
|
||||
<p>The columns in the referenced table. If not
|
||||
specified, the columns of the primary key of the referenced table
|
||||
are used.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1075,7 +1065,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional action when the referenced row is deleted.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1088,7 +1077,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional action when the referenced row is updated.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1100,8 +1088,8 @@
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>If true, defines a deferred foreign key constraint. See <a href="https://www.sqlite.org/foreignkeys.html#fk_deferred">https://www.sqlite.org/foreignkeys.html#fk_deferred</a>.</p>
|
||||
|
||||
<p>If true, defines a deferred foreign key constraint.
|
||||
See <a href="https://www.sqlite.org/foreignkeys.html#fk_deferred">https://www.sqlite.org/foreignkeys.html#fk_deferred</a>.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1128,7 +1116,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Adds a CHECK constraint.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("personalPhone", .text)
|
||||
t.column("workPhone", .text)
|
||||
@@ -1162,7 +1149,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The checked condition</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1189,7 +1175,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Adds a CHECK constraint.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try db.create(table: "persons") { t in
|
||||
t.column("personalPhone", .text)
|
||||
t.column("workPhone", .text)
|
||||
@@ -1221,7 +1206,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL snippet</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1240,7 +1224,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -756,7 +756,6 @@
|
||||
<p>A subclass of Statement that executes SQL queries.</p>
|
||||
|
||||
<p>You create UpdateStatement with the Database.makeUpdateStatement() method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbQueue.inTransaction { db in
|
||||
let statement = try db.makeUpdateStatement("INSERT INTO persons (name) VALUES (?)")
|
||||
try statement.execute(arguments: ["Arthur"])
|
||||
@@ -783,7 +782,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Executes the SQL query.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -812,7 +810,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>Statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -831,7 +828,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -929,7 +929,7 @@ Do not use it directly.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -935,7 +935,7 @@ by selectionInfo.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -938,7 +938,7 @@ been changed.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -830,7 +830,7 @@ found in the database.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -832,7 +832,7 @@ Do not use it directly.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -1608,7 +1608,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -772,7 +772,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates an array containing the elements of a cursor.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let cursor = try String.fetchCursor(db, "SELECT 'foo' UNION ALL SELECT 'bar'")
|
||||
let strings = try Array(cursor) // ["foo", "bar"]
|
||||
</code></pre>
|
||||
@@ -798,7 +797,7 @@ let strings = try Array(cursor) // ["foo", "bar"]
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -795,7 +795,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>A pointer to an SQLite statement.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -808,7 +807,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The column index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -887,7 +885,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -819,7 +819,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -772,7 +772,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that checks the inclusion of an expression in a range.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// email BETWEEN 'A' AND 'B'
|
||||
("A"..."B").contains(Column("email"))
|
||||
</code></pre>
|
||||
@@ -806,7 +805,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that checks the inclusion of an expression in a range.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// email BETWEEN 'A' AND 'B' COLLATE NOCASE
|
||||
("A"..."B").contains(Column("email").collating(.nocase))
|
||||
</code></pre>
|
||||
@@ -832,7 +830,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -778,7 +778,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -772,7 +772,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that checks the inclusion of an expression in a range.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// id BETWEEN 1 AND 10
|
||||
(1...10).contains(Column("id"))
|
||||
</code></pre>
|
||||
@@ -798,7 +797,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -772,7 +772,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that checks the inclusion of an expression in a range.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// id BETWEEN 1 AND 9
|
||||
(1..<10).contains(Column("id"))
|
||||
</code></pre>
|
||||
@@ -798,7 +797,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -820,7 +820,7 @@ a Blob.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -831,7 +831,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -808,7 +808,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -808,7 +808,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -795,7 +795,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>A pointer to an SQLite statement.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -808,7 +807,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The column index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -887,7 +885,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -795,7 +795,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>A pointer to an SQLite statement.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -808,7 +807,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The column index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -887,7 +885,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -795,7 +795,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>A pointer to an SQLite statement.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -808,7 +807,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The column index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -887,7 +885,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -795,7 +795,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>A pointer to an SQLite statement.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -808,7 +807,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The column index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -887,7 +885,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -795,7 +795,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>A pointer to an SQLite statement.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -808,7 +807,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The column index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -887,7 +885,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -825,7 +825,7 @@ a Blob.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -819,7 +819,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -819,7 +819,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -819,7 +819,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -819,7 +819,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -820,7 +820,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -819,7 +819,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -779,7 +779,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over optional values fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT name FROM ...")
|
||||
let names = try Optional<String>.fetchCursor(statement) // DatabaseCursor<String?>
|
||||
while let name = try names.next() { // String?
|
||||
@@ -791,7 +790,6 @@ while let name = try names.next() { // String?
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -820,7 +818,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -833,7 +830,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -846,7 +842,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -856,7 +851,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched optional values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L324-L337">Show on GitHub</a>
|
||||
@@ -878,11 +872,9 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of optional values fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT name FROM ...")
|
||||
let names = try Optional<String>.fetchAll(statement) // [String?]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -911,7 +903,6 @@ let names = try Optional<String>.fetchAll(statement) // [String?]
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -924,7 +915,6 @@ let names = try Optional<String>.fetchAll(statement) // [String?]
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -937,7 +927,6 @@ let names = try Optional<String>.fetchAll(statement) // [String?]
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -947,7 +936,6 @@ let names = try Optional<String>.fetchAll(statement) // [String?]
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array of optional values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L350-L352">Show on GitHub</a>
|
||||
@@ -980,7 +968,6 @@ let names = try Optional<String>.fetchAll(statement) // [String?]
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over optional values fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn)
|
||||
let names = try Optional<String>.fetchCursor(db, request) // DatabaseCursor<String?>
|
||||
@@ -993,7 +980,6 @@ while let name = try names.next() { // String?
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1022,7 +1008,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1035,7 +1020,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A fetch request.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1045,7 +1029,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched optional values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L378-L381">Show on GitHub</a>
|
||||
@@ -1067,12 +1050,10 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of optional values fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn)
|
||||
let names = try Optional<String>.fetchAll(db, request) // [String?]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1101,7 +1082,6 @@ let names = try Optional<String>.fetchAll(db, request) // [String?]
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1139,7 +1119,6 @@ let names = try Optional<String>.fetchAll(db, request) // [String?]
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over optional values fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let names = try Optional<String>.fetchCursor(db, "SELECT name FROM ...") // DatabaseCursor<String?>
|
||||
while let name = try names.next() { // String?
|
||||
...
|
||||
@@ -1150,7 +1129,6 @@ while let name = try names.next() { // String?
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1179,7 +1157,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1192,7 +1169,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1205,7 +1181,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1218,7 +1193,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1228,7 +1202,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched optional values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L420-L422">Show on GitHub</a>
|
||||
@@ -1250,10 +1223,8 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of optional values fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let names = try String.fetchAll(db, "SELECT name FROM ...") // [String?]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1282,7 +1253,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1295,7 +1265,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1307,8 +1276,7 @@ elements are undefined.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1321,7 +1289,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1331,7 +1298,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array of optional values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L435-L437">Show on GitHub</a>
|
||||
@@ -1345,7 +1311,7 @@ elements are undefined.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -785,7 +785,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -772,7 +772,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that checks the inclusion of an expression in a range.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// email >= 'A' AND email < 'B'
|
||||
("A"..<"B").contains(Column("email"))
|
||||
</code></pre>
|
||||
@@ -806,7 +805,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that checks the inclusion of an expression in a range.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// email >= 'A' COLLATE NOCASE AND email < 'B' COLLATE NOCASE
|
||||
("A"..<"B").contains(Column("email").collating(.nocase))
|
||||
</code></pre>
|
||||
@@ -832,7 +830,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -824,7 +824,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -824,7 +824,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -808,7 +808,6 @@ over self.</p>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that checks the inclusion of an expression in
|
||||
a sequence.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// id IN (1,2,3)
|
||||
[1, 2, 3].contains(Column("id"))
|
||||
</code></pre>
|
||||
@@ -843,7 +842,6 @@ a sequence.</p>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that checks the inclusion of an expression in
|
||||
a sequence.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IN ('A', 'B') COLLATE NOCASE
|
||||
["A", "B"].contains(Column("name").collating(.nocase))
|
||||
</code></pre>
|
||||
@@ -869,7 +867,7 @@ a sequence.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -795,7 +795,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>A pointer to an SQLite statement.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -808,7 +807,6 @@
|
||||
<td>
|
||||
<div>
|
||||
<p>The column index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -900,7 +898,6 @@
|
||||
<div class="abstract">
|
||||
<p>Returns the receiver, quoted for safe insertion as an identifier in an
|
||||
SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>db.execute("SELECT * FROM \(tableName.quotedDatabaseIdentifier)")
|
||||
</code></pre>
|
||||
|
||||
@@ -925,7 +922,7 @@ SQL query.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -785,7 +785,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -773,7 +773,6 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an expression that evaluates the <code>ABS</code> SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// ABS(amount)
|
||||
abs(Column("amount"))
|
||||
</code></pre>
|
||||
@@ -818,7 +817,6 @@ abs(Column("amount"))
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an expression that evaluates the <code>AVG</code> SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// AVG(length)
|
||||
average(Column("length"))
|
||||
</code></pre>
|
||||
@@ -863,7 +861,6 @@ average(Column("length"))
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an expression that evaluates the <code>COUNT</code> SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// COUNT(email)
|
||||
count(Column("email"))
|
||||
</code></pre>
|
||||
@@ -908,7 +905,6 @@ count(Column("email"))
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an expression that evaluates the <code>COUNT(DISTINCT)</code> SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// COUNT(DISTINCT email)
|
||||
count(distinct: Column("email"))
|
||||
</code></pre>
|
||||
@@ -953,7 +949,6 @@ count(distinct: Column("email"))
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an expression that evaluates the <code>IFNULL</code> SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// IFNULL(name, 'Anonymous')
|
||||
Column("name") ?? "Anonymous"
|
||||
</code></pre>
|
||||
@@ -998,7 +993,6 @@ Column("name") ?? "Anonymous"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an expression that evaluates the <code>LENGTH</code> SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// LENGTH(name)
|
||||
length(Column("name"))
|
||||
</code></pre>
|
||||
@@ -1043,7 +1037,6 @@ length(Column("name"))
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an expression that evaluates the <code>MAX</code> SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// MAX(score)
|
||||
max(Column("score"))
|
||||
</code></pre>
|
||||
@@ -1088,7 +1081,6 @@ max(Column("score"))
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an expression that evaluates the <code>MIN</code> SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// MIN(score)
|
||||
min(Column("score"))
|
||||
</code></pre>
|
||||
@@ -1133,7 +1125,6 @@ min(Column("score"))
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an expression that evaluates the <code>SUM</code> SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SUM(amount)
|
||||
sum(Column("amount"))
|
||||
</code></pre>
|
||||
@@ -1178,13 +1169,11 @@ sum(Column("amount"))
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name = 'Arthur'
|
||||
Column("name") == "Arthur"
|
||||
</code></pre>
|
||||
|
||||
<p>When the right operand is nil, <code>IS NULL</code> is used instead.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NULL
|
||||
Column("name") == nil
|
||||
</code></pre>
|
||||
@@ -1218,13 +1207,11 @@ Column("name") == nil
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name = 'Arthur' COLLATE NOCASE
|
||||
Column("name").collating(.nocase) == "Arthur"
|
||||
</code></pre>
|
||||
|
||||
<p>When the right operand is nil, <code>IS NULL</code> is used instead.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NULL
|
||||
Column("name").collating(.nocase) == nil
|
||||
</code></pre>
|
||||
@@ -1260,7 +1247,6 @@ Column("name").collating(.nocase) == nil
|
||||
<p>An SQL expression that checks the boolean value of an expression.</p>
|
||||
|
||||
<p>The comparison is done with the built-in boolean evaluation of SQLite:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// validated
|
||||
Column("validated") == true
|
||||
|
||||
@@ -1297,13 +1283,11 @@ Column("validated") == false
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 'Arthur' = name
|
||||
"Arthur" == Column("name")
|
||||
</code></pre>
|
||||
|
||||
<p>When the left operand is nil, <code>IS NULL</code> is used instead.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NULL
|
||||
nil == Column("name")
|
||||
</code></pre>
|
||||
@@ -1337,13 +1321,11 @@ nil == Column("name")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 'Arthur' = name COLLATE NOCASE
|
||||
"Arthur" == Column("name").collating(.nocase)
|
||||
</code></pre>
|
||||
|
||||
<p>When the left operand is nil, <code>IS NULL</code> is used instead.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NULL
|
||||
nil == Column("name").collating(.nocase)
|
||||
</code></pre>
|
||||
@@ -1379,7 +1361,6 @@ nil == Column("name").collating(.nocase)
|
||||
<p>An SQL expression that checks the boolean value of an expression.</p>
|
||||
|
||||
<p>The comparison is done with the built-in boolean evaluation of SQLite:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// validated
|
||||
true == Column("validated")
|
||||
|
||||
@@ -1416,7 +1397,6 @@ false == Column("validated")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// email = login
|
||||
Column("email") == Column("login")
|
||||
</code></pre>
|
||||
@@ -1450,13 +1430,11 @@ Column("email") == Column("login")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><></code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name <> 'Arthur'
|
||||
Column("name") != "Arthur"
|
||||
</code></pre>
|
||||
|
||||
<p>When the right operand is nil, <code>IS NOT NULL</code> is used instead.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NOT NULL
|
||||
Column("name") != nil
|
||||
</code></pre>
|
||||
@@ -1490,13 +1468,11 @@ Column("name") != nil
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><></code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name <> 'Arthur' COLLATE NOCASE
|
||||
Column("name").collating(.nocase) != "Arthur"
|
||||
</code></pre>
|
||||
|
||||
<p>When the right operand is nil, <code>IS NOT NULL</code> is used instead.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NOT NULL
|
||||
Column("name").collating(.nocase) != nil
|
||||
</code></pre>
|
||||
@@ -1532,7 +1508,6 @@ Column("name").collating(.nocase) != nil
|
||||
<p>An SQL expression that checks the boolean value of an expression.</p>
|
||||
|
||||
<p>The comparison is done with the built-in boolean evaluation of SQLite:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// NOT validated
|
||||
Column("validated") != true
|
||||
|
||||
@@ -1569,13 +1544,11 @@ Column("validated") != false
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><></code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 'Arthur' <> name
|
||||
"Arthur" != Column("name")
|
||||
</code></pre>
|
||||
|
||||
<p>When the left operand is nil, <code>IS NOT NULL</code> is used instead.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NOT NULL
|
||||
nil != Column("name")
|
||||
</code></pre>
|
||||
@@ -1609,13 +1582,11 @@ nil != Column("name")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><></code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 'Arthur' <> name COLLATE NOCASE
|
||||
"Arthur" != Column("name").collating(.nocase)
|
||||
</code></pre>
|
||||
|
||||
<p>When the left operand is nil, <code>IS NOT NULL</code> is used instead.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NOT NULL
|
||||
nil != Column("name").collating(.nocase)
|
||||
</code></pre>
|
||||
@@ -1651,7 +1622,6 @@ nil != Column("name").collating(.nocase)
|
||||
<p>An SQL expression that checks the boolean value of an expression.</p>
|
||||
|
||||
<p>The comparison is done with the built-in boolean evaluation of SQLite:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// NOT validated
|
||||
true != Column("validated")
|
||||
|
||||
@@ -1688,7 +1658,6 @@ false != Column("validated")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><></code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// email <> login
|
||||
Column("email") != Column("login")
|
||||
</code></pre>
|
||||
@@ -1722,7 +1691,6 @@ Column("email") != Column("login")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>IS</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS 'Arthur'
|
||||
Column("name") === "Arthur"
|
||||
</code></pre>
|
||||
@@ -1756,7 +1724,6 @@ Column("name") === "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>IS</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS 'Arthur' COLLATE NOCASE
|
||||
Column("name").collating(.nocase) === "Arthur"
|
||||
</code></pre>
|
||||
@@ -1790,7 +1757,6 @@ Column("name").collating(.nocase) === "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>IS</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS 'Arthur'
|
||||
"Arthur" === Column("name")
|
||||
</code></pre>
|
||||
@@ -1824,7 +1790,6 @@ Column("name").collating(.nocase) === "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>IS</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS 'Arthur' COLLATE NOCASE
|
||||
"Arthur" === Column("name").collating(.nocase)
|
||||
</code></pre>
|
||||
@@ -1858,7 +1823,6 @@ Column("name").collating(.nocase) === "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>IS</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// email IS login
|
||||
Column("email") === Column("login")
|
||||
</code></pre>
|
||||
@@ -1892,7 +1856,6 @@ Column("email") === Column("login")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>IS NOT</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NOT 'Arthur'
|
||||
Column("name") !== "Arthur"
|
||||
</code></pre>
|
||||
@@ -1926,7 +1889,6 @@ Column("name") !== "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>IS NOT</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NOT 'Arthur' COLLATE NOCASE
|
||||
Column("name").collating(.nocase) !== "Arthur"
|
||||
</code></pre>
|
||||
@@ -1960,7 +1922,6 @@ Column("name").collating(.nocase) !== "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>IS NOT</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NOT 'Arthur'
|
||||
"Arthur" !== Column("name")
|
||||
</code></pre>
|
||||
@@ -1994,7 +1955,6 @@ Column("name").collating(.nocase) !== "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>IS NOT</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name IS NOT 'Arthur' COLLATE NOCASE
|
||||
"Arthur" !== Column("name").collating(.nocase)
|
||||
</code></pre>
|
||||
@@ -2028,7 +1988,6 @@ Column("name").collating(.nocase) !== "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>IS NOT</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// email IS NOT login
|
||||
Column("email") !== Column("login")
|
||||
</code></pre>
|
||||
@@ -2073,7 +2032,6 @@ Column("email") !== Column("login")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// age < 18
|
||||
Column("age") < 18
|
||||
</code></pre>
|
||||
@@ -2107,7 +2065,6 @@ Column("age") < 18
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name < 'Arthur' COLLATE NOCASE
|
||||
Column("name").collating(.nocase) < "Arthur"
|
||||
</code></pre>
|
||||
@@ -2141,7 +2098,6 @@ Column("name").collating(.nocase) < "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 18 < age
|
||||
18 < Column("age")
|
||||
</code></pre>
|
||||
@@ -2175,7 +2131,6 @@ Column("name").collating(.nocase) < "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 'Arthur' < name COLLATE NOCASE
|
||||
"Arthur" < Column("name").collating(.nocase)
|
||||
</code></pre>
|
||||
@@ -2209,7 +2164,6 @@ Column("name").collating(.nocase) < "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width < height
|
||||
Column("width") < Column("height")
|
||||
</code></pre>
|
||||
@@ -2243,7 +2197,6 @@ Column("width") < Column("height")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// age <= 18
|
||||
Column("age") <= 18
|
||||
</code></pre>
|
||||
@@ -2277,7 +2230,6 @@ Column("age") <= 18
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name <= 'Arthur' COLLATE NOCASE
|
||||
Column("name").collating(.nocase) <= "Arthur"
|
||||
</code></pre>
|
||||
@@ -2311,7 +2263,6 @@ Column("name").collating(.nocase) <= "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 18 <= age
|
||||
18 <= Column("age")
|
||||
</code></pre>
|
||||
@@ -2345,7 +2296,6 @@ Column("name").collating(.nocase) <= "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 'Arthur' <= name COLLATE NOCASE
|
||||
"Arthur" <= Column("name").collating(.nocase)
|
||||
</code></pre>
|
||||
@@ -2379,7 +2329,6 @@ Column("name").collating(.nocase) <= "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code><=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width <= height
|
||||
Column("width") <= Column("height")
|
||||
</code></pre>
|
||||
@@ -2413,7 +2362,6 @@ Column("width") <= Column("height")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>></code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// age > 18
|
||||
Column("age") > 18
|
||||
</code></pre>
|
||||
@@ -2447,7 +2395,6 @@ Column("age") > 18
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>></code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// age > 'Arthur' COLLATE NOCASE
|
||||
Column("name").collating(.nocase) > "Arthur"
|
||||
</code></pre>
|
||||
@@ -2481,7 +2428,6 @@ Column("name").collating(.nocase) > "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>></code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 18 > age
|
||||
18 > Column("age")
|
||||
</code></pre>
|
||||
@@ -2515,7 +2461,6 @@ Column("name").collating(.nocase) > "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>></code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 'Arthur' > name COLLATE NOCASE
|
||||
"Arthur" > Column("name").collating(.nocase)
|
||||
</code></pre>
|
||||
@@ -2549,7 +2494,6 @@ Column("name").collating(.nocase) > "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>></code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width > height
|
||||
Column("width") > Column("height")
|
||||
</code></pre>
|
||||
@@ -2583,7 +2527,6 @@ Column("width") > Column("height")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>>=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// age >= 18
|
||||
Column("age") >= 18
|
||||
</code></pre>
|
||||
@@ -2617,7 +2560,6 @@ Column("age") >= 18
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>>=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// name >= 'Arthur' COLLATE NOCASE
|
||||
Column("name").collating(.nocase) >= "Arthur"
|
||||
</code></pre>
|
||||
@@ -2651,7 +2593,6 @@ Column("name").collating(.nocase) >= "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>>=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 18 >= age
|
||||
18 >= Column("age")
|
||||
</code></pre>
|
||||
@@ -2685,7 +2626,6 @@ Column("name").collating(.nocase) >= "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>>=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 'Arthur' >= age COLLATE NOCASE
|
||||
"Arthur" >= Column("age").collating(.nocase)
|
||||
</code></pre>
|
||||
@@ -2719,7 +2659,6 @@ Column("name").collating(.nocase) >= "Arthur"
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression that compares two expressions with the <code>>=</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width >= height
|
||||
Column("width") >= Column("height")
|
||||
</code></pre>
|
||||
@@ -2764,7 +2703,6 @@ Column("width") >= Column("height")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic multiplication.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width * 2
|
||||
Column("width") * 2
|
||||
</code></pre>
|
||||
@@ -2798,7 +2736,6 @@ Column("width") * 2
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic multiplication.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 2 * width
|
||||
2 * Column("width")
|
||||
</code></pre>
|
||||
@@ -2832,7 +2769,6 @@ Column("width") * 2
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic multiplication.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width * height
|
||||
Column("width") * Column("height")
|
||||
</code></pre>
|
||||
@@ -2866,7 +2802,6 @@ Column("width") * Column("height")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic division.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width / 2
|
||||
Column("width") / 2
|
||||
</code></pre>
|
||||
@@ -2900,7 +2835,6 @@ Column("width") / 2
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic division.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 2 / width
|
||||
2 / Column("width")
|
||||
</code></pre>
|
||||
@@ -2934,7 +2868,6 @@ Column("width") / 2
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic division.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width / height
|
||||
Column("width") / Column("height")
|
||||
</code></pre>
|
||||
@@ -2968,7 +2901,6 @@ Column("width") / Column("height")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic addition.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width + 2
|
||||
Column("width") + 2
|
||||
</code></pre>
|
||||
@@ -3002,7 +2934,6 @@ Column("width") + 2
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic addition.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 2 + width
|
||||
2 + Column("width")
|
||||
</code></pre>
|
||||
@@ -3036,7 +2967,6 @@ Column("width") + 2
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic addition.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width + height
|
||||
Column("width") + Column("height")
|
||||
</code></pre>
|
||||
@@ -3070,7 +3000,6 @@ Column("width") + Column("height")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A negated SQL arithmetic expression.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// -width
|
||||
-Column("width")
|
||||
</code></pre>
|
||||
@@ -3104,7 +3033,6 @@ Column("width") + Column("height")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic substraction.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width - 2
|
||||
Column("width") - 2
|
||||
</code></pre>
|
||||
@@ -3138,7 +3066,6 @@ Column("width") - 2
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic substraction.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 2 - width
|
||||
2 - Column("width")
|
||||
</code></pre>
|
||||
@@ -3172,7 +3099,6 @@ Column("width") - 2
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL arithmetic substraction.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// width - height
|
||||
Column("width") - Column("height")
|
||||
</code></pre>
|
||||
@@ -3217,7 +3143,6 @@ Column("width") - Column("height")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A logical SQL expression with the <code>AND</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// favorite AND 0
|
||||
Column("favorite") && false
|
||||
</code></pre>
|
||||
@@ -3251,7 +3176,6 @@ Column("favorite") && false
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A logical SQL expression with the <code>AND</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 0 AND favorite
|
||||
false && Column("favorite")
|
||||
</code></pre>
|
||||
@@ -3285,7 +3209,6 @@ false && Column("favorite")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A logical SQL expression with the <code>AND</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// email IS NOT NULL AND favorite
|
||||
Column("email") != nil && Column("favorite")
|
||||
</code></pre>
|
||||
@@ -3319,7 +3242,6 @@ Column("email") != nil && Column("favorite")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A logical SQL expression with the <code>OR</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// favorite OR 1
|
||||
Column("favorite") || true
|
||||
</code></pre>
|
||||
@@ -3353,7 +3275,6 @@ Column("favorite") || true
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A logical SQL expression with the <code>OR</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 0 OR favorite
|
||||
true || Column("favorite")
|
||||
</code></pre>
|
||||
@@ -3387,7 +3308,6 @@ true || Column("favorite")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A logical SQL expression with the <code>OR</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// email IS NULL OR hidden
|
||||
Column("email") == nil || Column("hidden")
|
||||
</code></pre>
|
||||
@@ -3421,13 +3341,11 @@ Column("email") == nil || Column("hidden")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A negated logical SQL expression with the <code>NOT</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// NOT hidden
|
||||
!Column("hidden")
|
||||
</code></pre>
|
||||
|
||||
<p>Some expressions may be negated with specific SQL operators:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// id NOT BETWEEN 1 AND 10
|
||||
!((1...10).contains(Column("id")))
|
||||
</code></pre>
|
||||
@@ -3472,7 +3390,6 @@ Column("email") == nil || Column("hidden")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Return as many question marks separated with commas as the <em>count</em> argument.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>databaseQuestionMarks(count: 3) // "?,?,?"
|
||||
</code></pre>
|
||||
|
||||
@@ -3497,7 +3414,7 @@ Column("email") == nil || Column("hidden")
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -766,19 +766,16 @@
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A type that supplies the values of some external resource, one at a time.</p>
|
||||
|
||||
<p><a href='#overview' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='overview'>Overview</h2></p>
|
||||
<h2 id='overview' class='heading'>Overview</h2>
|
||||
|
||||
<p>The most common way to iterate over the elements of a cursor is to use a
|
||||
<code>while</code> loop:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let cursor = ...
|
||||
while let element = try cursor.next() {
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<p><a href='#relationship-with-standard-sequence-and-iteratorprotocol' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='relationship-with-standard-sequence-and-iteratorprotocol'>Relationship with standard Sequence and IteratorProtocol</h2></p>
|
||||
<h2 id='relationship-with-standard-sequence-and-iteratorprotocol' class='heading'>Relationship with standard Sequence and IteratorProtocol</h2>
|
||||
|
||||
<p>Cursors share traits with lazy sequences and iterators from the Swift
|
||||
standard library. Differences are:</p>
|
||||
@@ -945,7 +942,6 @@ database values.</p>
|
||||
|
||||
<p>The protocol comes with built-in methods that allow to fetch cursors,
|
||||
arrays, or single values:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try String.fetchCursor(db, "SELECT name FROM ...", arguments:...) // DatabaseCursor<String>
|
||||
try String.fetchAll(db, "SELECT name FROM ...", arguments:...) // [String]
|
||||
try String.fetchOne(db, "SELECT name FROM ...", arguments:...) // String?
|
||||
@@ -1045,7 +1041,6 @@ a database table.</p>
|
||||
|
||||
<p>Types that adopt both TableMapping and RowConvertible are granted with
|
||||
built-in methods that allow to fetch instances identified by key:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try Person.fetchOne(db, key: 123) // Person?
|
||||
try Citizenship.fetchOne(db, key: ["personId": 12, "countryId": 45]) // Citizenship?
|
||||
</code></pre>
|
||||
@@ -1257,7 +1252,6 @@ a database.</p>
|
||||
|
||||
<p>Requests can feed the fetching methods of any fetchable type (Row,
|
||||
value, record):</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let request: Request = ...
|
||||
try Row.fetchCursor(db, request) // DatabaseCursor<Row>
|
||||
try String.fetchAll(db, request) // [String]
|
||||
@@ -1298,7 +1292,6 @@ a database, with an attached type.</p>
|
||||
|
||||
<p>Typed requests can fetch if their associated type Fetched is fetchable
|
||||
(Row, value, record)</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let request: ... // Some TypedRequest that fetches Person
|
||||
try request.fetchCursor(db) // DatabaseCursor<Person>
|
||||
try request.fetchAll(db) // [Person]
|
||||
@@ -1447,7 +1440,6 @@ together.</p>
|
||||
</ul>
|
||||
|
||||
<p>To use a row adapter, provide it to any method that fetches:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let adapter = SuffixRowAdapter(fromIndex: 2)
|
||||
let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
|
||||
|
||||
@@ -1489,14 +1481,12 @@ try Row.fetchOne(db, sql, adapter: adapter)
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Types that adopt RowConvertible can be initialized from a database Row.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let row = try Row.fetchOne(db, "SELECT ...")!
|
||||
let person = Person(row)
|
||||
</code></pre>
|
||||
|
||||
<p>The protocol comes with built-in methods that allow to fetch cursors,
|
||||
arrays, or single records:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try Person.fetchCursor(db, "SELECT ...", arguments:...) // DatabaseCursor<Person>
|
||||
try Person.fetchAll(db, "SELECT ...", arguments:...) // [Person]
|
||||
try Person.fetchOne(db, "SELECT ...", arguments:...) // Person?
|
||||
@@ -1553,8 +1543,7 @@ try Person.fetchOne(statement, arguments:...) // Person?
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>SQLCollection is the protocol for types that can be checked for inclusion.</p>
|
||||
|
||||
@@ -1649,8 +1638,7 @@ like Column.</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>SQLSpecificExpressible is a protocol for all query interface types that can
|
||||
be turned into an SQL expression. Other types whose existence is not purely
|
||||
@@ -1706,8 +1694,7 @@ and it adopts SQLSpecificExpressible.</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>SQLExpression is the protocol for types that represent an SQL expression, as
|
||||
described at <a href="https://www.sqlite.org/lang_expr.html">https://www.sqlite.org/lang_expr.html</a></p>
|
||||
@@ -1770,8 +1757,7 @@ allow to represent many SQLite expressions:</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>The protocol for all types that can be used as an SQL ordering term, as
|
||||
described at <a href="https://www.sqlite.org/syntax/ordering-term.html">https://www.sqlite.org/syntax/ordering-term.html</a></p>
|
||||
@@ -1820,8 +1806,7 @@ described at <a href="https://www.sqlite.org/syntax/ordering-term.html">https://
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>SQLSelectable is the protocol for types that can be selected, as
|
||||
described at <a href="https://www.sqlite.org/syntax/result-column.html">https://www.sqlite.org/syntax/result-column.html</a></p>
|
||||
@@ -1870,8 +1855,7 @@ described at <a href="https://www.sqlite.org/syntax/result-column.html">https://
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>SQLSelectQuery is the protocol for types that represent a full select query.</p>
|
||||
|
||||
@@ -1947,7 +1931,6 @@ database values.</p>
|
||||
<div class="abstract">
|
||||
<p>The protocol for SQLite virtual table modules. It lets you define a DSL for
|
||||
the <code>Database.create(virtualTable:using:)</code> method:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let module = ...
|
||||
try db.create(virtualTable: "items", using: module) { t in
|
||||
...
|
||||
@@ -1979,7 +1962,7 @@ FTS4 and FTS5.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -754,19 +754,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<p>A type that supplies the values of some external resource, one at a time.</p>
|
||||
|
||||
<p><a href='#overview' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='overview'>Overview</h2></p>
|
||||
<h2 id='overview' class='heading'>Overview</h2>
|
||||
|
||||
<p>The most common way to iterate over the elements of a cursor is to use a
|
||||
<code>while</code> loop:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let cursor = ...
|
||||
while let element = try cursor.next() {
|
||||
...
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<p><a href='#relationship-with-standard-sequence-and-iteratorprotocol' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h2 id='relationship-with-standard-sequence-and-iteratorprotocol'>Relationship with standard Sequence and IteratorProtocol</h2></p>
|
||||
<h2 id='relationship-with-standard-sequence-and-iteratorprotocol' class='heading'>Relationship with standard Sequence and IteratorProtocol</h2>
|
||||
|
||||
<p>Cursors share traits with lazy sequences and iterators from the Swift
|
||||
standard library. Differences are:</p>
|
||||
@@ -903,8 +900,9 @@ element that satisfies the given predicate.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>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.</p>
|
||||
|
||||
<p>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.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -913,8 +911,8 @@ element that satisfies the given predicate.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>true if the cursor contains an element that satisfies predicate; otherwise, false.</p>
|
||||
|
||||
<p>true if the cursor contains an element that satisfies
|
||||
predicate; otherwise, false.</p>
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Cursor.swift#L94-L101">Show on GitHub</a>
|
||||
@@ -940,7 +938,6 @@ element that satisfies the given predicate.</p>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor of pairs (n, x), where n represents a consecutive
|
||||
integer starting at zero, and x represents an element of the cursor.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let cursor = try String.fetchCursor(db, "SELECT 'foo' UNION ALL SELECT 'bar'")
|
||||
let c = cursor.enumerated()
|
||||
while let (n, x) = c.next() {
|
||||
@@ -1353,7 +1350,7 @@ given element.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -798,7 +798,6 @@ connection, and returns its result.</p>
|
||||
|
||||
<p>Guarantee 1: the block argument is isolated. Eventual concurrent
|
||||
database updates are not visible inside the block:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try reader.read { db in
|
||||
// Those two values are guaranteed to be equal, even if the
|
||||
// `wines` table is modified between the two requests:
|
||||
@@ -815,7 +814,6 @@ try reader.read { db in
|
||||
<p>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 <code>SQLITE_READONLY</code>.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block, or any DatabaseError that would
|
||||
@@ -845,7 +843,6 @@ happen while establishing the read access to the database.
|
||||
<td>
|
||||
<div>
|
||||
<p>A block that accesses the database.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -878,7 +875,6 @@ connection, and returns its result.</p>
|
||||
|
||||
<p>The block argument is not isolated: eventual concurrent database updates
|
||||
are visible inside the block:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try reader.unsafeRead { db in
|
||||
// Those two values may be different because some other thread
|
||||
// may have inserted or deleted a wine between the two requests:
|
||||
@@ -888,7 +884,6 @@ are visible inside the block:</p>
|
||||
</code></pre>
|
||||
|
||||
<p>Cursor iterations are isolated, though:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try reader.unsafeRead { db in
|
||||
// No concurrent update can mess with this iteration:
|
||||
let rows = try Row.fetchCursor(db, "SELECT ...")
|
||||
@@ -898,7 +893,6 @@ are visible inside the block:</p>
|
||||
|
||||
<p>The block argument is not prevented from writing (DatabaseQueue, in
|
||||
particular, will accept database modifications in <code>unsafeRead</code>).</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
The error thrown by the block, or any DatabaseError that would
|
||||
@@ -928,7 +922,6 @@ happen while establishing the read access to the database.
|
||||
<td>
|
||||
<div>
|
||||
<p>A block that accesses the database.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -966,7 +959,6 @@ happen while establishing the read access to the database.
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Add or redefine an SQL function.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let fn = DatabaseFunction("succ", argumentCount: 1) { databaseValues in
|
||||
let dbv = databaseValues.first!
|
||||
guard let int = dbv.value() as Int? else {
|
||||
@@ -1050,7 +1042,6 @@ try reader.read { db in
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Add or redefine a collation.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let collation = DatabaseCollation("localized_standard") { (string1, string2) in
|
||||
return (string1 as NSString).localizedStandardCompare(string2)
|
||||
}
|
||||
@@ -1160,7 +1151,7 @@ but they won’t trigger any error.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -758,7 +758,6 @@ database values.</p>
|
||||
|
||||
<p>The protocol comes with built-in methods that allow to fetch cursors,
|
||||
arrays, or single values:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try String.fetchCursor(db, "SELECT name FROM ...", arguments:...) // DatabaseCursor<String>
|
||||
try String.fetchAll(db, "SELECT name FROM ...", arguments:...) // [String]
|
||||
try String.fetchOne(db, "SELECT name FROM ...", arguments:...) // String?
|
||||
@@ -859,8 +858,7 @@ try String.fetchOne(statement, arguments:...) // String?
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>See SQLExpression.sqlExpression</p>
|
||||
|
||||
@@ -907,7 +905,6 @@ Do not use it directly.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over values fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT name FROM ...")
|
||||
let names = try String.fetchCursor(statement) // DatabaseCursor<String>
|
||||
while let name = try names.next() { // String
|
||||
@@ -919,7 +916,6 @@ while let name = try names.next() { // String
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -948,7 +944,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -961,7 +956,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -974,7 +968,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -984,7 +977,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L112-L122">Show on GitHub</a>
|
||||
@@ -1009,11 +1001,9 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of values fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT name FROM ...")
|
||||
let names = try String.fetchAll(statement) // [String]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1042,7 +1032,6 @@ let names = try String.fetchAll(statement) // [String]
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1055,7 +1044,6 @@ let names = try String.fetchAll(statement) // [String]
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1068,7 +1056,6 @@ let names = try String.fetchAll(statement) // [String]
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1078,7 +1065,6 @@ let names = try String.fetchAll(statement) // [String]
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L135-L137">Show on GitHub</a>
|
||||
@@ -1106,11 +1092,9 @@ let names = try String.fetchAll(statement) // [String]
|
||||
|
||||
<p>The result is nil if the query returns no row, or if no value can be
|
||||
extracted from the first row.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT name FROM ...")
|
||||
let name = try String.fetchOne(statement) // String?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1139,7 +1123,6 @@ let name = try String.fetchOne(statement) // String?
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1152,7 +1135,6 @@ let name = try String.fetchOne(statement) // String?
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1165,7 +1147,6 @@ let name = try String.fetchOne(statement) // String?
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1175,7 +1156,6 @@ let name = try String.fetchOne(statement) // String?
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An optional value.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L153-L167">Show on GitHub</a>
|
||||
@@ -1211,7 +1191,6 @@ let name = try String.fetchOne(statement) // String?
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over values fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn)
|
||||
let names = try String.fetchCursor(db, request) // DatabaseCursor<String>
|
||||
@@ -1224,7 +1203,6 @@ for let name = try names.next() { // String
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1253,7 +1231,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1266,7 +1243,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A fetch request.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1276,7 +1252,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L193-L196">Show on GitHub</a>
|
||||
@@ -1301,12 +1276,10 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of values fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn)
|
||||
let names = try String.fetchAll(db, request) // [String]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1335,7 +1308,6 @@ let names = try String.fetchAll(db, request) // [String]
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1368,12 +1340,10 @@ let names = try String.fetchAll(db, request) // [String]
|
||||
|
||||
<p>The result is nil if the query returns no row, or if no value can be
|
||||
extracted from the first row.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn)
|
||||
let name = try String.fetchOne(db, request) // String?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1402,7 +1372,6 @@ let name = try String.fetchOne(db, request) // String?
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1443,7 +1412,6 @@ let name = try String.fetchOne(db, request) // String?
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over values fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let names = try String.fetchCursor(db, "SELECT name FROM ...") // DatabaseCursor<String>
|
||||
while let name = try name.next() { // String
|
||||
...
|
||||
@@ -1454,7 +1422,6 @@ while let name = try name.next() { // String
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1483,7 +1450,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1496,7 +1462,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1509,7 +1474,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1522,7 +1486,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1532,7 +1495,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L251-L253">Show on GitHub</a>
|
||||
@@ -1557,10 +1519,8 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of values fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let names = try String.fetchAll(db, "SELECT name FROM ...") // [String]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1589,7 +1549,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1602,7 +1561,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1615,7 +1573,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1628,7 +1585,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1638,7 +1594,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L266-L268">Show on GitHub</a>
|
||||
@@ -1666,10 +1621,8 @@ elements are undefined.</p>
|
||||
|
||||
<p>The result is nil if the query returns no row, or if no value can be
|
||||
extracted from the first row.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let name = try String.fetchOne(db, "SELECT name FROM ...") // String?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1698,7 +1651,6 @@ extracted from the first row.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1711,7 +1663,6 @@ extracted from the first row.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1724,7 +1675,6 @@ extracted from the first row.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1737,7 +1687,6 @@ extracted from the first row.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1747,7 +1696,6 @@ extracted from the first row.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An optional value.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/DatabaseValueConvertible.swift#L284-L286">Show on GitHub</a>
|
||||
@@ -1783,7 +1731,6 @@ extracted from the first row.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over values fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT name FROM ...")
|
||||
let names = try String.fetchCursor(statement) // DatabaseCursor<String>
|
||||
while let name = try names.next() { // String
|
||||
@@ -1795,7 +1742,6 @@ while let name = try names.next() { // String
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1824,7 +1770,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1837,7 +1782,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1850,7 +1794,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1860,7 +1803,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/StatementColumnConvertible.swift#L60-L70">Show on GitHub</a>
|
||||
@@ -1885,11 +1827,9 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of values fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT name FROM ...")
|
||||
let names = try String.fetchAll(statement) // [String]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1918,7 +1858,6 @@ let names = try String.fetchAll(statement) // [String]
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1931,7 +1870,6 @@ let names = try String.fetchAll(statement) // [String]
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1944,7 +1882,6 @@ let names = try String.fetchAll(statement) // [String]
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1954,7 +1891,6 @@ let names = try String.fetchAll(statement) // [String]
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array of values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/StatementColumnConvertible.swift#L83-L85">Show on GitHub</a>
|
||||
@@ -1979,11 +1915,9 @@ let names = try String.fetchAll(statement) // [String]
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a single value fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT name FROM ...")
|
||||
let name = try String.fetchOne(statement) // String?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2012,7 +1946,6 @@ let name = try String.fetchOne(statement) // String?
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2025,7 +1958,6 @@ let name = try String.fetchOne(statement) // String?
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2038,7 +1970,6 @@ let name = try String.fetchOne(statement) // String?
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2048,7 +1979,6 @@ let name = try String.fetchOne(statement) // String?
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An optional value.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/StatementColumnConvertible.swift#L98-L109">Show on GitHub</a>
|
||||
@@ -2084,7 +2014,6 @@ let name = try String.fetchOne(statement) // String?
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over values fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn)
|
||||
let names = try String.fetchCursor(db, request) // DatabaseCursor<String>
|
||||
@@ -2097,7 +2026,6 @@ while let name = try names.next() { // String
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2126,7 +2054,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2139,7 +2066,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A fetch request.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2149,7 +2075,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/StatementColumnConvertible.swift#L135-L138">Show on GitHub</a>
|
||||
@@ -2174,12 +2099,10 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of values fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn)
|
||||
let names = try String.fetchAll(db, request) // [String]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2208,7 +2131,6 @@ let names = try String.fetchAll(db, request) // [String]
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2241,12 +2163,10 @@ let names = try String.fetchAll(db, request) // [String]
|
||||
|
||||
<p>The result is nil if the query returns no row, or if no value can be
|
||||
extracted from the first row.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn)
|
||||
let name = try String.fetchOne(db, request) // String?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2275,7 +2195,6 @@ let name = try String.fetchOne(db, request) // String?
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2316,7 +2235,6 @@ let name = try String.fetchOne(db, request) // String?
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over values fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let names = try String.fetchCursor(db, "SELECT name FROM ...") // DatabaseCursor<String>
|
||||
while let name = try names.next() { // String
|
||||
...
|
||||
@@ -2327,7 +2245,6 @@ while let name = try names.next() { // String
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2356,7 +2273,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2369,7 +2285,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2382,7 +2297,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2395,7 +2309,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2405,7 +2318,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/StatementColumnConvertible.swift#L193-L195">Show on GitHub</a>
|
||||
@@ -2430,10 +2342,8 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of values fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let names = try String.fetchAll(db, "SELECT name FROM ...") // [String]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2462,7 +2372,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2475,7 +2384,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2488,7 +2396,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2501,7 +2408,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2511,7 +2417,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array of values.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/StatementColumnConvertible.swift#L208-L210">Show on GitHub</a>
|
||||
@@ -2536,10 +2441,8 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a single value fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let name = try String.fetchOne(db, "SELECT name FROM ...") // String?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2568,7 +2471,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2581,7 +2483,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2594,7 +2495,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2607,7 +2507,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2617,7 +2516,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An optional value.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/StatementColumnConvertible.swift#L223-L225">Show on GitHub</a>
|
||||
@@ -2631,7 +2529,7 @@ elements are undefined.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -1005,7 +1005,6 @@ stops getting notifications after it is deallocated.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A transaction observer.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1057,7 +1056,7 @@ stops getting notifications after it is deallocated.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -823,7 +823,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -778,7 +778,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -823,7 +823,7 @@
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -829,7 +829,7 @@ column in a base row.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -836,7 +836,6 @@ updates, which has GRDB generate regular INSERT and UPDATE queries.</p>
|
||||
target database table (see TableMapping.databaseTableName()).</p>
|
||||
|
||||
<p>In particular, primary key columns, if any, must be included.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>struct Person : MutablePersistable {
|
||||
var id: Int64?
|
||||
var name: String?
|
||||
@@ -885,7 +884,6 @@ dispatch queue, with the inserted RowID and the eventual
|
||||
INTEGER PRIMARY KEY column name.</p>
|
||||
|
||||
<p>This method is optional: the default implementation does nothing.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>struct Person : MutablePersistable {
|
||||
var id: Int64?
|
||||
var name: String?
|
||||
@@ -925,7 +923,6 @@ INTEGER PRIMARY KEY column name.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The inserted rowID.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -938,7 +935,6 @@ INTEGER PRIMARY KEY column name.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The name of the eventual INTEGER PRIMARY KEY column.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -991,7 +987,6 @@ column name.</p>
|
||||
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.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -1027,7 +1022,6 @@ that they invoke the performInsert() method.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1065,7 +1059,6 @@ returns without error.</p>
|
||||
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.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1078,7 +1071,6 @@ match any row in the database.
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
<p>Executes an UPDATE statement.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1086,9 +1078,7 @@ PersistenceError.recordNotFound is thrown if the primary key does not
|
||||
match any row in the database.
|
||||
|
||||
</div>
|
||||
|
||||
<p>Executes an UPDATE statement.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1096,9 +1086,7 @@ PersistenceError.recordNotFound is thrown if the primary key does not
|
||||
match any row in the database.
|
||||
|
||||
</div>
|
||||
|
||||
<p>Executes an UPDATE statement.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1129,7 +1117,6 @@ match any row in the database.
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1142,7 +1129,6 @@ match any row in the database.
|
||||
<td>
|
||||
<div>
|
||||
<p>The columns to update.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1186,7 +1172,6 @@ database if it returns without error.</p>
|
||||
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.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs, or errors
|
||||
@@ -1224,7 +1209,6 @@ the database.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1259,7 +1243,6 @@ the database.</p>
|
||||
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.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1295,7 +1278,6 @@ that they invoke the performDelete() method.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1305,7 +1287,6 @@ that they invoke the performDelete() method.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Whether a database row was deleted.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/Persistable.swift#L190">Show on GitHub</a>
|
||||
@@ -1336,7 +1317,6 @@ the database.</p>
|
||||
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.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1373,7 +1353,6 @@ the database.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1383,7 +1362,6 @@ the database.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Whether the primary key matches a row in the database.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/Persistable.swift#L203">Show on GitHub</a>
|
||||
@@ -1419,7 +1397,6 @@ the database.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Executes an UPDATE statement that updates all table columns.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1450,7 +1427,6 @@ match any row in the database.
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1536,7 +1512,6 @@ that adopt MutablePersistable.</p>
|
||||
that adopt MutablePersistable can invoke performUpdate() in their
|
||||
implementation of update(). They should not provide their own
|
||||
implementation of performUpdate().</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1567,7 +1542,6 @@ match any row in the database.
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1580,7 +1554,6 @@ match any row in the database.
|
||||
<td>
|
||||
<div>
|
||||
<p>The columns to update.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1718,7 +1691,7 @@ implementation of performExists().</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -820,7 +820,6 @@ MutablePersistable protocol instead.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The inserted rowID.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -833,7 +832,6 @@ MutablePersistable protocol instead.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The name of the eventual INTEGER PRIMARY KEY column.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -875,7 +873,6 @@ column name.</p>
|
||||
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.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs.
|
||||
@@ -911,7 +908,6 @@ that they invoke the performInsert() method.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -955,7 +951,6 @@ database if it returns without error.</p>
|
||||
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.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError whenever an SQLite error occurs, or errors
|
||||
@@ -993,7 +988,6 @@ the database.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1103,7 +1097,7 @@ implementation of performSave().</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -758,7 +758,6 @@ a database.</p>
|
||||
|
||||
<p>Requests can feed the fetching methods of any fetchable type (Row,
|
||||
value, record):</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let request: Request = ...
|
||||
try Row.fetchCursor(db, request) // DatabaseCursor<Row>
|
||||
try String.fetchAll(db, request) // [String]
|
||||
@@ -854,7 +853,6 @@ statement returned by the <code>prepare</code> method: <code>SELECT COUNT(*) FRO
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -891,7 +889,6 @@ statement returned by the <code>prepare</code> method: <code>SELECT COUNT(*) FRO
|
||||
|
||||
<p>The returned request can fetch if the type T is fetchable (Row,
|
||||
value, record).</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let minHeight = Person
|
||||
.select(min(heightColumn))
|
||||
.bound(to: Double.self) // <--
|
||||
@@ -920,7 +917,6 @@ value, record).</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The fetched type T</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -930,7 +926,6 @@ value, record).</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A typed request bound to type T.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Core/Request.swift#L55-L57">Show on GitHub</a>
|
||||
@@ -977,7 +972,7 @@ value, record).</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -766,7 +766,6 @@ together.</p>
|
||||
</ul>
|
||||
|
||||
<p>To use a row adapter, provide it to any method that fetches:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let adapter = SuffixRowAdapter(fromIndex: 2)
|
||||
let sql = "SELECT 1 AS foo, 2 AS bar, 3 AS baz"
|
||||
|
||||
@@ -798,7 +797,6 @@ adapter has to be applied.</p>
|
||||
LayoutedColumnMapping.</p>
|
||||
|
||||
<p>For example:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// 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.
|
||||
@@ -873,8 +871,8 @@ eventual existing scopes with the same name.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A dictionary that maps scope names to row adapters.</p>
|
||||
|
||||
<p>A dictionary that maps scope names to
|
||||
row adapters.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -893,7 +891,7 @@ eventual existing scopes with the same name.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -754,14 +754,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<p>Types that adopt RowConvertible can be initialized from a database Row.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let row = try Row.fetchOne(db, "SELECT ...")!
|
||||
let person = Person(row)
|
||||
</code></pre>
|
||||
|
||||
<p>The protocol comes with built-in methods that allow to fetch cursors,
|
||||
arrays, or single records:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try Person.fetchCursor(db, "SELECT ...", arguments:...) // DatabaseCursor<Person>
|
||||
try Person.fetchAll(db, "SELECT ...", arguments:...) // [Person]
|
||||
try Person.fetchOne(db, "SELECT ...", arguments:...) // Person?
|
||||
@@ -884,7 +882,6 @@ initialization.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A cursor over all records fetched from the database.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let persons = try Person.fetchCursor(db) // DatabaseCursor<Person>
|
||||
while let person = try persons.next() { // Person
|
||||
...
|
||||
@@ -897,7 +894,6 @@ while let person = try persons.next() { // Person
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -926,7 +922,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -936,7 +931,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched records.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible+TableMapping.swift#L22-L24">Show on GitHub</a>
|
||||
@@ -961,10 +955,8 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An array of all records fetched from the database.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let persons = try Person.fetchAll(db) // [Person]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -993,7 +985,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1023,10 +1014,8 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The first found record.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let person = try Person.fetchOne(db) // Person?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1055,7 +1044,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1096,7 +1084,6 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over records, given their primary keys.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let persons = try Person.fetchCursor(db, keys: [1, 2, 3]) // DatabaseCursor<Person>
|
||||
while let person = try persons.next() {
|
||||
...
|
||||
@@ -1104,7 +1091,6 @@ while let person = try persons.next() {
|
||||
</code></pre>
|
||||
|
||||
<p>Records are iterated in unspecified order.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1133,7 +1119,6 @@ while let person = try persons.next() {
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1146,7 +1131,6 @@ while let person = try persons.next() {
|
||||
<td>
|
||||
<div>
|
||||
<p>A sequence of primary keys.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1156,7 +1140,6 @@ while let person = try persons.next() {
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched records.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible+TableMapping.swift#L65-L70">Show on GitHub</a>
|
||||
@@ -1181,12 +1164,10 @@ while let person = try persons.next() {
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of records, given their primary keys.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let persons = try Person.fetchAll(db, keys: [1, 2, 3]) // [Person]
|
||||
</code></pre>
|
||||
|
||||
<p>The order of records in the returned array is undefined.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1215,7 +1196,6 @@ while let person = try persons.next() {
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1228,7 +1208,6 @@ while let person = try persons.next() {
|
||||
<td>
|
||||
<div>
|
||||
<p>A sequence of primary keys.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1238,7 +1217,6 @@ while let person = try persons.next() {
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array of records.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible+TableMapping.swift#L83-L88">Show on GitHub</a>
|
||||
@@ -1263,10 +1241,8 @@ while let person = try persons.next() {
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a single record given its primary key.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let person = try Person.fetchOne(db, key: 123) // Person?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1295,7 +1271,6 @@ while let person = try persons.next() {
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1308,7 +1283,6 @@ while let person = try persons.next() {
|
||||
<td>
|
||||
<div>
|
||||
<p>A primary key value.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1318,7 +1292,6 @@ while let person = try persons.next() {
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An optional record.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible+TableMapping.swift#L99-L104">Show on GitHub</a>
|
||||
@@ -1355,7 +1328,6 @@ while let person = try persons.next() {
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over records identified by the provided unique keys
|
||||
(primary key or any key with a unique index on it).</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let persons = try Person.fetchCursor(db, keys: [["email": "a@example.com"], ["email": "b@example.com"]]) // DatabaseCursor<Person>
|
||||
while let person = try persons.next() { // Person
|
||||
...
|
||||
@@ -1363,7 +1335,6 @@ while let person = try persons.next() { // Person
|
||||
</code></pre>
|
||||
|
||||
<p>Records are iterated in unspecified order.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1392,7 +1363,6 @@ while let person = try persons.next() { // Person
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1405,7 +1375,6 @@ while let person = try persons.next() { // Person
|
||||
<td>
|
||||
<div>
|
||||
<p>An array of key dictionaries.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1415,7 +1384,6 @@ while let person = try persons.next() { // Person
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched records.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible+TableMapping.swift#L160-L165">Show on GitHub</a>
|
||||
@@ -1441,12 +1409,10 @@ while let person = try persons.next() { // Person
|
||||
<div class="abstract">
|
||||
<p>Returns an array of records identified by the provided unique keys
|
||||
(primary key or any key with a unique index on it).</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let persons = try Person.fetchAll(db, keys: [["email": "a@example.com"], ["email": "b@example.com"]]) // [Person]
|
||||
</code></pre>
|
||||
|
||||
<p>The order of records in the returned array is undefined.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1475,7 +1441,6 @@ while let person = try persons.next() { // Person
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1488,7 +1453,6 @@ while let person = try persons.next() { // Person
|
||||
<td>
|
||||
<div>
|
||||
<p>An array of key dictionaries.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1498,7 +1462,6 @@ while let person = try persons.next() { // Person
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array of records.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible+TableMapping.swift#L179-L184">Show on GitHub</a>
|
||||
@@ -1524,10 +1487,8 @@ while let person = try persons.next() { // Person
|
||||
<div class="abstract">
|
||||
<p>Returns a single record identified by a unique key (the primary key or
|
||||
any key with a unique index on it).</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let person = try Person.fetchOne(db, key: ["name": Arthur"]) // Person?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1556,7 +1517,6 @@ any key with a unique index on it).</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1569,7 +1529,6 @@ any key with a unique index on it).</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A dictionary of values.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1579,7 +1538,6 @@ any key with a unique index on it).</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An optional record.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible+TableMapping.swift#L196-L198">Show on GitHub</a>
|
||||
@@ -1615,7 +1573,6 @@ any key with a unique index on it).</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A cursor over records fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT * FROM persons")
|
||||
let persons = try Person.fetchCursor(statement) // DatabaseCursor<Person>
|
||||
while let person = try persons.next() { // Person
|
||||
@@ -1627,7 +1584,6 @@ while let person = try persons.next() { // Person
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1656,7 +1612,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1669,7 +1624,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1682,7 +1636,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1692,7 +1645,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched records.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible.swift#L65-L75">Show on GitHub</a>
|
||||
@@ -1717,11 +1669,9 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of records fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT * FROM persons")
|
||||
let persons = try Person.fetchAll(statement) // [Person]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1750,7 +1700,6 @@ let persons = try Person.fetchAll(statement) // [Person]
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1763,7 +1712,6 @@ let persons = try Person.fetchAll(statement) // [Person]
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1776,7 +1724,6 @@ let persons = try Person.fetchAll(statement) // [Person]
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1786,7 +1733,6 @@ let persons = try Person.fetchAll(statement) // [Person]
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array of records.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible.swift#L88-L90">Show on GitHub</a>
|
||||
@@ -1811,11 +1757,9 @@ let persons = try Person.fetchAll(statement) // [Person]
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a single record fetched from a prepared statement.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let statement = try db.makeSelectStatement("SELECT * FROM persons")
|
||||
let person = try Person.fetchOne(statement) // Person?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1844,7 +1788,6 @@ let person = try Person.fetchOne(statement) // Person?
|
||||
<td>
|
||||
<div>
|
||||
<p>The statement to run.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1857,7 +1800,6 @@ let person = try Person.fetchOne(statement) // Person?
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1870,7 +1812,6 @@ let person = try Person.fetchOne(statement) // Person?
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1880,7 +1821,6 @@ let person = try Person.fetchOne(statement) // Person?
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An optional record.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible.swift#L103-L105">Show on GitHub</a>
|
||||
@@ -1916,7 +1856,6 @@ let person = try Person.fetchOne(statement) // Person?
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over records fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("firstName")
|
||||
let request = Person.order(nameColumn)
|
||||
let identities = try Identity.fetchCursor(db, request) // DatabaseCursor<Identity>
|
||||
@@ -1929,7 +1868,6 @@ while let identity = try identities.next() { // Identity
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1958,7 +1896,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1971,7 +1908,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A fetch request.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1981,7 +1917,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched records.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible.swift#L131-L134">Show on GitHub</a>
|
||||
@@ -2006,12 +1941,10 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of records fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.order(nameColumn)
|
||||
let identities = try Identity.fetchAll(db, request) // [Identity]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2040,7 +1973,6 @@ let identities = try Identity.fetchAll(db, request) // [Identity]
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2070,12 +2002,10 @@ let identities = try Identity.fetchAll(db, request) // [Identity]
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a single record fetched from a fetch request.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.order(nameColumn)
|
||||
let identity = try Identity.fetchOne(db, request) // Identity?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2104,7 +2034,6 @@ let identity = try Identity.fetchOne(db, request) // Identity?
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2145,7 +2074,6 @@ let identity = try Identity.fetchOne(db, request) // Identity?
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a cursor over records fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let persons = try Person.fetchCursor(db, "SELECT * FROM persons") // DatabaseCursor<Person>
|
||||
while let person = try persons.next() { // Person
|
||||
...
|
||||
@@ -2156,7 +2084,6 @@ while let person = try persons.next() { // Person
|
||||
elements are undefined.</p>
|
||||
|
||||
<p>The cursor must be iterated in a protected dispath queue.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2185,7 +2112,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2198,7 +2124,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2211,7 +2136,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2224,7 +2148,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2234,7 +2157,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A cursor over fetched records.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible.swift#L186-L188">Show on GitHub</a>
|
||||
@@ -2259,10 +2181,8 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns an array of records fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let persons = try Person.fetchAll(db, "SELECT * FROM persons") // [Person]
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2291,7 +2211,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2304,7 +2223,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2317,7 +2235,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2330,7 +2247,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2340,7 +2256,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An array of records.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible.swift#L201-L203">Show on GitHub</a>
|
||||
@@ -2365,10 +2280,8 @@ elements are undefined.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a single record fetched from an SQL query.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let person = try Person.fetchOne(db, "SELECT * FROM persons") // Person?
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -2397,7 +2310,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2410,7 +2322,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An SQL query.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2423,7 +2334,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional statement arguments.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2436,7 +2346,6 @@ elements are undefined.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>Optional RowAdapter</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2446,7 +2355,6 @@ elements are undefined.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An optional record.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/RowConvertible.swift#L216-L218">Show on GitHub</a>
|
||||
@@ -2460,7 +2368,7 @@ elements are undefined.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -828,7 +828,7 @@ case-insensitive way.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,8 +757,7 @@
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>SQLCollection is the protocol for types that can be checked for inclusion.</p>
|
||||
|
||||
@@ -783,14 +782,12 @@ Do not use it directly.</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>Returns an SQL string that represents the collection.</p>
|
||||
|
||||
<p>When the arguments parameter is nil, any value must be written down as
|
||||
a literal in the returned SQL:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>var arguments: StatementArguments? = nil
|
||||
let collection = SQLExpressionsArray([1,2,3])
|
||||
collection.collectionSQL(&arguments) // "1,2,3"
|
||||
@@ -798,7 +795,6 @@ collection.collectionSQL(&arguments) // "1,2,3"
|
||||
|
||||
<p>When the arguments parameter is not nil, then values may be replaced by
|
||||
<code>?</code> or colon-prefixed tokens, and fed into arguments.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>var arguments = StatementArguments()
|
||||
let collection = SQLExpressionsArray([1,2,3])
|
||||
collection.collectionSQL(&arguments) // "?,?,?"
|
||||
@@ -841,7 +837,6 @@ the expression.</p>
|
||||
|
||||
<p>The default implementation returns a SQLExpressionContains which applies
|
||||
the <code>IN</code> operator:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let request = Person.select(Column("id"))
|
||||
request.contains(Column("id")) // id IN (SELECT id FROM persons)
|
||||
</code></pre>
|
||||
@@ -850,7 +845,6 @@ request.contains(Column("id")) // id IN (SELECT id FROM persons)
|
||||
<h4>Default Implementation</h4>
|
||||
<div class="default_impl abstract">
|
||||
<p>Returns a SQLExpressionContains which applies the <code>IN</code> operator:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let request = Person.select(Column("id"))
|
||||
request.contains(Column("id")) // id IN (SELECT id FROM persons)
|
||||
</code></pre>
|
||||
@@ -876,7 +870,7 @@ request.contains(Column("id")) // id IN (SELECT id FROM persons)
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -820,8 +820,7 @@ like Column.</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>See SQLOrderingTerm.reversed</p>
|
||||
|
||||
@@ -860,8 +859,7 @@ Do not use it directly.</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>See SQLOrderingTerm.orderingTermSQL(_)</p>
|
||||
|
||||
@@ -904,8 +902,7 @@ Do not use it directly.</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>See SQLSelectable.resultColumnSQL(_)</p>
|
||||
|
||||
@@ -944,8 +941,7 @@ Do not use it directly.</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>See SQLSelectable.countedSQL(_)</p>
|
||||
|
||||
@@ -984,8 +980,7 @@ Do not use it directly.</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>See SQLSelectable.count(distinct:from:aliased:)</p>
|
||||
|
||||
@@ -1010,7 +1005,7 @@ Do not use it directly.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,8 +757,7 @@
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>SQLExpression is the protocol for types that represent an SQL expression, as
|
||||
described at <a href="https://www.sqlite.org/lang_expr.html">https://www.sqlite.org/lang_expr.html</a></p>
|
||||
@@ -798,14 +797,12 @@ allow to represent many SQLite expressions:</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>Returns an SQL string that represents the expression.</p>
|
||||
|
||||
<p>When the arguments parameter is nil, any value must be written down as
|
||||
a literal in the returned SQL:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>var arguments: StatementArguments? = nil
|
||||
let expression = "foo'bar".databaseValue
|
||||
expression.expressionSQL(&arguments) // "'foo''bar'"
|
||||
@@ -813,7 +810,6 @@ expression.expressionSQL(&arguments) // "'foo''bar'"
|
||||
|
||||
<p>When the arguments parameter is not nil, then values may be replaced by
|
||||
<code>?</code> or colon-prefixed tokens, and fed into arguments.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>var arguments = StatementArguments()
|
||||
let expression = "foo'bar".databaseValue
|
||||
expression.expressionSQL(&arguments) // "?"
|
||||
@@ -855,20 +851,17 @@ arguments // ["foo'bar"]
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>Returns the expression, negated. This property fuels the <code>!</code> operator.</p>
|
||||
|
||||
<p>The default implementation returns the expression prefixed by <code>NOT</code>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let column = Column("favorite")
|
||||
column.negated // NOT favorite
|
||||
</code></pre>
|
||||
|
||||
<p>Some expressions may provide a custom implementation that returns a
|
||||
more natural SQL expression.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let expression = [1,2,3].contains(Column("id")) // id IN (1,2,3)
|
||||
expression.negated // id NOT IN (1,2,3)
|
||||
</code></pre>
|
||||
@@ -880,11 +873,9 @@ expression.negated // id NOT IN (1,2,3)
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>The default implementation returns the expression prefixed by <code>NOT</code>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let column = Column("favorite")
|
||||
column.negated // NOT favorite
|
||||
</code></pre>
|
||||
@@ -928,8 +919,7 @@ column.negated // NOT favorite
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>Converts an expression to an SQLExpressionLiteral</p>
|
||||
|
||||
@@ -972,8 +962,7 @@ Do not use it directly.</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>See SQLExpressible.sqlExpression</p>
|
||||
|
||||
@@ -1016,8 +1005,7 @@ Do not use it directly.</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>See SQLSelectable.count(distinct:from:aliased:)</p>
|
||||
|
||||
@@ -1042,7 +1030,7 @@ Do not use it directly.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,8 +757,7 @@
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>The protocol for all types that can be used as an SQL ordering term, as
|
||||
described at <a href="https://www.sqlite.org/syntax/ordering-term.html">https://www.sqlite.org/syntax/ordering-term.html</a></p>
|
||||
@@ -833,7 +832,7 @@ described at <a href="https://www.sqlite.org/syntax/ordering-term.html">https://
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,8 +757,7 @@
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>SQLSelectQuery is the protocol for types that represent a full select query.</p>
|
||||
|
||||
@@ -783,8 +782,7 @@ Do not use it directly.</p>
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>Returns the SQL string of the select query.</p>
|
||||
|
||||
@@ -831,7 +829,6 @@ a literal in the returned SQL.</p>
|
||||
<div class="abstract">
|
||||
<p>Returns an SQL expression that checks whether the receiver, as a
|
||||
subquery, returns any row.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let request = Person.all()
|
||||
request.exists() // EXISTS (SELECT * FROM persons)
|
||||
</code></pre>
|
||||
@@ -875,8 +872,7 @@ request.exists() // EXISTS (SELECT * FROM persons)
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>See SQLCollection.collectionSQL(_)</p>
|
||||
|
||||
@@ -939,7 +935,7 @@ executed, and an eventual row adapter.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,8 +757,7 @@
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>SQLSelectable is the protocol for types that can be selected, as
|
||||
described at <a href="https://www.sqlite.org/syntax/result-column.html">https://www.sqlite.org/syntax/result-column.html</a></p>
|
||||
@@ -863,7 +862,7 @@ described at <a href="https://www.sqlite.org/syntax/result-column.html">https://
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -757,8 +757,7 @@
|
||||
Do not use it directly.</p>
|
||||
|
||||
<p>See <a href="https://github.com/groue/GRDB.swift/#the-query-interface">https://github.com/groue/GRDB.swift/#the-query-interface</a></p>
|
||||
|
||||
<p><a href='#low-level-query-interface' class='anchor' aria-hidden=true><span class="header-anchor"></span></a><h1 id='low-level-query-interface'>Low Level Query Interface</h1></p>
|
||||
<h1 id='low-level-query-interface' class='heading'>Low Level Query Interface</h1>
|
||||
|
||||
<p>SQLSpecificExpressible is a protocol for all query interface types that can
|
||||
be turned into an SQL expression. Other types whose existence is not purely
|
||||
@@ -792,7 +791,6 @@ and it adopts SQLSpecificExpressible.</p>
|
||||
<div class="abstract">
|
||||
<p>Returns an SQL expression that applies the Swift’s built-in
|
||||
capitalized String property. It is NULL for non-String arguments.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.capitalized)
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -831,7 +829,6 @@ let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
<div class="abstract">
|
||||
<p>Returns an SQL expression that applies the Swift’s built-in
|
||||
lowercased String property. It is NULL for non-String arguments.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.lowercased())
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -870,7 +867,6 @@ let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
<div class="abstract">
|
||||
<p>Returns an SQL expression that applies the Swift’s built-in
|
||||
uppercased String property. It is NULL for non-String arguments.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.uppercased())
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -913,7 +909,6 @@ let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
<div class="abstract">
|
||||
<p>Returns an SQL expression that applies the Swift’s built-in
|
||||
localizedCapitalized String property. It is NULL for non-String arguments.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.localizedCapitalized)
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -952,7 +947,6 @@ let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
<div class="abstract">
|
||||
<p>Returns an SQL expression that applies the Swift’s built-in
|
||||
localizedLowercased String property. It is NULL for non-String arguments.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.localizedLowercased)
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -991,7 +985,6 @@ let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
<div class="abstract">
|
||||
<p>Returns an SQL expression that applies the Swift’s built-in
|
||||
localizedUppercased String property. It is NULL for non-String arguments.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>let nameColumn = Column("name")
|
||||
let request = Person.select(nameColumn.localizedUppercased)
|
||||
let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
@@ -1033,7 +1026,6 @@ let names = try String.fetchAll(dbQueue, request) // [String]
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An SQL expression with the <code>LIKE</code> SQL operator.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// email LIKE '%@example.com"
|
||||
Column("email").like("%@example.com")
|
||||
</code></pre>
|
||||
@@ -1248,7 +1240,7 @@ Do not use it directly.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -777,7 +777,6 @@ database values.</p>
|
||||
<p>Returns a value initialized from a raw SQLite statement pointer.</p>
|
||||
|
||||
<p>As an example, here is the how Int64 adopts StatementColumnConvertible:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>extension Int64: StatementColumnConvertible {
|
||||
public init(sqliteStatement: SQLiteStatement, index: Int32) {
|
||||
self = sqlite3_column_int64(sqliteStatement, index)
|
||||
@@ -811,7 +810,6 @@ database values.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A pointer to an SQLite statement.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -824,7 +822,6 @@ database values.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>The column index.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -843,7 +840,7 @@ database values.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -758,7 +758,6 @@ a database table.</p>
|
||||
|
||||
<p>Types that adopt both TableMapping and RowConvertible are granted with
|
||||
built-in methods that allow to fetch instances identified by key:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try Person.fetchOne(db, key: 123) // Person?
|
||||
try Citizenship.fetchOne(db, key: ["personId": 12, "countryId": 45]) // Citizenship?
|
||||
</code></pre>
|
||||
@@ -819,13 +818,11 @@ try Citizenship.fetchOne(db, key: ["personId": 12, "countryId": 45]) // Citizens
|
||||
with other columns.</p>
|
||||
|
||||
<p>Its default value is false:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT * FROM persons
|
||||
try Person.fetchAll(db)
|
||||
</code></pre>
|
||||
|
||||
<p>When true, the rowid column is fetched:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT *, rowid FROM persons
|
||||
try Person.fetchAll(db)
|
||||
</code></pre>
|
||||
@@ -878,14 +875,12 @@ try Person.fetchAll(db)
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Returns a QueryInterfaceRequest with a matching predicate.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT * FROM books WHERE books MATCH '...'
|
||||
var request = Book.matching(pattern)
|
||||
</code></pre>
|
||||
|
||||
<p>If the <code><a href="../Protocols/TableMapping.html#/s:ZvP4GRDB12TableMapping12selectsRowIDSb">selectsRowID</a></code> type property is true, then the selection includes
|
||||
the hidden <q>rowid</q> column:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT *, rowid FROM books WHERE books MATCH '...'
|
||||
var request = Book.matching(pattern)
|
||||
</code></pre>
|
||||
@@ -936,14 +931,12 @@ database row.</p>
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a QueryInterfaceRequest which fetches all records.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT * FROM persons
|
||||
var request = Person.all()
|
||||
</code></pre>
|
||||
|
||||
<p>If the <code><a href="../Protocols/TableMapping.html#/s:ZvP4GRDB12TableMapping12selectsRowIDSb">selectsRowID</a></code> type property is true, then the selection includes
|
||||
the hidden <q>rowid</q> column:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT *, rowid FROM persons
|
||||
var request = Person.all()
|
||||
</code></pre>
|
||||
@@ -1013,7 +1006,6 @@ var request = Person.all()
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a QueryInterfaceRequest which selects <em>selection</em>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT id, email FROM persons
|
||||
var request = Person.select(Column("id"), Column("email"))
|
||||
</code></pre>
|
||||
@@ -1050,7 +1042,6 @@ var request = Person.select(Column("id"), Column("email"))
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a QueryInterfaceRequest which selects <em>selection</em>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT id, email FROM persons
|
||||
var request = Person.select([Column("id"), Column("email")])
|
||||
</code></pre>
|
||||
@@ -1087,7 +1078,6 @@ var request = Person.select([Column("id"), Column("email")])
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a QueryInterfaceRequest which selects <em>sql</em>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT id, email FROM persons
|
||||
var request = Person.select(sql: "id, email")
|
||||
</code></pre>
|
||||
@@ -1124,14 +1114,12 @@ var request = Person.select(sql: "id, email")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a QueryInterfaceRequest with the provided <em>predicate</em>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT * FROM persons WHERE email = 'arthur@example.com'
|
||||
var request = Person.filter(Column("email") == "arthur@example.com")
|
||||
</code></pre>
|
||||
|
||||
<p>If the <code><a href="../Protocols/TableMapping.html#/s:ZvP4GRDB12TableMapping12selectsRowIDSb">selectsRowID</a></code> type property is true, then the selection includes
|
||||
the hidden <q>rowid</q> column:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT *, rowid FROM persons WHERE email = 'arthur@example.com'
|
||||
var request = Person.filter(Column("email") == "arthur@example.com")
|
||||
</code></pre>
|
||||
@@ -1168,14 +1156,12 @@ var request = Person.filter(Column("email") == "arthur@example.com")
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a QueryInterfaceRequest with the provided <em>predicate</em>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT * FROM persons WHERE email = 'arthur@example.com'
|
||||
var request = Person.filter(sql: "email = ?", arguments: ["arthur@example.com"])
|
||||
</code></pre>
|
||||
|
||||
<p>If the <code><a href="../Protocols/TableMapping.html#/s:ZvP4GRDB12TableMapping12selectsRowIDSb">selectsRowID</a></code> type property is true, then the selection includes
|
||||
the hidden <q>rowid</q> column:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT *, rowid FROM persons WHERE email = 'arthur@example.com'
|
||||
var request = Person.filter(sql: "email = ?", arguments: ["arthur@example.com"])
|
||||
</code></pre>
|
||||
@@ -1213,14 +1199,12 @@ var request = Person.filter(sql: "email = ?", arguments: ["arthur@example.com"])
|
||||
<div class="abstract">
|
||||
<p>Creates a QueryInterfaceRequest sorted according to the
|
||||
provided <em>orderings</em>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT * FROM persons ORDER BY name
|
||||
var request = Person.order(Column("name"))
|
||||
</code></pre>
|
||||
|
||||
<p>If the <code><a href="../Protocols/TableMapping.html#/s:ZvP4GRDB12TableMapping12selectsRowIDSb">selectsRowID</a></code> type property is true, then the selection includes
|
||||
the hidden <q>rowid</q> column:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT *, rowid FROM persons ORDER BY name
|
||||
var request = Person.order(Column("name"))
|
||||
</code></pre>
|
||||
@@ -1258,14 +1242,12 @@ var request = Person.order(Column("name"))
|
||||
<div class="abstract">
|
||||
<p>Creates a QueryInterfaceRequest sorted according to the
|
||||
provided <em>orderings</em>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT * FROM persons ORDER BY name
|
||||
var request = Person.order([Column("name")])
|
||||
</code></pre>
|
||||
|
||||
<p>If the <code><a href="../Protocols/TableMapping.html#/s:ZvP4GRDB12TableMapping12selectsRowIDSb">selectsRowID</a></code> type property is true, then the selection includes
|
||||
the hidden <q>rowid</q> column:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT *, rowid FROM persons ORDER BY name
|
||||
var request = Person.order([Column("name")])
|
||||
</code></pre>
|
||||
@@ -1302,14 +1284,12 @@ var request = Person.order([Column("name")])
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Creates a QueryInterfaceRequest sorted according to <em>sql</em>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT * FROM persons ORDER BY name
|
||||
var request = Person.order(sql: "name")
|
||||
</code></pre>
|
||||
|
||||
<p>If the <code><a href="../Protocols/TableMapping.html#/s:ZvP4GRDB12TableMapping12selectsRowIDSb">selectsRowID</a></code> type property is true, then the selection includes
|
||||
the hidden <q>rowid</q> column:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT *, rowid FROM persons ORDER BY name
|
||||
var request = Person.order(sql: "name")
|
||||
</code></pre>
|
||||
@@ -1347,14 +1327,12 @@ var request = Person.order(sql: "name")
|
||||
<div class="abstract">
|
||||
<p>Creates a QueryInterfaceRequest which fetches <em>limit</em> rows, starting at
|
||||
<em>offset</em>.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT * FROM persons LIMIT 1
|
||||
var request = Person.limit(1)
|
||||
</code></pre>
|
||||
|
||||
<p>If the <code><a href="../Protocols/TableMapping.html#/s:ZvP4GRDB12TableMapping12selectsRowIDSb">selectsRowID</a></code> type property is true, then the selection includes
|
||||
the hidden <q>rowid</q> column:</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>// SELECT *, rowid FROM persons LIMIT 1
|
||||
var request = Person.limit(1)
|
||||
</code></pre>
|
||||
@@ -1425,7 +1403,6 @@ var request = Person.limit(1)
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1466,7 +1443,6 @@ var request = Person.limit(1)
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Deletes all records; returns the number of deleted rows.</p>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError is thrown whenever an SQLite error occurs.
|
||||
@@ -1495,7 +1471,6 @@ var request = Person.limit(1)
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1505,7 +1480,6 @@ var request = Person.limit(1)
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>The number of deleted rows</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/TableMapping.swift#L57-L59">Show on GitHub</a>
|
||||
@@ -1542,7 +1516,6 @@ var request = Person.limit(1)
|
||||
<div class="abstract">
|
||||
<p>Delete records identified by their primary keys; returns the number of
|
||||
deleted rows.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try Person.deleteAll(db, keys: [1, 2, 3])
|
||||
</code></pre>
|
||||
|
||||
@@ -1568,7 +1541,6 @@ deleted rows.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1581,7 +1553,6 @@ deleted rows.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A sequence of primary keys.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1591,7 +1562,6 @@ deleted rows.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>The number of deleted rows</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/TableMapping.swift#L76-L82">Show on GitHub</a>
|
||||
@@ -1617,7 +1587,6 @@ deleted rows.</p>
|
||||
<div class="abstract">
|
||||
<p>Delete a record, identified by its primary key; returns whether a
|
||||
database row was deleted.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try Person.deleteOne(db, key: 123)
|
||||
</code></pre>
|
||||
|
||||
@@ -1643,7 +1612,6 @@ database row was deleted.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1656,7 +1624,6 @@ database row was deleted.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A primary key value.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1666,7 +1633,6 @@ database row was deleted.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Whether a database row was deleted.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/TableMapping.swift#L94-L99">Show on GitHub</a>
|
||||
@@ -1703,7 +1669,6 @@ database row was deleted.</p>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try Person.deleteAll(db, keys: [["email": "a@example.com"], ["email": "b@example.com"]])
|
||||
</code></pre>
|
||||
|
||||
@@ -1729,7 +1694,6 @@ any key with a unique index on it); returns the number of deleted rows.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1742,7 +1706,6 @@ any key with a unique index on it); returns the number of deleted rows.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>An array of key dictionaries.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1752,7 +1715,6 @@ any key with a unique index on it); returns the number of deleted rows.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>The number of deleted rows</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/TableMapping.swift#L150-L156">Show on GitHub</a>
|
||||
@@ -1778,7 +1740,6 @@ any key with a unique index on it); returns the number of deleted rows.</p>
|
||||
<div class="abstract">
|
||||
<p>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.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>Person.deleteOne(db, key: ["name": Arthur"])
|
||||
</code></pre>
|
||||
|
||||
@@ -1804,7 +1765,6 @@ with a unique index on it); returns whether a database row was deleted.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A database connection.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1817,7 +1777,6 @@ with a unique index on it); returns whether a database row was deleted.</p>
|
||||
<td>
|
||||
<div>
|
||||
<p>A dictionary of values.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1827,7 +1786,6 @@ with a unique index on it); returns whether a database row was deleted.</p>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>Whether a database row was deleted.</p>
|
||||
|
||||
</div>
|
||||
<div class="slightly-smaller">
|
||||
<a href="https://github.com/groue/GRDB.swift/tree/v0.107.0/GRDB/Record/TableMapping.swift#L168-L170">Show on GitHub</a>
|
||||
@@ -1858,7 +1816,6 @@ with a unique index on it); returns whether a database row was deleted.</p>
|
||||
<p>Returns a function that returns true if and only if two rows have the
|
||||
same primary key and both primary keys contain at least one non-null
|
||||
value.</p>
|
||||
|
||||
<pre class="highlight plaintext"><code>try dbQueue.inDatabase { db in
|
||||
let comparator = try Person.primaryKeyRowComparator(db)
|
||||
let row0 = Row(["id": nil, "name": "Unsaved"])
|
||||
@@ -1870,7 +1827,6 @@ value.</p>
|
||||
comparator(row1, row3) // false
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
A DatabaseError if table does not exist.
|
||||
@@ -1898,7 +1854,7 @@ value.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -815,7 +815,6 @@ to databaseWillCommit, databaseDidCommit and databaseDidRollback.</p>
|
||||
|
||||
<p>The event is only valid for the duration of this method call. If you
|
||||
need to keep it longer, store a copy of its properties.</p>
|
||||
|
||||
<div class="aside aside-warning">
|
||||
<p class="aside-title">Warning</p>
|
||||
this method must not change the database.
|
||||
@@ -854,13 +853,11 @@ need to keep it longer, store a copy of its properties.</p>
|
||||
has an opportunity to rollback pending changes by throwing an error.</p>
|
||||
|
||||
<p>This method is called on the database queue.</p>
|
||||
|
||||
<div class="aside aside-warning">
|
||||
<p class="aside-title">Warning</p>
|
||||
<p>this method must not change the database.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<p>An eventual error that rollbacks pending changes.</p>
|
||||
@@ -979,7 +976,7 @@ has an opportunity to rollback pending changes by throwing an error.</p>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2017 <a class="link" href="https://github.com/groue" target="_blank" rel="external">Gwendal Roué</a>. All rights reserved. (Last updated: 2017-05-05)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
Loaded 100 of 311 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user