mirror of https://github.com/status-im/nim-eth.git
Add sqlite3.isInsideTransaction
This commit is contained in:
parent
4c70293883
commit
3a0afa4aa2
|
@ -57,6 +57,9 @@ template dispose(db: RawStmtPtr) =
|
||||||
template dispose*(db: SqliteStmt) =
|
template dispose*(db: SqliteStmt) =
|
||||||
discard sqlite3_finalize(RawStmtPtr db)
|
discard sqlite3_finalize(RawStmtPtr db)
|
||||||
|
|
||||||
|
func isInsideTransaction*(db: SqStoreRef): bool =
|
||||||
|
sqlite3_get_autocommit(db.env) == 0
|
||||||
|
|
||||||
proc release[T](x: var AutoDisposed[T]): T =
|
proc release[T](x: var AutoDisposed[T]): T =
|
||||||
result = x.val
|
result = x.val
|
||||||
x.val = nil
|
x.val = nil
|
||||||
|
|
Loading…
Reference in New Issue