database

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v1.9.0

type Config struct {
	Dsn      string
	Host     string
	Port     int
	Database string
	Username string
	Password string
	// Only for Postgres
	Schema string
}

Config Used in config/database.go

type ConfigBuilder added in v1.15.0

type ConfigBuilder interface {
	Reads() []FullConfig
	Writes() []FullConfig
}

type Driver added in v1.15.0

type Driver string
const (
	DriverMysql     Driver = "mysql"
	DriverPostgres  Driver = "postgres"
	DriverSqlite    Driver = "sqlite"
	DriverSqlserver Driver = "sqlserver"
)

func (Driver) String added in v1.15.0

func (d Driver) String() string

type FullConfig added in v1.15.0

type FullConfig struct {
	Config
	Driver       Driver
	Connection   string
	Prefix       string
	Singular     bool
	Charset      string // Mysql, Sqlserver
	Loc          string // Mysql
	Sslmode      string // Postgres
	Timezone     string // Postgres
	NoLowerCase  bool
	NameReplacer Replacer
}

FullConfig Fill the default value for Config

type Replacer added in v1.15.0

type Replacer interface {
	Replace(name string) string
}

Replacer replacer interface like strings.Replacer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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