Documentation
¶
Index ¶
- Variables
- func CreateFile(filePath string) (*os.File, string, error)
- func CreateMigrationTable(q Queryer) (e goerr.IError)
- func GetTableColumns(q Queryer, schema string, table string) (columns *Columns, imports *Imports, e error)
- func MakeModel(db Queryer, filePath string, schema string, table string, templatePath string) error
- func SnakeToCamel(value string, firstTitle bool) (res string)
- func SnakeToCamelWithGOData(value string, firstTitle bool) (res string)
- type Builder
- type Column
- type Columns
- type Config
- type DB
- func (b *DB) Begin() (tx *Tx, e goerr.IError)
- func (b *DB) Exec(query string, args ...interface{}) (res sql.Result, e goerr.IError)
- func (b *DB) Query(query string, args ...interface{}) (rows *sql.Rows, e goerr.IError)
- func (b *DB) QueryRow(query string, args ...interface{}) (row *sql.Row, e goerr.IError)
- type Imports
- type Migration
- type Queryer
- type Tx
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTableFound = errors.New("no table found or no columns in table ") ErrTableNameEmpty = errors.New("table name is empty") )
View Source
var ( ErrQuerierIsNil = errors.New("Queryer is nil ") ErrNoData = errors.New("No data") )
Functions ¶
func CreateMigrationTable ¶
func CreateMigrationTable(q Queryer) (e goerr.IError)
func GetTableColumns ¶
func GetTableColumns(q Queryer, schema string, table string) (columns *Columns, imports *Imports, e error)
Get table columns from db.
func SnakeToCamel ¶
func SnakeToCamelWithGOData ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *Builder
func (*Builder) Pagination ¶
type Config ¶
type Config struct { Host string `json:"host" yaml:"host"` Port int `json:"port" yaml:"port"` UserName string `json:"userName" yaml:"userName"` DBName string `json:"dbName" yaml:"dbName"` Password string `json:"password" yaml:"password"` SslMode string `json:"sslMode" yaml:"sslMode"` Binary bool `json:"binary" yaml:"binary"` MaxConnections int `json:"maxConnections" yaml:"maxConnections"` ConnectionIdle int `json:"connectionIdle" yaml:"connectionIdle"` }
func (*Config) ConnectionURL ¶
type Migration ¶
Click to show internal directories.
Click to hide internal directories.