Documentation
¶
Overview ¶
Package turso provides the Turso Database engine implementation.
Turso Database is the Rust rewrite of SQLite (formerly "Limbo"). It is compatible with SQLite at the SQL and file-format level, so this engine reuses the SQLite schema parser, SQL generator, and type mapper. It differs from the SQLite engine in three ways:
- DefaultDriver reports the official Turso database/sql driver (turso.tech/database/tursogo, registered under the name "turso").
- SupportsFeature reflects Turso's compatibility matrix: SQLite's FTS3/4/5 are not implemented (Turso ships a separate Tantivy-based full-text engine instead).
- The type mapper recognises Turso's native vector columns (F32_BLOB), mapping them to a Go []float32 instead of an opaque []byte.
Index ¶
- Constants
- func New(opts engine.Options) (engine.Engine, error)
- type Engine
- func (e *Engine) BulkInsertStrategy() engine.BulkInsertStrategy
- func (e *Engine) ConnectionPool() engine.ConnectionPoolConfig
- func (e *Engine) DefaultDriver() string
- func (e *Engine) IsolationLevels() (supported []engine.IsolationLevel, defaultLevel engine.IsolationLevel)
- func (e *Engine) Name() string
- func (e *Engine) QueryHints() []engine.QueryHint
- func (e *Engine) SQLGenerator() engine.SQLGenerator
- func (e *Engine) SchemaParser() schemaparser.SchemaParser
- func (e *Engine) SupportsFeature(feature engine.Feature) bool
- func (e *Engine) TypeMapper() engine.TypeMapper
Constants ¶
const ( // DriverImport is the Go module path for the official Turso database/sql driver. DriverImport = "turso.tech/database/tursogo" // DriverName is the name the Turso driver registers with database/sql, // i.e. the first argument to sql.Open. DriverName = "turso" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine implements the engine.Engine interface for Turso Database. It delegates SQLite-compatible behavior to an embedded SQLite engine and overrides only the Turso-specific surface.
func (*Engine) BulkInsertStrategy ¶
func (e *Engine) BulkInsertStrategy() engine.BulkInsertStrategy
BulkInsertStrategy returns the :copyfrom strategy for Turso, delegating to the underlying SQLite engine (runtime multi-row VALUES with "?" placeholders).
func (*Engine) ConnectionPool ¶
func (e *Engine) ConnectionPool() engine.ConnectionPoolConfig
ConnectionPool returns recommended connection pool settings.
func (*Engine) DefaultDriver ¶
DefaultDriver returns the default Go driver import path for Turso.
func (*Engine) IsolationLevels ¶
func (e *Engine) IsolationLevels() (supported []engine.IsolationLevel, defaultLevel engine.IsolationLevel)
IsolationLevels returns supported isolation levels for Turso.
func (*Engine) QueryHints ¶
QueryHints returns available query hints for Turso.
func (*Engine) SQLGenerator ¶
func (e *Engine) SQLGenerator() engine.SQLGenerator
SQLGenerator returns the SQL generator. Turso emits SQLite-dialect DDL.
func (*Engine) SchemaParser ¶
func (e *Engine) SchemaParser() schemaparser.SchemaParser
SchemaParser returns the schema parser. Turso parses SQLite DDL.
func (*Engine) SupportsFeature ¶
SupportsFeature reports whether Turso supports a specific feature. Turso targets full SQLite compatibility, so it inherits the SQLite matrix except where its implementation diverges.
func (*Engine) TypeMapper ¶
func (e *Engine) TypeMapper() engine.TypeMapper
TypeMapper returns the Turso type mapper (SQLite types plus native vectors).