Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FetchOptBuilder ¶
type FetchOptBuilder interface { WithDeletedAtIsNull(val ...bool) FetchOptBuilder EndQuery(query string) FetchOptBuilder FullQuery(query string) FetchOptBuilder FullQueryFormatter(formatter func(query string) string) FetchOptBuilder UsingRW(val ...bool) FetchOptBuilder }
func FetchOpt ¶
func FetchOpt() FetchOptBuilder
type Repo ¶
type Repo[T any] interface { SetInsert(columns string, fn func(e *T) []any) Fetch(clog clog.Instance, condition string, args ...any) (*T, error) Fetches(clog clog.Instance, condition string, args ...any) ([]*T, error) Insert(clog clog.Instance, e *T) error InsertRID(clog clog.Instance, e *T) (*int64, error) Update(clog clog.Instance, builder UpdateBuilder) error Delete(clog clog.Instance, condition string, args ...any) error TxFetch(clog clog.Instance, tx ice.DbTx, condition string, args ...any) (*T, error) TxFetches(clog clog.Instance, tx ice.DbTx, condition string, args ...any) ([]*T, error) TxInsert(clog clog.Instance, tx ice.DbTx, e *T) error TxInsertRID(clog clog.Instance, tx ice.DbTx, e *T) (*int64, error) TxBulkInsert(clog clog.Instance, tx ice.DbTx, entities []*T, chunkSize ...int) error TxUpdate(clog clog.Instance, tx ice.DbTx, builder UpdateBuilder) error TxDelete(clog clog.Instance, tx ice.DbTx, condition string, args ...any) error }
func NewRepo ¶
func NewRepo[T any](db ice.DbInstance, tableName string, opt ...RepoOptBuilder) Repo[T]
type RepoOptBuilder ¶
type RepoOptBuilder interface { WithDeletedAtIsNull(val ...bool) RepoOptBuilder RWFetchWhenNull(val ...bool) RepoOptBuilder }
func RepoOpt ¶
func RepoOpt() RepoOptBuilder
type UpdateBuilder ¶
type UpdateBuilder interface { AutoUpdatedAt(val ...bool) UpdateBuilder Set(query string, args ...any) UpdateBuilder SetIfNotNil(keyVal map[string]any) UpdateBuilder Where(query string, args ...any) UpdateBuilder }
func Update ¶
func Update() UpdateBuilder
type VDB ¶ added in v1.0.17
type VDB[T any] interface { Sql(sqlName string) string Fetch(clog clog.Instance, sqlName string, args ...any) (*T, error) Fetches(clog clog.Instance, sqlName string, args ...any) ([]*T, error) TxFetch(clog clog.Instance, tx ice.DbTx, sqlName string, args ...any) (*T, error) TxFetches(clog clog.Instance, tx ice.DbTx, sqlName string, args ...any) ([]*T, error) }
Source Files ¶
- db-fetch-opt-builder-impl.go
- db-ice.go
- db-impl.go
- db-logic.go
- db-new-dbv.go
- db-new-repo.go
- db-new.go
- db-pg-instance-impl.go
- db-pg-instance-logic.go
- db-pg-instance-tx-impl.go
- db-repo-clog.go
- db-repo-execute-logic.go
- db-repo-fetch-logic.go
- db-repo-impl.go
- db-repo-insert-logic.go
- db-repo-logic.go
- db-repo-opt-builder-impl.go
- db-repo-result-func.go
- db-repo-update-logic.go
- db-report-func.go
- db-stu.go
- db-update-builder-impl.go
- db-vars.go
- db-vdb-fetch-logic.go
- db-vdb-impl.go
- db-vdb-logic.go
- db.go
Click to show internal directories.
Click to hide internal directories.