rdbms

package
v0.0.0-...-80f8683 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPrepareStatement = "error when tying to prepare statement"

	ErrCreate    = "error when tying to create entry"
	ErrDuplicate = "entry exists"

	ErrRead         = "error when tying to read entry"
	ErrReadNotFound = "there is no entry with provided arguments"

	ErrUpdate = "error when tying to update entry"

	ErrDelete = "error when tying to delete entry"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string `koanf:"host"`
	Port     int    `koanf:"port"`
	Username string `koanf:"username"`
	Password string `koanf:"password"`
	Database string `koanf:"database"`
}

type RDBMS

type RDBMS interface {
	MigrateUp(source string) error

	MigrateDown(source string) error

	Create(query string, args []any) (uint64, error)

	Read(query string, args []any, dest []any) error

	Update(query string, args []any) error

	Delete(query string, args []any) error
}

func NewMysql

func NewMysql(cfg *Config) (RDBMS, error)

func NewPostgres

func NewPostgres(cfg *Config) (RDBMS, error)

Jump to

Keyboard shortcuts

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