db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DialectSQLite3  = "sqlite3"
	DialectPostgres = "postgres"
)

Variables

This section is empty.

Functions

func NewPersister

func NewPersister(config Config) (persistence.Persister, error)

Types

type Config

type Config struct {
	Dialect  string
	SQLite   sqlite.Opts
	Postgres postgres2.Opts

	Logger       *zap.Logger
	QueryTimeout time.Duration
}

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

func NewMigrator

func NewMigrator(config Config) (*Migrator, error)

func (*Migrator) Close

func (m *Migrator) Close() (error, error)

func (*Migrator) NeedsMigration

func (m *Migrator) NeedsMigration() (bool, error)

func (*Migrator) Printf

func (m *Migrator) Printf(format string, v ...interface{})

func (*Migrator) Reset

func (m *Migrator) Reset() error

func (*Migrator) Status

func (m *Migrator) Status() (current uint, latest uint, err error)

func (*Migrator) Up

func (m *Migrator) Up() error

func (*Migrator) Verbose

func (m *Migrator) Verbose() bool

type SQLite

type SQLite struct {
	Filename string
	InMemory bool
}

Jump to

Keyboard shortcuts

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