sqlite

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const FilepathMemory = ":memory:"

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase(
	ctx context.Context,
	fpath string,
	log *zap.Logger,
	logQueries bunx.LogQueriesFlag,
) (*bun.DB, error)

func RunMigrations

func RunMigrations(db *bun.DB, fpath string, migrationsDir string, log any) error

Types

type MasterModel

type MasterModel struct {
	bun.BaseModel `bun:"table:sqlite_master,alias:sqlite_master"`

	Name string `bun:"name"`
}

func ListTables

func ListTables(ctx context.Context, db *bun.DB) ([]MasterModel, error)

Jump to

Keyboard shortcuts

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