table

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

README

ydb_table resource

ydb_table resource is used to manage YDB table entity.

Example

resource "ydb_table" "table" {
    table_path        = "path/to/table"
    connection_string = "grpc://localhost:2136/?database=/local"
    column {
        name = "a"
        type = "Utf8"
    }
    column {
        name = "b"
        type = "Uint32"
    }

    primary_key = ["b", "a"]
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(authCreds auth.YdbCredentials) resources.Handler

func PrepareAlterRequest

func PrepareAlterRequest(diff *tableDiff) string

func PrepareCreateRequest

func PrepareCreateRequest(r *Resource) string

func PrepareDropTableRequest

func PrepareDropTableRequest(tableName string) string

Types

type Column

type Column struct {
	Name    string
	Type    string
	Family  string
	NotNull bool
}

func (*Column) ToYQL

func (c *Column) ToYQL() string

type Family

type Family struct {
	Name        string
	Data        string
	Compression string
}

type Index

type Index struct {
	Name    string
	Type    string
	Columns []string
	Cover   []string
}

type PartitionAtKeys

type PartitionAtKeys struct {
	Keys []interface{}
}

type PartitioningSettings

type PartitioningSettings struct {
	BySize             *bool
	ByLoad             *bool
	PartitionSizeMb    *int
	PartitionAtKeys    []*PartitionAtKeys
	PartitionsCount    int
	MinPartitionsCount int
	MaxPartitionsCount int
}

type PrimaryKey

type PrimaryKey struct {
	Columns []string
}

type ReplicationSettings

type ReplicationSettings struct {
	ReadReplicasSettings string
}

type Resource

type Resource struct {
	Entity *helpers.YDBEntity

	FullPath             string
	Path                 string
	DatabaseEndpoint     string
	Attributes           map[string]string
	Family               []*Family
	Columns              []*Column
	PrimaryKey           *PrimaryKey
	TTL                  *TTL
	ReplicationSettings  *ReplicationSettings
	PartitioningSettings *PartitioningSettings
	EnableBloomFilter    *bool
}

type TTL

type TTL struct {
	ColumnName     string
	ExpireInterval string
	Unit           string
}

func (*TTL) ToYQL

func (t *TTL) ToYQL() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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