db

package module
v0.0.0-...-e1ca8e0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Dialect  string `json:"dialect"` // mysql,postgres,sqlite3
	Host     string `json:"host"`    // if Dialect is `sqlite3`, host should be db file path
	ReadHost string `json:"read_host"`
	Port     int    `json:"port"`
	User     string `json:"user"`
	Password string `json:"password"`
	Database string `json:"database"`
	Location string `json:"location,omitempty"`
	SSLMode  string `json:"sslmode,omitempty"` // postgres has this property, which could be "disable"
	Debug    bool   `json:"debug,omitempty"`
}

func SqliteInMemory

func SqliteInMemory() Config

func (Config) DSN

func (c Config) DSN() (string, error)

func (Config) ReadHostDSN

func (c Config) ReadHostDSN() (string, error)

Jump to

Keyboard shortcuts

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