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 ¶
type ClientResolver func(context.Context) (sql_sqlite_wasm_rpc.SRPCSqliteBridgeClient, error)
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 ¶
Description describes the physical database reached through the bridge.
func (Config) DriverName ¶
DriverName identifies the bridge; instance-bound callers use OpenStore.
func (Config) IsBusyError ¶
IsBusyError identifies contention reported by a SQLite backend.
func (Config) IsNestedTxError ¶
IsNestedTxError identifies a connection with an unfinished transaction.
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.
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.