...
Package stdlib
Overview ▹
Index ▹
func OpenFromConnPool ¶
func OpenFromConnPool(pool *pgx.ConnPool) (*sql.DB, error)
OpenFromConnPool takes the existing *pgx.ConnPool pool and returns a *sql.DB with pool as the backend. This enables full control over the connection process and configuration while maintaining compatibility with the database/sql interface. In addition, by calling Driver() on the returned *sql.DB and typecasting to *stdlib.Driver a reference to the pgx.ConnPool can be reaquired later. This allows fast paths targeting pgx to be used while still maintaining compatibility with other databases and drivers.
pool connection size must be at least 2.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) Begin ¶
func (c *Conn) Begin() (driver.Tx, error)
func (*Conn) Close ¶
func (c *Conn) Close() error
func (*Conn) Exec ¶
func (c *Conn) Exec(query string, argsV []driver.Value) (driver.Result, error)
func (*Conn) Prepare ¶
func (c *Conn) Prepare(query string) (driver.Stmt, error)
func (*Conn) Query ¶
func (c *Conn) Query(query string, argsV []driver.Value) (driver.Rows, error)
type Driver ¶
type Driver struct {
Pool *pgx.ConnPool
}
func (*Driver) Open ¶
func (d *Driver) Open(name string) (driver.Conn, error)
type Rows ¶
TODO - rename to avoid alloc
type Rows struct {
// contains filtered or unexported fields
}
func (*Rows) Close ¶
func (r *Rows) Close() error
func (*Rows) Columns ¶
func (r *Rows) Columns() []string
func (*Rows) Next ¶
func (r *Rows) Next(dest []driver.Value) error
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
func (*Stmt) Close ¶
func (s *Stmt) Close() error
func (*Stmt) Exec ¶
func (s *Stmt) Exec(argsV []driver.Value) (driver.Result, error)
func (*Stmt) NumInput ¶
func (s *Stmt) NumInput() int
func (*Stmt) Query ¶
func (s *Stmt) Query(argsV []driver.Value) (driver.Rows, error)
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) Commit ¶
func (t *Tx) Commit() error
func (*Tx) Rollback ¶
func (t *Tx) Rollback() error
ActiveGo 1.8