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

sqlengine

package
v0.5.6-alpha02-pure-go... Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDSN

func BuildDSN(dsn string) (string, map[string]string, error)

BuildDSN is the single place embedded-engine DSNs are constructed. It translates legacy `_param=value` shorthands to modernc `_pragma=name(value)` directives, passes through modernc-native and plain URI parameters, rejects unknown underscore parameters (modernc would silently ignore them), and injects the 5000ms legacy busy_timeout default when unset. An empty dsn selects the default shared in-memory database. The returned map records every pragma the DSN sets, for the startup assertion.

func GetSQLEngineSetupDDL

func GetSQLEngineSetupDDL(engineType string) (string, error)

Types

type SQLEngine

type SQLEngine interface {
	GetDB() (*sql.DB, error)
	GetTx() (*sql.Tx, error)
	Exec(string, ...interface{}) (sql.Result, error)
	Query(string, ...interface{}) (*sql.Rows, error)
	QueryRow(query string, args ...any) *sql.Row
	// ExecFileLocal(string) error
	// ExecFile(string) error
	ExecInTxn(queries []string) error
	GetCurrentGenerationID() (int, error)
	GetNextGenerationID() (int, error)
	GetCurrentSessionID(int) (int, error)
	GetNextSessionID(int) (int, error)
	GetCurrentDiscoveryGenerationID(discoveryID string) (int, error)
	GetNextDiscoveryGenerationID(discoveryID string) (int, error)
	CacheStoreGet(string) ([]byte, error)
	CacheStoreGetAll() ([]internaldto.KeyVal, error)
	CacheStorePut(string, []byte, string, int) error
	IsMemory() bool
}

func NewSQLEngine

func NewSQLEngine(cfg dto.SQLBackendCfg, controlAttributes sqlcontrol.ControlAttributes) (SQLEngine, error)

Jump to

Keyboard shortcuts

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