generator

package
v0.0.0-...-cdb9ebd Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MessageColumnExists is a fragment of the CQL error we see when a column already exists.
	MessageColumnExists = "conflicts with an existing column"
)

Variables

View Source
var ErrInvalidInput = errors.New("invalid input or object not specified")

ErrInvalidInput indicates an input object was not specifier

Functions

func CreateDDLFromTableSpecification

func CreateDDLFromTableSpecification(keyspace string, spec *metadata.TableSpecification, existingMetadata *tableMetadata) ([]metadata.DDLOperation, error)

CreateDDLFromTableSpecification creates the DDL to create and extend a table from its table specification

func CreateDDLFromViewSpecification

func CreateDDLFromViewSpecification(keyspace string, spec *metadata.ViewSpecification, existing *gocql.ViewMetadata) ([]metadata.DDLOperation, error)

CreateDDLFromViewSpecification creates the DDL to create a view from its spec

func DescribeKeyspaceMetadata

func DescribeKeyspaceMetadata(sess gocqlx.Session, keyspace string) (*gocql.KeyspaceMetadata, error)

DescribeKeyspaceMetadata reads the schema of a keyspace from the database

func DescribeTableMetadata

func DescribeTableMetadata(sess gocqlx.Session, keyspace string, tableName string) (*tableMetadata, error)

DescribeTableMetadata reads the schema of a table in a given keyspace schema from the database

func DescribeViewMetadata

func DescribeViewMetadata(sess gocqlx.Session, keyspace string, viewName string) (*gocql.ViewMetadata, error)

DescribeViewMetadata reads the schema of a view in a given keyspace schema from the database

func WithAutomaticTableManagement

func WithAutomaticTableManagement(log *zap.Logger, clusterFn utils.ClusterConfigGeneratorFn) tables.ManagerOption

WithAutomaticTableManagement automatically performs management of tables and structures on startup when using a tables.TableManager, using the charybdis DDL generator.

func WithAutomaticViewManagement

func WithAutomaticViewManagement(log *zap.Logger, cluster utils.ClusterConfigGeneratorFn) tables.ManagerOption

WithAutomaticViewManagement automatically performs management of views and structures on startup when using a tables.ViewManager, using the charybdis DDL generator.

func WithNetworkAwareKeyspaceManagement

func WithNetworkAwareKeyspaceManagement(log *zap.Logger, cluster utils.ClusterConfigGeneratorFn, replicationFactors map[string]int32) tables.ManagerOption

WithNetworkAwareKeyspaceManagement creates a network aware keyspace

func WithSimpleKeyspaceManagement

func WithSimpleKeyspaceManagement(log *zap.Logger, cluster utils.ClusterConfigGeneratorFn, replicationFactor int) tables.ManagerOption

WithSimpleKeyspaceManagement does a 'CREATE KEYSPACE' command at the startup, with a default replication factor. This should only be used for trivial scenarios.

Types

This section is empty.

Jump to

Keyboard shortcuts

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