mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-14 17:04:53 +00:00
chore: sqlite make sure code is always run (#2891)
This commit is contained in:
parent
e1518cf9ff
commit
4ac4ab2a41
@ -234,6 +234,8 @@ proc query*(
|
|||||||
return err($sqlite3_errstr(v))
|
return err($sqlite3_errstr(v))
|
||||||
return ok gotResults
|
return ok gotResults
|
||||||
except Exception, CatchableError:
|
except Exception, CatchableError:
|
||||||
|
error "exception in query", query = query, error = getCurrentExceptionMsg()
|
||||||
|
|
||||||
# release implicit transaction
|
# release implicit transaction
|
||||||
discard sqlite3_reset(s) # same return information as step
|
discard sqlite3_reset(s) # same return information as step
|
||||||
discard sqlite3_clear_bindings(s) # no errors possible
|
discard sqlite3_clear_bindings(s) # no errors possible
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{.push raises: [].}
|
{.push raises: [].}
|
||||||
|
|
||||||
import std/[options, sequtils], stew/byteutils, sqlite3_abi, results
|
import std/[options, sequtils], stew/byteutils, sqlite3_abi, results
|
||||||
|
import chronicles
|
||||||
import
|
import
|
||||||
../../../common/databases/db_sqlite,
|
../../../common/databases/db_sqlite,
|
||||||
../../../common/databases/common,
|
../../../common/databases/common,
|
||||||
@ -427,6 +428,9 @@ proc execSelectMessagesV2WithLimitStmt(
|
|||||||
else:
|
else:
|
||||||
return err($sqlite3_errstr(v))
|
return err($sqlite3_errstr(v))
|
||||||
except Exception, CatchableError:
|
except Exception, CatchableError:
|
||||||
|
error "exception in execSelectMessagesV2WithLimitStmt",
|
||||||
|
error = getCurrentExceptionMsg()
|
||||||
|
|
||||||
# release implicit transaction
|
# release implicit transaction
|
||||||
discard sqlite3_reset(s) # same return information as step
|
discard sqlite3_reset(s) # same return information as step
|
||||||
discard sqlite3_clear_bindings(s) # no errors possible
|
discard sqlite3_clear_bindings(s) # no errors possible
|
||||||
@ -498,6 +502,8 @@ proc execSelectMessageByHash(
|
|||||||
else:
|
else:
|
||||||
return err($sqlite3_errstr(v))
|
return err($sqlite3_errstr(v))
|
||||||
except Exception, CatchableError:
|
except Exception, CatchableError:
|
||||||
|
error "exception in execSelectMessageByHash", error = getCurrentExceptionMsg()
|
||||||
|
|
||||||
# release implicit transaction
|
# release implicit transaction
|
||||||
discard sqlite3_reset(s) # same return information as step
|
discard sqlite3_reset(s) # same return information as step
|
||||||
discard sqlite3_clear_bindings(s) # no errors possible
|
discard sqlite3_clear_bindings(s) # no errors possible
|
||||||
@ -629,6 +635,9 @@ proc execSelectMessagesWithLimitStmt(
|
|||||||
else:
|
else:
|
||||||
return err($sqlite3_errstr(v))
|
return err($sqlite3_errstr(v))
|
||||||
except Exception, CatchableError:
|
except Exception, CatchableError:
|
||||||
|
error "exception in execSelectMessagesWithLimitStmt",
|
||||||
|
error = getCurrentExceptionMsg()
|
||||||
|
|
||||||
# release implicit transaction
|
# release implicit transaction
|
||||||
discard sqlite3_reset(s) # same return information as step
|
discard sqlite3_reset(s) # same return information as step
|
||||||
discard sqlite3_clear_bindings(s) # no errors possible
|
discard sqlite3_clear_bindings(s) # no errors possible
|
||||||
|
Loading…
x
Reference in New Issue
Block a user