mapping

package
v0.0.0-...-3c8ad4e Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TagNameCassandra is the tag that indicates a  column in our data
	TagNameCassandra = "cql"

	// TagNameExplicitType indicates a tag that lets us specify a custom CQL type
	// that does not depend on our mapping lookups. This allows users to use types
	// such as UDT's.
	TagNameExplicitType = "cqltype"

	// TagNamePartitioning indicates the tag name to use when identifying partitioning
	// keys within the table. The order of the partition values is the absolute value,
	// with negative numeric values indicating descending sorts.
	TagNamePartitioning = "cqlpartitioning"

	// TagNameSorting indicates the tag name to use when identifying clustering keys
	// within the table. The order of the clustering values is the absolute value, with
	// negative numeric values indicating descending sorts.
	TagNameSorting = "cqlclustering"

	// TagNameIndex indicates to create a named index over the table for a given column.
	// Scylla only supports a singular index.
	TagNameIndex = "cqlindex"
)

Variables

This section is empty.

Functions

func CollectSubTypesFromType

func CollectSubTypesFromType(parentType reflect.Type) (map[string]reflect.Type, error)

func CreateTableSpecificationFromExample

func CreateTableSpecificationFromExample(name string, example any) (*metadata.TableSpecification, error)

CreateTableSpecificationFromExample creates a table specification object by example from a structure

func CreateTypeSpecificationFromExample

func CreateTypeSpecificationFromExample(typeName string, example any) (*metadata.TypeSpecification, error)

CreateTypeSpecificationFromExample creates a type specification object by example from a structure

func CreateTypeSpecificationsFromTableExample

func CreateTypeSpecificationsFromTableExample(example any) ([]*metadata.TypeSpecification, error)

CreateTypeSpecificationsFromTableExample creates a type specification object by example from a table structure

func GetScyllaTypeForGoType

func GetScyllaTypeForGoType(t reflect.Type) (string, error)

GetScyllaTypeForGoType determines the type to use in Scylla

func WithAutomaticTableSpecification

func WithAutomaticTableSpecification[T any](name string) tables.ManagerOption

WithAutomaticTableSpecification creates a table-manager option that sets the table specification by reflecting over the structure.

func WithAutomaticTypeSpecification

func WithAutomaticTypeSpecification[T any](name string) tables.ManagerOption

WithAutomaticTypeSpecification creates a table-manager option that sets the table specification by reflecting over the structure.

func WithSimpleView

func WithSimpleView(name string, partitionKeys []string, clusteringKeys []string) tables.ManagerOption

WithSimpleView attaches a view definition to the table manager, based on named columns. All columns of the base table are part of the view

Types

This section is empty.

Jump to

Keyboard shortcuts

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