@@ -446,9 +446,10 @@ proc getParameterIndex*(st: ref Statement, name: string): int =
446446 if result == 0 :
447447 raise newException (SQLiteError , " Unknown parameter " & name)
448448
449+ {.push inline .}
450+
449451proc `[]=` * (st: ref Statement , idx: int , blob: openarray [byte ]) =
450- st.raw.check_sqlite_stmt sqlite3_bind_blob64 (st.raw, idx, blob.unsafeAddr,
451- blob.len, TransientDestructor )
452+ st.raw.check_sqlite_stmt sqlite3_bind_blob64 (st.raw, idx, blob.unsafeAddr, blob.len, TransientDestructor )
452453
453454proc `[]=` * (st: ref Statement , idx: int , val: SomeFloat ) =
454455 st.raw.check_sqlite_stmt sqlite3_bind_double (st.raw, idx, float64 val)
@@ -465,7 +466,7 @@ proc `[]=`*(st: ref Statement, idx: int, val: string) =
465466proc reset * (st: ref Statement ) =
466467 st.raw.check_sqlite_stmt sqlite3_reset (st.raw)
467468
468- proc step * (st: ref Statement ): bool =
469+ proc step * (st: ref Statement ): bool {. inline .} =
469470 let res = sqlite3_step (st.raw)
470471 case res:
471472 of sr_row: true
@@ -489,12 +490,10 @@ proc getColumn*(st: ref Statement, idx: int, T: typedesc[seq[byte]]): seq[byte]
489490 result = newSeq[byte ]l
490491 copyMem (addr result [0 ], p, l)
491492
492- proc getColumn * (st: ref Statement , idx: int , T: typedesc [
493- SomeFloat ]): SomeFloat =
493+ proc getColumn * (st: ref Statement , idx: int , T: typedesc [SomeFloat ]): SomeFloat =
494494 cast [T](sqlite3_column_double (st.raw, idx))
495495
496- proc getColumn * (st: ref Statement , idx: int , T: typedesc [
497- SomeOrdinal ]): SomeOrdinal =
496+ proc getColumn * (st: ref Statement , idx: int , T: typedesc [SomeOrdinal ]): SomeOrdinal =
498497 cast [T](sqlite3_column_int64 (st.raw, idx))
499498
500499proc getColumn * (st: ref Statement , idx: int , T: typedesc [string ]): string =
@@ -515,6 +514,8 @@ proc unpack*[T: tuple](st: ref Statement, _: typedesc[T]): T =
515514 value = st.getColumn (idx, type (value))
516515 idx.inc
517516
517+ {.pop .}
518+
518519proc exec * (db: var Database , sql: string ): int {.discardable .} =
519520 var st = db.fetchStatement (sql)
520521 defer : st.reset ()
0 commit comments