resourcetable

package
v4.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourceTable

func ResourceTable() *schema.Resource

func ValidateOnClusterEngine

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

func ValidatePartitionBy

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

func ValidateType

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

Types

type CHColumn

type CHColumn struct {
	Database string `ch:"database"`
	Table    string `ch:"table"`
	Name     string `ch:"name"`
	Type     string `ch:"type"`
}

type CHTable

type CHTable struct {
	Database   string     `ch:"database"`
	Name       string     `ch:"name"`
	EngineFull string     `ch:"engine_full"`
	Engine     string     `ch:"engine"`
	Comment    string     `ch:"comment"`
	Columns    []CHColumn `ch:"columns"`
}

func (*CHTable) ColumnsToResource

func (t *CHTable) ColumnsToResource() []interface{}

func (*CHTable) ToResource

func (t *CHTable) ToResource() (*TableResource, error)

type CHTableService

type CHTableService struct {
	CHConnection *driver.Conn
}

func (*CHTableService) CreateTable

func (ts *CHTableService) CreateTable(ctx context.Context, tableResource TableResource) error

func (*CHTableService) DeleteTable

func (ts *CHTableService) DeleteTable(ctx context.Context, tableResource TableResource) error

func (*CHTableService) GetDBTables

func (ts *CHTableService) GetDBTables(ctx context.Context, database string) ([]CHTable, error)

func (*CHTableService) GetTable

func (ts *CHTableService) GetTable(ctx context.Context, database string, table string) (*CHTable, error)

type ColumnResource

type ColumnResource struct {
	Name string
	Type string
}

type PartitionByResource

type PartitionByResource struct {
	By                string
	PartitionFunction string
}

type TableResource

type TableResource struct {
	Database     string
	Name         string
	EngineFull   string
	Engine       string
	Cluster      string
	Comment      string
	EngineParams []string
	OrderBy      []string
	Columns      []interface{}
	PartitionBy  []PartitionByResource
}

func (*TableResource) GetColumnsResourceList

func (t *TableResource) GetColumnsResourceList() []ColumnResource

func (*TableResource) HasColumn

func (t *TableResource) HasColumn(columnName string) bool

func (*TableResource) SetPartitionBy

func (t *TableResource) SetPartitionBy(partitionBy []interface{})

func (*TableResource) Validate

func (t *TableResource) Validate(diags diag.Diagnostics)

Jump to

Keyboard shortcuts

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