database

package
v0.0.0-...-00fc209 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	User         string `yaml:"user"`
	Password     string `yaml:"password"`
	Host         string `yaml:"host"`
	Port         string `yaml:"port"`
	DatabaseName string `yaml:"database_name"`
}

Conf is the configuration for the database.

type Database

type Database interface {
	Connect() error
	Migrate() error
	Close() error
	Insert(ctx context.Context, query string, arguments ...interface{}) error
	BuildInsertQuery(table string, fields []string) string
}

Database is the interface that wraps the basic database operations.

func NewDatabase

func NewDatabase(databaseType DatabaseType) Database

NewDatabase returns a new database instance.

func NewTimescaleDB

func NewTimescaleDB() Database

NewTimescaleDB returns a new instance of timescaleDB.

type DatabaseType

type DatabaseType string

DatabaseType is the type of database.

const (
	TimeScaleDB DatabaseType = "timescaledb"
)

Database types

Jump to

Keyboard shortcuts

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