Documentation ¶
Index ¶
- func Init(conf config.ClickHouse) error
- func OpenDB(conf config.ClickHouse) (*sql.DB, error)
- type ClickHouse
- func (ck *ClickHouse[T]) BatchInsert(batch *ds.Batch) (int64, error)
- func (ck *ClickHouse[T]) BatchInsertCtx(ctx context.Context, batch *ds.Batch) (int64, error)
- func (ck *ClickHouse[T]) Count(table string, where *ds.Where) (int64, error)
- func (ck *ClickHouse[T]) CountCtx(ctx context.Context, table string, where *ds.Where) (int64, error)
- func (ck *ClickHouse[T]) Delete(del *ds.Delete) (int64, error)
- func (ck *ClickHouse[T]) DeleteCtx(ctx context.Context, del *ds.Delete) (int64, error)
- func (ck *ClickHouse[T]) Desc(desc *ds.Desc, model T) ([]T, error)
- func (ck *ClickHouse[T]) DescCtx(ctx context.Context, desc *ds.Desc, model T) ([]T, error)
- func (ck *ClickHouse[T]) Exec(statement string) error
- func (ck *ClickHouse[T]) ExecCtx(ctx context.Context, statement string) error
- func (ck *ClickHouse[T]) FetchAll(table string, where meta.Where, model T) ([]T, error)
- func (ck *ClickHouse[T]) FetchAllByWhere(table string, where *ds.Where, model T) ([]T, error)
- func (ck *ClickHouse[T]) FetchAllByWhereCtx(ctx context.Context, table string, where *ds.Where, model T) ([]T, error)
- func (ck *ClickHouse[T]) FetchAllCtx(ctx context.Context, table string, where meta.Where, model T) ([]T, error)
- func (ck *ClickHouse[T]) FetchPage(table string, where meta.Where, model T, page int, pageSize int, ...) (*meta.Page[T], error)
- func (ck *ClickHouse[T]) FetchPageBySelect(sel *ds.Select, model T) (*meta.Page[T], error)
- func (ck *ClickHouse[T]) FetchPageBySelectCtx(ctx context.Context, sel *ds.Select, model T) (*meta.Page[T], error)
- func (ck *ClickHouse[T]) FetchPageByWhere(table string, where *ds.Where, model T, page int, pageSize int, ...) (*meta.Page[T], error)
- func (ck *ClickHouse[T]) FetchPageByWhereCtx(ctx context.Context, table string, where *ds.Where, model T, page int, ...) (*meta.Page[T], error)
- func (ck *ClickHouse[T]) FetchPageCtx(ctx context.Context, table string, where meta.Where, model T, page int, ...) (*meta.Page[T], error)
- func (ck *ClickHouse[T]) FetchRow(table string, where meta.Where, model T) error
- func (ck *ClickHouse[T]) FetchRowCtx(ctx context.Context, table string, where meta.Where, model T) error
- func (ck *ClickHouse[T]) InTransaction() bool
- func (ck *ClickHouse[T]) Insert(insert *ds.Insert) (int64, error)
- func (ck *ClickHouse[T]) InsertCtx(ctx context.Context, insert *ds.Insert) (int64, error)
- func (ck *ClickHouse[T]) LockRow(table string, where meta.Where, model T) error
- func (ck *ClickHouse[T]) LockRowCtx(ctx context.Context, table string, where meta.Where, model T) error
- func (ck *ClickHouse[T]) Query(query string, model T, args ...any) ([]T, error)
- func (ck *ClickHouse[T]) QueryCtx(ctx context.Context, query string, model T, args ...any) ([]T, error)
- func (ck *ClickHouse[T]) RollBack() error
- func (ck *ClickHouse[T]) Select(sel *ds.Select, model T) ([]T, error)
- func (ck *ClickHouse[T]) SelectCtx(ctx context.Context, sel *ds.Select, model T) ([]T, error)
- func (ck *ClickHouse[T]) SetTx(tx *db.Tx)
- func (ck *ClickHouse[T]) ShowTables(show *ds.ShowTables, model T) ([]T, error)
- func (ck *ClickHouse[T]) ShowTablesCtx(ctx context.Context, show *ds.ShowTables, model T) ([]T, error)
- func (ck *ClickHouse[T]) Transaction(func(*db.Tx) error) error
- func (ck *ClickHouse[T]) TransactionCtx(context.Context, func(*db.Tx) error) error
- func (ck *ClickHouse[T]) Update(update *ds.Update) (int64, error)
- func (ck *ClickHouse[T]) UpdateCtx(ctx context.Context, update *ds.Update) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(conf config.ClickHouse) error
Types ¶
type ClickHouse ¶
type ClickHouse[T itf.ModelInterface] struct { DbName string // contains filtered or unexported fields }
func NewClickHouse ¶
func NewClickHouse[T itf.ModelInterface]() *ClickHouse[T]
func (*ClickHouse[T]) BatchInsert ¶
func (ck *ClickHouse[T]) BatchInsert(batch *ds.Batch) (int64, error)
func (*ClickHouse[T]) BatchInsertCtx ¶ added in v2.1.0
func (*ClickHouse[T]) Desc ¶ added in v2.0.2
func (ck *ClickHouse[T]) Desc(desc *ds.Desc, model T) ([]T, error)
func (*ClickHouse[T]) Exec ¶
func (ck *ClickHouse[T]) Exec(statement string) error
func (*ClickHouse[T]) ExecCtx ¶ added in v2.1.0
func (ck *ClickHouse[T]) ExecCtx(ctx context.Context, statement string) error
func (*ClickHouse[T]) FetchAll ¶
func (ck *ClickHouse[T]) FetchAll(table string, where meta.Where, model T) ([]T, error)
func (*ClickHouse[T]) FetchAllByWhere ¶
func (ck *ClickHouse[T]) FetchAllByWhere(table string, where *ds.Where, model T) ([]T, error)
func (*ClickHouse[T]) FetchAllByWhereCtx ¶ added in v2.1.0
func (*ClickHouse[T]) FetchAllCtx ¶ added in v2.1.0
func (*ClickHouse[T]) FetchPageBySelect ¶ added in v2.0.8
func (*ClickHouse[T]) FetchPageBySelectCtx ¶ added in v2.1.0
func (*ClickHouse[T]) FetchPageByWhere ¶
func (*ClickHouse[T]) FetchPageByWhereCtx ¶ added in v2.1.0
func (*ClickHouse[T]) FetchPageCtx ¶ added in v2.1.0
func (*ClickHouse[T]) FetchRow ¶
func (ck *ClickHouse[T]) FetchRow(table string, where meta.Where, model T) error
func (*ClickHouse[T]) FetchRowCtx ¶ added in v2.1.0
func (*ClickHouse[T]) InTransaction ¶
func (ck *ClickHouse[T]) InTransaction() bool
func (*ClickHouse[T]) LockRow ¶ added in v2.0.4
func (ck *ClickHouse[T]) LockRow(table string, where meta.Where, model T) error
func (*ClickHouse[T]) LockRowCtx ¶ added in v2.1.0
func (*ClickHouse[T]) Query ¶
func (ck *ClickHouse[T]) Query(query string, model T, args ...any) ([]T, error)
func (*ClickHouse[T]) RollBack ¶
func (ck *ClickHouse[T]) RollBack() error
func (*ClickHouse[T]) Select ¶
func (ck *ClickHouse[T]) Select(sel *ds.Select, model T) ([]T, error)
func (*ClickHouse[T]) SetTx ¶ added in v2.0.3
func (ck *ClickHouse[T]) SetTx(tx *db.Tx)
func (*ClickHouse[T]) ShowTables ¶ added in v2.0.2
func (ck *ClickHouse[T]) ShowTables(show *ds.ShowTables, model T) ([]T, error)
func (*ClickHouse[T]) ShowTablesCtx ¶ added in v2.1.0
func (ck *ClickHouse[T]) ShowTablesCtx(ctx context.Context, show *ds.ShowTables, model T) ([]T, error)
func (*ClickHouse[T]) Transaction ¶ added in v2.0.3
func (ck *ClickHouse[T]) Transaction(func(*db.Tx) error) error
func (*ClickHouse[T]) TransactionCtx ¶ added in v2.1.0
Click to show internal directories.
Click to hide internal directories.