resourcetable

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 6, 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"`
	Comment  string `ch:"comment"`
}

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"`
}

-- begin DB read() types --

func (*CHTable) ColumnsToResource

func (t *CHTable) ColumnsToResource() []ColumnDefinition

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 ColumnDefinition added in v1.0.6

type ColumnDefinition struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Array    bool   `json:"array"`
	Nullable bool   `json:"nullable"`
	Comment  string `json:"comment"`
}

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      []ColumnDefinition
	PartitionBy  []PartitionByResource
	Settings     map[string]string
}

-- built from DB read, and from tf definition code --

func (*TableResource) GetColumnsResourceList

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

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