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