Skip to content

Commit 68b324a

Browse files
committed
Add SQLStatement.isBusy
1 parent f91a8fc commit 68b324a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Sources/SwiftSQL/SQLRow.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public struct SQLRow {
3737

3838
/// Returns a single column of the current result row of a query.
3939
public subscript<T: SQLDataType>(name: String) -> T {
40+
#warning("TODO: not implemented")
4041
fatalError()
4142
}
4243

Sources/SwiftSQL/SQLStatement.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ public final class SQLStatement {
5353
let db: SQLConnection
5454
let ref: OpaquePointer
5555

56+
/// Returns true (non-zero) if the statement has been stepped at least once
57+
/// using `next()`, but has neither run to completion nor been reset.
58+
public var isBusy: Bool {
59+
sqlite3_stmt_busy(ref) != 0
60+
}
61+
5662
init(db: SQLConnection, ref: OpaquePointer) {
5763
self.db = db
5864
self.ref = ref

0 commit comments

Comments
 (0)