summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/stmt.go
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-04-28 11:20:24 +0000
committerLibravatar kim <gruf@noreply.codeberg.org>2025-04-28 11:20:24 +0000
commit436765a6a2ddf400b6e06c9a7c3283b1351fcbcd (patch)
treec1a0e969c23a74eaca258c709db1776763d576dd /vendor/github.com/ncruces/go-sqlite3/stmt.go
parent[chore] Update build to use new woodpecker dind container, bump version numbe... (diff)
downloadgotosocial-436765a6a2ddf400b6e06c9a7c3283b1351fcbcd.tar.xz
bump dependencies: minio-go, go-sqlite3, goldmark, otel, x/image/webp (#4075)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4075 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
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)