Documentation ¶
Index ¶
- func CheckDSN(driver, dsn, dbName, dbHost, dbPort, dbUser, dbPass string) string
- func CheckDriver(driver string) string
- func Connect(driver, dsn string) (interface{}, error)
- func DefaultPorts() map[string]string
- func PGXConnect(dsn string) (*pgx.Conn, error)
- func PGXExec(db *pgx.Conn, ctx context.Context, query string, args ...interface{}) (pgconn.CommandTag, error)
- func PGXExecNoResult(db *pgx.Conn, ctx context.Context, query string, args ...interface{}) error
- func PGXQuery(db *pgx.Conn, ctx context.Context, query string, args ...interface{}) (pgx.Rows, error)
- func PGXQueryRow(db *pgx.Conn, ctx context.Context, query string, args ...interface{}) pgx.Row
- func SQLConnect(driver, dsn string) (*sql.DB, error)
- func SQLExec(db *sql.DB, ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func SQLExecNoResult(db *sql.DB, ctx context.Context, query string, args ...interface{}) error
- func SQLQuery(db *sql.DB, ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func SQLQueryRow(db *sql.DB, ctx context.Context, query string, args ...interface{}) *sql.Row
- func SetDBDriver(driver string, usePgx bool) string
- func SupportedDrivers() []string
- type DB
- func (d *DB) CheckDriver()
- func (d *DB) Close() error
- func (d *DB) Exec(ctx context.Context, query string, args ...interface{}) (interface{}, error)
- func (d *DB) ExecNoResult(ctx context.Context, query string, args ...interface{}) error
- func (d *DB) Open(dsn string) error
- func (d *DB) PGXNew(db *pgx.Conn)
- func (d *DB) Pgx() *pgx.Conn
- func (d *DB) PgxClose() error
- func (d *DB) PgxExec(ctx context.Context, query string, args ...interface{}) (pgconn.CommandTag, error)
- func (d *DB) PgxExecNoResult(ctx context.Context, query string, args ...interface{}) error
- func (d *DB) PgxOpen(dsn string) error
- func (d *DB) PgxQuery(ctx context.Context, query string, args ...interface{}) (pgx.Rows, error)
- func (d *DB) PgxQueryRow(ctx context.Context, query string, args ...interface{}) pgx.Row
- func (d *DB) Query(ctx context.Context, query string, args ...interface{}) (interface{}, error)
- func (d *DB) QueryRow(ctx context.Context, query string, args ...interface{}) interface{}
- func (d *DB) SetDB(db interface{}, driver string)
- func (d *DB) SetDSN(driver, dsn, dbName, dbHost, dbPort, dbUser, dbPass string) string
- func (d *DB) SetDriver(driver string, usePgx bool)
- func (d *DB) Sql() *sql.DB
- func (d *DB) SqlClose() error
- func (d *DB) SqlExec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (d *DB) SqlExecNoResult(ctx context.Context, query string, args ...interface{}) error
- func (d *DB) SqlNew(db *sql.DB, driver string)
- func (d *DB) SqlOpen(driver, dsn string) error
- func (d *DB) SqlQuery(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (d *DB) SqlQueryRow(ctx context.Context, query string, args ...interface{}) *sql.Row
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPorts ¶ added in v0.3.1
func PGXConnect ¶ added in v0.3.1
func PGXExecNoResult ¶ added in v0.3.1
func PGXQueryRow ¶ added in v0.3.1
func SQLConnect ¶ added in v0.3.1
Connect to database
func SQLExecNoResult ¶ added in v0.3.1
func SQLQueryRow ¶ added in v0.3.1
func SetDBDriver ¶ added in v0.3.1
func SupportedDrivers ¶ added in v0.3.1
func SupportedDrivers() []string
Types ¶
type DB ¶ added in v0.3.1
func New ¶ added in v0.3.1
func New() DB
All databases will use the sql.DB interface unless pgx is specified pgx is a PostgreSQL driver that is more efficient than the standard sql.DB pgx will be used if the driver is set to "pgx" or "postgres" and pgxNew is called
func (*DB) CheckDriver ¶ added in v0.3.1
func (d *DB) CheckDriver()
func (*DB) ExecNoResult ¶ added in v0.3.1
func (*DB) PgxExecNoResult ¶ added in v0.3.1
func (*DB) PgxQueryRow ¶ added in v0.3.1
func (*DB) SqlExecNoResult ¶ added in v0.3.1
Click to show internal directories.
Click to hide internal directories.