Skip to content

Commit b831eeb

Browse files
committed
Document execute() method
1 parent 322940f commit b831eeb

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Sources/SwiftSQL/SQLConnection.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public final class SQLConnection {
3030
/// - parameter mode: Specifies whether open the database for reading, writing
3131
/// or both, and whether to create it on write. `.readwrite(create: true)` by default.
3232
/// - parameter options: See `SQLConnectionOptions` for more information.
33+
///
34+
/// - note: See [SQLite: Result and Error Codes](https://www.sqlite.org/rescode.html)
35+
/// for more information.
3336
public init(location: Location, mode: Mode = .readwrite(create: true), options: Options = Options()) throws {
3437
let path: String
3538
var flags: Int32 = 0

Sources/SwiftSQL/SQLError.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import Foundation
66
import SQLite3
77

88
#warning("TODO: update documentation")
9+
/// - note: See [SQLite: Result and Error Codes](https://www.sqlite.org/rescode.html)
10+
/// for more information.
911
public struct SQLError: Swift.Error, CustomStringConvertible {
1012
// MARK: Properties
1113

Sources/SwiftSQL/SQLStatement.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ public final class SQLStatement {
6464

6565
// MARK: Execute
6666

67-
#warning("TODO: add example")
68-
6967
/// Executes the statement and returns the row (`SQLRow`) if it is available.
7068
/// Returns nil if the statement is finished executing and no more data
7169
/// is available. Throws an error if an error is encountered.
@@ -79,14 +77,19 @@ public final class SQLStatement {
7977
/// objects.append(user)
8078
/// }
8179
///
80+
/// - note: See [SQLite: Result and Error Codes](https://www.sqlite.org/rescode.html)
81+
/// for more information.
8282
public func next() throws -> SQLRow? {
8383
guard try isOK(sqlite3_step(ref)) == SQLITE_ROW else {
8484
return nil
8585
}
8686
return SQLRow(statement: self)
8787
}
8888

89-
#warning("TODO: document")
89+
/// Executes the statement. Throws an error if an error is occured.
90+
///
91+
/// - note: See [SQLite: Result and Error Codes](https://www.sqlite.org/rescode.html)
92+
/// for more information.
9093
@discardableResult
9194
public func execute() throws -> SQLStatement {
9295
try isOK(sqlite3_step(ref))

0 commit comments

Comments
 (0)