sqliteconn

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package sqliteconn opens SQLite connections that run a fixed set of statements, usually pragmas, on every connection the pool opens, and provides the bun dialect for them. It has no Shisho imports, so both pkg/database and pkg/testutils/testdb can use it.

Pragmas such as foreign_keys and busy_timeout apply only to the connection that ran them. database/sql discards a connection whose query is canceled mid-statement and opens a replacement with SQLite's defaults, so running them once at startup is not enough.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnector

func NewConnector(dsn string, statements ...string) (driver.Connector, error)

NewConnector returns a connector for dsn on the sqliteshim driver that runs statements, in order, on each new connection before handing it out.

func NewDialect added in v0.3.0

func NewDialect() schema.Dialect

NewDialect returns the bun dialect Shisho uses for SQLite. It drops NUL bytes from string values instead of failing the query.

bun's own dialect rejects any string containing a NUL byte. Shisho stores text read from book files, and M4B tags, PDF Info strings, and plugin results can carry stray NULs that are never part of the text. Rejecting them would fail a whole scan or save over one unprintable byte.

Types

This section is empty.

Jump to

Keyboard shortcuts

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