database

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Driver   Driver
	Host     string
	Port     uint32
	Username string
	Password string
	DbName   string

	HistoryTable string

	Db *sql.DB
}

func New

func New(config *Config) (*Config, error)

type Database

type Database interface {
	Read(cat string) ([]*Row, error)
	Insert(cat, ver string, name string, desc string, checksum string) (*Row, error)
	Update(seq uint64, execTime uint32, success bool) error
	Exec(script string) error
}

type Driver

type Driver rune
const (
	MySQLDriver Driver = iota
)

type Row

type Row struct {
	Sequence      uint64
	Category      string
	Version       string
	ScriptName    string
	Description   string
	Checksum      string
	AppliedBy     string
	AppliedAt     uint64
	ExecutionTime uint32
	Success       bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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