mrpostgres

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnAdapter added in v0.3.1

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

func New

func New() *ConnAdapter

func (*ConnAdapter) Begin added in v0.3.1

func (*ConnAdapter) Cli added in v0.3.1

func (c *ConnAdapter) Cli() *pgxpool.Pool

func (*ConnAdapter) Close added in v0.3.1

func (c *ConnAdapter) Close() error

func (*ConnAdapter) Connect added in v0.3.1

func (c *ConnAdapter) Connect(opt Options) error

func (*ConnAdapter) Exec added in v0.3.1

func (c *ConnAdapter) Exec(ctx context.Context, sql string, args ...any) error

func (*ConnAdapter) Ping added in v0.3.1

func (c *ConnAdapter) Ping(ctx context.Context) error

func (*ConnAdapter) Query added in v0.3.1

func (c *ConnAdapter) Query(ctx context.Context, sql string, args ...any) (mrstorage.DbQueryRows, error)

func (*ConnAdapter) QueryRow added in v0.3.1

func (c *ConnAdapter) QueryRow(ctx context.Context, sql string, args ...any) mrstorage.DbQueryRow

func (*ConnAdapter) SqExec added in v0.4.0

func (c *ConnAdapter) SqExec(ctx context.Context, query mrstorage.DbSqlizer) error

func (*ConnAdapter) SqQuery added in v0.3.1

func (*ConnAdapter) SqQueryRow added in v0.3.1

type Options

type Options struct {
	Host             string
	Port             string
	Database         string
	Username         string
	Password         string
	MaxPoolSize      int32
	ConnAttempts     int32
	ConnTimeout      time.Duration
	AfterConnectFunc func() any
}

type Transaction added in v0.4.0

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

func (*Transaction) Commit added in v0.4.0

func (t *Transaction) Commit(ctx context.Context) error

func (*Transaction) Exec added in v0.4.0

func (t *Transaction) Exec(ctx context.Context, sql string, args ...any) error

func (*Transaction) Query added in v0.4.0

func (t *Transaction) Query(ctx context.Context, sql string, args ...any) (mrstorage.DbQueryRows, error)

func (*Transaction) QueryRow added in v0.4.0

func (t *Transaction) QueryRow(ctx context.Context, sql string, args ...any) mrstorage.DbQueryRow

func (*Transaction) Rollback added in v0.4.0

func (t *Transaction) Rollback(ctx context.Context) error

func (*Transaction) SqExec added in v0.4.0

func (t *Transaction) SqExec(ctx context.Context, query mrstorage.DbSqlizer) error

func (*Transaction) SqQuery added in v0.4.0

func (*Transaction) SqQueryRow added in v0.4.0

Jump to

Keyboard shortcuts

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