sqlite

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 1

README

sqlite

This package registers a SQLite database/sql driver as sqlite and selects its implementation at build time:

Build Backend
TinyGo or -tags force_tinygo_logic Petitweb tinygosqlite
Standard Go with cgo github.com/mattn/go-sqlite3
Standard Go without cgo modernc.org/sqlite
import "github.com/shibukawa/tinygodriver/database/sql/sqlite"

db, err := sqlite.Open("app.db")

For portable applications, use a plain filename, :memory:, or a file: URI limited to SQLite's mode, cache, and immutable parameters. The Petitweb native backend additionally accepts busy_timeout in milliseconds.

See BENCHMARK.md for a reproducible host-backend baseline.

PostgreSQL is covered by pgx, including TLS. MySQL is not: its maintained Go drivers do not currently form a reliable TinyGo-compatible path, so generators, examples, and compatibility guarantees do not cover it.

Documentation

Overview

Package sqlite selects a database/sql SQLite backend appropriate for the active Go toolchain. Importing the package registers DriverName.

Index

Constants

View Source
const Backend = "mattn"

Backend identifies the implementation selected by build constraints.

View Source
const DriverName = "sqlite"

DriverName is the portable database/sql driver name.

Variables

This section is empty.

Functions

func Open

func Open(dsn string) (*sql.DB, error)

Open opens a database using the selected backend.

Types

This section is empty.

Directories

Path Synopsis
Package tinygosqlite provides a small database/sql driver backed by the statically linked, official SQLite amalgamation.
Package tinygosqlite provides a small database/sql driver backed by the statically linked, official SQLite amalgamation.

Jump to

Keyboard shortcuts

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