bump ncruces/go-sqlite3 to v0.21.0 (#3621)

This commit is contained in:
kim
2024-12-12 19:44:53 +00:00
committed by GitHub
parent 60acdb21a9
commit fb12bbb10b
42 changed files with 224 additions and 105 deletions

View File

@ -582,7 +582,9 @@ func (s *Stmt) ColumnRawBlob(col int) []byte {
func (s *Stmt) columnRawBytes(col int, ptr uint32) []byte {
if ptr == 0 {
r := s.c.call("sqlite3_errcode", uint64(s.c.handle))
s.err = s.c.error(r)
if r != _ROW && r != _DONE {
s.err = s.c.error(r)
}
return nil
}
@ -637,7 +639,7 @@ func (s *Stmt) ColumnValue(col int) Value {
// [TEXT] as string, and [BLOB] as []byte.
// Any []byte are owned by SQLite and may be invalidated by
// subsequent calls to [Stmt] methods.
func (s *Stmt) Columns(dest []any) error {
func (s *Stmt) Columns(dest ...any) error {
defer s.c.arena.mark()()
count := uint64(len(dest))
typePtr := s.c.arena.new(count)
@ -666,6 +668,10 @@ func (s *Stmt) Columns(dest []any) error {
dest[i] = nil
default:
ptr := util.ReadUint32(s.c.mod, dataPtr+0)
if ptr == 0 {
dest[i] = []byte{}
continue
}
len := util.ReadUint32(s.c.mod, dataPtr+4)
buf := util.View(s.c.mod, ptr, uint64(len))
if types[i] == byte(TEXT) {