Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlite_rpc

package
v0.57.28 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package sqlite_rpc connects database/sql to an instance-bound SQLite bridge.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenStore

func OpenStore(ctx context.Context, client sql_sqlite_wasm_rpc.SRPCSqliteBridgeClient, path, table string) (*common.Store[Config], error)

OpenStore opens the existing KVTX implementation over a supplied SQLite bridge. The bridge configures durability on every physical connection it creates.

Types

type ClientResolver

ClientResolver waits for the SQLite bridge that will own a connection.

type Config

type Config struct{}

Config classifies SQLite bridge errors for the existing KV transaction owner.

func (Config) Description

func (Config) Description() string

Description describes the physical database reached through the bridge.

func (Config) DriverName

func (Config) DriverName() string

DriverName identifies the bridge; instance-bound callers use OpenStore.

func (Config) IsBusyError

func (Config) IsBusyError(err error) bool

IsBusyError identifies contention reported by a SQLite backend.

func (Config) IsNestedTxError

func (Config) IsNestedTxError(err error) bool

IsNestedTxError identifies a connection with an unfinished transaction.

func (Config) OpenDSN

func (Config) OpenDSN(path string) string

OpenDSN preserves the database path supplied to its bridge.

type Connector

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

Connector binds one SQL pool to its database path and bridge lifetime.

func NewConnector

func NewConnector(client sql_sqlite_wasm_rpc.SRPCSqliteBridgeClient, path string) *Connector

NewConnector constructs an instance-bound connector for sql.OpenDB.

func (*Connector) Connect

func (c *Connector) Connect(ctx context.Context) (driver.Conn, error)

Connect opens a physical connection using the pool's cancellation context.

func (*Connector) Driver

func (c *Connector) Driver() driver.Driver

Driver returns the driver used to construct this connector.

type Driver

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

Driver connects SQL pools to the bridge supplied by their runtime.

func NewDriver

func NewDriver(resolve ClientResolver) *Driver

NewDriver constructs a driver whose connector retains its runtime resolver.

func (*Driver) Open

func (d *Driver) Open(path string) (driver.Conn, error)

Open opens a connection for callers that do not support DriverContext.

func (*Driver) OpenConnector

func (d *Driver) OpenConnector(path string) (driver.Connector, error)

OpenConnector binds a database path without opening a connection.

Jump to

Keyboard shortcuts

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