ddl

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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

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

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

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

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

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 (*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

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

Jump to

Keyboard shortcuts

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