common

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCreateONClusterSentence

func BuildCreateONClusterSentence(mappedColumns []CHColumn, db_name string, table_name string, cluster string, defaultCluster string, engine string, order_by []string, engine_params []string, partition_by *[]TPartitionBy, comment string) (query string, clusterToUse string)

func GetClusterStatement

func GetClusterStatement(cluster string, defaultCluster string) (clusterStatement string, clusterToUse string)

func GetComment

func GetComment(comment string, cluster string) string

func GetTables

func GetTables(conn *ch.Conn, data *CHDataBase, errors *[]error) []clickhouseTable

func MapArrayInterfaceToArrayOfStrings

func MapArrayInterfaceToArrayOfStrings(in []interface{}) []string

func MapDbData

func MapDbData(result ch.Result) (map[string]string, error)

func MapPartitionBy

func MapPartitionBy(partitionBy interface{}, mappedColumns []CHColumn) (*[]TPartitionBy, error)

func UnmarshalComment

func UnmarshalComment(storedComment string) (comment string, cluster string, err error)

func ValidateOnClusterEngine

func ValidateOnClusterEngine(inValue any, p hashicorpcty.Path) diag.Diagnostics

func ValidateParams

func ValidateParams(mappedColumns []CHColumn, params []string, params_name string) error

func ValidatePartitionBy

func ValidatePartitionBy(inValue any, p hashicorpcty.Path) diag.Diagnostics

func ValidateType

func ValidateType(inValue any, p hashicorpcty.Path) diag.Diagnostics

Types

type ApiClient

type ApiClient struct {
	ClickhouseConnection *ch.Conn
	DefaultCluster       string
}

type CHColumn

type CHColumn struct {
	// contains filtered or unexported fields
}

func MapColumns

func MapColumns(dataColumns []interface{}) []CHColumn

type CHDataBase

type CHDataBase struct {
	Database   string
	Table_name string
}

type CHDbResources

type CHDbResources struct {
	TableNames []string
}

func GetResourceNamesOnDataBases

func GetResourceNamesOnDataBases(conn *ch.Conn, databaseName string) (resources *CHDbResources, errors []error)

type DataSourceCHTable

type DataSourceCHTable struct {
	Database      string
	Table_name    string
	Engine_full   string
	Engine        string
	Cluster       *string
	Comment       string
	Engine_params *[]string
	Columns       []dataSourceClickhouseColumn
}

func MapTableToDatasource

func MapTableToDatasource(table clickhouseTable) (*DataSourceCHTable, error)

type DataSourceDbsItem

type DataSourceDbsItem struct {
	DbName       string `json:"db_name"`
	Engine       string `json:"engine"`
	DataPath     string `json:"data_path"`
	MetadataPath string `json:"metadata_path"`
	Uuid         string `json:"uuid"`
	Comment      string `json:"comment"`
}

type TPartitionBy

type TPartitionBy struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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