Versions in this module Expand all Collapse all v2 v2.0.2 Nov 29, 2021 Changes in this version + var ErrNoData = errors.New("No data") + var ErrQuerierIsNil = errors.New("Queryer is nil ") + var ErrTableFound = errors.New("no table found or no columns in table ") + var ErrTableNameEmpty = errors.New("table name is empty") + 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 struct + func NewBuilder() *Builder + func (b *Builder) Add(statement string, args ...interface{}) + func (b *Builder) Order(statement string) + func (b *Builder) Pagination(limit int, offset int) + func (b *Builder) RawSQL() string + func (b *Builder) Select(statement string, args ...interface{}) + func (b *Builder) Values() []interface{} + type Column struct + DataType string + Default *string + Description *string + HasUniqueIndex bool + Import []string + IsArray bool + IsNullable bool + IsPrimaryKey bool + ModelName string + ModelType string + Name string + Schema string + Sequence *string + Table string + Tags string + UniqueIndexName *string + type Columns []Column + type Config struct + Binary bool + ConnectionIdle int + DBName string + Host string + MaxConnections int + Password string + Port int + SslMode string + UserName string + func (c *Config) Connect() (db *DB, e goerr.IError) + func (c *Config) ConnectionURL() (url string, e goerr.IError) + type DB struct + Debug bool + 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 []string + func (im *Imports) Add(value string) + type Migration struct + DownSQL []string + Name string + UpSQL []string + func (m *Migration) Down(q Queryer) (e goerr.IError) + func (m *Migration) Up(q Queryer) (e goerr.IError) + type Queryer interface + Exec func(query string, args ...interface{}) (sql.Result, goerr.IError) + Query func(query string, args ...interface{}) (*sql.Rows, goerr.IError) + QueryRow func(query string, args ...interface{}) (*sql.Row, goerr.IError) + type Tx struct + Debug bool + func (b *Tx) Exec(query string, args ...interface{}) (res sql.Result, e goerr.IError) + func (b *Tx) Query(query string, args ...interface{}) (rows *sql.Rows, e goerr.IError) + func (b *Tx) QueryRow(query string, args ...interface{}) (row *sql.Row, e goerr.IError) Other modules containing this package github.com/cadyrov/gopsql