Documentation ¶
Index ¶
- func ColumnsMatch(cs1, cs2 []*Column) bool
- func CreateDbClusterIne(dsn, cluster string) error
- func CreateDbIne(dsn string) error
- func CreateTempTable(shards [][]string, db, table string) (string, error)
- func DropTable(c sqlx.SqlConn, table string) error
- func DropTableClusterIe(c sqlx.SqlConn, cluster, db, table string) error
- func DropTableIe(c sqlx.SqlConn, table string) error
- func ExecClusterAllReplicas(shards [][]string, retry int, f func(dsn string) error) error
- func ExecClusterAnyShard(shards [][]string, retry int, f func(dsn string) error) error
- func ExecClusterEachShards(shards [][]string, retry int, f func(dsn string) error) error
- func ExecClusterEachShardsAll(shards [][]string, retry int, f func(dsn string) error) error
- func ExecWithRetry(dsn string, retry int, f func(dsn string) error) error
- func GetCreateTableQuery(c sqlx.SqlConn, db, table string) (string, error)
- func GetLengthTag(field reflect.StructField) (int, error)
- func RenameTable(c sqlx.SqlConn, table, to string) error
- func ShowDatabases(c sqlx.SqlConn) ([]string, error)
- func ShowTables(c sqlx.SqlConn) ([]string, error)
- func TableExists(c sqlx.SqlConn, table string) (bool, error)
- func TakeClient(dsn string) (*sql.DB, error)
- func TakeClientx(dsn string) sqlx.SqlConn
- func TruncateTable(c sqlx.SqlConn, table string) error
- type ClickHouseClusterModel
- func (c *ClickHouseClusterModel) All() (interface{}, error)
- func (c *ClickHouseClusterModel) BatchInsert(vs interface{}) error
- func (c *ClickHouseClusterModel) DeleteWhere(where string, args ...interface{}) error
- func (c *ClickHouseClusterModel) DropTableIfExists() error
- func (c *ClickHouseClusterModel) MustAll() interface{}
- func (c *ClickHouseClusterModel) QueryWhere(where string, args ...interface{}) (interface{}, error)
- type Cluster
- type Column
- type CreateTableQuery
- type Name
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColumnsMatch ¶
func CreateDbClusterIne ¶
func CreateDbIne ¶
func ExecClusterAllReplicas ¶
func ExecClusterAnyShard ¶
func ExecClusterEachShards ¶
func GetCreateTableQuery ¶
func GetLengthTag ¶
func GetLengthTag(field reflect.StructField) (int, error)
func TakeClientx ¶
Types ¶
type ClickHouseClusterModel ¶
type ClickHouseClusterModel struct { Conn sqlx.SqlConn AppName string Dsn string Shards [][]string Database string Cluster string TableName string Type reflect.Type Indexes []string InsertIDKey string FlagKey string FieldDBs []string FieldNames []string // contains filtered or unexported fields }
func MustNewClickHouseClusterModel ¶
func MustNewClickHouseClusterModel(appName, dsn, cluster string, data interface{}, shards [][]string) (*ClickHouseClusterModel, error)
MustNewClickHouseClusterModel 按照data结构体新建model,如果表存在,则删掉重新创建
func NewClickHouseClusterModel ¶
func NewClickHouseClusterModel(appName, dsn, cluster string, data interface{}, shards [][]string) (*ClickHouseClusterModel, error)
NewClickHouseClusterModel 按照data结构体新建model,如果表不存在,则自动创建
func (*ClickHouseClusterModel) All ¶
func (c *ClickHouseClusterModel) All() (interface{}, error)
func (*ClickHouseClusterModel) BatchInsert ¶
func (c *ClickHouseClusterModel) BatchInsert(vs interface{}) error
func (*ClickHouseClusterModel) DeleteWhere ¶
func (c *ClickHouseClusterModel) DeleteWhere(where string, args ...interface{}) error
func (*ClickHouseClusterModel) DropTableIfExists ¶
func (c *ClickHouseClusterModel) DropTableIfExists() error
func (*ClickHouseClusterModel) MustAll ¶
func (c *ClickHouseClusterModel) MustAll() interface{}
func (*ClickHouseClusterModel) QueryWhere ¶
func (c *ClickHouseClusterModel) QueryWhere(where string, args ...interface{}) (interface{}, error)
type Column ¶
type CreateTableQuery ¶
type CreateTableQuery struct {
CreateTableQuery string `db:"create_table_query"`
}
Click to show internal directories.
Click to hide internal directories.