Documentation ¶
Index ¶
- func New(params Params) (*sql.DB, error)
- func Register() fx.Option
- func StringifyFilter(filter domain.Filter, optAlias ...string) (string, error)
- func StringifySort(sort domain.Sort, optAlias ...string) (string, error)
- type MatcherBuilder
- func (m *MatcherBuilder[T]) Exec(ctx context.Context, db *sql.DB) (int64, error)
- func (m *MatcherBuilder[T]) ThenDelete() *MutationBuilder[T]
- func (m *MatcherBuilder[T]) ThenDoNothing() *MutationBuilder[T]
- func (m *MatcherBuilder[T]) ThenInsert(columns ...string) *MutationBuilder[T]
- func (m *MatcherBuilder[T]) ThenUpdate(columns ...string) *MutationBuilder[T]
- type MergeCondition
- type MutationBuilder
- func (b *MutationBuilder[T]) Exec(ctx context.Context, db *sql.DB) (int64, error)
- func (b *MutationBuilder[T]) MergeInto(table string) *MutationBuilder[T]
- func (b *MutationBuilder[T]) On(mergeCond MergeCondition) *MutationBuilder[T]
- func (b *MutationBuilder[T]) Using(values *T) *MutationBuilder[T]
- func (b *MutationBuilder[T]) UsingValues(values ...Setter) *MutationBuilder[T]
- func (b *MutationBuilder[T]) WhenMatched(cond ...string) *MatcherBuilder[T]
- func (b *MutationBuilder[T]) WhenNotMatched(cond ...string) *MatcherBuilder[T]
- type Params
- type QueryBuilder
- func (b *QueryBuilder[T]) Close()
- func (b *QueryBuilder[T]) Count(ctx context.Context, db *sql.DB) (int64, error)
- func (b *QueryBuilder[T]) Exist(ctx context.Context, db *sql.DB) (bool, error)
- func (b *QueryBuilder[T]) From(tables ...string) *QueryBuilder[T]
- func (b *QueryBuilder[T]) NoPagination() *QueryBuilder[T]
- func (b *QueryBuilder[T]) OrderBy(sort domain.Sort, optAlias ...string) *QueryBuilder[T]
- func (b *QueryBuilder[T]) Paginate(pagination domain.Pagination) *QueryBuilder[T]
- func (b *QueryBuilder[T]) Query(ctx context.Context, db *sql.DB, scanner func(row *sql.Rows, out T) error) (*T, error)
- func (b *QueryBuilder[T]) QueryAll(ctx context.Context, db *sql.DB, scanner func(row *sql.Rows, out T) error) ([]*T, error)
- func (b *QueryBuilder[T]) Select(fields ...string) *QueryBuilder[T]
- func (b *QueryBuilder[T]) SelectCount() *QueryBuilder[T]
- func (b *QueryBuilder[T]) SelectExists() *QueryBuilder[T]
- func (b *QueryBuilder[T]) String() (string, error)
- func (b *QueryBuilder[T]) Where(filter domain.Filter, optAlias ...string) *QueryBuilder[T]
- func (b *QueryBuilder[T]) WhereRaw(where string) *QueryBuilder[T]
- type Setter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StringifyFilter ¶
Types ¶
type MatcherBuilder ¶
type MatcherBuilder[T any] struct { // contains filtered or unexported fields }
func NewErrorMatcher ¶
func NewErrorMatcher[T any](matched bool, err error) *MatcherBuilder[T]
func NewMatcher ¶
func NewMatcher[T any](mb *MutationBuilder[T], matched bool) *MatcherBuilder[T]
func (*MatcherBuilder[T]) ThenDelete ¶
func (m *MatcherBuilder[T]) ThenDelete() *MutationBuilder[T]
func (*MatcherBuilder[T]) ThenDoNothing ¶
func (m *MatcherBuilder[T]) ThenDoNothing() *MutationBuilder[T]
func (*MatcherBuilder[T]) ThenInsert ¶
func (m *MatcherBuilder[T]) ThenInsert(columns ...string) *MutationBuilder[T]
func (*MatcherBuilder[T]) ThenUpdate ¶
func (m *MatcherBuilder[T]) ThenUpdate(columns ...string) *MutationBuilder[T]
type MergeCondition ¶
type MutationBuilder ¶
type MutationBuilder[T any] struct { // contains filtered or unexported fields }
func NewMutationBuilder ¶
func NewMutationBuilder[T any]() *MutationBuilder[T]
func (*MutationBuilder[T]) MergeInto ¶
func (b *MutationBuilder[T]) MergeInto(table string) *MutationBuilder[T]
func (*MutationBuilder[T]) On ¶
func (b *MutationBuilder[T]) On(mergeCond MergeCondition) *MutationBuilder[T]
func (*MutationBuilder[T]) Using ¶
func (b *MutationBuilder[T]) Using(values *T) *MutationBuilder[T]
func (*MutationBuilder[T]) UsingValues ¶
func (b *MutationBuilder[T]) UsingValues(values ...Setter) *MutationBuilder[T]
func (*MutationBuilder[T]) WhenMatched ¶
func (b *MutationBuilder[T]) WhenMatched(cond ...string) *MatcherBuilder[T]
func (*MutationBuilder[T]) WhenNotMatched ¶
func (b *MutationBuilder[T]) WhenNotMatched(cond ...string) *MatcherBuilder[T]
type QueryBuilder ¶
type QueryBuilder[T any] struct { // contains filtered or unexported fields }
func NewQueryBuilder ¶
func NewQueryBuilder[T any]() *QueryBuilder[T]
func (*QueryBuilder[T]) Close ¶
func (b *QueryBuilder[T]) Close()
func (*QueryBuilder[T]) From ¶
func (b *QueryBuilder[T]) From(tables ...string) *QueryBuilder[T]
func (*QueryBuilder[T]) NoPagination ¶
func (b *QueryBuilder[T]) NoPagination() *QueryBuilder[T]
func (*QueryBuilder[T]) OrderBy ¶
func (b *QueryBuilder[T]) OrderBy(sort domain.Sort, optAlias ...string) *QueryBuilder[T]
func (*QueryBuilder[T]) Paginate ¶
func (b *QueryBuilder[T]) Paginate(pagination domain.Pagination) *QueryBuilder[T]
func (*QueryBuilder[T]) Select ¶
func (b *QueryBuilder[T]) Select(fields ...string) *QueryBuilder[T]
func (*QueryBuilder[T]) SelectCount ¶
func (b *QueryBuilder[T]) SelectCount() *QueryBuilder[T]
func (*QueryBuilder[T]) SelectExists ¶
func (b *QueryBuilder[T]) SelectExists() *QueryBuilder[T]
func (*QueryBuilder[T]) String ¶
func (b *QueryBuilder[T]) String() (string, error)
func (*QueryBuilder[T]) Where ¶
func (b *QueryBuilder[T]) Where(filter domain.Filter, optAlias ...string) *QueryBuilder[T]
func (*QueryBuilder[T]) WhereRaw ¶
func (b *QueryBuilder[T]) WhereRaw(where string) *QueryBuilder[T]
Click to show internal directories.
Click to hide internal directories.