Documentation
¶
Index ¶
- Constants
- Variables
- func BuildStatementCacheFromBaseBuildStatementCache(func(conn *basePgconn.PgConn) baseStmtCache.Cache) func(conn pgconn.PgConn) stmtcache.Cache
- func ScanRow(connInfo *pgtype.ConnInfo, fieldDescriptions []pgproto3.FieldDescription, ...) error
- type Batch
- type BatchResults
- type BuildStatementCacheFunc
- type ConcreteConn
- func (c *ConcreteConn) Begin(ctx context.Context) (Tx, error)
- func (c *ConcreteConn) BeginFunc(ctx context.Context, f func(Tx) error) (err error)
- func (c *ConcreteConn) BeginTx(ctx context.Context, txOptions TxOptions) (Tx, error)
- func (c *ConcreteConn) BeginTxFunc(ctx context.Context, txOptions TxOptions, f func(Tx) error) (err error)
- func (c *ConcreteConn) Close(ctx context.Context) error
- func (c *ConcreteConn) Config() ConnConfig
- func (c *ConcreteConn) CopyFrom(ctx context.Context, tableName Identifier, columnNames []string, ...) (int64, error)
- func (c *ConcreteConn) Deallocate(ctx context.Context, name string) error
- func (c *ConcreteConn) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
- func (c *ConcreteConn) IsClosed() bool
- func (c *ConcreteConn) PgConn() pgconn.PgConn
- func (c *ConcreteConn) Ping(ctx context.Context) error
- func (c *ConcreteConn) Prepare(ctx context.Context, name, sql string) (sd pgconn.StatementDescription, err error)
- func (c *ConcreteConn) Query(ctx context.Context, sql string, args ...interface{}) (Rows, error)
- func (c *ConcreteConn) QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, ...) (pgconn.CommandTag, error)
- func (c *ConcreteConn) QueryRow(ctx context.Context, sql string, args ...interface{}) Row
- func (c *ConcreteConn) SendBatch(ctx context.Context, b Batch) BatchResults
- func (c *ConcreteConn) StatementCache() stmtcache.Cache
- func (c *ConcreteConn) WaitForNotification(ctx context.Context) (pgconn.Notification, error)
- type ConcreteConnConfig
- func (cc *ConcreteConnConfig) BuildStatementCache() BuildStatementCacheFunc
- func (cc *ConcreteConnConfig) Config() pgconn.Config
- func (cc *ConcreteConnConfig) ConnString() string
- func (cc *ConcreteConnConfig) Copy() ConnConfig
- func (cc *ConcreteConnConfig) LogLevel() LogLevel
- func (cc *ConcreteConnConfig) Logger() Logger
- func (cc *ConcreteConnConfig) PreferSimpleProtocol() bool
- func (cc *ConcreteConnConfig) SetBuildStatementCache(BuildStatementCacheFunc) ConnConfig
- func (cc *ConcreteConnConfig) SetConfig(config pgconn.Config) ConnConfig
- func (cc *ConcreteConnConfig) SetLogLevel(LogLevel) ConnConfig
- func (cc *ConcreteConnConfig) SetLogger(Logger) ConnConfig
- func (cc *ConcreteConnConfig) SetPreferSimpleProtocol(bool) ConnConfig
- type ConcreteRow
- type ConcreteRows
- type Conn
- type ConnConfig
- type CopyFromSource
- type Identifier
- type LargeObject
- type LargeObjectMode
- type LargeObjects
- type LogLevel
- type Logger
- type QueryFuncRow
- type QueryResultFormats
- type QueryResultFormatsByOID
- type QuerySimpleProtocol
- type Row
- type Rows
- type ScanArgError
- type SerializationError
- type Tx
- type TxAccessMode
- type TxDeferrableMode
- type TxIsoLevel
- type TxOptions
Constants ¶
View Source
const ( LargeObjectModeWrite = LargeObjectMode(pgx.LargeObjectModeWrite) LargeObjectModeRead = LargeObjectMode(pgx.LargeObjectModeRead) )
View Source
const ( LogLevelTrace = LogLevel(pgx.LogLevelTrace) LogLevelDebug = LogLevel(pgx.LogLevelDebug) LogLevelInfo = LogLevel(pgx.LogLevelInfo) LogLevelWarn = LogLevel(pgx.LogLevelWarn) LogLevelError = LogLevel(pgx.LogLevelError) LogLevelNone = LogLevel(pgx.LogLevelNone) )
View Source
const ( ReadWrite = TxAccessMode(pgx.ReadWrite) ReadOnly = TxAccessMode(pgx.ReadOnly) )
View Source
const ( Deferrable = TxDeferrableMode(pgx.Deferrable) NotDeferrable = TxDeferrableMode(pgx.NotDeferrable) )
View Source
const ( Serializable = TxIsoLevel(pgx.Serializable) RepeatableRead = TxIsoLevel(pgx.RepeatableRead) ReadCommitted = TxIsoLevel(pgx.ReadCommitted) ReadUncommitted = TxIsoLevel(pgx.ReadUncommitted) )
View Source
const ( TextFormatCode = pgx.TextFormatCode BinaryFormatCode = pgx.BinaryFormatCode )
Variables ¶
View Source
var ErrInvalidLogLevel = basePgx.ErrInvalidLogLevel
View Source
var ErrNoRows = basePgx.ErrNoRows
View Source
var ErrTxClosed = pgx.ErrTxClosed
View Source
var ErrTxCommitRollback = pgx.ErrTxCommitRollback
Functions ¶
func BuildStatementCacheFromBaseBuildStatementCache ¶
func BuildStatementCacheFromBaseBuildStatementCache(func(conn *basePgconn.PgConn) baseStmtCache.Cache) func(conn pgconn.PgConn) stmtcache.Cache
Types ¶
type BatchResults ¶
type BuildStatementCacheFunc ¶
type ConcreteConn ¶
func (*ConcreteConn) BeginTxFunc ¶
func (*ConcreteConn) Config ¶
func (c *ConcreteConn) Config() ConnConfig
func (*ConcreteConn) CopyFrom ¶
func (c *ConcreteConn) CopyFrom(ctx context.Context, tableName Identifier, columnNames []string, rowSrc CopyFromSource) (int64, error)
func (*ConcreteConn) Deallocate ¶
func (c *ConcreteConn) Deallocate(ctx context.Context, name string) error
func (*ConcreteConn) Exec ¶
func (c *ConcreteConn) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
func (*ConcreteConn) IsClosed ¶
func (c *ConcreteConn) IsClosed() bool
func (*ConcreteConn) PgConn ¶
func (c *ConcreteConn) PgConn() pgconn.PgConn
func (*ConcreteConn) Prepare ¶
func (c *ConcreteConn) Prepare(ctx context.Context, name, sql string) (sd pgconn.StatementDescription, err error)
func (*ConcreteConn) QueryFunc ¶
func (c *ConcreteConn) QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, f func(QueryFuncRow) error) (pgconn.CommandTag, error)
func (*ConcreteConn) QueryRow ¶
func (c *ConcreteConn) QueryRow(ctx context.Context, sql string, args ...interface{}) Row
func (*ConcreteConn) SendBatch ¶
func (c *ConcreteConn) SendBatch(ctx context.Context, b Batch) BatchResults
func (*ConcreteConn) StatementCache ¶
func (c *ConcreteConn) StatementCache() stmtcache.Cache
func (*ConcreteConn) WaitForNotification ¶
func (c *ConcreteConn) WaitForNotification(ctx context.Context) (pgconn.Notification, error)
type ConcreteConnConfig ¶
type ConcreteConnConfig struct {
*basePgx.ConnConfig
}
func (*ConcreteConnConfig) BuildStatementCache ¶
func (cc *ConcreteConnConfig) BuildStatementCache() BuildStatementCacheFunc
func (*ConcreteConnConfig) Config ¶
func (cc *ConcreteConnConfig) Config() pgconn.Config
func (*ConcreteConnConfig) ConnString ¶
func (cc *ConcreteConnConfig) ConnString() string
func (*ConcreteConnConfig) Copy ¶
func (cc *ConcreteConnConfig) Copy() ConnConfig
func (*ConcreteConnConfig) LogLevel ¶
func (cc *ConcreteConnConfig) LogLevel() LogLevel
func (*ConcreteConnConfig) Logger ¶
func (cc *ConcreteConnConfig) Logger() Logger
func (*ConcreteConnConfig) PreferSimpleProtocol ¶
func (cc *ConcreteConnConfig) PreferSimpleProtocol() bool
func (*ConcreteConnConfig) SetBuildStatementCache ¶
func (cc *ConcreteConnConfig) SetBuildStatementCache(BuildStatementCacheFunc) ConnConfig
func (*ConcreteConnConfig) SetConfig ¶
func (cc *ConcreteConnConfig) SetConfig(config pgconn.Config) ConnConfig
func (*ConcreteConnConfig) SetLogLevel ¶
func (cc *ConcreteConnConfig) SetLogLevel(LogLevel) ConnConfig
func (*ConcreteConnConfig) SetLogger ¶
func (cc *ConcreteConnConfig) SetLogger(Logger) ConnConfig
func (*ConcreteConnConfig) SetPreferSimpleProtocol ¶
func (cc *ConcreteConnConfig) SetPreferSimpleProtocol(bool) ConnConfig
type ConcreteRow ¶
ConcreteRow method Scan is not needed: the base implementation is directly usable.
type ConcreteRows ¶
ConcreteRows methods are not needed except for CommandTag: the base implementation is directly usable.
func (ConcreteRows) CommandTag ¶
func (c ConcreteRows) CommandTag() pgconn.CommandTag
type Conn ¶
type Conn interface {
Begin(ctx context.Context) (Tx, error)
BeginFunc(ctx context.Context, f func(Tx) error) (err error)
BeginTx(ctx context.Context, txOptions TxOptions) (Tx, error)
BeginTxFunc(ctx context.Context, txOptions TxOptions, f func(Tx) error) (err error)
Close(ctx context.Context) error
Config() ConnConfig
CopyFrom(ctx context.Context, tableName Identifier, columnNames []string, rowSrc CopyFromSource) (int64, error)
Deallocate(ctx context.Context, name string) error
Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
IsClosed() bool
PgConn() pgconn.PgConn
Ping(ctx context.Context) error
Prepare(ctx context.Context, name, sql string) (sd pgconn.StatementDescription, err error)
Query(ctx context.Context, sql string, args ...interface{}) (Rows, error)
QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, f func(QueryFuncRow) error) (pgconn.CommandTag, error)
QueryRow(ctx context.Context, sql string, args ...interface{}) Row
SendBatch(ctx context.Context, b Batch) BatchResults
StatementCache() stmtcache.Cache
WaitForNotification(ctx context.Context) (pgconn.Notification, error)
}
func ConnectConfig ¶
func ConnectConfig(ctx context.Context, connConfig ConnConfig) (Conn, error)
type ConnConfig ¶
type ConnConfig interface {
Config() pgconn.Config
SetConfig(config pgconn.Config) ConnConfig
BuildStatementCache() BuildStatementCacheFunc
Logger() Logger
LogLevel() LogLevel
PreferSimpleProtocol() bool
SetBuildStatementCache(BuildStatementCacheFunc) ConnConfig
SetLogger(Logger) ConnConfig
SetLogLevel(LogLevel) ConnConfig
SetPreferSimpleProtocol(bool) ConnConfig
ConnString() string
Copy() ConnConfig
}
func ParseConfig ¶
func ParseConfig(connString string) (ConnConfig, error)
type CopyFromSource ¶
func CopyFromRows ¶
func CopyFromRows(rows [][]interface{}) CopyFromSource
func CopyFromSlice ¶
func CopyFromSlice(length int, next func(int) ([]interface{}, error)) CopyFromSource
type Identifier ¶
type Identifier = basePgx.Identifier
type LargeObject ¶
type LargeObjectMode ¶
type LargeObjectMode = pgx.LargeObjectMode
type LargeObjects ¶
type LogLevel ¶
func LogLevelFromString ¶
type QueryFuncRow ¶
type QueryFuncRow interface {
FieldDescriptions() []pgproto3.FieldDescription
RawValues() [][]byte
}
type QueryResultFormats ¶
type QueryResultFormats = basePgx.QueryResultFormats
type QueryResultFormatsByOID ¶
type QueryResultFormatsByOID = basePgx.QueryResultFormatsByOID
type QuerySimpleProtocol ¶
type QuerySimpleProtocol = basePgx.QuerySimpleProtocol
type Rows ¶
type Rows interface {
Close()
CommandTag() pgconn.CommandTag
Err() error
FieldDescriptions() []pgproto3.FieldDescription
Next() bool
RawValues() [][]byte
Scan(dest ...interface{}) error
Values() ([]interface{}, error)
}
type ScanArgError ¶
type ScanArgError interface {
ColumnIndex() int
Err() error
SetColumnIndex(int) ScanArgError
SetErr(error) ScanArgError
Error() string
Unwrap() error
}
type SerializationError ¶
type SerializationError = pgx.SerializationError
type Tx ¶
type Tx interface {
Begin(ctx context.Context) (Tx, error)
BeginFunc(ctx context.Context, f func(Tx) error) (err error)
Commit(ctx context.Context) error
Conn() *Conn
CopyFrom(ctx context.Context, tableName Identifier, columnNames []string, rowSrc CopyFromSource) (int64, error)
Exec(ctx context.Context, sql string, arguments ...interface{}) (commandTag pgconn.CommandTag, err error)
LargeObjects() LargeObjects
Prepare(ctx context.Context, name, sql string) (*pgconn.StatementDescription, error)
Query(ctx context.Context, sql string, args ...interface{}) (Rows, error)
QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, f func(QueryFuncRow) error) (pgconn.CommandTag, error)
QueryRow(ctx context.Context, sql string, args ...interface{}) Row
Rollback(ctx context.Context) error
SendBatch(ctx context.Context, b *Batch) BatchResults
}
type TxAccessMode ¶
type TxAccessMode = pgx.TxAccessMode
type TxDeferrableMode ¶
type TxDeferrableMode = pgx.TxDeferrableMode
type TxIsoLevel ¶
type TxIsoLevel = pgx.TxIsoLevel
type TxOptions ¶
type TxOptions interface {
AccessMode() TxAccessMode
DeferrableMode() TxDeferrableMode
IsoLevel() TxIsoLevel
SetAccessMode(TxAccessMode) TxOptions
SetDeferrableMode(TxDeferrableMode) TxOptions
SetIsoLevel(TxIsoLevel) TxOptions
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
chat
command
|
|
|
todo
command
|
|
|
url_shortener
command
|
|
|
log
|
|
|
Package stdlib in pgx implements the database/sql/driver SPI.
|
Package stdlib in pgx implements the database/sql/driver SPI. |
Click to show internal directories.
Click to hide internal directories.