database

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: AGPL-3.0 Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

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

type Driver

type Driver string
const (
	DriverMysql     Driver = "mysql"
	DriverPostgres  Driver = "postgres"
	DriverSqlite    Driver = "sqlite"
	DriverSqlserver Driver = "sqlserver"
	DriverTurso     Driver = "turso"
	DriverOracle    Driver = "oracle"
	DriverArray     Driver = "array"
)

func (Driver) String

func (d Driver) String() string

String returns the string representation of the Driver.

type FullConfig

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

type Replacer interface {
	Replace(name string) string
}

Replacer replacer interface like strings.Replacer

Directories

Path Synopsis
orm

Jump to

Keyboard shortcuts

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