libsqldriver

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package libsqldriver implements driver.Driver for libSQL / Turso using the database/sql libsql driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LibSQLDriver

type LibSQLDriver struct {
	// contains filtered or unexported fields
}

LibSQLDriver implements driver.Driver over a libSQL/Turso connection.

func New

func New(dsn string, pc ...driver.PoolConfig) (*LibSQLDriver, error)

New opens a libSQL database at the given DSN (e.g. "libsql://name.turso.io?authToken=...").

func (*LibSQLDriver) Begin

func (d *LibSQLDriver) Begin(ctx context.Context) (driver.Tx, error)

func (*LibSQLDriver) BeginTx

func (d *LibSQLDriver) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)

BeginTx starts a transaction. libSQL supports only SERIALIZABLE isolation, so the requested level is ignored; the ReadOnly flag is forwarded.

func (*LibSQLDriver) Close

func (d *LibSQLDriver) Close()

func (*LibSQLDriver) Exec

func (d *LibSQLDriver) Exec(ctx context.Context, query string, args ...any) (int64, error)

func (*LibSQLDriver) Ping added in v0.5.0

func (d *LibSQLDriver) Ping(ctx context.Context) error

Ping verifies a working connection to the database.

func (*LibSQLDriver) Query

func (d *LibSQLDriver) Query(ctx context.Context, query string, args ...any) (driver.Rows, error)

func (*LibSQLDriver) QueryRow

func (d *LibSQLDriver) QueryRow(ctx context.Context, query string, args ...any) driver.Row

func (*LibSQLDriver) Stat added in v0.5.0

func (d *LibSQLDriver) Stat() driver.PoolStat

Stat returns a snapshot of the database/sql connection pool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL