turso

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 5 Imported by: 0

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

View Source
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

func New

func New(opts engine.Options) (engine.Engine, error)

New creates a new Turso engine instance.

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

func (e *Engine) DefaultDriver() string

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) Name

func (e *Engine) Name() string

Name returns the engine identifier.

func (*Engine) QueryHints

func (e *Engine) QueryHints() []engine.QueryHint

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

func (e *Engine) SupportsFeature(feature engine.Feature) bool

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).

Jump to

Keyboard shortcuts

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