Versions in this module Expand all Collapse all v4 v4.6.3 Jun 25, 2020 Changes in this version + const BinaryFormatCode + const Deferrable + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelNone + const LogLevelTrace + const LogLevelWarn + const NotDeferrable + const ReadCommitted + const ReadOnly + const ReadUncommitted + const ReadWrite + const RepeatableRead + const Serializable + const TextFormatCode + var ErrInvalidLogLevel = errors.New("invalid log level") + var ErrNoRows = errors.New("no rows in result set") + var ErrTxClosed = errors.New("tx is closed") + var ErrTxCommitRollback = errors.New("commit unexpectedly resulted in rollback") + func ScanRow(connInfo *pgtype.ConnInfo, fieldDescriptions []pgproto3.FieldDescription, ...) error + type Batch struct + func (b *Batch) Len() int + func (b *Batch) Queue(query string, arguments ...interface{}) + type BatchResults interface + Close func() error + Exec func() (pgconn.CommandTag, error) + Query func() (Rows, error) + QueryRow func() Row + type BuildStatementCacheFunc func(conn *pgconn.PgConn) stmtcache.Cache + type Conn struct + func Connect(ctx context.Context, connString string) (*Conn, error) + func ConnectConfig(ctx context.Context, connConfig *ConnConfig) (*Conn, error) + func (c *Conn) Begin(ctx context.Context) (Tx, error) + func (c *Conn) BeginTx(ctx context.Context, txOptions TxOptions) (Tx, error) + func (c *Conn) Close(ctx context.Context) error + func (c *Conn) Config() *ConnConfig + func (c *Conn) ConnInfo() *pgtype.ConnInfo + func (c *Conn) CopyFrom(ctx context.Context, tableName Identifier, columnNames []string, ...) (int64, error) + func (c *Conn) Deallocate(ctx context.Context, name string) error + func (c *Conn) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error) + func (c *Conn) IsClosed() bool + func (c *Conn) PgConn() *pgconn.PgConn + func (c *Conn) Ping(ctx context.Context) error + func (c *Conn) Prepare(ctx context.Context, name, sql string) (sd *pgconn.StatementDescription, err error) + func (c *Conn) Query(ctx context.Context, sql string, args ...interface{}) (Rows, error) + func (c *Conn) QueryRow(ctx context.Context, sql string, args ...interface{}) Row + func (c *Conn) SendBatch(ctx context.Context, b *Batch) BatchResults + func (c *Conn) StatementCache() stmtcache.Cache + func (c *Conn) WaitForNotification(ctx context.Context) (*pgconn.Notification, error) + type ConnConfig struct + BuildStatementCache BuildStatementCacheFunc + LogLevel LogLevel + Logger Logger + PreferSimpleProtocol bool + func ParseConfig(connString string) (*ConnConfig, error) + func (cc *ConnConfig) ConnString() string + func (cc *ConnConfig) Copy() *ConnConfig + type CopyFromSource interface + Err func() error + Next func() bool + Values func() ([]interface{}, error) + func CopyFromRows(rows [][]interface{}) CopyFromSource + type Identifier []string + func (ident Identifier) Sanitize() string + type LargeObject struct + func (o *LargeObject) Close() error + func (o *LargeObject) Read(p []byte) (int, error) + func (o *LargeObject) Seek(offset int64, whence int) (n int64, err error) + func (o *LargeObject) Tell() (n int64, err error) + func (o *LargeObject) Truncate(size int64) (err error) + func (o *LargeObject) Write(p []byte) (int, error) + type LargeObjectMode int32 + const LargeObjectModeRead + const LargeObjectModeWrite + type LargeObjects struct + func (o *LargeObjects) Create(ctx context.Context, oid uint32) (uint32, error) + func (o *LargeObjects) Open(ctx context.Context, oid uint32, mode LargeObjectMode) (*LargeObject, error) + func (o *LargeObjects) Unlink(ctx context.Context, oid uint32) error + type LogLevel int + func LogLevelFromString(s string) (LogLevel, error) + func (ll LogLevel) String() string + type Logger interface + Log func(ctx context.Context, level LogLevel, msg string, data map[string]interface{}) + type QueryResultFormats []int16 + type QueryResultFormatsByOID map[uint32]int16 + type QuerySimpleProtocol bool + type Row interface + Scan func(dest ...interface{}) error + type Rows interface + Close func() + CommandTag func() pgconn.CommandTag + Err func() error + FieldDescriptions func() []pgproto3.FieldDescription + Next func() bool + RawValues func() [][]byte + Scan func(dest ...interface{}) error + Values func() ([]interface{}, error) + type SerializationError string + func (e SerializationError) Error() string + type Tx interface + Begin func(ctx context.Context) (Tx, error) + Commit func(ctx context.Context) error + Conn func() *Conn + CopyFrom func(ctx context.Context, tableName Identifier, columnNames []string, ...) (int64, error) + Exec func(ctx context.Context, sql string, arguments ...interface{}) (commandTag pgconn.CommandTag, err error) + LargeObjects func() LargeObjects + Prepare func(ctx context.Context, name, sql string) (*pgconn.StatementDescription, error) + Query func(ctx context.Context, sql string, args ...interface{}) (Rows, error) + QueryRow func(ctx context.Context, sql string, args ...interface{}) Row + Rollback func(ctx context.Context) error + SendBatch func(ctx context.Context, b *Batch) BatchResults + type TxAccessMode string + type TxDeferrableMode string + type TxIsoLevel string + type TxOptions struct + AccessMode TxAccessMode + DeferrableMode TxDeferrableMode + IsoLevel TxIsoLevel Other modules containing this package github.com/khaibin/pgx