代码拉取完成,页面将自动刷新
package clickhouse
import (
"database/sql"
"database/sql/driver"
"time"
"github.com/ClickHouse/clickhouse-go/lib/data"
)
// Interface for Clickhouse driver
type Clickhouse interface {
Block() (*data.Block, error)
Prepare(query string) (driver.Stmt, error)
Begin() (driver.Tx, error)
Commit() error
Rollback() error
Close() error
WriteBlock(block *data.Block) error
}
// Interface for Block allowing writes to individual columns
type ColumnWriter interface {
WriteDate(c int, v time.Time) error
WriteDateTime(c int, v time.Time) error
WriteUInt8(c int, v uint8) error
WriteUInt16(c int, v uint16) error
WriteUInt32(c int, v uint32) error
WriteUInt64(c int, v uint64) error
WriteFloat32(c int, v float32) error
WriteFloat64(c int, v float64) error
WriteBytes(c int, v []byte) error
WriteArray(c int, v interface{}) error
WriteString(c int, v string) error
WriteFixedString(c int, v []byte) error
}
func OpenDirect(dsn string) (Clickhouse, error) {
return open(dsn)
}
func (ch *clickhouse) Block() (*data.Block, error) {
if ch.block == nil {
return nil, sql.ErrTxDone
}
return ch.block, nil
}
func (ch *clickhouse) WriteBlock(block *data.Block) error {
if block == nil {
return sql.ErrTxDone
}
return ch.writeBlock(block, "")
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。