Documentation ¶
Index ¶
- type ConnAdapter
- func (c *ConnAdapter) Begin(ctx context.Context) (mrstorage.DBTransaction, error)
- func (c *ConnAdapter) Cli() *pgxpool.Pool
- func (c *ConnAdapter) Close() error
- func (c *ConnAdapter) Connect(opt Options) error
- func (c *ConnAdapter) Exec(ctx context.Context, sql string, args ...any) error
- func (c *ConnAdapter) Ping(ctx context.Context) error
- func (c *ConnAdapter) Query(ctx context.Context, sql string, args ...any) (mrstorage.DBQueryRows, error)
- func (c *ConnAdapter) QueryRow(ctx context.Context, sql string, args ...any) mrstorage.DBQueryRow
- type Options
- type SqlBuilderOrderBy
- func (b *SqlBuilderOrderBy) Field(name string, direction mrenum.SortDirection) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderOrderBy) Join(fields ...mrstorage.SqlBuilderPartFunc) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderOrderBy) WrapWithDefault(field mrstorage.SqlBuilderPartFunc) mrstorage.SqlBuilderPartFunc
- type SqlBuilderPager
- type SqlBuilderSet
- type SqlBuilderWhere
- func (b *SqlBuilderWhere) Equal(name string, value any) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) Expr(expr string) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) ExprWithValue(expr string, value any) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) FilterAnyOf(name string, values any) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) FilterEqualBool(name string, value mrtype.NullableBool) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) FilterEqualInt64(name string, value, empty int64) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) FilterEqualString(name, value string) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) FilterLike(name, value string) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) FilterLikeFields(names []string, value string) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) FilterRangeInt64(name string, value mrtype.RangeInt64, empty int64) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) Greater(name string, value any) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) GreaterOrEqual(name string, value any) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) JoinAnd(conds ...mrstorage.SqlBuilderPartFunc) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) JoinOr(conds ...mrstorage.SqlBuilderPartFunc) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) Less(name string, value any) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) LessOrEqual(name string, value any) mrstorage.SqlBuilderPartFunc
- func (b *SqlBuilderWhere) NotEqual(name string, value any) mrstorage.SqlBuilderPartFunc
- type Transaction
- func (t *Transaction) Commit(ctx context.Context) error
- func (t *Transaction) Exec(ctx context.Context, sql string, args ...any) error
- func (t *Transaction) Query(ctx context.Context, sql string, args ...any) (mrstorage.DBQueryRows, error)
- func (t *Transaction) QueryRow(ctx context.Context, sql string, args ...any) mrstorage.DBQueryRow
- func (t *Transaction) Rollback(ctx context.Context) error
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 (c *ConnAdapter) Begin(ctx context.Context) (mrstorage.DBTransaction, error)
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) 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 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 (b *SqlBuilderOrderBy) Field(name string, direction mrenum.SortDirection) mrstorage.SqlBuilderPartFunc
func (*SqlBuilderOrderBy) Join ¶ added in v0.5.0
func (b *SqlBuilderOrderBy) Join(fields ...mrstorage.SqlBuilderPartFunc) mrstorage.SqlBuilderPartFunc
func (*SqlBuilderOrderBy) WrapWithDefault ¶ added in v0.6.0
func (b *SqlBuilderOrderBy) WrapWithDefault(field mrstorage.SqlBuilderPartFunc) mrstorage.SqlBuilderPartFunc
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
func (b *SqlBuilderSet) Join(fields ...mrstorage.SqlBuilderPartFunc) mrstorage.SqlBuilderPartFunc
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 (b *SqlBuilderWhere) Expr(expr string) mrstorage.SqlBuilderPartFunc
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 (b *SqlBuilderWhere) JoinAnd(conds ...mrstorage.SqlBuilderPartFunc) mrstorage.SqlBuilderPartFunc
func (*SqlBuilderWhere) JoinOr ¶ added in v0.5.0
func (b *SqlBuilderWhere) JoinOr(conds ...mrstorage.SqlBuilderPartFunc) mrstorage.SqlBuilderPartFunc
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) 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
Click to show internal directories.
Click to hide internal directories.