Documentation
¶
Index ¶
- Constants
- Variables
- type BagType
- func (ct *BagType) CQLDef() string
- func (ct *BagType) CQLHolder() string
- func (ct *BagType) CQLPretty(builder *bytes.Buffer, value any) error
- func (ct *BagType) CQLType() gocql.TypeInfo
- func (ct *BagType) GenJSONValue(r *rand.Rand, p *PartitionRangeConfig) any
- func (ct *BagType) GenValue(r *rand.Rand, p *PartitionRangeConfig) []any
- func (ct *BagType) Indexable() bool
- func (ct *BagType) LenValue() int
- func (ct *BagType) Name() string
- func (ct *BagType) ValueVariationsNumber(p *PartitionRangeConfig) float64
- type CQLFeature
- type ColumnDef
- func GetBagTypeColumn(data map[string]any) (out *ColumnDef, err error)
- func GetMapTypeColumn(data map[string]any) (out *ColumnDef, err error)
- func GetSimpleTypeColumn(data map[string]any) (*ColumnDef, error)
- func GetTupleTypeColumn(data map[string]any) (out *ColumnDef, err error)
- func GetUDTTypeColumn(data map[string]any) (out *ColumnDef, err error)
- type Columns
- func (c Columns) Len() int
- func (c Columns) LenValues() int
- func (c Columns) Names() []string
- func (c Columns) NonCounters() Columns
- func (c Columns) Random(r *rand.Rand) *ColumnDef
- func (c Columns) Remove(column *ColumnDef) Columns
- func (c Columns) ToJSONMap(values map[string]any, r *rand.Rand, p *PartitionRangeConfig) map[string]any
- func (c Columns) ValidColumnsForPrimaryKey() Columns
- func (c Columns) ValueVariationsNumber(p *PartitionRangeConfig) float64
- type CounterType
- func (ct *CounterType) CQLDef() string
- func (ct *CounterType) CQLHolder() string
- func (ct *CounterType) CQLPretty(builder *bytes.Buffer, value any) error
- func (ct *CounterType) CQLType() gocql.TypeInfo
- func (ct *CounterType) GenJSONValue(r *rand.Rand, _ *PartitionRangeConfig) any
- func (ct *CounterType) GenValue(r *rand.Rand, _ *PartitionRangeConfig) []any
- func (ct *CounterType) Indexable() bool
- func (ct *CounterType) LenValue() int
- func (ct *CounterType) Name() string
- func (ct *CounterType) ValueVariationsNumber(_ *PartitionRangeConfig) float64
- type IndexDef
- type Keyspace
- type KnownIssues
- type MapType
- func (mt *MapType) CQLDef() string
- func (mt *MapType) CQLHolder() string
- func (mt *MapType) CQLPretty(builder *bytes.Buffer, value any) error
- func (mt *MapType) CQLType() gocql.TypeInfo
- func (mt *MapType) GenJSONValue(r *rand.Rand, p *PartitionRangeConfig) any
- func (mt *MapType) GenValue(r *rand.Rand, p *PartitionRangeConfig) []any
- func (mt *MapType) Indexable() bool
- func (mt *MapType) LenValue() int
- func (mt *MapType) Name() string
- func (mt *MapType) ValueVariationsNumber(p *PartitionRangeConfig) float64
- type MaterializedView
- type OpType
- type PartitionRangeConfig
- type QueryCache
- type Schema
- type SchemaConfig
- func (sc *SchemaConfig) GetMaxClusteringKeys() int
- func (sc *SchemaConfig) GetMaxColumns() int
- func (sc *SchemaConfig) GetMaxPartitionKeys() int
- func (sc *SchemaConfig) GetMaxTables() int
- func (sc *SchemaConfig) GetMinClusteringKeys() int
- func (sc *SchemaConfig) GetMinColumns() int
- func (sc *SchemaConfig) GetMinPartitionKeys() int
- func (sc *SchemaConfig) GetPartitionRangeConfig() PartitionRangeConfig
- func (sc *SchemaConfig) Valid() error
- type SimpleQuery
- type SimpleType
- func (st SimpleType) CQLDef() string
- func (st SimpleType) CQLHolder() string
- func (st SimpleType) CQLPretty(builder *bytes.Buffer, value any) error
- func (st SimpleType) CQLType() gocql.TypeInfo
- func (st SimpleType) GenJSONValue(r *rand.Rand, p *PartitionRangeConfig) any
- func (st SimpleType) GenValue(r *rand.Rand, p *PartitionRangeConfig) []any
- func (st SimpleType) Indexable() bool
- func (st SimpleType) LenValue() int
- func (st SimpleType) Name() string
- func (st SimpleType) ValueVariationsNumber(p *PartitionRangeConfig) float64
- type SimpleTypes
- type Statement
- type StatementCacheType
- type StatementType
- type Stmt
- type StmtCache
- type Stmts
- type Table
- func (t *Table) GetQueryCache(st StatementCacheType) StmtCache
- func (t *Table) Init(s *Schema, c QueryCache)
- func (t *Table) IsCounterTable() bool
- func (t *Table) LinkIndexAndColumns()
- func (t *Table) Lock()
- func (t *Table) PartitionKeysLenValues() int
- func (t *Table) RLock()
- func (t *Table) RUnlock()
- func (t *Table) ResetQueryCache()
- func (t *Table) Unlock()
- func (t *Table) ValidColumnsForDelete() Columns
- type TupleType
- func (t *TupleType) CQLDef() string
- func (t *TupleType) CQLHolder() string
- func (t *TupleType) CQLPretty(builder *bytes.Buffer, value any) error
- func (t *TupleType) CQLType() gocql.TypeInfo
- func (t *TupleType) GenJSONValue(r *rand.Rand, p *PartitionRangeConfig) any
- func (t *TupleType) GenValue(r *rand.Rand, p *PartitionRangeConfig) []any
- func (t *TupleType) Indexable() bool
- func (t *TupleType) LenValue() int
- func (t *TupleType) Name() string
- func (t *TupleType) ValueVariationsNumber(p *PartitionRangeConfig) float64
- type Type
- type Types
- type UDTType
- func (t *UDTType) CQLDef() string
- func (t *UDTType) CQLHolder() string
- func (t *UDTType) CQLPretty(builder *bytes.Buffer, value any) error
- func (t *UDTType) CQLType() gocql.TypeInfo
- func (t *UDTType) GenJSONValue(r *rand.Rand, p *PartitionRangeConfig) any
- func (t *UDTType) GenValue(r *rand.Rand, p *PartitionRangeConfig) []any
- func (t *UDTType) Indexable() bool
- func (t *UDTType) LenValue() int
- func (t *UDTType) Name() string
- func (t *UDTType) ValueVariationsNumber(p *PartitionRangeConfig) float64
- type ValueWithToken
- type Values
Constants ¶
View Source
const ( GoCQLProtoDirectionMask = 0x80 GoCQLProtoVersionMask = 0x7F GoCQLProtoVersion1 = 0x01 GoCQLProtoVersion2 = 0x02 GoCQLProtoVersion3 = 0x03 GoCQLProtoVersion4 = 0x04 GoCQLProtoVersion5 = 0x05 )
View Source
const ( TypeUdt = "udt" TypeMap = "map" TypeList = "list" TypeSet = "set" TypeTuple = "tuple" )
nolint:revive
View Source
const ( TypeAscii = SimpleType("ascii") TypeBigint = SimpleType("bigint") TypeBlob = SimpleType("blob") TypeBoolean = SimpleType("boolean") TypeDate = SimpleType("date") TypeDecimal = SimpleType("decimal") TypeDouble = SimpleType("double") TypeDuration = SimpleType("duration") TypeFloat = SimpleType("float") TypeInet = SimpleType("inet") TypeInt = SimpleType("int") TypeSmallint = SimpleType("smallint") TypeText = SimpleType("text") TypeTime = SimpleType("time") TypeTimestamp = SimpleType("timestamp") TypeTimeuuid = SimpleType("timeuuid") TypeTinyint = SimpleType("tinyint") TypeUuid = SimpleType("uuid") TypeVarchar = SimpleType("varchar") TypeVarint = SimpleType("varint") )
nolint:revive
View Source
const (
KnownIssuesJSONWithTuples = "https://github.com/scylladb/scylla/issues/3708"
)
Variables ¶
View Source
var ( ErrSchemaConfigInvalidRangePK = errors.New( "max number of partition keys must be bigger than min number of partition keys", ) ErrSchemaConfigInvalidRangeCK = errors.New( "max number of clustering keys must be bigger than min number of clustering keys", ) ErrSchemaConfigInvalidRangeCols = errors.New( "max number of columns must be bigger than min number of columns", ) )
View Source
var ( TypesMapKeyBlacklist = map[SimpleType]struct{}{ TypeBlob: {}, TypeDuration: {}, } TypesForIndex = SimpleTypes{ TypeDecimal, TypeDouble, TypeFloat, TypeInt, TypeSmallint, TypeTinyint, TypeVarint, } PartitionKeyTypes = SimpleTypes{ TypeAscii, TypeBigint, TypeDate, TypeDecimal, TypeDouble, TypeFloat, TypeInet, TypeInt, TypeSmallint, TypeText, TypeTime, TypeTimestamp, TypeTimeuuid, TypeTinyint, TypeUuid, TypeVarchar, TypeVarint, TypeBoolean, } PkTypes = SimpleTypes{ TypeAscii, TypeBigint, TypeBlob, TypeDate, TypeDecimal, TypeDouble, TypeFloat, TypeInet, TypeInt, TypeSmallint, TypeText, TypeTime, TypeTimestamp, TypeTimeuuid, TypeTinyint, TypeUuid, TypeVarchar, TypeVarint, } AllTypes = append(append(SimpleTypes{}, PkTypes...), TypeBoolean, TypeDuration) )
View Source
var CompatibleColumnTypes = map[SimpleType]SimpleTypes{ TypeAscii: { TypeText, TypeBlob, }, TypeBigint: { TypeBlob, }, TypeBoolean: { TypeBlob, }, TypeDecimal: { TypeBlob, }, TypeFloat: { TypeBlob, }, TypeInet: { TypeBlob, }, TypeInt: { TypeVarint, TypeBlob, }, TypeTimestamp: { TypeBlob, }, TypeTimeuuid: { TypeUuid, TypeBlob, }, TypeUuid: { TypeBlob, }, TypeVarchar: { TypeText, TypeBlob, }, TypeVarint: { TypeBlob, }, }
View Source
var ErrSchemaValidation = errors.New("validation failed")
Functions ¶
This section is empty.
Types ¶
type BagType ¶ added in v1.8.3
type BagType struct { ComplexType string `json:"complex_type"` // We need to differentiate between sets and lists ValueType SimpleType `json:"value_type"` Frozen bool `json:"frozen"` }
func (*BagType) GenJSONValue ¶ added in v1.8.3
func (ct *BagType) GenJSONValue(r *rand.Rand, p *PartitionRangeConfig) any
func (*BagType) GenValue ¶ added in v1.8.3
func (ct *BagType) GenValue(r *rand.Rand, p *PartitionRangeConfig) []any
func (*BagType) ValueVariationsNumber ¶ added in v1.8.7
func (ct *BagType) ValueVariationsNumber(p *PartitionRangeConfig) float64
ValueVariationsNumber returns number of bytes generated value holds
type CQLFeature ¶
type CQLFeature int
const ( CQL_FEATURE_BASIC CQLFeature = iota + 1 CQL_FEATURE_NORMAL CQL_FEATURE_ALL )
type ColumnDef ¶ added in v1.8.3
func GetBagTypeColumn ¶ added in v1.8.3
func GetMapTypeColumn ¶ added in v1.8.3
func GetSimpleTypeColumn ¶ added in v1.8.3
func GetTupleTypeColumn ¶ added in v1.8.3
func GetUDTTypeColumn ¶ added in v1.8.3
func (*ColumnDef) IsValidForPrimaryKey ¶ added in v1.8.3
func (*ColumnDef) UnmarshalJSON ¶ added in v1.8.3
type Columns ¶ added in v1.8.3
type Columns []*ColumnDef
func (Columns) NonCounters ¶ added in v1.8.3
func (Columns) ValidColumnsForPrimaryKey ¶ added in v1.8.3
func (Columns) ValueVariationsNumber ¶ added in v1.8.7
func (c Columns) ValueVariationsNumber(p *PartitionRangeConfig) float64
ValueVariationsNumber returns number of bytes generated value holds
type CounterType ¶ added in v1.8.3
type CounterType struct {
Value int64
}
func (*CounterType) CQLDef ¶ added in v1.8.3
func (ct *CounterType) CQLDef() string
func (*CounterType) CQLHolder ¶ added in v1.8.3
func (ct *CounterType) CQLHolder() string
func (*CounterType) CQLPretty ¶ added in v1.8.3
func (ct *CounterType) CQLPretty(builder *bytes.Buffer, value any) error
func (*CounterType) CQLType ¶ added in v1.8.3
func (ct *CounterType) CQLType() gocql.TypeInfo
func (*CounterType) GenJSONValue ¶ added in v1.8.3
func (ct *CounterType) GenJSONValue(r *rand.Rand, _ *PartitionRangeConfig) any
func (*CounterType) GenValue ¶ added in v1.8.3
func (ct *CounterType) GenValue(r *rand.Rand, _ *PartitionRangeConfig) []any
func (*CounterType) Indexable ¶ added in v1.8.3
func (ct *CounterType) Indexable() bool
func (*CounterType) LenValue ¶ added in v1.8.3
func (ct *CounterType) LenValue() int
func (*CounterType) Name ¶ added in v1.8.3
func (ct *CounterType) Name() string
func (*CounterType) ValueVariationsNumber ¶ added in v1.8.7
func (ct *CounterType) ValueVariationsNumber(_ *PartitionRangeConfig) float64
ValueVariationsNumber returns number of bytes generated value holds
type Keyspace ¶
type Keyspace struct { Replication replication.Replication `json:"replication"` OracleReplication replication.Replication `json:"oracle_replication"` Name string `json:"name"` }
type KnownIssues ¶ added in v1.8.3
type MapType ¶ added in v1.8.3
type MapType struct { ComplexType string `json:"complex_type"` KeyType SimpleType `json:"key_type"` ValueType SimpleType `json:"value_type"` Frozen bool `json:"frozen"` }
func (*MapType) GenJSONValue ¶ added in v1.8.3
func (mt *MapType) GenJSONValue(r *rand.Rand, p *PartitionRangeConfig) any
func (*MapType) GenValue ¶ added in v1.8.3
func (mt *MapType) GenValue(r *rand.Rand, p *PartitionRangeConfig) []any
func (*MapType) ValueVariationsNumber ¶ added in v1.8.7
func (mt *MapType) ValueVariationsNumber(p *PartitionRangeConfig) float64
ValueVariationsNumber returns number of bytes generated value holds
type MaterializedView ¶ added in v1.8.3
type MaterializedView struct { NonPrimaryKey *ColumnDef Name string `json:"name"` PartitionKeys Columns `json:"partition_keys"` ClusteringKeys Columns `json:"clustering_keys"` // contains filtered or unexported fields }
func (*MaterializedView) HaveNonPrimaryKey ¶ added in v1.8.3
func (m *MaterializedView) HaveNonPrimaryKey() bool
func (*MaterializedView) PartitionKeysLenValues ¶ added in v1.8.3
func (m *MaterializedView) PartitionKeysLenValues() int
type PartitionRangeConfig ¶
type QueryCache ¶ added in v1.8.3
type QueryCache interface { GetQuery(qct StatementCacheType) StmtCache Reset() BindToTable(t *Table) }
type Schema ¶ added in v1.8.3
type Schema struct { Keyspace Keyspace `json:"keyspace"` Tables []*Table `json:"tables"` Config SchemaConfig `json:"-"` }
type SchemaConfig ¶
type SchemaConfig struct { ReplicationStrategy replication.Replication OracleReplicationStrategy replication.Replication TableOptions []tableopts.Option MaxTables int MaxPartitionKeys int MinPartitionKeys int MaxClusteringKeys int MinClusteringKeys int MaxColumns int MinColumns int MaxUDTParts int MaxTupleParts int MaxBlobLength int MaxStringLength int MinBlobLength int MinStringLength int UseCounters bool UseLWT bool UseMaterializedViews bool CQLFeature CQLFeature AsyncObjectStabilizationAttempts int AsyncObjectStabilizationDelay time.Duration }
func (*SchemaConfig) GetMaxClusteringKeys ¶
func (sc *SchemaConfig) GetMaxClusteringKeys() int
func (*SchemaConfig) GetMaxColumns ¶
func (sc *SchemaConfig) GetMaxColumns() int
func (*SchemaConfig) GetMaxPartitionKeys ¶
func (sc *SchemaConfig) GetMaxPartitionKeys() int
func (*SchemaConfig) GetMaxTables ¶
func (sc *SchemaConfig) GetMaxTables() int
func (*SchemaConfig) GetMinClusteringKeys ¶
func (sc *SchemaConfig) GetMinClusteringKeys() int
func (*SchemaConfig) GetMinColumns ¶
func (sc *SchemaConfig) GetMinColumns() int
func (*SchemaConfig) GetMinPartitionKeys ¶
func (sc *SchemaConfig) GetMinPartitionKeys() int
func (*SchemaConfig) GetPartitionRangeConfig ¶ added in v1.8.5
func (sc *SchemaConfig) GetPartitionRangeConfig() PartitionRangeConfig
func (*SchemaConfig) Valid ¶
func (sc *SchemaConfig) Valid() error
type SimpleQuery ¶ added in v1.8.8
type SimpleQuery struct {
// contains filtered or unexported fields
}
func (SimpleQuery) ToCql ¶ added in v1.8.8
func (q SimpleQuery) ToCql() (stmt string, names []string)
type SimpleType ¶ added in v1.8.3
type SimpleType string
func (SimpleType) CQLDef ¶ added in v1.8.3
func (st SimpleType) CQLDef() string
func (SimpleType) CQLHolder ¶ added in v1.8.3
func (st SimpleType) CQLHolder() string
func (SimpleType) CQLPretty ¶ added in v1.8.3
func (st SimpleType) CQLPretty(builder *bytes.Buffer, value any) error
func (SimpleType) CQLType ¶ added in v1.8.3
func (st SimpleType) CQLType() gocql.TypeInfo
func (SimpleType) GenJSONValue ¶ added in v1.8.3
func (st SimpleType) GenJSONValue(r *rand.Rand, p *PartitionRangeConfig) any
func (SimpleType) GenValue ¶ added in v1.8.3
func (st SimpleType) GenValue(r *rand.Rand, p *PartitionRangeConfig) []any
func (SimpleType) Indexable ¶ added in v1.8.3
func (st SimpleType) Indexable() bool
func (SimpleType) LenValue ¶ added in v1.8.3
func (st SimpleType) LenValue() int
func (SimpleType) Name ¶ added in v1.8.3
func (st SimpleType) Name() string
func (SimpleType) ValueVariationsNumber ¶ added in v1.8.7
func (st SimpleType) ValueVariationsNumber(p *PartitionRangeConfig) float64
ValueVariationsNumber returns number of bytes generated value holds
type SimpleTypes ¶ added in v1.8.3
type SimpleTypes []SimpleType
func (SimpleTypes) Contains ¶ added in v1.8.3
func (l SimpleTypes) Contains(colType Type) bool
func (SimpleTypes) Random ¶ added in v1.8.3
func (l SimpleTypes) Random(r *rand.Rand) SimpleType
type StatementCacheType ¶
type StatementCacheType uint8
const ( CacheInsert StatementCacheType = iota CacheInsertIfNotExists CacheUpdate CacheDelete CacheArrayLen )
func (StatementCacheType) String ¶ added in v1.11.0
func (t StatementCacheType) String() string
type StatementType ¶
type StatementType uint8
const ( SelectStatementType StatementType = iota SelectRangeStatementType SelectByIndexStatementType SelectFromMaterializedViewStatementType DeleteStatementType InsertStatementType InsertJSONStatementType UpdateStatementType AlterColumnStatementType DropColumnStatementType AddColumnStatementType DropKeyspaceStatementType CreateKeyspaceStatementType CreateSchemaStatementType CreateIndexStatementType DropIndexStatementType CreateTypeStatementType DropTypeStatementType CreateTableStatementType DropTableStatementType )
func ParseStatementTypeFromQuery ¶ added in v1.9.3
func ParseStatementTypeFromQuery(query string) StatementType
func (StatementType) OpType ¶ added in v1.8.8
func (st StatementType) OpType() OpType
func (StatementType) PossibleAsyncOperation ¶
func (st StatementType) PossibleAsyncOperation() bool
func (StatementType) String ¶ added in v1.8.9
func (st StatementType) String() string
type Stmt ¶
type Stmt struct { ValuesWithToken []ValueWithToken Values Values StmtCache }
func SimpleStmt ¶ added in v1.8.8
func SimpleStmt(query string, queryType StatementType) *Stmt
func (*Stmt) PrettyCQLBuffered ¶ added in v1.8.9
type StmtCache ¶
type StmtCache struct { Query qb.Builder Types Types QueryType StatementType LenValue int }
type Stmts ¶
type Stmts struct { PostStmtHook func() List []*Stmt QueryType StatementType }
type Table ¶ added in v1.8.3
type Table struct { Name string `json:"name"` PartitionKeys Columns `json:"partition_keys"` ClusteringKeys Columns `json:"clustering_keys"` Columns Columns `json:"columns"` Indexes []IndexDef `json:"indexes,omitempty"` MaterializedViews []MaterializedView `json:"materialized_views,omitempty"` KnownIssues KnownIssues `json:"known_issues"` TableOptions []string `json:"table_options,omitempty"` // contains filtered or unexported fields }
func (*Table) GetQueryCache ¶ added in v1.8.3
func (t *Table) GetQueryCache(st StatementCacheType) StmtCache
func (*Table) Init ¶ added in v1.8.3
func (t *Table) Init(s *Schema, c QueryCache)
func (*Table) IsCounterTable ¶ added in v1.8.3
func (*Table) LinkIndexAndColumns ¶ added in v1.8.4
func (t *Table) LinkIndexAndColumns()
func (*Table) PartitionKeysLenValues ¶ added in v1.8.3
func (*Table) ResetQueryCache ¶ added in v1.8.3
func (t *Table) ResetQueryCache()
func (*Table) ValidColumnsForDelete ¶ added in v1.8.3
type TupleType ¶ added in v1.8.3
type TupleType struct { ComplexType string `json:"complex_type"` ValueTypes []SimpleType `json:"value_types"` Frozen bool `json:"frozen"` }
func (*TupleType) GenJSONValue ¶ added in v1.8.3
func (t *TupleType) GenJSONValue(r *rand.Rand, p *PartitionRangeConfig) any
func (*TupleType) GenValue ¶ added in v1.8.3
func (t *TupleType) GenValue(r *rand.Rand, p *PartitionRangeConfig) []any
func (*TupleType) ValueVariationsNumber ¶ added in v1.8.7
func (t *TupleType) ValueVariationsNumber(p *PartitionRangeConfig) float64
ValueVariationsNumber returns number of bytes generated value holds
type Type ¶
type Type interface { Name() string CQLDef() string CQLHolder() string CQLPretty(*bytes.Buffer, any) error GenValue(*rand.Rand, *PartitionRangeConfig) []any GenJSONValue(*rand.Rand, *PartitionRangeConfig) any LenValue() int // ValueVariationsNumber returns number of bytes generated value holds ValueVariationsNumber(*PartitionRangeConfig) float64 Indexable() bool CQLType() gocql.TypeInfo }
type Types ¶
type Types []Type
func (Types) ValueVariationsNumber ¶ added in v1.8.7
func (l Types) ValueVariationsNumber(p *PartitionRangeConfig) float64
type UDTType ¶ added in v1.8.3
type UDTType struct { ComplexType string `json:"complex_type"` ValueTypes map[string]SimpleType `json:"value_types"` TypeName string `json:"type_name"` Frozen bool `json:"frozen"` }
func (*UDTType) GenJSONValue ¶ added in v1.8.3
func (t *UDTType) GenJSONValue(r *rand.Rand, p *PartitionRangeConfig) any
func (*UDTType) GenValue ¶ added in v1.8.3
func (t *UDTType) GenValue(r *rand.Rand, p *PartitionRangeConfig) []any
func (*UDTType) ValueVariationsNumber ¶ added in v1.8.7
func (t *UDTType) ValueVariationsNumber(p *PartitionRangeConfig) float64
ValueVariationsNumber returns number of bytes generated value holds
type ValueWithToken ¶
func (ValueWithToken) MemoryFootprint ¶ added in v1.9.3
func (v ValueWithToken) MemoryFootprint() uint64
Click to show internal directories.
Click to hide internal directories.