ck

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(conf config.ClickHouse) error

func OpenDB

func OpenDB(conf config.ClickHouse) (*sql.DB, 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 (ck *ClickHouse[T]) BatchInsertCtx(ctx context.Context, batch *ds.Batch) (int64, error)

func (*ClickHouse[T]) Count added in v2.0.8

func (ck *ClickHouse[T]) Count(table string, where *ds.Where) (int64, error)

func (*ClickHouse[T]) CountCtx added in v2.1.0

func (ck *ClickHouse[T]) CountCtx(ctx context.Context, table string, where *ds.Where) (int64, error)

func (*ClickHouse[T]) Delete

func (ck *ClickHouse[T]) Delete(del *ds.Delete) (int64, error)

func (*ClickHouse[T]) DeleteCtx added in v2.1.0

func (ck *ClickHouse[T]) DeleteCtx(ctx context.Context, del *ds.Delete) (int64, error)

func (*ClickHouse[T]) Desc added in v2.0.2

func (ck *ClickHouse[T]) Desc(desc *ds.Desc, model T) ([]T, error)

func (*ClickHouse[T]) DescCtx added in v2.1.0

func (ck *ClickHouse[T]) DescCtx(ctx context.Context, 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 (ck *ClickHouse[T]) FetchAllByWhereCtx(ctx context.Context, table string, where *ds.Where, model T) ([]T, error)

func (*ClickHouse[T]) FetchAllCtx added in v2.1.0

func (ck *ClickHouse[T]) FetchAllCtx(ctx context.Context, table string, where meta.Where, model T) ([]T, error)

func (*ClickHouse[T]) FetchPage

func (ck *ClickHouse[T]) FetchPage(table string, where meta.Where, model T, page int, pageSize int, orders ...string) (*meta.Page[T], error)

func (*ClickHouse[T]) FetchPageBySelect added in v2.0.8

func (ck *ClickHouse[T]) FetchPageBySelect(sel *ds.Select, model T) (*meta.Page[T], error)

func (*ClickHouse[T]) FetchPageBySelectCtx added in v2.1.0

func (ck *ClickHouse[T]) FetchPageBySelectCtx(ctx context.Context, sel *ds.Select, model T) (*meta.Page[T], error)

func (*ClickHouse[T]) FetchPageByWhere

func (ck *ClickHouse[T]) FetchPageByWhere(table string, where *ds.Where, model T, page int, pageSize int, orders ...string) (*meta.Page[T], error)

func (*ClickHouse[T]) FetchPageByWhereCtx added in v2.1.0

func (ck *ClickHouse[T]) FetchPageByWhereCtx(ctx context.Context, table string, where *ds.Where, model T, page int, pageSize int, orders ...string) (*meta.Page[T], error)

func (*ClickHouse[T]) FetchPageCtx added in v2.1.0

func (ck *ClickHouse[T]) FetchPageCtx(ctx context.Context, table string, where meta.Where, model T, page int, pageSize int, orders ...string) (*meta.Page[T], error)

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 (ck *ClickHouse[T]) FetchRowCtx(ctx context.Context, table string, where meta.Where, model T) error

func (*ClickHouse[T]) InTransaction

func (ck *ClickHouse[T]) InTransaction() bool

func (*ClickHouse[T]) Insert

func (ck *ClickHouse[T]) Insert(insert *ds.Insert) (int64, error)

func (*ClickHouse[T]) InsertCtx added in v2.1.0

func (ck *ClickHouse[T]) InsertCtx(ctx context.Context, insert *ds.Insert) (int64, error)

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 (ck *ClickHouse[T]) LockRowCtx(ctx context.Context, table string, where meta.Where, model T) error

func (*ClickHouse[T]) Query

func (ck *ClickHouse[T]) Query(query string, model T, args ...any) ([]T, error)

func (*ClickHouse[T]) QueryCtx added in v2.1.0

func (ck *ClickHouse[T]) QueryCtx(ctx context.Context, 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]) SelectCtx added in v2.1.0

func (ck *ClickHouse[T]) SelectCtx(ctx context.Context, 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

func (ck *ClickHouse[T]) TransactionCtx(context.Context, func(*db.Tx) error) error

func (*ClickHouse[T]) Update

func (ck *ClickHouse[T]) Update(update *ds.Update) (int64, error)

func (*ClickHouse[T]) UpdateCtx added in v2.1.0

func (ck *ClickHouse[T]) UpdateCtx(ctx context.Context, update *ds.Update) (int64, error)

Jump to

Keyboard shortcuts

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