Documentation
¶
Overview ¶
Package sqlitetest opens in-memory SQLite databases for unit tests using modernc.org/sqlite.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenClient ¶
OpenClient opens a private in-memory SQLite database and returns an ent client with schema applied. dbName is a caller hint only; a unique suffix is always appended so shared-memory SQLite databases never collide across parallel tests or -count>1 (raw CREATE TABLE is not idempotent).
Schema is materialized once into a temp-file template, then each OpenClient clones it via SQLite's Online Backup API (NewRestore). Replaying hundreds of DDL statements under -race (or calling Atlas Schema.Create per test) is prohibitively slow for packages such as internal/modules/web.
Types ¶
This section is empty.