Skip to content

Commit 3203dfd

Browse files
committed
Better document defaults
And fix the documentation for the create function shims while we're at it. Signed-off-by: Stephen Celis <stephen@stephencelis.com>
1 parent c4cba1d commit 3203dfd

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

SQLite/Database.swift

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,9 @@ public final class Database {
257257

258258
/// Starts a new transaction with the given mode.
259259
///
260-
/// :param: mode The mode in which a transaction acquires a lock. (Default:
261-
/// .Deferred.)
260+
/// :param: mode The mode in which a transaction acquires a lock.
261+
///
262+
/// Default: `.Deferred`
262263
///
263264
/// :returns: The BEGIN TRANSACTION statement.
264265
public func transaction(_ mode: TransactionMode = .Deferred) -> Statement {
@@ -268,8 +269,9 @@ public final class Database {
268269
/// Runs a transaction with the given savepoint name (if omitted, it will
269270
/// generate a UUID).
270271
///
271-
/// :param: mode The mode in which a transaction acquires a lock. (Default:
272-
/// .Deferred.)
272+
/// :param: mode The mode in which a transaction acquires a lock.
273+
///
274+
/// Default: `.Deferred`
273275
///
274276
/// :param: block A closure to run SQL statements within the transaction.
275277
/// Should return a TransactionResult depending on success or
@@ -285,7 +287,8 @@ public final class Database {
285287
///
286288
/// :param: all Only applicable if a savepoint is open. If true, commits all
287289
/// open savepoints, otherwise releases the current savepoint.
288-
/// (Default: false.)
290+
///
291+
/// Default: `false`
289292
///
290293
/// :returns: The COMMIT (or RELEASE) statement.
291294
public func commit(all: Bool = false) -> Statement {
@@ -301,7 +304,9 @@ public final class Database {
301304
///
302305
/// :param: all Only applicable if a savepoint is open. If true, rolls back
303306
/// all open savepoints, otherwise rolls back the current
304-
/// savepoint. (Default: false.)
307+
/// savepoint.
308+
///
309+
/// Default: `false`
305310
///
306311
/// :returns: The ROLLBACK statement.
307312
public func rollback(all: Bool = false) -> Statement {
@@ -519,13 +524,16 @@ public final class Database {
519524
/// :param: function The name of the function to create or redefine.
520525
///
521526
/// :param: argc The number of arguments that the function takes.
522-
/// If this parameter is -1, then the SQL function may
523-
/// take any number of arguments. (Default: -1.)
527+
/// If this parameter is `-1`, then the SQL function
528+
/// may take any number of arguments.
529+
///
530+
/// Default: `-1`
524531
///
525532
/// :param: deterministic Whether or not the function is deterministic. If
526533
/// the function always returns the same result for a
527534
/// given input, SQLite can make optimizations.
528-
/// (Default: false.)
535+
///
536+
/// Default: `false`
529537
///
530538
/// :param: block A block of code to run when the function is
531539
/// called. The block is called with an array of raw

SQLite/Functions.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,16 @@ public extension Database {
3030

3131
/// Creates or redefines a custom SQL function.
3232
///
33-
/// :param: function The name of the function to create or redefine.
33+
/// :param: function The name of the function to create or redefine.
3434
///
35-
/// :param: block A block of code to run when the function is called.
36-
/// The assigned types must be explicit.
35+
/// :param: deterministic Whether or not the function is deterministic. If
36+
/// the function always returns the same result for a
37+
/// given input, SQLite can make optimizations.
38+
///
39+
/// Default: `false`
40+
///
41+
/// :param: block A block of code to run when the function is
42+
/// called. The assigned types must be explicit.
3743
///
3844
/// :returns: A closure returning an SQL expression to call the function.
3945
public func create<Z: Value>(#function: String, deterministic: Bool = false, _ block: () -> Z) -> (() -> Expression<Z>) {

0 commit comments

Comments
 (0)