db

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomString

func RandomString(n int) string

RandomString generates a random string of length `n`.

func SetLogger

func SetLogger(l *zap.SugaredLogger)

Types

type DB

type DB struct {
	*sql.DB
	// contains filtered or unexported fields
}

func OpenDB

func OpenDB(file string) *DB

OpenDB opens sqlite database file.

func OpenTestDB

func OpenTestDB() *DB

OpenTestDB opens an in-memory sqlite database for use in tests.

func (*DB) MigrateDown

func (db *DB) MigrateDown(s string) error

func (*DB) MigrateDownFromFile

func (db *DB) MigrateDownFromFile(file string) error

func (*DB) MigrateUp

func (db *DB) MigrateUp(s string) error

func (*DB) MigrateUpFromFile

func (db *DB) MigrateUpFromFile(file string) error

Jump to

Keyboard shortcuts

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