db

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POSTGRES      = "postgres"
	MATERIALIZE   = "materialize"
	MYSQL         = "mysql"
	CLICKHOUSE    = "clickhouse"
	MONGODB       = "mongodb"
	ELASTICSEARCH = "elasticsearch"
	TIMESCALE     = "timescale"
)

Variables

This section is empty.

Functions

func EnsureTable

func EnsureTable(gormDb *gorm.DB, tableName string, model interface{}) error

EnsureTable creates a table according to the specified model if it does not already exist.

func GenerateClickhouseDsn

func GenerateClickhouseDsn(params ConnectionParams) string

GenerateClickhouseDsn generates a dsn from the provided connection params

func GenerateMysqlDsn

func GenerateMysqlDsn(params ConnectionParams) string

GenerateMysqlDsn generates a Mysql Dsn from the provided connection params

func GenerateMzDsn

func GenerateMzDsn(params ConnectionParams) string

GenerateMzDsn generates a Materialize dsn from the provided connection params

func GeneratePostgresDsn

func GeneratePostgresDsn(params ConnectionParams) string

GeneratePostgresDsn generates a dsn from the provided connection params

Types

type BasePKeylessModel

type BasePKeylessModel struct {
	CreatedAt time.Time  `json:"-" sql:"index"`
	UpdatedAt time.Time  `json:"-" sql:"index"`
	DeletedAt *time.Time `json:"-" sql:"index"`
}

type ConnectionParams

type ConnectionParams struct {
	Host string
	Port uint16
	Db   string
	User string
	Pass string
}

Jump to

Keyboard shortcuts

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