Documentation
¶
Overview ¶
Package sqlite provides a SQLite-backed implementation of refid.SequenceStore using database/sql and raw SQL — no ORM. Import a SQLite driver (e.g. modernc.org/sqlite, which is pure Go — no CGO), open a connection with sql.Open, and pass the resulting *sql.DB to New.
SQLite allows only one writer at a time via a whole-database file lock, and nothing sets a busy_timeout by default, so concurrent access can fail immediately with SQLITE_BUSY. Set a busy timeout in the DSN (e.g. "file:refid.db?_busy_timeout=5000") if you need Next to wait instead of failing, or use refid/store/postgres for real concurrent-safe access.
Index ¶
Constants ¶
const DefaultTableName = "refid_sequences"
DefaultTableName is the default table name used for sequence counters.
Variables ¶
This section is empty.
Functions ¶
func Migrate ¶
Migrate creates the sequence-counter table if it does not already exist. Pass WithTableName to migrate a custom table name.
Types ¶
type Option ¶
type Option func(*config)
Option configures optional behavior for a SQLite SequenceStore.
func WithTableName ¶
WithTableName overrides the default table name ("refid_sequences"). An invalid name (must match [a-zA-Z_][a-zA-Z0-9_]*) is recorded and surfaced as an error from New or Migrate — never a panic.