sqlite

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FmtTimestampDay    = datetimes.FmtTimestampDay
	FmtTimestampHour   = datetimes.FmtTimestampHour
	FmtTimestampMinute = datetimes.FmtTimestampMinute
	FmtDateTime        = datetimes.FmtDateTime
	FmtDate            = datetimes.FmtDate
	FmtTime            = datetimes.FmtTime

	// SQLite datetime format strings
	SQLiteFmtDatetime = "%Y-%m-%d %H:%M:%S"
	SQLiteFmtMinute   = "%Y-%m-%d %H:%M"
	SQLiteFmtHour     = "%Y-%m-%d %H"
	SQLiteFmtDay      = "%Y-%m-%d"
)
View Source
const (
	ERR_UNDEFINED_DSN = "connection error: SQLite DSN '%s' is undefined\n"
)

Variables

This section is empty.

Functions

func MustConnect

func MustConnect(dsn string, opts ...Option) *sql.DB

MustConnect returns a new DB connection

func ParseSQLiteDateTime added in v0.3.0

func ParseSQLiteDateTime(t string) time.Time

Types

type Option

type Option func(db *sql.DB) error

func CacheSize

func CacheSize(cacheSize int) Option

func EncodingUTF8

func EncodingUTF8() Option

func JournalWAL

func JournalWAL() Option

func MaxOpenConnections

func MaxOpenConnections(conns int) Option

func PageSize

func PageSize(pageSize int) Option

func Vacuum

func Vacuum() Option

Vacuum rebuilds the DB file to keep it tidy

func WALCheckpoint

func WALCheckpoint() Option

WalCheckpoint commits the WAL; DO NOT USE

Jump to

Keyboard shortcuts

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