Documentation
¶
Index ¶
- Constants
- type CreateDatabaseConstantAction
- type CreateSchemaConstantAction
- type DropDatabaseConstantAction
- type DropSchemaConstantAction
- type DropSchemaTemplateConstantAction
- type RecordLayerMetadataOperationsFactory
- func (f *RecordLayerMetadataOperationsFactory) CreateDatabase(dbPath string, _ api.Options) apiddl.ConstantAction
- func (f *RecordLayerMetadataOperationsFactory) CreateSchema(dbPath, schemaName, templateID string, _ api.Options) apiddl.ConstantAction
- func (f *RecordLayerMetadataOperationsFactory) DropDatabase(dbPath string, throwIfDoesNotExist bool, options api.Options) apiddl.ConstantAction
- func (f *RecordLayerMetadataOperationsFactory) DropSchema(dbPath, schemaName string, _ api.Options) apiddl.ConstantAction
- func (f *RecordLayerMetadataOperationsFactory) DropSchemaTemplate(templateID string, throwIfDoesNotExist bool, _ api.Options) apiddl.ConstantAction
- func (f *RecordLayerMetadataOperationsFactory) SaveSchemaTemplate(template api.SchemaTemplate, _ api.Options) apiddl.ConstantAction
- type RelationalSchemaEvolutionValidator
- type SaveSchemaTemplateConstantAction
Constants ¶
const ( // SysDatabasePath is the protected system database. DDL operations // that could break the catalog are rejected for this path. SysDatabasePath = "/__SYS" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateDatabaseConstantAction ¶
type CreateDatabaseConstantAction struct {
// contains filtered or unexported fields
}
CreateDatabaseConstantAction creates a new database entry in the catalog. Mirrors Java's CreateDatabaseConstantAction.
func NewCreateDatabaseConstantAction ¶
func NewCreateDatabaseConstantAction(dbPath string, catalog api.StoreCatalog) *CreateDatabaseConstantAction
func (*CreateDatabaseConstantAction) Execute ¶
func (a *CreateDatabaseConstantAction) Execute(txn api.Transaction) error
type CreateSchemaConstantAction ¶
type CreateSchemaConstantAction struct {
// contains filtered or unexported fields
}
CreateSchemaConstantAction creates a new schema in the catalog and, when a keyspace is provided, also creates the underlying FDB record store. Mirrors Java's RecordLayerCreateSchemaConstantAction.
func NewCreateSchemaConstantAction ¶
func NewCreateSchemaConstantAction( dbPath, schemaName, templateID string, cat api.StoreCatalog, ks *keyspace.RelationalKeyspace, ) *CreateSchemaConstantAction
func (*CreateSchemaConstantAction) Execute ¶
func (a *CreateSchemaConstantAction) Execute(txn api.Transaction) error
type DropDatabaseConstantAction ¶
type DropDatabaseConstantAction struct {
// contains filtered or unexported fields
}
DropDatabaseConstantAction removes a database and all its schemas. Mirrors Java's DropDatabaseConstantAction.
func NewDropDatabaseConstantAction ¶
func NewDropDatabaseConstantAction( dbPath string, throwIfDoesNotExist bool, catalog api.StoreCatalog, opsFactory apiddl.MetadataOperationsFactory, options api.Options, ) *DropDatabaseConstantAction
func (*DropDatabaseConstantAction) Execute ¶
func (a *DropDatabaseConstantAction) Execute(txn api.Transaction) error
type DropSchemaConstantAction ¶
type DropSchemaConstantAction struct {
// contains filtered or unexported fields
}
DropSchemaConstantAction removes one schema from the catalog and, when a keyspace is provided, also deletes the underlying FDB record store. Mirrors Java's DropSchemaConstantAction.
func NewDropSchemaConstantAction ¶
func NewDropSchemaConstantAction( dbPath, schemaName string, cat api.StoreCatalog, ks *keyspace.RelationalKeyspace, ) *DropSchemaConstantAction
func (*DropSchemaConstantAction) Execute ¶
func (a *DropSchemaConstantAction) Execute(txn api.Transaction) error
type DropSchemaTemplateConstantAction ¶
type DropSchemaTemplateConstantAction struct {
// contains filtered or unexported fields
}
DropSchemaTemplateConstantAction removes all versions of a schema template. Mirrors Java's DropSchemaTemplateConstantAction (implied by MetadataOperationsFactory).
func NewDropSchemaTemplateConstantAction ¶
func NewDropSchemaTemplateConstantAction(templateID string, throwIfDoesNotExist bool, catalog api.SchemaTemplateCatalog) *DropSchemaTemplateConstantAction
func (*DropSchemaTemplateConstantAction) Execute ¶
func (a *DropSchemaTemplateConstantAction) Execute(txn api.Transaction) error
type RecordLayerMetadataOperationsFactory ¶
type RecordLayerMetadataOperationsFactory struct {
// contains filtered or unexported fields
}
RecordLayerMetadataOperationsFactory is the concrete MetadataOperationsFactory backed by a StoreCatalog. When ks is non-nil, CreateSchema and DropSchema also create/delete the underlying FDB record store. Mirrors Java's RecordLayerMetadataOperationsFactory.
func NewRecordLayerMetadataOperationsFactory ¶
func NewRecordLayerMetadataOperationsFactory(catalog api.StoreCatalog) *RecordLayerMetadataOperationsFactory
NewRecordLayerMetadataOperationsFactory constructs a factory in catalog-only mode (no FDB store creation/deletion).
func NewRecordLayerMetadataOperationsFactoryWithKeyspace ¶
func NewRecordLayerMetadataOperationsFactoryWithKeyspace( cat api.StoreCatalog, ks *keyspace.RelationalKeyspace, ) *RecordLayerMetadataOperationsFactory
NewRecordLayerMetadataOperationsFactoryWithKeyspace constructs a factory that also creates/deletes FDB record stores for schema operations.
func (*RecordLayerMetadataOperationsFactory) CreateDatabase ¶
func (f *RecordLayerMetadataOperationsFactory) CreateDatabase(dbPath string, _ api.Options) apiddl.ConstantAction
func (*RecordLayerMetadataOperationsFactory) CreateSchema ¶
func (f *RecordLayerMetadataOperationsFactory) CreateSchema(dbPath, schemaName, templateID string, _ api.Options) apiddl.ConstantAction
func (*RecordLayerMetadataOperationsFactory) DropDatabase ¶
func (f *RecordLayerMetadataOperationsFactory) DropDatabase(dbPath string, throwIfDoesNotExist bool, options api.Options) apiddl.ConstantAction
func (*RecordLayerMetadataOperationsFactory) DropSchema ¶
func (f *RecordLayerMetadataOperationsFactory) DropSchema(dbPath, schemaName string, _ api.Options) apiddl.ConstantAction
func (*RecordLayerMetadataOperationsFactory) DropSchemaTemplate ¶
func (f *RecordLayerMetadataOperationsFactory) DropSchemaTemplate(templateID string, throwIfDoesNotExist bool, _ api.Options) apiddl.ConstantAction
func (*RecordLayerMetadataOperationsFactory) SaveSchemaTemplate ¶
func (f *RecordLayerMetadataOperationsFactory) SaveSchemaTemplate(template api.SchemaTemplate, _ api.Options) apiddl.ConstantAction
type RelationalSchemaEvolutionValidator ¶
type RelationalSchemaEvolutionValidator struct{}
RelationalSchemaEvolutionValidator validates that a new schema template version is backward-compatible with the current version stored in the catalog.
Rules (conservative by default — matches Java's relational evolution semantics):
- Tables may be added; tables may NOT be removed.
- For each existing table: columns may be added; columns may NOT be removed.
- Column data types must not change (type widening is not yet implemented).
- Primary key column order must not change (PKs are the first N columns in the StructDataType; we compare column names in declared order).
func NewRelationalSchemaEvolutionValidator ¶
func NewRelationalSchemaEvolutionValidator() *RelationalSchemaEvolutionValidator
NewRelationalSchemaEvolutionValidator returns a validator with default (strict) settings.
func (*RelationalSchemaEvolutionValidator) Validate ¶
func (v *RelationalSchemaEvolutionValidator) Validate(oldTemplate, newTemplate api.SchemaTemplate) error
Validate checks that newTemplate is backward-compatible with oldTemplate. Returns a non-nil error describing the first violation found.
type SaveSchemaTemplateConstantAction ¶
type SaveSchemaTemplateConstantAction struct {
// contains filtered or unexported fields
}
SaveSchemaTemplateConstantAction persists a schema template. If a previous version of the same template already exists, it runs the RelationalSchemaEvolutionValidator to ensure the change is backward-compatible. Mirrors Java's SaveSchemaTemplateConstantAction (api/ddl package).
func NewSaveSchemaTemplateConstantAction ¶
func NewSaveSchemaTemplateConstantAction(template api.SchemaTemplate, catalog api.SchemaTemplateCatalog) *SaveSchemaTemplateConstantAction
func (*SaveSchemaTemplateConstantAction) Execute ¶
func (a *SaveSchemaTemplateConstantAction) Execute(txn api.Transaction) error