clickhouse

package
v1.9.8 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnectTimeout = errors.New(`连接超时,请重试`)

Functions

func LookupClickHouseClient

func LookupClickHouseClient() (string, error)

LookupClickHouseClient finds clickhouse-client binary.

func NativeExportCH

func NativeExportCH(ctx context.Context, cfg *shared.DBConfig, tables []string, structWriter, dataWriter io.Writer) error

NativeExportCH uses clickhouse-client to export tables as INSERT statements.

func NativeImportCH

func NativeImportCH(ctx context.Context, cfg *shared.DBConfig, files []string, noticer *notice.NoticeAndProgress) error

NativeImportCH uses clickhouse-client to import SQL files.

func New

func New() driver.Driver

func QuoteCol

func QuoteCol(name string) string

QuoteCol quotes a column/identifier name for ClickHouse

func QuoteVal

func QuoteVal(v string) string

QuoteVal quotes a value string for ClickHouse

func SupportedCmdExport

func SupportedCmdExport() bool

SupportedExport returns true if the native export tool for the given driver is available.

func SupportedCmdImport

func SupportedCmdImport() bool

SupportedImport returns true if the native import tool for the given driver is available.

Types

type ClickHouse

type ClickHouse struct {
	*driver.BaseDriver
	// contains filtered or unexported fields
}

func (*ClickHouse) CreateData

func (c *ClickHouse) CreateData() error

CreateData handles insert, update, and delete of table data

func (*ClickHouse) CreateDb

func (c *ClickHouse) CreateDb() error

CreateDb handles the create database operation

func (*ClickHouse) CreateTable

func (c *ClickHouse) CreateTable() error

CreateTable handles the create table operation

func (*ClickHouse) Export

func (c *ClickHouse) Export() error

Export handles data export

func (*ClickHouse) Import

func (c *ClickHouse) Import() error

func (*ClickHouse) Indexes

func (c *ClickHouse) Indexes() error

Indexes handles showing indexes for a table (ClickHouse uses ORDER BY / PRIMARY KEY)

func (*ClickHouse) Info

func (c *ClickHouse) Info() error

Info handles the server info operation

func (*ClickHouse) Init

func (c *ClickHouse) Init(ctx echo.Context, auth *driver.DbAuth)

func (*ClickHouse) IsSupported

func (c *ClickHouse) IsSupported(operation string) bool

func (*ClickHouse) ListData

func (c *ClickHouse) ListData() error

ListData handles displaying table data (paginated)

func (*ClickHouse) ListDb

func (c *ClickHouse) ListDb() error

ListDb handles the list databases operation

func (*ClickHouse) ListTable

func (c *ClickHouse) ListTable() error

ListTable handles the list tables operation

func (*ClickHouse) Login

func (c *ClickHouse) Login() error

func (*ClickHouse) Logined

func (c *ClickHouse) Logined() bool

func (*ClickHouse) Logout

func (c *ClickHouse) Logout() error

func (*ClickHouse) ModifyDb

func (c *ClickHouse) ModifyDb() error

ModifyDb handles the modify/delete database operation

func (*ClickHouse) ModifyTable

func (c *ClickHouse) ModifyTable() error

ModifyTable handles the modify table operation

func (*ClickHouse) Name

func (c *ClickHouse) Name() string

func (*ClickHouse) Privileges

func (c *ClickHouse) Privileges() error

Privileges handles the privileges management operation

func (*ClickHouse) ProcessList

func (c *ClickHouse) ProcessList() error

ProcessList handles showing the process list

func (*ClickHouse) RunCommand

func (c *ClickHouse) RunCommand() error

RunCommand handles running SQL commands

func (*ClickHouse) ViewTable

func (c *ClickHouse) ViewTable() error

ViewTable handles the view table structure operation

type FieldInfo

type FieldInfo struct {
	ColumnName  string
	DataType    string
	DefaultType string
	DefaultExpr string
	Comment     string
}

FieldInfo holds column information for ClickHouse

type TableStatus

type TableStatus struct {
	Name    string
	Engine  string
	Rows    int64
	Size    int64
	Comment string
}

TableStatus holds table status information for ClickHouse

Jump to

Keyboard shortcuts

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