summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/stmt.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/stmt.go')
-rw-r--r--vendor/github.com/ncruces/go-sqlite3/stmt.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/stmt.go b/vendor/github.com/ncruces/go-sqlite3/stmt.go
index 1ea726ea1..7fa2a504d 100644
--- a/vendor/github.com/ncruces/go-sqlite3/stmt.go
+++ b/vendor/github.com/ncruces/go-sqlite3/stmt.go
@@ -110,10 +110,7 @@ func (s *Stmt) Step() bool {
s.err = INTERRUPT
return false
}
- return s.step()
-}
-func (s *Stmt) step() bool {
rc := res_t(s.c.call("sqlite3_step", stk_t(s.handle)))
switch rc {
case _ROW:
@@ -141,10 +138,9 @@ func (s *Stmt) Exec() error {
if s.c.interrupt.Err() != nil {
return INTERRUPT
}
- // TODO: implement this in C.
- for s.step() {
- }
- return s.Reset()
+ rc := res_t(s.c.call("sqlite3_exec_go", stk_t(s.handle)))
+ s.err = nil
+ return s.c.error(rc)
}
// Status monitors the performance characteristics of prepared statements.
@@ -649,6 +645,7 @@ func (s *Stmt) ColumnValue(col int) Value {
// [FLOAT] as float64, [NULL] as nil,
// [TEXT] as string, and [BLOB] as []byte.
func (s *Stmt) Columns(dest ...any) error {
+ defer s.c.arena.mark()()
types, ptr, err := s.columns(int64(len(dest)))
if err != nil {
return err
@@ -701,6 +698,7 @@ func (s *Stmt) Columns(dest ...any) error {
// Any []byte are owned by SQLite and may be invalidated by
// subsequent calls to [Stmt] methods.
func (s *Stmt) ColumnsRaw(dest ...any) error {
+ defer s.c.arena.mark()()
types, ptr, err := s.columns(int64(len(dest)))
if err != nil {
return err
@@ -739,7 +737,6 @@ func (s *Stmt) ColumnsRaw(dest ...any) error {
}
func (s *Stmt) columns(count int64) ([]byte, ptr_t, error) {
- defer s.c.arena.mark()()
typePtr := s.c.arena.new(count)
dataPtr := s.c.arena.new(count * 8)