Documentation
¶
Overview ¶
Package database wraps the database implmementation used for Pricewarp
Index ¶
- Variables
- type Batch
- type BatchResults
- type Conn
- func (conn *Conn) Begin() (*Tx, error)
- func (conn *Conn) Close()
- func (conn *Conn) CopyFrom(tableName string, columNames []string, rows [][]any) (int64, error)
- func (conn *Conn) Exec(sql string, arguments ...any) error
- func (conn *Conn) Query(sql string, arguments ...any) (Rows, error)
- func (conn *Conn) QueryRow(sql string, arguments ...any) Row
- func (conn *Conn) SendBatch(batch *Batch) BatchResults
- type Queryable
- type Row
- type Rows
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) CopyFrom(tableName string, columNames []string, rows [][]interface{}) (int64, error)
- func (tx *Tx) Exec(sql string, arguments ...any) error
- func (tx *Tx) Query(sql string, arguments ...any) (Rows, error)
- func (tx *Tx) QueryRow(sql string, arguments ...any) Row
- func (tx *Tx) Rollback() error
- func (tx *Tx) SendBatch(batch *Batch) BatchResults
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoRows = pgx.ErrNoRows
Functions ¶
This section is empty.
Types ¶
type BatchResults ¶
type BatchResults = pgx.BatchResults
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) SendBatch ¶
func (conn *Conn) SendBatch(batch *Batch) BatchResults
SendBatch send a series of queries in a batch.
type Queryable ¶
type Queryable interface {
// Exec executes a database query
Exec(sql string, arguments ...any) error
// QueryRow executes a database query
Query(sql string, arguments ...any) (Rows, error)
// QueryRow executes a database query returning Row data
QueryRow(sql string, arguments ...any) Row
// SendBatch send a series of queries in a batch.
SendBatch(batch *Batch) BatchResults
// CopyFrom copies rows into a database.
CopyFrom(tableName string, columNames []string, rows [][]interface{}) (int64, error)
}
Queryable defines an interface for either a connection or a transaction
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) SendBatch ¶
func (tx *Tx) SendBatch(batch *Batch) BatchResults
SendBatch send a series of queries in a batch.
Click to show internal directories.
Click to hide internal directories.