Versions in this module Expand all Collapse all v2 v2.1.3 Feb 5, 2023 Changes in this version + type ILogger interface + Fatal func(v ...interface{}) + Fatalf func(format string, v ...interface{}) + Fatalln func(v ...interface{}) + Output func(callDepth int, message string) error + Panic func(v ...interface{}) + Panicf func(format string, v ...interface{}) + Panicln func(v ...interface{}) + Print func(v ...interface{}) + Printf func(format string, v ...interface{}) + Println func(v ...interface{}) v2.1.2 Feb 5, 2023 Changes in this version + type Connection interface + GetConnMaxLifetime func() int + GetDbType func() string + GetMaxConnection func() int + GetMaxIdleConns func() int + String func() string + type ConnectionConfig struct + ConnectionIdleLifetime int + Host string + MaxConnections int + MaxIdleConnections int + Name string + Password string + Port int + User string + func (cc *ConnectionConfig) GetConnMaxLifetime() int + func (cc *ConnectionConfig) GetMaxConnection() int + func (cc *ConnectionConfig) GetMaxIdleConns() int + type DBO struct + Connection Connection + func (dbo *DBO) Begin() (*SqlTx, error) + func (dbo *DBO) BeginContext(ctx context.Context) (*SqlTx, error) + func (dbo *DBO) Exec(query string, args ...interface{}) (sql.Result, error) + func (dbo *DBO) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + func (dbo *DBO) Prepare(query string) (*SqlStmt, error) + func (dbo *DBO) PrepareContext(ctx context.Context, query string) (*SqlStmt, error) + func (dbo *DBO) Query(query string, args ...interface{}) (*sql.Rows, error) + func (dbo *DBO) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + func (dbo *DBO) QueryRow(query string, args ...interface{}) *sql.Row + func (dbo *DBO) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row + func (dbo DBO) Init() (*DBO, error) + type IMigrationFile interface + Down func(tx *SqlTx) error + GetVersion func() string + Up func(tx *SqlTx) error + type Migration struct + Config ConnectionConfig + DBO *DBO + MigrationPath string + Registry MigrationRegistry + RegistryPath string + RegistryXPath string + func (m *Migration) CreateMigrationFile(class string, name string) error + func (m *Migration) Downgrade(class string, version string) error + func (m *Migration) GetTemplate() *template.Template + func (m *Migration) InitMigration(class string) error + func (m *Migration) Upgrade(class string) error + type MigrationRegistry map[string][]IMigrationFile + type Options struct + Debug bool + Logger gocli.Logger + TransactionTTL time.Duration + type PostgresConnectionConfig struct + BinaryParameters bool + SSLMode string + func (pcc *PostgresConnectionConfig) GetDbType() string + func (pcc *PostgresConnectionConfig) String() string + type Queryer interface + Exec func(query string, args ...interface{}) (sql.Result, error) + Prepare func(query string) (*SqlStmt, error) + Query func(query string, args ...interface{}) (*sql.Rows, error) + QueryContext func(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + QueryRow func(query string, args ...interface{}) *sql.Row + QueryRowContext func(ctx context.Context, query string, args ...interface{}) *sql.Row + type SqlStmt struct + func (st *SqlStmt) Exec(args ...interface{}) (sql.Result, error) + func (st *SqlStmt) ExecContext(ctx context.Context, args ...interface{}) (sql.Result, error) + func (st *SqlStmt) Query(args ...interface{}) (*sql.Rows, error) + func (st *SqlStmt) QueryContext(ctx context.Context, args ...interface{}) (*sql.Rows, error) + func (st *SqlStmt) QueryRow(args ...interface{}) *sql.Row + func (st *SqlStmt) QueryRowContext(ctx context.Context, args ...interface{}) *sql.Row + type SqlTx struct + func (tx *SqlTx) Commit() error + func (tx *SqlTx) Exec(query string, args ...interface{}) (sql.Result, error) + func (tx *SqlTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + func (tx *SqlTx) Prepare(query string) (*SqlStmt, error) + func (tx *SqlTx) PrepareContext(ctx context.Context, query string) (*SqlStmt, error) + func (tx *SqlTx) Query(query string, args ...interface{}) (*sql.Rows, error) + func (tx *SqlTx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + func (tx *SqlTx) QueryRow(query string, args ...interface{}) *sql.Row + func (tx *SqlTx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row + func (tx *SqlTx) Rollback() error + func (tx *SqlTx) Stmt(stmt *SqlStmt) *SqlStmt + func (tx *SqlTx) StmtContext(ctx context.Context, stmt *SqlStmt) *SqlStmt + type Transaction struct + TTL int + type TransactionId string + func GenTransactionId() TransactionId + type TransactionPool struct + func NewTransactionPool() *TransactionPool + func (p *TransactionPool) Count() int + func (p *TransactionPool) Get(id TransactionId) *SqlTx + func (p *TransactionPool) Reset() *TransactionPool + func (p *TransactionPool) Set(id TransactionId, tx *SqlTx) *TransactionPool + func (p *TransactionPool) UnSet(id TransactionId) *TransactionPool