Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InteractiveConfig ¶
InteractiveConfig gets the database configuration interactively from console. it takes default options and return new input options.
The parsed default options are:
- database: (string) the database name - REQUIRED
- address: (string) the database server address - REQUIRED
- username: (string) the database access username (if any)
- password: (string) the database access password (if any)
- connect_args: (string) holds connection params
func InteractiveSetup ¶
InteractiveSetup performs an interactive console based database setup. it takes database options and makes config validation.
The parsed options are:
- database: (string) the database name - REQUIRED
- address: (string) the database server address - REQUIRED
- username: (string) the database access username (if any)
- password: (string) the database access password (if any)
- connect_args: (string) holds connection params
Types ¶
type Config ¶
type Config struct { // Database name Database string // Database server address Address string // Database access username Username string // Database access password Password string // ConnectArgs holds connection params ConnectArgs string }
Config represents the database configuration params.
https://github.com/go-sql-driver/mysql?tab=readme-ov-file#dsn-data-source-name
func NewConfig ¶
NewConfig creates configuration object from options dict. it checks and returns error if not all options have valid values.
The parsed options are:
- database: (string) the database name - REQUIRED
- address: (string) the database server address - REQUIRED
- username: (string) the database access username (if any)
- password: (string) the database access password (if any)
- connect_args: (string) holds connection params
type Engine ¶
type Engine struct { // Log is the logger instance for database logging. Log *logging.Logger // contains filtered or unexported fields }
Engine represents the backend engine structure.
func (*Engine) CanRetryErr ¶
CanRetryErr checks weather an operation error type can be retried.
func (*Engine) SqlGenerator ¶
func (e *Engine) SqlGenerator() sqldb.SqlGenerator
SqlGenerator returns the engine SQL statment generator.
type SqlGenerator ¶
type SqlGenerator struct {
sqldb.StdSqlGenerator
}
SqlGenerator represents mysql SQL statment generator.