mrpostgres

package
v0.6.10 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: Apache-2.0 Imports: 17 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

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 SqlBuilderOrderBy added in v0.5.0

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

func NewSqlBuilderOrderBy added in v0.5.0

func NewSqlBuilderOrderBy(defaultField string, defaultDirection mrenum.SortDirection) *SqlBuilderOrderBy

func NewSqlBuilderOrderByWithDefaultSort added in v0.6.0

func NewSqlBuilderOrderByWithDefaultSort(defaultSort mrtype.SortParams) *SqlBuilderOrderBy

func (*SqlBuilderOrderBy) Field added in v0.5.0

func (*SqlBuilderOrderBy) Join added in v0.5.0

func (*SqlBuilderOrderBy) WrapWithDefault added in v0.6.0

type SqlBuilderPager added in v0.5.0

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

func NewSqlBuilderPager added in v0.5.0

func NewSqlBuilderPager(maxSize uint64) *SqlBuilderPager

func (*SqlBuilderPager) OffsetLimit added in v0.5.0

func (b *SqlBuilderPager) OffsetLimit(index, size uint64) mrstorage.SqlBuilderPartFunc

type SqlBuilderSet added in v0.5.0

type SqlBuilderSet struct {
}

func NewSqlBuilderSet added in v0.5.0

func NewSqlBuilderSet() *SqlBuilderSet

func (*SqlBuilderSet) Field added in v0.5.0

func (b *SqlBuilderSet) Field(name string, value any) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderSet) Fields added in v0.5.0

func (b *SqlBuilderSet) Fields(names []string, args []any) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderSet) Join added in v0.5.0

type SqlBuilderWhere added in v0.5.0

type SqlBuilderWhere struct {
}

func NewSqlBuilderWhere added in v0.5.0

func NewSqlBuilderWhere() *SqlBuilderWhere

func (*SqlBuilderWhere) Equal added in v0.5.0

func (b *SqlBuilderWhere) Equal(name string, value any) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) Expr added in v0.5.0

func (*SqlBuilderWhere) ExprWithValue added in v0.5.0

func (b *SqlBuilderWhere) ExprWithValue(expr string, value any) mrstorage.SqlBuilderPartFunc

ExprWithValue - sample: "UPPER(field_name) = %s"

func (*SqlBuilderWhere) FilterAnyOf added in v0.5.0

func (b *SqlBuilderWhere) FilterAnyOf(name string, values any) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) FilterEqualBool added in v0.6.0

func (b *SqlBuilderWhere) FilterEqualBool(name string, value mrtype.NullableBool) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) FilterEqualInt64 added in v0.5.0

func (b *SqlBuilderWhere) FilterEqualInt64(name string, value, empty int64) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) FilterEqualString added in v0.6.0

func (b *SqlBuilderWhere) FilterEqualString(name, value string) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) FilterLike added in v0.5.0

func (b *SqlBuilderWhere) FilterLike(name, value string) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) FilterLikeFields added in v0.5.0

func (b *SqlBuilderWhere) FilterLikeFields(names []string, value string) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) FilterRangeInt64 added in v0.5.0

func (b *SqlBuilderWhere) FilterRangeInt64(name string, value mrtype.RangeInt64, empty int64) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) Greater added in v0.6.4

func (b *SqlBuilderWhere) Greater(name string, value any) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) GreaterOrEqual added in v0.6.4

func (b *SqlBuilderWhere) GreaterOrEqual(name string, value any) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) JoinAnd added in v0.5.0

func (*SqlBuilderWhere) JoinOr added in v0.5.0

func (*SqlBuilderWhere) Less added in v0.6.4

func (b *SqlBuilderWhere) Less(name string, value any) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) LessOrEqual added in v0.6.4

func (b *SqlBuilderWhere) LessOrEqual(name string, value any) mrstorage.SqlBuilderPartFunc

func (*SqlBuilderWhere) NotEqual added in v0.5.0

func (b *SqlBuilderWhere) NotEqual(name string, value any) mrstorage.SqlBuilderPartFunc

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

Jump to

Keyboard shortcuts

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