pg

package
v1.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BIGINT_INT0  = big.NewInt(0)
	BIGINT_INT10 = big.NewInt(10)
)
View Source
var PostgresStmtBuilder = rdb.NewStatementBuilder(
	sq.StatementBuilder.PlaceholderFormat(sq.Dollar),
	sq.Dollar,
)

Functions

This section is empty.

Types

type ConnConfig

type ConnConfig struct {
	Host                  string
	Port                  int32
	MaybeUsername         *string
	MaybePassword         *string
	MaybeXMigrationsTable *string
	Database              string
	SSL                   bool
}

func (*ConnConfig) DeepClone added in v1.3.0

func (config *ConnConfig) DeepClone() ConnConfig

func (*ConnConfig) ToURL

func (config *ConnConfig) ToURL() string

type ConnParams added in v1.3.0

type ConnParams struct {
	SSLMode          string `url:"sslmode,omitempty"`
	XMigrationsTable string `url:"x-migrations-table,omitempty"`
}

type Migrate

type Migrate struct {
	*gomigrate.Migrate
	// contains filtered or unexported fields
}

func MustNewMigrate

func MustNewMigrate(config *ConnConfig, sourceFolder string) *Migrate

func NewMigrate

func NewMigrate(config *ConnConfig, sourceFolder string) (*Migrate, error)

func (*Migrate) Down

func (m *Migrate) Down() error

func (*Migrate) MustDown

func (m *Migrate) MustDown()

func (*Migrate) MustReset

func (m *Migrate) MustReset()

func (*Migrate) MustUp

func (m *Migrate) MustUp()

func (*Migrate) Reset

func (m *Migrate) Reset() error

func (*Migrate) SetReCreateOnReset

func (m *Migrate) SetReCreateOnReset(shouldReset bool)

func (*Migrate) Up

func (m *Migrate) Up() error

type PgxConn

type PgxConn struct {
	// contains filtered or unexported fields
}

func MustNewPgxConn

func MustNewPgxConn(config *ConnConfig, logger logger.Logger) *PgxConn

func MustNewPgxConnPool

func MustNewPgxConnPool(config *PgxConnPoolConfig, logger logger.Logger) *PgxConn

func NewPgxConn

func NewPgxConn(config *ConnConfig, logger logger.Logger) (*PgxConn, error)

func NewPgxConnPool

func NewPgxConnPool(config *PgxConnPoolConfig, logger logger.Logger) (*PgxConn, error)

func (*PgxConn) Begin

func (conn *PgxConn) Begin() (rdb.Tx, error)

func (*PgxConn) ConnString added in v1.1.0

func (conn *PgxConn) ConnString() string

func (*PgxConn) Exec

func (conn *PgxConn) Exec(sql string, args ...interface{}) (rdb.ExecResult, error)

func (*PgxConn) Query

func (conn *PgxConn) Query(sql string, args ...interface{}) (rdb.RowsResult, error)

func (*PgxConn) QueryRow

func (conn *PgxConn) QueryRow(sql string, args ...interface{}) rdb.RowResult

func (*PgxConn) ToHandle

func (conn *PgxConn) ToHandle() *rdb.Handle

type PgxConnLike

type PgxConnLike interface {
	Begin(ctx context.Context) (pgx.Tx, error)
	BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)
	Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
	QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
	Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
}

type PgxConnPoolConfig

type PgxConnPoolConfig struct {
	ConnConfig             `url:"-"`
	MaybeMaxConns          *int32         `url:"pool_max_conns,omitempty"`
	MaybeMinConns          *int32         `url:"pool_min_conns,omitempty"`
	MaybeMaxConnLifeTime   *time.Duration `url:"pool_max_conn_lifetime,omitempty"`
	MaybeMaxConnIdleTime   *time.Duration `url:"pool_max_conn_idle_time,omitempty"`
	MaybeHealthCheckPeriod *time.Duration `url:"pool_health_check_period,omitempty"`
}

func (*PgxConnPoolConfig) ToURL

func (config *PgxConnPoolConfig) ToURL() string

type PgxLoggerAdapter

type PgxLoggerAdapter struct {
	// contains filtered or unexported fields
}

func NewPgxLoggerAdapter

func NewPgxLoggerAdapter(l logger.Logger) *PgxLoggerAdapter

func (*PgxLoggerAdapter) Log

func (logger *PgxLoggerAdapter) Log(ctx context.Context, level pgx.LogLevel, msg string, data map[string]interface{})

type PgxNtobReader

type PgxNtobReader struct {
	// contains filtered or unexported fields
}

func (*PgxNtobReader) Parse

func (reader *PgxNtobReader) Parse() (*big.Int, error)

func (*PgxNtobReader) ScannableArg

func (reader *PgxNtobReader) ScannableArg() interface{}

type PgxNtobfReader

type PgxNtobfReader struct {
	// contains filtered or unexported fields
}

func (*PgxNtobfReader) Parse

func (reader *PgxNtobfReader) Parse() (*big.Float, error)

func (*PgxNtobfReader) ScannableArg

func (reader *PgxNtobfReader) ScannableArg() interface{}

type PgxNtotReader

type PgxNtotReader struct {
	// contains filtered or unexported fields
}

func NewPgxNtotReader

func NewPgxNtotReader() *PgxNtotReader

func (*PgxNtotReader) Parse

func (reader *PgxNtotReader) Parse() (*utctime.UTCTime, error)

func (*PgxNtotReader) ScannableArg

func (reader *PgxNtotReader) ScannableArg() interface{}

type PgxRDbExecResult

type PgxRDbExecResult struct {
	// contains filtered or unexported fields
}

func (*PgxRDbExecResult) IsDelete

func (result *PgxRDbExecResult) IsDelete() bool

func (*PgxRDbExecResult) IsInsert

func (result *PgxRDbExecResult) IsInsert() bool

func (*PgxRDbExecResult) IsSelect

func (result *PgxRDbExecResult) IsSelect() bool

func (*PgxRDbExecResult) IsUpdate

func (result *PgxRDbExecResult) IsUpdate() bool

func (*PgxRDbExecResult) RowsAffected

func (result *PgxRDbExecResult) RowsAffected() int64

func (*PgxRDbExecResult) String

func (result *PgxRDbExecResult) String() string

type PgxRDbRowResult

type PgxRDbRowResult struct {
	// contains filtered or unexported fields
}

func (*PgxRDbRowResult) Scan

func (result *PgxRDbRowResult) Scan(dest ...interface{}) error

type PgxRDbRowsResult

type PgxRDbRowsResult struct {
	// contains filtered or unexported fields
}

func (*PgxRDbRowsResult) Close

func (result *PgxRDbRowsResult) Close()

func (*PgxRDbRowsResult) Err

func (result *PgxRDbRowsResult) Err() error

func (*PgxRDbRowsResult) ExecResult

func (result *PgxRDbRowsResult) ExecResult() rdb.ExecResult

func (*PgxRDbRowsResult) Next

func (result *PgxRDbRowsResult) Next() bool

func (*PgxRDbRowsResult) Scan

func (result *PgxRDbRowsResult) Scan(dest ...interface{}) error

type PgxRDbTx

type PgxRDbTx struct {
	// contains filtered or unexported fields
}

func (*PgxRDbTx) Commit

func (tx *PgxRDbTx) Commit() error

func (*PgxRDbTx) Exec

func (tx *PgxRDbTx) Exec(sql string, args ...interface{}) (rdb.ExecResult, error)

func (*PgxRDbTx) Query

func (tx *PgxRDbTx) Query(sql string, args ...interface{}) (rdb.RowsResult, error)

func (*PgxRDbTx) QueryRow

func (tx *PgxRDbTx) QueryRow(sql string, args ...interface{}) rdb.RowResult

func (*PgxRDbTx) Rollback

func (tx *PgxRDbTx) Rollback() error

func (*PgxRDbTx) ToHandle

func (tx *PgxRDbTx) ToHandle() *rdb.Handle

type PgxTypeConv

type PgxTypeConv struct{}

func (*PgxTypeConv) BFton

func (conv *PgxTypeConv) BFton(b *big.Float) interface{}

func (*PgxTypeConv) Bton

func (conv *PgxTypeConv) Bton(b *big.Int) interface{}

func (*PgxTypeConv) Iton

func (conv *PgxTypeConv) Iton(i int) interface{}

func (*PgxTypeConv) NtobReader

func (conv *PgxTypeConv) NtobReader() rdb.NtobReader

func (*PgxTypeConv) NtobfReader

func (conv *PgxTypeConv) NtobfReader() rdb.NtobfReader

func (*PgxTypeConv) NtotReader

func (conv *PgxTypeConv) NtotReader() rdb.NtotReader

func (*PgxTypeConv) Tton

func (conv *PgxTypeConv) Tton(t *utctime.UTCTime) interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL