feat: Added Sqlite reader
Some checks failed
CI / Test (1.24) (push) Successful in -23m3s
CI / Test (1.25) (push) Successful in -22m45s
CI / Lint (push) Failing after -25m11s
CI / Build (push) Failing after -25m26s
Integration Tests / Integration Tests (push) Successful in -25m38s

This commit is contained in:
2026-02-07 09:30:45 +02:00
parent c9eed9b794
commit d0630b4899
1370 changed files with 6350551 additions and 361 deletions

62
vendor/modernc.org/sqlite/tx.go generated vendored Normal file
View File

@@ -0,0 +1,62 @@
// Copyright 2025 The Sqlite Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sqlite // import "modernc.org/sqlite"
import (
"context"
"database/sql/driver"
"modernc.org/libc"
sqlite3 "modernc.org/sqlite/lib"
)
type tx struct {
c *conn
}
func newTx(ctx context.Context, c *conn, opts driver.TxOptions) (*tx, error) {
r := &tx{c: c}
sql := "begin"
if !opts.ReadOnly && c.beginMode != "" {
sql = "begin " + c.beginMode
}
if err := r.exec(ctx, sql); err != nil {
return nil, err
}
return r, nil
}
// Commit implements driver.Tx.
func (t *tx) Commit() (err error) {
return t.exec(context.Background(), "commit")
}
// Rollback implements driver.Tx.
func (t *tx) Rollback() (err error) {
return t.exec(context.Background(), "rollback")
}
func (t *tx) exec(ctx context.Context, sql string) (err error) {
psql, err := libc.CString(sql)
if err != nil {
return err
}
defer t.c.free(psql)
//TODO use t.conn.ExecContext() instead
if ctx != nil && ctx.Done() != nil {
defer interruptOnDone(ctx, t.c, nil)()
}
if rc := sqlite3.Xsqlite3_exec(t.c.tls, t.c.db, psql, 0, 0, 0); rc != sqlite3.SQLITE_OK {
return t.c.errstr(rc)
}
return nil
}