Documentation
¶
Index ¶
- Constants
- func File(location string, opts ...Option) (*sql.DB, error)
- func GetJournalMode(database db.DB) (string, error)
- func GetPragma[T any](database db.DB, name string) (T, error)
- func GetPragmaCacheSize(database db.DB) (int64, error)
- func GetWalCheckpoint(database db.DB) (int, int, int, error)
- func InMemory(opts ...Option) (*sql.DB, error)
- func ListTablesNames(db db.DB) ([]string, error)
- func Open(location string, config *Config) (*sql.DB, error)
- func OpenURI(uri *url.URL, opts ...Option) (*sql.DB, error)
- func ReadOnly(c *Config)
- type CacheMode
- type Config
- type DatabaseList
- type Option
- type Synchronous
Constants ¶
View Source
const ( PragmaSynchronous = "synchronous" PragmaJournalMode = "journal_mode" PragmaWalCheckpoint = "wal_checkpoint" PragmaCacheSize = "cache_size" PragmaApplicationID = "application_id" PragmaAutoVacuum = "auto_vacuum" PragmaAutomaticIndex = "automatic_index" PragmaDataVersion = "data_version" PragmaDatabaseList = "database_list" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DatabaseList ¶
func GetPragmaDatabaseList ¶
func GetPragmaDatabaseList(database db.DB) ([]DatabaseList, error)
type Option ¶
type Option func(c *Config)
func JournalMode ¶
JournalMode sets the database's journal_mode pragma.
func WalCheckpoint ¶
WalCheckpoint sets the database's wal_checkpoint pragma.
func WithCacheMode ¶
func WithPragma ¶
Pragma will add a database pragma.
Calling Pragma("journal_mode", "WAL") will end up executing PRAGMA journal_mode = WAL;
type Synchronous ¶
type Synchronous uint8
See https://www.sqlite.org/pragma.html
const ( SynchronousOff Synchronous = iota SynchronousNormal SynchronousFull SynchronousExtra )
func GetPragmaSynchronous ¶
func GetPragmaSynchronous(database db.DB) (Synchronous, error)
Click to show internal directories.
Click to hide internal directories.