db

package
v0.11.10 Latest Latest
Warning

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

Go to latest
Published: Aug 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

func GenerateClickhouseDsn

func GenerateClickhouseDsn(params ConnectionParams) string

func GenerateMysqlDsn

func GenerateMysqlDsn(params ConnectionParams) string

func GenerateMzDsn

func GenerateMzDsn(params ConnectionParams) string

func GeneratePostgresDsn

func GeneratePostgresDsn(params ConnectionParams) string

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