Documentation
¶
Index ¶
- Variables
- func ApplyUserContext(matrix *ConversionMatrix, context *UserConversionContext) (*ConversionMatrix, []ContextApplicationWarning, error)
- func AreCompatible(source, target *resource.ResourceAddress) (bool, error)
- func CanStoreValues(objType resource.ObjectType, path []resource.PathSegment) bool
- func GenerateColumnKey(tableName, columnName string) string
- func GenerateContainerURI(protocol, scope, dbID, objType, objName string) string
- func GenerateItemURI(containerURI, itemType, itemName string, path []string) string
- func GenerateMCPContainerURI(serverID, objType, objName string) string
- func GenerateObjectPath(objectType ObjectType, names ...string) string
- func GenerateSchemaHash(schema *UnifiedModel) string
- func GenerateSchemaID(schema *UnifiedModel) string
- func GenerateStreamContainerURI(provider, connectionID, objType, objName string) string
- func GenerateWebhookContainerURI(endpointID, direction string) string
- func GetCommonPitfalls(source, target dbcapabilities.DataParadigm) []string
- func GetConversionGuidance(source, target dbcapabilities.DataParadigm) []string
- func GetPreferredConversionPartners(dbType dbcapabilities.DatabaseType, asSource bool) []dbcapabilities.DatabaseType
- func GetRecommendedTools(source, target dbcapabilities.DataParadigm) []string
- func GetUnsupportedFeatures(source, target dbcapabilities.DatabaseType) []string
- func HasConversionCapability(dbType dbcapabilities.DatabaseType, asSource bool) bool
- func HasSignificantChanges(source, target *UnifiedModel) (bool, error)
- func IsConversionPossible(source, target dbcapabilities.DatabaseType) bool
- func IsMetadataProperty(objType resource.ObjectType, propertyName string) bool
- func IsObjectSupported(dbType dbcapabilities.DatabaseType, objType ObjectType) bool
- func IsParadigmConversionSupported(source, target dbcapabilities.DataParadigm) bool
- func IsSchemaEmpty(schema *UnifiedModel) bool
- func ListAddressableLocations(um *UnifiedModel, protocol resource.ResourceProtocol, objectPath string) ([]*resource.ResourceAddress, error)
- func PopulateResourcesFromUnifiedModel(um *UnifiedModel, ...) ([]*models.ResourceContainer, []*models.ResourceItem, error)
- func RedactSensitiveData(sampleData *UnifiedModelSampleData) error
- func RequiresEnrichmentData(source, target dbcapabilities.DatabaseType) bool
- func RequiresUserInteraction(source, target dbcapabilities.DatabaseType) bool
- func SerializeSampleData(sampleData *UnifiedModelSampleData) ([]byte, error)
- func SerializeSchema(schema *UnifiedModel) ([]byte, error)
- func SupportsSelector(objType resource.ObjectType, selectorType resource.SelectorType) bool
- type AccessPattern
- type Aggregate
- type AggregationOp
- type Alert
- type Alias
- type AlternativeApproach
- type AlternativeLevel
- type Annotation
- type Archive
- type Argument
- type AutomationLevel
- type Backup
- type Blob
- type Branch
- type Bucket
- type BudgetConstraints
- type BufferPool
- type Cache
- type CapacityMetrics
- type Catalog
- type CategoryScore
- type ChangeSeverity
- type ChangeType
- type Cluster
- type Collection
- type CollectionDocs
- type CollectionEnrichment
- type CollectionPerformance
- type CollectionQuality
- type CollectionSampleData
- type CollectionSize
- type CollectionStrategy
- type Column
- type ColumnEnrichment
- type ColumnQuality
- type ColumnSampleData
- type ColumnSampleValues
- type Comment
- type ComparisonMode
- type ComparisonOptions
- type ComparisonResult
- type ComplianceFinding
- type ComplianceFramework
- type ComplianceIssue
- type ComplianceSummary
- type Connection
- type Constraint
- type ConstraintSupportInfo
- type ConstraintType
- type ContentSample
- type ContextApplicationMode
- type ContextApplicationWarning
- type ContextWarningType
- type ConversionAnalysis
- type ConversionCapabilities
- type ConversionComplexity
- type ConversionContext
- type ConversionContextRequest
- type ConversionEngine
- type ConversionHint
- type ConversionHintType
- type ConversionMatrix
- type ConversionMode
- type ConversionPair
- type ConversionPath
- type ConversionPreferences
- type ConversionPriority
- type ConversionRecommendation
- type ConversionReport
- type ConversionRequest
- type ConversionResult
- type ConversionStats
- type ConversionStep
- type ConversionStrategy
- type ConversionType
- type ConversionUtils
- func (cu *ConversionUtils) FormatConversionSummary(analysis *ConversionAnalysis) string
- func (cu *ConversionUtils) GenerateConversionMatrix(sourceDB, targetDB dbcapabilities.DatabaseType) (*ConversionMatrix, error)
- func (cu *ConversionUtils) GetConversionPath(source, target dbcapabilities.DatabaseType) (*ConversionPath, error)
- func (cu *ConversionUtils) QuickConversionAnalysis(source, target dbcapabilities.DatabaseType) (*ConversionAnalysis, error)
- func (cu *ConversionUtils) ValidateConversionRequest(request ConversionRequest) []ValidationError
- type ConversionWarning
- type CustomPattern
- type CustomSampleData
- type CustomTypeCategory
- type CustomTypeConversionResult
- type CustomTypeImplementation
- type CustomTypeStrategy
- type CustomTypeSupportInfo
- type CustomTypeValidation
- type DBRole
- type DBUser
- type DataCategory
- type DataLossLimit
- type DataPreservationRule
- type DataTypeCapability
- type DataTypeConversionKey
- type DataTypeConversionResult
- type DataTypeConversionRule
- type Database
- type DatabaseFeatureSupport
- type DatabaseTypeMetadata
- type Datafile
- type DecisionType
- type DetectionCapabilities
- type DetectionLevel
- type DetectionLevelRecommendation
- type DetectionRecommendation
- type DetectionRequest
- func (r *DetectionRequest) Validate() []ValidationError
- func (r *DetectionRequest) WithComplianceFrameworks(frameworks ...string) *DetectionRequest
- func (r *DetectionRequest) WithCustomPatterns(patterns ...CustomPattern) *DetectionRequest
- func (r *DetectionRequest) WithEnrichment(enrichment *UnifiedModelEnrichment) *DetectionRequest
- func (r *DetectionRequest) WithSampleData(sampleData *UnifiedModelSampleData) *DetectionRequest
- type DetectionResponse
- type DetectionSummary
- type DimensionSpec
- type DistanceMetricSpec
- type Document
- type DocumentEnrichment
- type DocumentSchemaProfile
- type DocumentToVectorRule
- type EdgeSampleData
- type EmbeddedDocument
- type Embedding
- type EmbeddingSource
- type EmbeddingStrategy
- type Endpoint
- type EnhancedComparisonOptions
- type EnrichedDetectionCapabilities
- type Enrichment
- type EnrichmentCategory
- type EnrichmentChange
- type EnrichmentImpact
- type EnrichmentSummary
- type EnrichmentType
- type Event
- type EventTrigger
- type Evidence
- type Extension
- type Extent
- type ExternalTable
- type FailoverGroup
- type Federation
- type Field
- type FieldSampleValues
- type Filegroup
- type ForeignDataWrapper
- type ForeignTable
- type FullDetectionCapabilities
- type Function
- type Grant
- type Graph
- type GraphEdgeSample
- type GraphEdgeStrategy
- type GraphNodeStrategy
- type GraphSampleData
- type GraphSize
- type GrowthTrend
- type Histogram
- type Identity
- type Index
- type IndexEnrichment
- type IndexPerformance
- type IndexRecommendation
- type IndexSize
- type IndexType
- type Job
- type KeyPatternInfo
- type KeyValuePair
- type KeyValueSampleData
- type KeyValueSampleEntry
- type Keyspace
- type Label
- type LiveView
- type Macro
- type MaterializedView
- type MemoryTable
- type Method
- type MetricsSummary
- type Migration
- type MigrationComplexity
- type Module
- type ModuleExtension
- type Monitor
- type MonitorMetric
- type Namespace
- type NamingConventions
- type Node
- type NodeCounts
- type NodeEnrichment
- type NodeSampleData
- type Notification
- type ObjectCapability
- type ObjectChange
- type ObjectConversionRule
- func DirectConversion(sourceObj, targetObj ObjectType) ObjectConversionRule
- func DroppedConversion(sourceObj ObjectType, reason string) ObjectConversionRule
- func EmulatedConversion(sourceObj ObjectType, emulationObjs []ObjectType, notes string) ObjectConversionRule
- func GetObjectConversionRule(source, target dbcapabilities.DatabaseType, objType ObjectType) (ObjectConversionRule, bool)
- func SplitConversion(sourceObj ObjectType, targetObjs []ObjectType, userDecisions []UserDecision) ObjectConversionRule
- type ObjectCounts
- type ObjectLimit
- type ObjectNames
- type ObjectReference
- type ObjectSample
- type ObjectSampleData
- type ObjectSupport
- func EmulatedSupport(alternatives []ObjectType, notes string) ObjectSupport
- func FullSupport() ObjectSupport
- func GetObjectSupport(dbType dbcapabilities.DatabaseType, objType ObjectType) (ObjectSupport, bool)
- func PartialSupport(limitations []string, notes string) ObjectSupport
- func UnsupportedObject(alternatives []ObjectType, notes string) ObjectSupport
- type ObjectType
- func GetObjectAlternatives(dbType dbcapabilities.DatabaseType, objType ObjectType) []ObjectType
- func GetSupportedObjects(dbType dbcapabilities.DatabaseType) []ObjectType
- func GetUnsupportedObjects(dbType dbcapabilities.DatabaseType) []ObjectType
- func ParseObjectPath(path string) (ObjectType, []string, error)
- type Operator
- type OptimizationGoal
- type OptimizationGoalType
- type Package
- type PackageBody
- type Page
- type ParadigmCompatibility
- type ParadigmConversionStrategy
- func CreateDocumentToVectorStrategy() ParadigmConversionStrategy
- func CreateRelationalToDocumentStrategy() ParadigmConversionStrategy
- func CreateRelationalToGraphStrategy() ParadigmConversionStrategy
- func GetParadigmConversionStrategy(source, target dbcapabilities.DataParadigm) (ParadigmConversionStrategy, bool)
- type ParadigmPair
- type Partition
- type PartitionRecommendation
- type PartitionSampleData
- type Path
- type PendingUserDecision
- type PerformanceHint
- type PerformanceImpact
- type PerformanceMetrics
- type PerformanceRequirements
- type Pipeline
- type Plugin
- type Policy
- type PolicyType
- type PreservationLevel
- type PreservationRuleType
- type PrimitiveTypeInfo
- type PrivilegedDataFinding
- type Procedure
- type Projection
- type Property
- type PropertyKey
- type Publication
- type QualityMetrics
- type Recommendation
- type RecommendationType
- type RecoveryPoint
- type Reference
- type RelationalToGraphRule
- type Relationship
- type RelationshipCounts
- type RelationshipEnrichment
- type RelationshipType
- type Replica
- type ReplicationSlot
- type ResourceLocation
- func Navigate(ctx context.Context, addr *resource.ResourceAddress) (*ResourceLocation, error)
- func NavigateDatabase(um *UnifiedModel, addr *resource.ResourceAddress) (*ResourceLocation, error)
- func NavigateMCP(ctx context.Context, addr *resource.ResourceAddress) (*ResourceLocation, error)
- func NavigateStream(ctx context.Context, addr *resource.ResourceAddress) (*ResourceLocation, error)
- func NavigateWebhook(ctx context.Context, addr *resource.ResourceAddress) (*ResourceLocation, error)
- type ResourceSchemaInfo
- type RiskAssessment
- type RiskLevel
- type RiskObject
- type RowMetrics
- type Rule
- type SampleDataCollector
- func (c *SampleDataCollector) ProcessCollectionSample(collectionName string, documents []map[string]interface{}, totalDocCount int64) CollectionSampleData
- func (c *SampleDataCollector) ProcessKeyValueSample(namespaceName string, keyValuePairs []KeyValueSampleEntry, totalKeyCount int64) KeyValueSampleData
- func (c *SampleDataCollector) ProcessTableSample(tableName string, rows []map[string]interface{}, totalRowCount int64) TableSampleData
- type SampleDataConfig
- type ScalableTypeConverter
- func (stc *ScalableTypeConverter) ConvertCustomTypeScalable(customType Type, sourceDB, targetDB dbcapabilities.DatabaseType) (*CustomTypeConversionResult, error)
- func (stc *ScalableTypeConverter) ConvertPrimitiveType(sourceDB, targetDB dbcapabilities.DatabaseType, sourceType string) (*DataTypeConversionResult, error)
- type Schedule
- type Schema
- type SchemaDetectionCapabilities
- type SchemaField
- type SchemaInfo
- type SearchDocument
- type SearchIndex
- type SearchMappingInfo
- type SearchSampleData
- type Segment
- type Sequence
- type Server
- type Shard
- type SizeMetrics
- type Snapshot
- type Statistic
- type Stream
- type StructuralChange
- type SubPartition
- type Subscription
- type SupportLevel
- type Synonym
- type TTLSetting
- type Table
- type TableCategory
- type TableEnrichment
- type TablePerformance
- type TableQuality
- type TableRows
- type TableSampleData
- type TableSize
- type TableToCollectionRule
- type Tablespace
- type Tag
- type Task
- type TemporaryTable
- type TextSearchComponent
- type TextSearchComponentType
- type Threshold
- type TimeRange
- type TimeSeriesDataPoint
- type TimeSeriesPoint
- type TimeSeriesSampleData
- type TimeTravel
- type TransformRuleType
- type TransformationStep
- type TransientTable
- type TrendMetrics
- type Trigger
- type Type
- type TypeConversionCapabilities
- type TypeConversionValidation
- type TypeConverter
- func (tc *TypeConverter) ConvertColumn(column Column, sourceDB, targetDB dbcapabilities.DatabaseType) (Column, error)
- func (tc *TypeConverter) ConvertCustomType(customType Type, sourceDB, targetDB dbcapabilities.DatabaseType) (*CustomTypeConversionResult, error)
- func (tc *TypeConverter) ConvertDataType(sourceDB, targetDB dbcapabilities.DatabaseType, sourceType string) (*DataTypeConversionResult, error)
- func (tc *TypeConverter) ConvertDataTypeWithCustomTypes(sourceDB, targetDB dbcapabilities.DatabaseType, sourceType string, ...) (*DataTypeConversionResult, error)
- func (tc *TypeConverter) ConvertField(field Field, sourceDB, targetDB dbcapabilities.DatabaseType) (Field, error)
- func (tc *TypeConverter) ConvertProperty(property Property, sourceDB, targetDB dbcapabilities.DatabaseType) (Property, error)
- func (tc *TypeConverter) GetSupportedConversions(sourceDB, targetDB dbcapabilities.DatabaseType) []DataTypeConversionRule
- func (tc *TypeConverter) IsCustomType(typeName string, schema *UnifiedModel) bool
- func (tc *TypeConverter) ValidateCustomTypeConversion(customType Type, sourceDB, targetDB dbcapabilities.DatabaseType) (*CustomTypeValidation, error)
- func (tc *TypeConverter) ValidateTypeConversion(sourceDB, targetDB dbcapabilities.DatabaseType, sourceType string) (*TypeConversionValidation, error)
- type UUIDGenerator
- type UnifiedDataType
- type UnifiedModel
- func CloneSchema(schema *UnifiedModel) (*UnifiedModel, error)
- func ConvertFromProto(pbUM *pb.UnifiedModel) *UnifiedModel
- func DeserializeSchema(data []byte) (*UnifiedModel, error)
- func FilterObjects(schema *UnifiedModel, ...) *UnifiedModel
- func FromProto(pbUM *pb.UnifiedModel) *UnifiedModel
- func MergeSchemas(base, overlay *UnifiedModel) (*UnifiedModel, error)
- func NewUnifiedModel(dbType dbcapabilities.DatabaseType) *UnifiedModel
- func (schema *UnifiedModel) AddCollection(collection Collection)
- func (schema *UnifiedModel) AddConstraint(constraint Constraint)
- func (schema *UnifiedModel) AddIndex(index Index)
- func (schema *UnifiedModel) AddTable(table Table)
- func (um *UnifiedModel) ConvertToProto() *pb.UnifiedModel
- func (um *UnifiedModel) GetBasicMetrics(schemaID string) *UnifiedModelMetrics
- func (schema *UnifiedModel) GetCollection(name string) (*Collection, bool)
- func (schema *UnifiedModel) GetConstraint(name string) (*Constraint, bool)
- func (schema *UnifiedModel) GetFunction(name string) (*Function, bool)
- func (schema *UnifiedModel) GetIndex(name string) (*Index, bool)
- func (schema *UnifiedModel) GetObjectsByType(objectType ObjectType) map[string]interface{}
- func (schema *UnifiedModel) GetTable(name string) (*Table, bool)
- func (schema *UnifiedModel) GetView(name string) (*View, bool)
- func (schema *UnifiedModel) HasObject(objectType ObjectType, name string) bool
- func (schema *UnifiedModel) RemoveCollection(name string) bool
- func (schema *UnifiedModel) RemoveIndex(name string) bool
- func (schema *UnifiedModel) RemoveTable(name string) bool
- func (um *UnifiedModel) ToProto() *pb.UnifiedModel
- type UnifiedModelEnrichment
- func (e *UnifiedModelEnrichment) AddColumnEnrichment(tableName, columnName string, enrichment ColumnEnrichment)
- func (e *UnifiedModelEnrichment) AddTableEnrichment(tableName string, enrichment TableEnrichment)
- func (e *UnifiedModelEnrichment) FilterByCategory(categories []EnrichmentCategory) *UnifiedModelEnrichment
- func (e *UnifiedModelEnrichment) GetColumnEnrichment(tableName, columnName string) (ColumnEnrichment, bool)
- func (e *UnifiedModelEnrichment) GetColumnsWithPrivilegedData() []string
- func (e *UnifiedModelEnrichment) GetComplianceRequirements() []ComplianceFramework
- func (e *UnifiedModelEnrichment) GetEnrichmentSummary() EnrichmentSummary
- func (e *UnifiedModelEnrichment) GetPrivilegedObjects() []RiskObject
- func (e *UnifiedModelEnrichment) GetRecommendationsByPriority(priority ConversionPriority) []Recommendation
- func (e *UnifiedModelEnrichment) GetRecommendationsByType(recommendationType RecommendationType) []Recommendation
- func (e *UnifiedModelEnrichment) GetTableEnrichment(tableName string) (TableEnrichment, bool)
- func (e *UnifiedModelEnrichment) GetTablesWithPrivilegedData() []string
- func (e *UnifiedModelEnrichment) HasPrivilegedData() bool
- func (e *UnifiedModelEnrichment) MergeEnrichment(other *UnifiedModelEnrichment) error
- func (e *UnifiedModelEnrichment) ValidateEnrichment() []string
- type UnifiedModelMetrics
- func (m *UnifiedModelMetrics) AddCollectionDocs(collectionName string, docCount int64)
- func (m *UnifiedModelMetrics) AddTableRows(tableName string, rowCount int64)
- func (m *UnifiedModelMetrics) AddTableSize(tableName string, dataSize, indexSize int64)
- func (m *UnifiedModelMetrics) GetMetricsSummary() MetricsSummary
- func (m *UnifiedModelMetrics) MergeMetrics(other *UnifiedModelMetrics) error
- func (m *UnifiedModelMetrics) ValidateMetrics() []string
- type UnifiedModelSampleData
- type UnsupportedFeature
- type UserContextManager
- func (ucm *UserContextManager) ApplyContextToConversionRequest(request *ConversionRequest, context *UserConversionContext) (*ConversionRequest, []ContextApplicationWarning, error)
- func (ucm *UserContextManager) CreateUserContext(userID string, sourceDB, targetDB dbcapabilities.DatabaseType) *UserConversionContext
- func (ucm *UserContextManager) GenerateContextSummary(context *UserConversionContext) string
- func (ucm *UserContextManager) MergeUserContexts(contexts ...*UserConversionContext) (*UserConversionContext, error)
- func (ucm *UserContextManager) ValidateUserContext(context *UserConversionContext) []ValidationError
- type UserContextTemplate
- type UserConversionContext
- type UserConversionRule
- type UserDataTypeMapping
- type UserDecision
- type UserDecisionResponse
- type UserFieldMapping
- type UserMapping
- type UserObjectMapping
- type UserRuleAction
- type UserRuleCondition
- type UserTransformRule
- type UserValidationRule
- type ValidationError
- type ValidationErrorType
- type ValidationRuleType
- type ValueFreq
- type ValueSampleInfo
- type Vector
- type VectorCounts
- type VectorIndex
- type VectorSample
- type VectorSampleData
- type VectorSize
- type VectorStrategy
- type VersionNode
- type View
- type ViewEnrichment
- type ViewSize
- type WarningType
- type WindowFunc
- type WindowView
Constants ¶
This section is empty.
Variables ¶
var ConversionMatrixRegistry = map[ConversionPair]ConversionMatrix{}
ConversionMatrixRegistry is deprecated - use dynamic generation instead Kept for backward compatibility during transition
var DataTypeRegistry = map[DataTypeConversionKey]DataTypeConversionRule{}
DataTypeRegistry holds type conversion rules for all database pairs
var DatabaseFeatureRegistry = map[dbcapabilities.DatabaseType]DatabaseFeatureSupport{}
DatabaseFeatureRegistry holds feature support information for all databases
var DatabaseMetadataRegistry = make(map[dbcapabilities.DatabaseType]DatabaseTypeMetadata)
DatabaseMetadataRegistry holds metadata for all supported databases
var ParadigmConversionRegistry = map[ParadigmPair]ParadigmConversionStrategy{}
ParadigmConversionRegistry is deprecated - use dynamic generation instead Kept for backward compatibility during transition
Functions ¶
func ApplyUserContext ¶
func ApplyUserContext(matrix *ConversionMatrix, context *UserConversionContext) (*ConversionMatrix, []ContextApplicationWarning, error)
ApplyUserContext applies user-provided context to a conversion matrix
func AreCompatible ¶
func AreCompatible(source, target *resource.ResourceAddress) (bool, error)
AreCompatible checks if two resource addresses are compatible for mapping
func CanStoreValues ¶
func CanStoreValues(objType resource.ObjectType, path []resource.PathSegment) bool
CanStoreValues checks if an object type at a given path can store data values
func GenerateColumnKey ¶
GenerateColumnKey creates a consistent key for column enrichments
func GenerateContainerURI ¶
GenerateContainerURI generates a URI for a container resource
func GenerateItemURI ¶
GenerateItemURI generates a URI for an item resource
func GenerateMCPContainerURI ¶
GenerateMCPContainerURI generates a URI for an MCP container resource
func GenerateObjectPath ¶
func GenerateObjectPath(objectType ObjectType, names ...string) string
GenerateObjectPath creates a hierarchical path for an object
func GenerateSchemaHash ¶
func GenerateSchemaHash(schema *UnifiedModel) string
GenerateSchemaHash generates a SHA-256 hash of the schema structure. This is used for quick equality checks and change detection.
func GenerateSchemaID ¶
func GenerateSchemaID(schema *UnifiedModel) string
GenerateSchemaID generates a unique identifier for a schema based on its content. This ID is used to link schemas to their metrics and enrichment data.
func GenerateStreamContainerURI ¶
GenerateStreamContainerURI generates a URI for a stream container resource
func GenerateWebhookContainerURI ¶
GenerateWebhookContainerURI generates a URI for a webhook container resource
func GetCommonPitfalls ¶
func GetCommonPitfalls(source, target dbcapabilities.DataParadigm) []string
GetCommonPitfalls returns common pitfalls for paradigm conversion
func GetConversionGuidance ¶
func GetConversionGuidance(source, target dbcapabilities.DataParadigm) []string
GetConversionGuidance returns user guidance for paradigm conversion
func GetPreferredConversionPartners ¶
func GetPreferredConversionPartners(dbType dbcapabilities.DatabaseType, asSource bool) []dbcapabilities.DatabaseType
GetPreferredConversionPartners returns preferred databases for conversion
func GetRecommendedTools ¶
func GetRecommendedTools(source, target dbcapabilities.DataParadigm) []string
GetRecommendedTools returns recommended tools for paradigm conversion
func GetUnsupportedFeatures ¶
func GetUnsupportedFeatures(source, target dbcapabilities.DatabaseType) []string
GetUnsupportedFeatures returns features that cannot be converted using dynamic generation
func HasConversionCapability ¶
func HasConversionCapability(dbType dbcapabilities.DatabaseType, asSource bool) bool
HasConversionCapability checks if a database can participate in conversions
func HasSignificantChanges ¶
func HasSignificantChanges(source, target *UnifiedModel) (bool, error)
HasSignificantChanges checks if two schemas have changes that would require versioning. This is used by the unified model service to determine if a new version should be created.
func IsConversionPossible ¶
func IsConversionPossible(source, target dbcapabilities.DatabaseType) bool
IsConversionPossible checks if conversion between databases is possible using dynamic generation
func IsMetadataProperty ¶
func IsMetadataProperty(objType resource.ObjectType, propertyName string) bool
IsMetadataProperty checks if a property name refers to metadata
func IsObjectSupported ¶
func IsObjectSupported(dbType dbcapabilities.DatabaseType, objType ObjectType) bool
IsObjectSupported checks if a database supports a specific object type
func IsParadigmConversionSupported ¶
func IsParadigmConversionSupported(source, target dbcapabilities.DataParadigm) bool
IsParadigmConversionSupported checks if conversion between paradigms is supported
func IsSchemaEmpty ¶
func IsSchemaEmpty(schema *UnifiedModel) bool
IsSchemaEmpty checks if a schema contains any meaningful data.
func ListAddressableLocations ¶
func ListAddressableLocations(um *UnifiedModel, protocol resource.ResourceProtocol, objectPath string) ([]*resource.ResourceAddress, error)
ListAddressableLocations returns all addressable locations within an object
func PopulateResourcesFromUnifiedModel ¶
func PopulateResourcesFromUnifiedModel( um *UnifiedModel, dbID, nodeID, tenantID, workspaceID, ownerID, databaseName string, enrichedAnalysis *pb.AnalyzeSchemaEnrichedResponse, ) ([]*models.ResourceContainer, []*models.ResourceItem, error)
PopulateResourcesFromUnifiedModel generates resource containers and items from a UnifiedModel enrichedAnalysis provides optional table-level classification data (PrimaryCategory, ClassificationConfidence)
func RedactSensitiveData ¶
func RedactSensitiveData(sampleData *UnifiedModelSampleData) error
RedactSensitiveData applies privacy-aware redaction to sample data
func RequiresEnrichmentData ¶
func RequiresEnrichmentData(source, target dbcapabilities.DatabaseType) bool
RequiresEnrichmentData checks if conversion requires enrichment data using dynamic generation
func RequiresUserInteraction ¶
func RequiresUserInteraction(source, target dbcapabilities.DatabaseType) bool
RequiresUserInteraction checks if conversion requires user decisions using dynamic generation
func SerializeSampleData ¶
func SerializeSampleData(sampleData *UnifiedModelSampleData) ([]byte, error)
SerializeSampleData converts sample data to JSON for temporary storage/transport
func SerializeSchema ¶
func SerializeSchema(schema *UnifiedModel) ([]byte, error)
SerializeSchema converts a UnifiedModel to JSON bytes for storage or transmission.
func SupportsSelector ¶
func SupportsSelector(objType resource.ObjectType, selectorType resource.SelectorType) bool
SupportsSelector checks if an object type supports a specific selector type
Types ¶
type AccessPattern ¶
type AccessPattern string
AccessPattern represents how a table is primarily accessed
const ( AccessPatternReadHeavy AccessPattern = "read_heavy" AccessPatternWriteHeavy AccessPattern = "write_heavy" AccessPatternAppendOnly AccessPattern = "append_only" AccessPatternReadWrite AccessPattern = "read_write" AccessPatternBatch AccessPattern = "batch" AccessPatternRealTime AccessPattern = "real_time" )
type AggregationOp ¶
type AlternativeApproach ¶
type AlternativeApproach struct {
Name string `json:"name"`
Description string `json:"description"`
Pros []string `json:"pros"`
Cons []string `json:"cons"`
ComplexityLevel MigrationComplexity `json:"complexity_level"`
EstimatedCost string `json:"estimated_cost,omitempty"`
}
AlternativeApproach represents an alternative way to achieve the same goal
type AlternativeLevel ¶
type AlternativeLevel struct {
Level DetectionLevel `json:"level"`
Pros []string `json:"pros"`
Cons []string `json:"cons"`
UseCase string `json:"use_case"`
}
AlternativeLevel describes an alternative detection level option
type Annotation ¶
type AutomationLevel ¶
type AutomationLevel string
AutomationLevel indicates how much automation is possible
const ( AutomationLevelFull AutomationLevel = "full" // Fully automated AutomationLevelPartial AutomationLevel = "partial" // Some automation possible AutomationLevelManual AutomationLevel = "manual" // Requires manual intervention AutomationLevelImpossible AutomationLevel = "impossible" // Cannot be automated )
type Blob ¶
type Blob struct {
Name string `json:"name"` // Object key or blob identifier
Bucket string `json:"bucket"` // Bucket/container name
Path string `json:"path"` // Full path or key
Size int64 `json:"size_bytes,omitempty"` // Size in bytes
ContentType string `json:"content_type,omitempty"` // MIME type
ETag string `json:"etag,omitempty"` // Entity tag (hash/version)
Metadata map[string]string `json:"metadata,omitempty"` // Custom metadata
StorageClass string `json:"storage_class,omitempty"` // Storage tier (e.g., STANDARD, GLACIER)
Encryption string `json:"encryption,omitempty"` // Encryption status
Labels map[string]string `json:"labels,omitempty"`
Options map[string]any `json:"options,omitempty"`
}
type BudgetConstraints ¶
type BudgetConstraints struct {
MaxTotalCost *float64 `json:"max_total_cost,omitempty"`
MaxMonthlyCost *float64 `json:"max_monthly_cost,omitempty"`
Currency string `json:"currency"`
CostOptimization bool `json:"cost_optimization"` // Optimize for cost over performance
}
BudgetConstraints specifies financial limits for migration
type BufferPool ¶
type CapacityMetrics ¶
type CapacityMetrics struct {
// Storage capacity
TotalStorageCapacity int64 `json:"total_storage_capacity_bytes"`
UsedStorageCapacity int64 `json:"used_storage_capacity_bytes"`
StorageUtilization float64 `json:"storage_utilization_percent"` // 0-100
// Memory capacity
TotalMemoryCapacity int64 `json:"total_memory_capacity_bytes,omitempty"`
UsedMemoryCapacity int64 `json:"used_memory_capacity_bytes,omitempty"`
MemoryUtilization float64 `json:"memory_utilization_percent,omitempty"` // 0-100
// Compute capacity
TotalCPUCores *float64 `json:"total_cpu_cores,omitempty"`
UsedCPUCores *float64 `json:"used_cpu_cores,omitempty"`
CPUUtilization *float64 `json:"cpu_utilization_percent,omitempty"` // 0-100
// Connection capacity
MaxConnections int `json:"max_connections,omitempty"`
CurrentConnections int `json:"current_connections,omitempty"`
ConnectionUtilization float64 `json:"connection_utilization_percent,omitempty"` // 0-100
// Object capacity limits
ObjectLimits map[string]ObjectLimit `json:"object_limits,omitempty"` // limits by object type
}
CapacityMetrics provides resource capacity and utilization information
type Catalog ¶
type Catalog struct {
Name string `json:"name"`
Owner string `json:"owner,omitempty"`
Comment string `json:"comment,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Options map[string]any `json:"options,omitempty"`
Databases map[string]Database `json:"databases,omitempty"`
Schemas map[string]Schema `json:"schemas,omitempty"`
Tables map[string]Table `json:"tables,omitempty"` // For engines without schemas
Collections map[string]Collection `json:"collections,omitempty"`
}
type CategoryScore ¶
type CategoryScore struct {
Category string `json:"category"` // Category name
Score float64 `json:"score"` // Confidence score 0.0-1.0
Reason string `json:"reason"` // Explanation for the score
Evidence []string `json:"evidence,omitempty"` // Supporting evidence
}
CategoryScore represents a classification category and its confidence score
type ChangeSeverity ¶
type ChangeSeverity string
Severity levels for changes
const ( ChangeSeverityMinor ChangeSeverity = "minor" // Cosmetic changes ChangeSeverityMajor ChangeSeverity = "major" // Significant changes ChangeSeverityCritical ChangeSeverity = "critical" // Breaking changes )
type ChangeType ¶
type ChangeType string
Change types for structural differences
const ( ChangeTypeAdded ChangeType = "added" ChangeTypeRemoved ChangeType = "removed" ChangeTypeModified ChangeType = "modified" ChangeTypeRenamed ChangeType = "renamed" ChangeTypeMoved ChangeType = "moved" )
type Collection ¶
type Collection struct {
Name string `json:"name"`
Owner string `json:"owner,omitempty"`
Comment string `json:"comment,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Options map[string]any `json:"options,omitempty"`
Fields map[string]Field `json:"fields,omitempty"`
Indexes map[string]Index `json:"indexes,omitempty"`
Validation map[string]any `json:"validation,omitempty"`
ShardKey []string `json:"shard_key,omitempty"`
}
type CollectionDocs ¶
type CollectionDocs struct {
DocumentCount int64 `json:"document_count"`
EstimatedDocuments *int64 `json:"estimated_documents,omitempty"`
AvgDocumentSize *int64 `json:"avg_document_size_bytes,omitempty"`
GrowthRate *float64 `json:"growth_rate_docs_per_day,omitempty"`
LastUpdated *time.Time `json:"last_updated,omitempty"`
}
type CollectionEnrichment ¶
type CollectionEnrichment struct {
// Document characteristics
DocumentCount *int64 `json:"document_count,omitempty"`
AverageDocumentSize *int64 `json:"average_document_size,omitempty"` // Bytes
SchemaFlexibility *float64 `json:"schema_flexibility,omitempty"` // 0.0-1.0, rigid to flexible
// Field analysis
CommonFields []string `json:"common_fields,omitempty"` // Fields present in >90% of docs
RareFields []string `json:"rare_fields,omitempty"` // Fields present in <10% of docs
HasPrivilegedData bool `json:"has_privileged_data"`
PrivilegedFields []string `json:"privileged_fields,omitempty"`
// Performance characteristics
QueryPatterns []string `json:"query_patterns,omitempty"` // Common query types
RecommendedIndexes []string `json:"recommended_indexes,omitempty"`
// Context
BusinessPurpose string `json:"business_purpose,omitempty"`
Context map[string]string `json:"context,omitempty"`
}
CollectionEnrichment contains analysis metadata for document collections
type CollectionPerformance ¶
type CollectionQuality ¶
type CollectionQuality struct {
QualityScore float64 `json:"quality_score"` // 0.0-1.0
SchemaCompliance float64 `json:"schema_compliance"` // 0.0-1.0
DocumentValidation float64 `json:"document_validation"` // 0.0-1.0
InconsistentDocs int64 `json:"inconsistent_docs,omitempty"`
LastQualityCheck *time.Time `json:"last_quality_check,omitempty"`
}
type CollectionSampleData ¶
type CollectionSampleData struct {
CollectionName string `json:"collection_name"`
DocumentCount int64 `json:"document_count"`
SampleCount int `json:"sample_count"`
Documents []map[string]interface{} `json:"documents"` // Sample documents
FieldSamples map[string]FieldSampleValues `json:"field_samples"` // Field-level samples
SchemaProfile DocumentSchemaProfile `json:"schema_profile"` // Detected field types/patterns
CollectedAt time.Time `json:"collected_at"`
Warnings []string `json:"warnings,omitempty"`
}
CollectionSampleData represents sample data from a document collection (MongoDB, CosmosDB)
type CollectionSize ¶
type CollectionStrategy ¶
type CollectionStrategy string
CollectionStrategy defines how to structure document collections
const ( CollectionStrategyOneToOne CollectionStrategy = "one_to_one" // One table = one collection CollectionStrategyAggregated CollectionStrategy = "aggregated" // Multiple tables = one collection CollectionStrategyNormalized CollectionStrategy = "normalized" // Maintain table structure CollectionStrategyDenormalized CollectionStrategy = "denormalized" // Flatten related data CollectionStrategyHierarchical CollectionStrategy = "hierarchical" // Create nested documents )
type Column ¶
type Column struct {
Name string `json:"name"`
DataType string `json:"data_type"`
Nullable bool `json:"nullable"`
Default string `json:"default,omitempty"`
GeneratedExpression string `json:"generated_expression,omitempty"`
IsPrimaryKey bool `json:"is_primary_key,omitempty"`
IsPartitionKey bool `json:"is_partition_key,omitempty"`
IsClusteringKey bool `json:"is_clustering_key,omitempty"`
AutoIncrement bool `json:"auto_increment,omitempty"`
Collation string `json:"collation,omitempty"`
OrdinalPosition *int `json:"ordinal_position,omitempty"`
Options map[string]any `json:"options,omitempty"`
}
type ColumnEnrichment ¶
type ColumnEnrichment struct {
// Privileged data detection
IsPrivilegedData bool `json:"is_privileged_data"`
DataCategory DataCategory `json:"data_category,omitempty"`
SubCategory string `json:"sub_category,omitempty"`
PrivilegedConfidence float64 `json:"privileged_confidence"` // 0.0-1.0
PrivilegedDescription string `json:"privileged_description,omitempty"`
RiskLevel RiskLevel `json:"risk_level,omitempty"`
ComplianceImpact []ComplianceFramework `json:"compliance_impact,omitempty"`
// Data characteristics
Cardinality *int64 `json:"cardinality,omitempty"` // Estimated unique values
NullPercentage *float64 `json:"null_percentage,omitempty"` // 0.0-1.0
DataDistribution *string `json:"data_distribution,omitempty"` // uniform, skewed, normal
ValuePatterns []string `json:"value_patterns,omitempty"` // Regex patterns found in data
SampleValues []string `json:"sample_values,omitempty"` // Anonymized sample values
// Usage patterns
IsSearchable bool `json:"is_searchable"` // Frequently used in WHERE clauses
IsFilterable bool `json:"is_filterable"` // Used for filtering/grouping
IsSortable bool `json:"is_sortable"` // Used in ORDER BY
QueryFrequency *float64 `json:"query_frequency,omitempty"` // Queries per day
// Optimization hints
RecommendedIndexType IndexType `json:"recommended_index_type,omitempty"`
ShouldEncrypt bool `json:"should_encrypt"`
ShouldMask bool `json:"should_mask"`
// Relationships
IsForeignKey bool `json:"is_foreign_key"`
ReferencedTable string `json:"referenced_table,omitempty"`
ReferencedColumn string `json:"referenced_column,omitempty"`
ReferencingTables []string `json:"referencing_tables,omitempty"` // Tables that reference this column
// Quality metrics
DataQualityScore *float64 `json:"data_quality_score,omitempty"` // 0.0-1.0
CompletenessScore *float64 `json:"completeness_score,omitempty"` // 0.0-1.0
ConsistencyScore *float64 `json:"consistency_score,omitempty"` // 0.0-1.0
// Metadata
BusinessMeaning string `json:"business_meaning,omitempty"`
Tags []string `json:"tags,omitempty"`
Context map[string]string `json:"context,omitempty"`
}
ColumnEnrichment contains analysis metadata for a column
type ColumnQuality ¶
type ColumnQuality struct {
QualityScore float64 `json:"quality_score"` // 0.0-1.0
NullPercent float64 `json:"null_percent"` // 0-100
UniquePercent float64 `json:"unique_percent"` // 0-100
ValidFormatPercent float64 `json:"valid_format_percent"` // 0-100
OutlierCount int64 `json:"outlier_count,omitempty"`
LastQualityCheck *time.Time `json:"last_quality_check,omitempty"`
}
type ColumnSampleData ¶
type ColumnSampleData struct {
ColumnFamilyName string `json:"column_family_name"`
RowCount int64 `json:"row_count"`
SampleCount int `json:"sample_count"`
ColumnSamples map[string]ColumnSampleValues `json:"column_samples"`
PartitionSamples []PartitionSampleData `json:"partition_samples"` // Cassandra partitions
CollectedAt time.Time `json:"collected_at"`
Warnings []string `json:"warnings,omitempty"`
}
ColumnSampleData represents sample data from columnar stores (ClickHouse, Cassandra wide-column)
type ColumnSampleValues ¶
type ColumnSampleValues struct {
FieldName string `json:"field_name"`
DataType string `json:"data_type"`
Values []interface{} `json:"values"` // Actual sample values
DistinctCount int `json:"distinct_count"` // Number of distinct values
NullCount int `json:"null_count"`
EmptyCount int `json:"empty_count"`
MinLength *int `json:"min_length,omitempty"` // For strings
MaxLength *int `json:"max_length,omitempty"` // For strings
AvgLength *float64 `json:"avg_length,omitempty"` // For strings
MinValue interface{} `json:"min_value,omitempty"` // For numeric/date
MaxValue interface{} `json:"max_value,omitempty"` // For numeric/date
ValuePatterns []string `json:"value_patterns,omitempty"` // Detected regex patterns
CommonValues []ValueFreq `json:"common_values,omitempty"` // Most frequent values
PiiIndicators []string `json:"pii_indicators,omitempty"` // Detected PII patterns
SensitivityTags []string `json:"sensitivity_tags,omitempty"` // Privacy classification
}
ColumnSampleValues represents sample values for a single column/field
type ComparisonMode ¶
type ComparisonMode string
ComparisonMode determines how enrichment is used in schema comparison
const ( ComparisonModeStructural ComparisonMode = "structural" // Pure structural comparison (traditional) ComparisonModeGuided ComparisonMode = "guided" // Use enrichment to guide structural comparison ComparisonModeEnriched ComparisonMode = "enriched" // Include enrichment in comparison results )
type ComparisonOptions ¶
type ComparisonOptions struct {
// Comparison behavior
Mode ComparisonMode `json:"mode"`
IncludeEnrichment bool `json:"include_enrichment"`
EnrichmentCategories []EnrichmentCategory `json:"enrichment_categories,omitempty"`
UseEnrichmentContext bool `json:"use_enrichment_context"`
// Structural comparison settings
IgnoreComments bool `json:"ignore_comments"`
IgnoreWhitespace bool `json:"ignore_whitespace"`
CaseSensitive bool `json:"case_sensitive"`
IgnoreObjectOrder bool `json:"ignore_object_order"`
// Enrichment comparison settings
PrivacyWeightThreshold float64 `json:"privacy_weight_threshold"` // 0.0-1.0
ScoreToleranceThreshold float64 `json:"score_tolerance_threshold"` // 0.0-1.0
// Object filtering
IncludeObjectTypes []ObjectType `json:"include_object_types,omitempty"`
ExcludeObjectTypes []ObjectType `json:"exclude_object_types,omitempty"`
IncludeObjectNames []string `json:"include_object_names,omitempty"`
ExcludeObjectNames []string `json:"exclude_object_names,omitempty"`
}
ComparisonOptions configures how schema comparison is performed
func DefaultComparisonOptions ¶
func DefaultComparisonOptions() ComparisonOptions
DefaultComparisonOptions returns sensible defaults for schema comparison
func EnrichedComparisonOptions ¶
func EnrichedComparisonOptions() ComparisonOptions
EnrichedComparisonOptions returns options optimized for enrichment-aware comparison
type ComparisonResult ¶
type ComparisonResult struct {
// Basic comparison metadata
SourceSchema string `json:"source_schema"`
TargetSchema string `json:"target_schema"`
ComparedAt time.Time `json:"compared_at"`
ComparisonMode ComparisonMode `json:"comparison_mode"`
// Structural differences
HasStructuralChanges bool `json:"has_structural_changes"`
StructuralChanges []StructuralChange `json:"structural_changes"`
AddedObjects []ObjectChange `json:"added_objects"`
RemovedObjects []ObjectChange `json:"removed_objects"`
ModifiedObjects []ObjectChange `json:"modified_objects"`
// Enrichment differences (only included if enrichment comparison enabled)
HasEnrichmentChanges bool `json:"has_enrichment_changes"`
EnrichmentChanges []EnrichmentChange `json:"enrichment_changes,omitempty"`
// Analysis and recommendations
OverallSimilarity float64 `json:"overall_similarity"` // 0.0-1.0
StructuralSimilarity float64 `json:"structural_similarity"` // 0.0-1.0
EnrichmentSimilarity *float64 `json:"enrichment_similarity,omitempty"` // 0.0-1.0
CompatibilityScore float64 `json:"compatibility_score"` // 0.0-1.0
MigrationComplexity MigrationComplexity `json:"migration_complexity"`
ConversionRecommendations []ConversionRecommendation `json:"conversion_recommendations"`
// Warnings and issues
Warnings []string `json:"warnings"`
ComplianceIssues []ComplianceIssue `json:"compliance_issues,omitempty"`
PerformanceImpacts []PerformanceImpact `json:"performance_impacts,omitempty"`
}
ComparisonResult represents the result of comparing two schemas
func CompareSchemas ¶
func CompareSchemas(source, target *UnifiedModel, options ComparisonOptions) (*ComparisonResult, error)
CompareSchemas is the main entry point for schema comparison. It provides both basic and enhanced comparison modes based on options.
func EnhancedCompareSchemas ¶
func EnhancedCompareSchemas(source, target *UnifiedModel, options EnhancedComparisonOptions) (*ComparisonResult, error)
EnhancedCompareSchemas provides production-ready schema comparison with detailed analysis
type ComplianceFinding ¶
type ComplianceFinding struct {
Framework ComplianceFramework `json:"framework"`
Severity RiskLevel `json:"severity"`
ObjectType string `json:"object_type"` // table, column, index, etc.
ObjectName string `json:"object_name"`
Finding string `json:"finding"` // Description of the issue
Requirement string `json:"requirement"` // Specific compliance requirement
Remediation string `json:"remediation"` // How to fix the issue
}
ComplianceFinding represents a specific compliance-related finding
type ComplianceFramework ¶
type ComplianceFramework string
ComplianceFramework represents regulatory compliance requirements
const ( ComplianceGDPR ComplianceFramework = "gdpr" ComplianceHIPAA ComplianceFramework = "hipaa" CompliancePCI ComplianceFramework = "pci" ComplianceSOX ComplianceFramework = "sox" ComplianceCCPA ComplianceFramework = "ccpa" ComplianceFERPA ComplianceFramework = "ferpa" ComplianceISO27001 ComplianceFramework = "iso27001" )
type ComplianceIssue ¶
type ComplianceIssue struct {
Framework ComplianceFramework `json:"framework"`
Severity RiskLevel `json:"severity"`
ObjectPath string `json:"object_path"`
Issue string `json:"issue"`
Requirement string `json:"requirement"`
RecommendedFix string `json:"recommended_fix"`
MustFix bool `json:"must_fix"` // Required vs. recommended
}
ComplianceIssue represents a compliance concern identified during comparison
type ComplianceSummary ¶
type ComplianceSummary struct {
// Framework-specific findings
GDPRFindings []ComplianceFinding `json:"gdpr_findings,omitempty"`
HIPAAFindings []ComplianceFinding `json:"hipaa_findings,omitempty"`
PCIFindings []ComplianceFinding `json:"pci_findings,omitempty"`
SOXFindings []ComplianceFinding `json:"sox_findings,omitempty"`
CCPAFindings []ComplianceFinding `json:"ccpa_findings,omitempty"`
// Overall assessment
OverallRiskLevel RiskLevel `json:"overall_risk_level"`
RequiredFrameworks []ComplianceFramework `json:"required_frameworks"`
RecommendedActions []string `json:"recommended_actions"`
ComplianceScore float64 `json:"compliance_score"` // 0.0-1.0
}
ComplianceSummary provides regulatory compliance analysis
type Connection ¶
type Constraint ¶
type Constraint struct {
Name string `json:"name"`
Type ConstraintType `json:"type"` // Use ConstraintType enum for type safety
Columns []string `json:"columns,omitempty"`
Expression string `json:"expression,omitempty"`
Reference Reference `json:"reference,omitempty"`
Options map[string]any `json:"options,omitempty"`
}
type ConstraintSupportInfo ¶
type ConstraintSupportInfo struct {
SupportsPrimaryKey bool `json:"supports_primary_key"`
SupportsForeignKey bool `json:"supports_foreign_key"`
SupportsUnique bool `json:"supports_unique"`
SupportsCheck bool `json:"supports_check"`
SupportsNotNull bool `json:"supports_not_null"`
SupportsDefault bool `json:"supports_default"`
SupportsAutoIncrement bool `json:"supports_auto_increment"`
}
ConstraintSupportInfo describes constraint support
type ConstraintType ¶
type ConstraintType string
const ( ConstraintTypePrimaryKey ConstraintType = "primary_key" ConstraintTypeForeignKey ConstraintType = "foreign_key" ConstraintTypeUnique ConstraintType = "unique" ConstraintTypeCheck ConstraintType = "check" ConstraintTypeNotNull ConstraintType = "not_null" ConstraintTypeExclusion ConstraintType = "exclusion" ConstraintTypeDefault ConstraintType = "default" )
type ContentSample ¶
type ContextApplicationMode ¶
type ContextApplicationMode string
const ( ContextModeStrict ContextApplicationMode = "strict" // Fail if context can't be applied ContextModePermissive ContextApplicationMode = "permissive" // Skip invalid context, warn user ContextModeAdvisory ContextApplicationMode = "advisory" // Use context as hints only )
type ContextApplicationWarning ¶
type ContextApplicationWarning struct {
Type ContextWarningType `json:"type"`
Message string `json:"message"`
Context string `json:"context,omitempty"`
}
ContextApplicationWarning represents warnings when applying user context
type ContextWarningType ¶
type ContextWarningType string
const ( WarningTypeObjectNotFound ContextWarningType = "object_not_found" WarningTypeInvalidMapping ContextWarningType = "invalid_mapping" WarningTypeConflictingRules ContextWarningType = "conflicting_rules" WarningTypeUnsupportedAction ContextWarningType = "unsupported_action" )
type ConversionAnalysis ¶
type ConversionAnalysis struct {
SourceDatabase dbcapabilities.DatabaseType `json:"source_database"`
TargetDatabase dbcapabilities.DatabaseType `json:"target_database"`
SourceParadigms []dbcapabilities.DataParadigm `json:"source_paradigms"`
TargetParadigms []dbcapabilities.DataParadigm `json:"target_paradigms"`
ParadigmCompatibility ParadigmCompatibility `json:"paradigm_compatibility"`
ConversionComplexity ConversionComplexity `json:"conversion_complexity"`
ConversionSupported bool `json:"conversion_supported"`
RequiresUserInput bool `json:"requires_user_input"`
RequiresEnrichment bool `json:"requires_enrichment"`
UnsupportedFeatures []string `json:"unsupported_features"`
AvailableStrategies []ConversionStrategy `json:"available_strategies"`
Recommendations []string `json:"recommendations"`
}
ConversionAnalysis provides a summary of conversion feasibility
type ConversionCapabilities ¶
type ConversionCapabilities struct {
CanBeSource bool `json:"can_be_source"`
CanBeTarget bool `json:"can_be_target"`
PreferredSourceTypes []dbcapabilities.DatabaseType `json:"preferred_source_types,omitempty"`
PreferredTargetTypes []dbcapabilities.DatabaseType `json:"preferred_target_types,omitempty"`
SpecialRequirements []string `json:"special_requirements,omitempty"`
ConversionLimitations []string `json:"conversion_limitations,omitempty"`
}
ConversionCapabilities defines database-specific conversion capabilities
type ConversionComplexity ¶
type ConversionComplexity string
ConversionComplexity indicates the overall difficulty of conversion
const ( ConversionComplexityTrivial ConversionComplexity = "trivial" // Same paradigm, minor differences ConversionComplexitySimple ConversionComplexity = "simple" // Same paradigm, some mapping needed ConversionComplexityModerate ConversionComplexity = "moderate" // Cross-paradigm, automated possible ConversionComplexityComplex ConversionComplexity = "complex" // Requires user decisions ConversionComplexityImpossible ConversionComplexity = "impossible" // Fundamental incompatibility )
func GetConversionComplexity ¶
func GetConversionComplexity(source, target dbcapabilities.DatabaseType) ConversionComplexity
GetConversionComplexity is deprecated - use dynamic generation instead
type ConversionContext ¶
type ConversionContext struct {
// Source and target information
SourceDatabase string `json:"source_database"`
TargetDatabase string `json:"target_database"`
SourceEnrichment *UnifiedModelEnrichment `json:"source_enrichment,omitempty"`
TargetCapabilities map[string]any `json:"target_capabilities"` // Database capabilities
// Conversion preferences
PreservationRules []DataPreservationRule `json:"preservation_rules"`
ConversionHints []ConversionHint `json:"conversion_hints"`
OptimizationGoals []OptimizationGoal `json:"optimization_goals"`
ComplianceRequirements []ComplianceFramework `json:"compliance_requirements"`
// Migration constraints
MaxDowntime *time.Duration `json:"max_downtime,omitempty"`
MaxDataLoss DataLossLimit `json:"max_data_loss"`
BudgetConstraints *BudgetConstraints `json:"budget_constraints,omitempty"`
PerformanceRequirements *PerformanceRequirements `json:"performance_requirements,omitempty"`
// Context metadata
MigrationReason string `json:"migration_reason,omitempty"`
BusinessContext map[string]string `json:"business_context,omitempty"`
TechnicalContext map[string]string `json:"technical_context,omitempty"`
}
ConversionContext provides context and guidance for schema conversion
type ConversionContextRequest ¶
type ConversionContextRequest struct {
ConversionRequest ConversionRequest `json:"conversion_request"`
UserContext *UserConversionContext `json:"user_context,omitempty"`
ContextMode ContextApplicationMode `json:"context_mode"`
}
ConversionContextRequest represents a request to apply user context to a conversion
type ConversionEngine ¶
type ConversionEngine struct {
// contains filtered or unexported fields
}
ConversionEngine executes conversions using dynamic generation
func NewConversionEngine ¶
func NewConversionEngine() *ConversionEngine
NewConversionEngine creates a new conversion engine
func (*ConversionEngine) AnalyzeConversion ¶
func (ce *ConversionEngine) AnalyzeConversion(request ConversionRequest) (*ConversionResult, error)
AnalyzeConversion analyzes conversion feasibility without performing it
func (*ConversionEngine) Convert ¶
func (ce *ConversionEngine) Convert(request ConversionRequest) (*ConversionResult, error)
Convert performs a schema conversion
type ConversionHint ¶
type ConversionHint struct {
ObjectPath string `json:"object_path"` // e.g., "tables.users.columns.email"
HintType ConversionHintType `json:"hint_type"`
RecommendedAction string `json:"recommended_action"`
Reason string `json:"reason"`
Priority ConversionPriority `json:"priority"`
TargetDatabase string `json:"target_database,omitempty"` // If specific to a database
EstimatedImpact string `json:"estimated_impact"`
AlternativeActions []string `json:"alternative_actions,omitempty"`
Context map[string]string `json:"context,omitempty"`
}
ConversionHint provides specific guidance for converting schema objects
type ConversionHintType ¶
type ConversionHintType string
ConversionHintType categorizes the type of conversion hint
const ( ConversionHintTypeDataType ConversionHintType = "data_type" ConversionHintTypeIndex ConversionHintType = "index" ConversionHintTypeConstraint ConversionHintType = "constraint" ConversionHintTypePartition ConversionHintType = "partition" ConversionHintTypeSecurity ConversionHintType = "security" ConversionHintTypePerformance ConversionHintType = "performance" ConversionHintTypeCompliance ConversionHintType = "compliance" )
type ConversionMatrix ¶
type ConversionMatrix struct {
SourceDatabase dbcapabilities.DatabaseType `json:"source_database"`
TargetDatabase dbcapabilities.DatabaseType `json:"target_database"`
ConversionComplexity ConversionComplexity `json:"conversion_complexity"`
ParadigmCompatibility ParadigmCompatibility `json:"paradigm_compatibility"`
ObjectConversions map[ObjectType]ObjectConversionRule `json:"object_conversions"`
RequiresUserInput bool `json:"requires_user_input"`
RequiresEnrichment bool `json:"requires_enrichment"`
UnsupportedFeatures []string `json:"unsupported_features"`
ConversionStrategies []ConversionStrategy `json:"conversion_strategies"`
EstimatedDuration string `json:"estimated_duration,omitempty"`
SuccessRate float64 `json:"success_rate,omitempty"`
}
ConversionMatrix defines conversion rules between database pairs
func GetConversionMatrix ¶
func GetConversionMatrix(source, target dbcapabilities.DatabaseType) (ConversionMatrix, bool)
GetConversionMatrix is deprecated - use ConversionUtils.GenerateConversionMatrix instead
type ConversionMode ¶
type ConversionMode string
ConversionMode defines how the conversion should be executed
const ( ConversionModeAutomatic ConversionMode = "automatic" // Fully automated ConversionModeInteractive ConversionMode = "interactive" // Prompt for decisions ConversionModeAnalysisOnly ConversionMode = "analysis_only" // Just analyze, don't convert ConversionModeDryRun ConversionMode = "dry_run" // Simulate conversion )
type ConversionPair ¶
type ConversionPair struct {
Source dbcapabilities.DatabaseType
Target dbcapabilities.DatabaseType
}
ConversionPair represents a source-target database pair
type ConversionPath ¶
type ConversionPath struct {
Steps []ConversionStep `json:"steps"`
TotalComplexity ConversionComplexity `json:"total_complexity"`
Recommended bool `json:"recommended"`
EstimatedTime string `json:"estimated_time,omitempty"`
Notes []string `json:"notes,omitempty"`
}
ConversionPath represents a conversion path between databases
type ConversionPreferences ¶
type ConversionPreferences struct {
PreferredStrategy ConversionStrategy `json:"preferred_strategy,omitempty"`
AcceptDataLoss bool `json:"accept_data_loss"`
OptimizeForPerformance bool `json:"optimize_for_performance"`
OptimizeForStorage bool `json:"optimize_for_storage"`
PreserveRelationships bool `json:"preserve_relationships"`
IncludeMetadata bool `json:"include_metadata"`
CustomMappings map[string]string `json:"custom_mappings,omitempty"`
ExcludeObjects []ObjectType `json:"exclude_objects,omitempty"`
}
ConversionPreferences defines user preferences for conversion
type ConversionPriority ¶
type ConversionPriority string
ConversionPriority indicates the importance level of a conversion hint
const ( ConversionPriorityHigh ConversionPriority = "high" ConversionPriorityMedium ConversionPriority = "medium" ConversionPriorityLow ConversionPriority = "low" )
type ConversionRecommendation ¶
type ConversionRecommendation struct {
ID string `json:"id"`
Type RecommendationType `json:"type"`
Priority ConversionPriority `json:"priority"`
Title string `json:"title"`
Description string `json:"description"`
ObjectPath string `json:"object_path,omitempty"`
RecommendedAction string `json:"recommended_action"`
Rationale string `json:"rationale"`
EstimatedImpact string `json:"estimated_impact"`
ImplementationSteps []string `json:"implementation_steps"`
RequiredCapabilities []string `json:"required_capabilities,omitempty"`
RiskFactors []string `json:"risk_factors,omitempty"`
AlternativeApproaches []AlternativeApproach `json:"alternative_approaches,omitempty"`
}
ConversionRecommendation provides specific recommendations for schema conversion
type ConversionReport ¶
type ConversionReport struct {
RequestID string `json:"request_id"`
SourceDatabase dbcapabilities.DatabaseType `json:"source_database"`
TargetDatabase dbcapabilities.DatabaseType `json:"target_database"`
ConversionComplexity ConversionComplexity `json:"conversion_complexity"`
ObjectsProcessed int `json:"objects_processed"`
ObjectsConverted int `json:"objects_converted"`
ObjectsSkipped int `json:"objects_skipped"`
ObjectsDropped int `json:"objects_dropped"`
ConversionSummary map[ObjectType]ConversionStats `json:"conversion_summary"`
StrategiesUsed []ConversionStrategy `json:"strategies_used"`
EnrichmentUsed bool `json:"enrichment_used"`
SampleDataUsed bool `json:"sample_data_used"`
ProcessedAt time.Time `json:"processed_at"`
}
ConversionReport provides detailed information about the conversion
type ConversionRequest ¶
type ConversionRequest struct {
SourceSchema *UnifiedModel `json:"source_schema"`
SourceDatabase dbcapabilities.DatabaseType `json:"source_database"`
TargetDatabase dbcapabilities.DatabaseType `json:"target_database"`
Enrichment *UnifiedModelEnrichment `json:"enrichment,omitempty"`
SampleData *UnifiedModelSampleData `json:"sample_data,omitempty"`
UserPreferences ConversionPreferences `json:"user_preferences"`
ConversionMode ConversionMode `json:"conversion_mode"`
RequestID string `json:"request_id"`
RequestedBy string `json:"requested_by"`
RequestedAt time.Time `json:"requested_at"`
}
ConversionRequest defines parameters for a schema conversion
type ConversionResult ¶
type ConversionResult struct {
TargetSchema *UnifiedModel `json:"target_schema,omitempty"`
ConversionReport ConversionReport `json:"conversion_report"`
UserDecisions []PendingUserDecision `json:"user_decisions,omitempty"`
Warnings []ConversionWarning `json:"warnings"`
UnsupportedFeatures []UnsupportedFeature `json:"unsupported_features"`
ProcessingTime time.Duration `json:"processing_time"`
Success bool `json:"success"`
ErrorMessage string `json:"error_message,omitempty"`
}
ConversionResult contains the results of a schema conversion
type ConversionStats ¶
type ConversionStats struct {
SourceCount int `json:"source_count"`
ConvertedCount int `json:"converted_count"`
SkippedCount int `json:"skipped_count"`
DroppedCount int `json:"dropped_count"`
SuccessRate float64 `json:"success_rate"`
}
ConversionStats provides statistics for object type conversions
type ConversionStep ¶
type ConversionStep struct {
From dbcapabilities.DatabaseType `json:"from"`
To dbcapabilities.DatabaseType `json:"to"`
Complexity ConversionComplexity `json:"complexity"`
Direct bool `json:"direct"`
Reason string `json:"reason,omitempty"`
}
ConversionStep represents a single step in a conversion path
type ConversionStrategy ¶
type ConversionStrategy string
ConversionStrategy defines high-level conversion approaches
const ( StrategyDirect ConversionStrategy = "direct" // Direct object mapping StrategyNormalization ConversionStrategy = "normalization" // Normalize then convert StrategyDenormalization ConversionStrategy = "denormalization" // Denormalize then convert StrategyDecomposition ConversionStrategy = "decomposition" // Break into components StrategyAggregation ConversionStrategy = "aggregation" // Combine components StrategyHybrid ConversionStrategy = "hybrid" // Multiple strategies )
func GetConversionStrategies ¶
func GetConversionStrategies(source, target dbcapabilities.DatabaseType) []ConversionStrategy
GetConversionStrategies returns available conversion strategies using dynamic generation
type ConversionType ¶
type ConversionType string
ConversionType defines the nature of the conversion
const ( ConversionTypeDirect ConversionType = "direct" // 1:1 mapping ConversionTypeSplit ConversionType = "split" // 1:N mapping ConversionTypeMerge ConversionType = "merge" // N:1 mapping ConversionTypeTransform ConversionType = "transform" // Structural change ConversionTypeEmulate ConversionType = "emulate" // Simulate with other objects ConversionTypeDrop ConversionType = "drop" // Cannot convert )
type ConversionUtils ¶
type ConversionUtils struct {
// contains filtered or unexported fields
}
ConversionUtils provides utility functions for the conversion framework
func NewConversionUtils ¶
func NewConversionUtils() *ConversionUtils
NewConversionUtils creates a new ConversionUtils instance
func (*ConversionUtils) FormatConversionSummary ¶
func (cu *ConversionUtils) FormatConversionSummary(analysis *ConversionAnalysis) string
FormatConversionSummary creates a human-readable conversion summary
func (*ConversionUtils) GenerateConversionMatrix ¶
func (cu *ConversionUtils) GenerateConversionMatrix(sourceDB, targetDB dbcapabilities.DatabaseType) (*ConversionMatrix, error)
GenerateConversionMatrix dynamically generates a conversion matrix between two databases based on their feature differences and paradigm compatibility.
func (*ConversionUtils) GetConversionPath ¶
func (cu *ConversionUtils) GetConversionPath(source, target dbcapabilities.DatabaseType) (*ConversionPath, error)
GetConversionPath finds the best conversion path between databases
func (*ConversionUtils) QuickConversionAnalysis ¶
func (cu *ConversionUtils) QuickConversionAnalysis(source, target dbcapabilities.DatabaseType) (*ConversionAnalysis, error)
QuickConversionAnalysis provides a quick analysis of conversion feasibility
func (*ConversionUtils) ValidateConversionRequest ¶
func (cu *ConversionUtils) ValidateConversionRequest(request ConversionRequest) []ValidationError
ValidateConversionRequest validates a conversion request
type ConversionWarning ¶
type ConversionWarning struct {
WarningType WarningType `json:"warning_type"`
ObjectType ObjectType `json:"object_type"`
ObjectName string `json:"object_name,omitempty"`
Message string `json:"message"`
Severity string `json:"severity"`
Suggestion string `json:"suggestion,omitempty"`
Details string `json:"details,omitempty"`
}
ConversionWarning represents a warning during schema conversion
type CustomPattern ¶
type CustomPattern struct {
Name string `json:"name"`
Pattern string `json:"pattern"` // Regex pattern
DataCategory string `json:"data_category"`
Confidence float64 `json:"confidence"` // Base confidence for matches
Description string `json:"description"`
ComplianceFrameworks []string `json:"compliance_frameworks,omitempty"`
}
CustomPattern allows users to define custom detection patterns
type CustomSampleData ¶
type CustomSampleData struct {
DatabaseType string `json:"database_type"`
StructureName string `json:"structure_name"`
SampleCount int `json:"sample_count"`
RawSamples []map[string]interface{} `json:"raw_samples"`
ProcessedSamples map[string]interface{} `json:"processed_samples,omitempty"`
CollectedAt time.Time `json:"collected_at"`
Warnings []string `json:"warnings,omitempty"`
}
CustomSampleData represents database-specific sample data structures
type CustomTypeCategory ¶
type CustomTypeCategory string
CustomTypeCategory represents the category of a custom type
const ( CustomTypeCategoryEnum CustomTypeCategory = "enum" CustomTypeCategoryComposite CustomTypeCategory = "composite" CustomTypeCategoryDomain CustomTypeCategory = "domain" CustomTypeCategoryArray CustomTypeCategory = "array" CustomTypeCategoryRange CustomTypeCategory = "range" CustomTypeCategorySpatial CustomTypeCategory = "spatial" CustomTypeCategoryTemporal CustomTypeCategory = "temporal" CustomTypeCategoryBinary CustomTypeCategory = "binary" CustomTypeCategoryOther CustomTypeCategory = "other" )
type CustomTypeConversionResult ¶
type CustomTypeConversionResult struct {
SourceType Type `json:"source_type"`
ConvertedTypes []Type `json:"converted_types"`
ConvertedColumns []Column `json:"converted_columns,omitempty"`
ConvertedConstraints []Constraint `json:"converted_constraints,omitempty"`
AdditionalObjects map[string]any `json:"additional_objects,omitempty"` // e.g., lookup tables
ConversionStrategy CustomTypeStrategy `json:"conversion_strategy"`
UsedFallbackStrategy bool `json:"used_fallback_strategy"`
RequiresUserInput bool `json:"requires_user_input"`
ConversionNotes string `json:"conversion_notes,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
CustomTypeConversionResult holds the result of a custom type conversion
type CustomTypeImplementation ¶
type CustomTypeImplementation struct {
IsNative bool `json:"is_native"`
RequiresEmulation bool `json:"requires_emulation"`
EmulationStrategy string `json:"emulation_strategy,omitempty"`
Syntax string `json:"syntax,omitempty"`
Limitations []string `json:"limitations,omitempty"`
Examples []string `json:"examples,omitempty"`
}
CustomTypeImplementation describes how a database implements custom types
type CustomTypeStrategy ¶
type CustomTypeStrategy string
CustomTypeStrategy defines how a custom type is converted
const ( CustomTypeStrategyDirect CustomTypeStrategy = "direct" // Native support in target CustomTypeStrategyEmulate CustomTypeStrategy = "emulate" // Emulate with constraints/triggers CustomTypeStrategyString CustomTypeStrategy = "string" // Convert to string type CustomTypeStrategyJSON CustomTypeStrategy = "json" // Convert to JSON/document type CustomTypeStrategyTable CustomTypeStrategy = "lookup_table" // Convert to a separate lookup table CustomTypeStrategyFlatten CustomTypeStrategy = "flatten" // Flatten composite types to multiple columns CustomTypeStrategyCheck CustomTypeStrategy = "check_constraint" // Apply base type with check constraints CustomTypeStrategyUnsupported CustomTypeStrategy = "unsupported" // Cannot be converted )
type CustomTypeSupportInfo ¶
type CustomTypeSupportInfo struct {
SupportsEnum bool `json:"supports_enum"`
SupportsComposite bool `json:"supports_composite"`
SupportsDomain bool `json:"supports_domain"`
SupportsArray bool `json:"supports_array"`
SupportsRange bool `json:"supports_range"`
SupportsJSON bool `json:"supports_json"`
SupportsXML bool `json:"supports_xml"`
SupportsSpatial bool `json:"supports_spatial"`
EnumImplementation CustomTypeImplementation `json:"enum_implementation"`
CompositeImplementation CustomTypeImplementation `json:"composite_implementation"`
DomainImplementation CustomTypeImplementation `json:"domain_implementation"`
ArrayImplementation CustomTypeImplementation `json:"array_implementation"`
JSONImplementation CustomTypeImplementation `json:"json_implementation"`
}
CustomTypeSupportInfo describes what custom types a database supports
type CustomTypeValidation ¶
type CustomTypeValidation struct {
IsSupported bool `json:"is_supported"`
ConversionResult *CustomTypeConversionResult `json:"conversion_result,omitempty"`
Strategy CustomTypeStrategy `json:"strategy"`
RequiresUserInput bool `json:"requires_user_input"`
Warnings []string `json:"warnings,omitempty"`
}
CustomTypeValidation represents the result of custom type validation
type DataCategory ¶
type DataCategory string
DataCategory represents the type of data detected in a column
const ( // Personal Information DataCategoryPII DataCategory = "pii" DataCategoryEmail DataCategory = "email" DataCategoryPhone DataCategory = "phone" DataCategoryAddress DataCategory = "address" DataCategoryName DataCategory = "name" DataCategoryBirthDate DataCategory = "birth_date" // Government IDs DataCategorySSN DataCategory = "ssn" DataCategoryPassport DataCategory = "passport" DataCategoryDriversLicense DataCategory = "drivers_license" DataCategoryNationalID DataCategory = "national_id" // Financial Information DataCategoryFinancial DataCategory = "financial" DataCategoryCreditCard DataCategory = "credit_card" DataCategoryBankAccount DataCategory = "bank_account" DataCategoryRoutingNumber DataCategory = "routing_number" DataCategoryIBAN DataCategory = "iban" DataCategorySWIFT DataCategory = "swift" // Medical Information DataCategoryMedical DataCategory = "medical" DataCategoryMedicalRecord DataCategory = "medical_record" DataCategoryInsuranceID DataCategory = "insurance_id" DataCategoryNPI DataCategory = "npi" // Technical/Network DataCategoryTechnical DataCategory = "technical" DataCategoryIPAddress DataCategory = "ip_address" DataCategoryMACAddress DataCategory = "mac_address" DataCategoryURL DataCategory = "url" // Authentication/Security DataCategoryAuth DataCategory = "auth" DataCategoryPassword DataCategory = "password" DataCategoryToken DataCategory = "token" DataCategoryAPIKey DataCategory = "api_key" // Business Data DataCategoryBusiness DataCategory = "business" DataCategoryCustomerID DataCategory = "customer_id" DataCategoryOrderID DataCategory = "order_id" DataCategoryProductCode DataCategory = "product_code" )
type DataLossLimit ¶
type DataLossLimit string
DataLossLimit specifies acceptable data loss during migration
const ( DataLossLimitNone DataLossLimit = "none" // Zero data loss required DataLossLimitMinimal DataLossLimit = "minimal" // <0.01% acceptable DataLossLimitLow DataLossLimit = "low" // <0.1% acceptable DataLossLimitModerate DataLossLimit = "moderate" // <1% acceptable DataLossLimitAcceptable DataLossLimit = "acceptable" // <5% acceptable )
type DataPreservationRule ¶
type DataPreservationRule struct {
RuleType PreservationRuleType `json:"rule_type"`
ObjectPattern string `json:"object_pattern"` // Regex pattern for object names
PreservationLevel PreservationLevel `json:"preservation_level"`
EncryptionRequired bool `json:"encryption_required"`
MaskingRequired bool `json:"masking_required"`
AuditingRequired bool `json:"auditing_required"`
BackupRequired bool `json:"backup_required"`
ValidateIntegrity bool `json:"validate_integrity"`
ComplianceFrameworks []ComplianceFramework `json:"compliance_frameworks,omitempty"`
}
DataPreservationRule specifies how data should be preserved during migration
type DataTypeCapability ¶
type DataTypeCapability struct {
// IsStructured indicates if the type has internal structure (JSON, Avro, etc.)
IsStructured bool
// IsArray indicates if the type represents an array/list
IsArray bool
CanNavigate bool
// ElementType specifies the type of array elements or nested structures
ElementType string
// SchemaFormat specifies the schema format for structured data
SchemaFormat resource.SchemaFormat
}
DataTypeCapability describes the capabilities of a data type
func GetDataTypeCapability ¶
func GetDataTypeCapability(dataType string) DataTypeCapability
GetDataTypeCapability returns capabilities for a data type string
type DataTypeConversionKey ¶
type DataTypeConversionKey struct {
SourceDB dbcapabilities.DatabaseType
TargetDB dbcapabilities.DatabaseType
SourceType string
}
DataTypeConversionKey uniquely identifies a type conversion
type DataTypeConversionResult ¶
type DataTypeConversionResult struct {
OriginalType string `json:"original_type"`
ConvertedType string `json:"converted_type"`
UnifiedType UnifiedDataType `json:"unified_type"`
ConversionType ConversionType `json:"conversion_type"`
IsLossyConversion bool `json:"is_lossy_conversion"`
RequiresValidation bool `json:"requires_validation"`
ConversionNotes string `json:"conversion_notes,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
DataTypeConversionResult represents the result of a data type conversion
type DataTypeConversionRule ¶
type DataTypeConversionRule struct {
SourceDatabase dbcapabilities.DatabaseType `json:"source_database"`
TargetDatabase dbcapabilities.DatabaseType `json:"target_database"`
SourceType string `json:"source_type"`
TargetType string `json:"target_type"`
UnifiedType UnifiedDataType `json:"unified_type"`
ConversionType ConversionType `json:"conversion_type"`
IsLossyConversion bool `json:"is_lossy_conversion"`
RequiresUserInput bool `json:"requires_user_input"`
// Conversion notes and warnings
ConversionNotes string `json:"conversion_notes,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
DataTypeConversionRule defines how to convert between specific data types
type Database ¶
type Database struct {
Name string `json:"name"`
Owner string `json:"owner,omitempty"`
Comment string `json:"comment,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Options map[string]any `json:"options,omitempty"`
DefaultSchema string `json:"default_schema,omitempty"`
Schemas map[string]Schema `json:"schemas,omitempty"`
Tables map[string]Table `json:"tables,omitempty"`
Collections map[string]Collection `json:"collections,omitempty"`
Graphs map[string]Graph `json:"graphs,omitempty"`
Namespaces map[string]Namespace `json:"namespaces,omitempty"`
Buckets map[string]Bucket `json:"buckets,omitempty"` // Object storage
}
type DatabaseFeatureSupport ¶
type DatabaseFeatureSupport struct {
DatabaseType dbcapabilities.DatabaseType `json:"database_type"`
SupportedObjects map[ObjectType]ObjectSupport `json:"supported_objects"`
Paradigms []dbcapabilities.DataParadigm `json:"paradigms"`
ConversionCapabilities ConversionCapabilities `json:"conversion_capabilities"`
}
DatabaseFeatureSupport defines what UnifiedModel objects each database supports
func GetDatabaseFeatures ¶
func GetDatabaseFeatures(dbType dbcapabilities.DatabaseType) (DatabaseFeatureSupport, bool)
GetDatabaseFeatures returns feature support information for a database
type DatabaseTypeMetadata ¶
type DatabaseTypeMetadata struct {
DatabaseType dbcapabilities.DatabaseType `json:"database_type"`
PrimitiveTypes map[string]PrimitiveTypeInfo `json:"primitive_types"`
CustomTypeSupport CustomTypeSupportInfo `json:"custom_type_support"`
TypeConversions TypeConversionCapabilities `json:"type_conversions"`
NamingConventions NamingConventions `json:"naming_conventions"`
ConstraintSupport ConstraintSupportInfo `json:"constraint_support"`
DefaultMappings map[UnifiedDataType]string `json:"default_mappings"`
}
DatabaseTypeMetadata contains comprehensive metadata about a database's type system
type DecisionType ¶
type DecisionType string
DecisionType categorizes the type of user decision needed
const ( DecisionTypeMapping DecisionType = "mapping" // How to map objects DecisionTypeStrategy DecisionType = "strategy" // Which conversion strategy DecisionTypeDataLoss DecisionType = "data_loss" // Accept potential data loss DecisionTypePerformance DecisionType = "performance" // Performance vs accuracy tradeoff DecisionTypeStructural DecisionType = "structural" // Structural changes )
type DetectionCapabilities ¶
type DetectionCapabilities struct {
Schema SchemaDetectionCapabilities `json:"schema"`
Enriched EnrichedDetectionCapabilities `json:"enriched"`
Full FullDetectionCapabilities `json:"full"`
}
DetectionCapabilities defines what detection features are available at each level
func GetDetectionCapabilities ¶
func GetDetectionCapabilities() DetectionCapabilities
GetDetectionCapabilities returns the capabilities available at each detection level
type DetectionLevel ¶
type DetectionLevel string
DetectionLevel represents the three levels of privileged data detection
const ( // DetectionLevelSchema uses only schema information (column names, types, constraints) DetectionLevelSchema DetectionLevel = "schema" // DetectionLevelEnriched uses schema + enrichment metadata (data classification, purpose, context) DetectionLevelEnriched DetectionLevel = "enriched" // DetectionLevelFull uses schema + enrichment + sample data (actual values for pattern analysis) DetectionLevelFull DetectionLevel = "full" )
type DetectionLevelRecommendation ¶
type DetectionLevelRecommendation struct {
RecommendedLevel DetectionLevel `json:"recommended_level"`
Reasoning string `json:"reasoning"`
Alternatives []AlternativeLevel `json:"alternatives"`
Considerations []string `json:"considerations"`
}
DetectionLevelRecommendation provides guidance on which detection level to use
func RecommendDetectionLevel ¶
func RecommendDetectionLevel(schema *UnifiedModel, enrichment *UnifiedModelEnrichment, sampleData *UnifiedModelSampleData, useCase string) DetectionLevelRecommendation
RecommendDetectionLevel analyzes the available data and recommends the best detection level
type DetectionRecommendation ¶
type DetectionRecommendation struct {
Type string `json:"type"` // "encryption", "access_control", "data_masking", "compliance", "monitoring"
Priority string `json:"priority"` // "immediate", "high", "medium", "low"
Title string `json:"title"`
Description string `json:"description"`
Actions []string `json:"actions"` // Specific action items
AffectedObjects []string `json:"affected_objects"` // Objects this recommendation applies to
ComplianceFrameworks []string `json:"compliance_frameworks,omitempty"`
EstimatedEffort string `json:"estimated_effort,omitempty"` // "low", "medium", "high"
}
DetectionRecommendation provides actionable recommendations based on findings
type DetectionRequest ¶
type DetectionRequest struct {
// Core inputs
Schema *UnifiedModel `json:"schema"`
Enrichment *UnifiedModelEnrichment `json:"enrichment,omitempty"`
SampleData *UnifiedModelSampleData `json:"sample_data,omitempty"`
// Detection configuration
Level DetectionLevel `json:"level"`
ConfidenceThreshold float64 `json:"confidence_threshold"` // Minimum confidence to report finding
IncludeContext bool `json:"include_context"` // Include surrounding column context
FastMode bool `json:"fast_mode"` // Skip expensive analysis
CustomPatterns []CustomPattern `json:"custom_patterns,omitempty"`
ExcludePatterns []string `json:"exclude_patterns,omitempty"`
// Privacy and compliance
ComplianceFrameworks []string `json:"compliance_frameworks,omitempty"` // GDPR, HIPAA, PCI-DSS, etc.
RedactFindings bool `json:"redact_findings"` // Redact sensitive examples
MaxExamplesPerFinding int `json:"max_examples_per_finding"`
// Metadata
RequestID string `json:"request_id"`
RequestedBy string `json:"requested_by"`
RequestedAt time.Time `json:"requested_at"`
}
DetectionRequest defines parameters for privileged data detection
func NewDetectionRequest ¶
func NewDetectionRequest(schema *UnifiedModel, level DetectionLevel) *DetectionRequest
NewDetectionRequest creates a new detection request with defaults
func (*DetectionRequest) Validate ¶
func (r *DetectionRequest) Validate() []ValidationError
Validate checks if the detection request is properly configured
func (*DetectionRequest) WithComplianceFrameworks ¶
func (r *DetectionRequest) WithComplianceFrameworks(frameworks ...string) *DetectionRequest
WithComplianceFrameworks sets the compliance frameworks to check against
func (*DetectionRequest) WithCustomPatterns ¶
func (r *DetectionRequest) WithCustomPatterns(patterns ...CustomPattern) *DetectionRequest
WithCustomPatterns adds custom detection patterns
func (*DetectionRequest) WithEnrichment ¶
func (r *DetectionRequest) WithEnrichment(enrichment *UnifiedModelEnrichment) *DetectionRequest
WithEnrichment adds enrichment data to the detection request
func (*DetectionRequest) WithSampleData ¶
func (r *DetectionRequest) WithSampleData(sampleData *UnifiedModelSampleData) *DetectionRequest
WithSampleData adds sample data to the detection request
type DetectionResponse ¶
type DetectionResponse struct {
// Request metadata
RequestID string `json:"request_id"`
Level DetectionLevel `json:"level"`
ProcessedAt time.Time `json:"processed_at"`
ProcessingTime time.Duration `json:"processing_time"`
// Core results
Findings []PrivilegedDataFinding `json:"findings"`
Summary DetectionSummary `json:"summary"`
Warnings []string `json:"warnings"`
Errors []string `json:"errors,omitempty"`
// Analysis insights
Recommendations []DetectionRecommendation `json:"recommendations"`
ComplianceMap map[string][]string `json:"compliance_map"` // Framework -> affected findings
RiskAssessment RiskAssessment `json:"risk_assessment"`
// Detection metadata
TotalObjectsScanned int `json:"total_objects_scanned"`
ScanCoverage float64 `json:"scan_coverage"` // Percentage of schema covered
DetectionAccuracy *float64 `json:"detection_accuracy,omitempty"` // If validation data available
}
DetectionResponse contains the results of privileged data detection
type DetectionSummary ¶
type DetectionSummary struct {
TotalFindings int `json:"total_findings"`
FindingsByCategory map[string]int `json:"findings_by_category"`
FindingsByRisk map[string]int `json:"findings_by_risk"`
FindingsByConfidence map[string]int `json:"findings_by_confidence"` // High (>0.8), Medium (0.5-0.8), Low (<0.5)
// Coverage metrics
ObjectsWithFindings int `json:"objects_with_findings"`
ObjectsScanned int `json:"objects_scanned"`
FieldsWithFindings int `json:"fields_with_findings"`
FieldsScanned int `json:"fields_scanned"`
// Compliance summary
AffectedFrameworks []string `json:"affected_frameworks"`
HighRiskFindings int `json:"high_risk_findings"`
RequiredActions []string `json:"required_actions"`
// Detection quality
AverageConfidence float64 `json:"average_confidence"`
HighConfidenceFindings int `json:"high_confidence_findings"`
SampleDataCoverage *float64 `json:"sample_data_coverage,omitempty"` // If sample data was used
}
DetectionSummary provides high-level statistics about the detection results
type DimensionSpec ¶
type DistanceMetricSpec ¶
type DocumentEnrichment ¶
type DocumentEnrichment struct {
// Content analysis
Size int64 `json:"size"` // Document size in bytes
FieldCount int `json:"field_count"` // Number of fields
NestedDepth int `json:"nested_depth"` // Maximum nesting level
HasPrivilegedData bool `json:"has_privileged_data"`
PrivilegedFields []string `json:"privileged_fields,omitempty"`
ComplianceImpact []ComplianceFramework `json:"compliance_impact,omitempty"`
// Context
DocumentType string `json:"document_type,omitempty"`
Context map[string]string `json:"context,omitempty"`
}
DocumentEnrichment contains analysis metadata for specific documents
type DocumentSchemaProfile ¶
type DocumentToVectorRule ¶
type DocumentToVectorRule struct {
Condition string `json:"condition"` // When to apply this rule
VectorStrategy VectorStrategy `json:"vector_strategy"` // How to create vectors
EmbeddingSource EmbeddingSource `json:"embedding_source"` // What to embed
RequiredEnrichment []EnrichmentType `json:"required_enrichment,omitempty"`
UserDecisions []UserDecision `json:"user_decisions,omitempty"`
}
DocumentToVectorRule defines how documents convert to vector representations
type EdgeSampleData ¶
type EdgeSampleData struct {
EdgeType string `json:"edge_type"`
Count int64 `json:"count"`
Samples []GraphEdgeSample `json:"samples"`
Properties map[string]ColumnSampleValues `json:"properties"`
}
type EmbeddedDocument ¶
type EmbeddingSource ¶
type EmbeddingSource string
EmbeddingSource defines what content to use for embeddings
const ( EmbeddingSourceFullDocument EmbeddingSource = "full_document" // Entire document EmbeddingSourceKeyFields EmbeddingSource = "key_fields" // Important fields only EmbeddingSourceTextFields EmbeddingSource = "text_fields" // Text fields only EmbeddingSourceMetadata EmbeddingSource = "metadata" // Document metadata EmbeddingSourceCustom EmbeddingSource = "custom" // User-defined fields )
type EmbeddingStrategy ¶
type EmbeddingStrategy string
EmbeddingStrategy defines how to handle foreign key relationships
const ( EmbeddingStrategyEmbed EmbeddingStrategy = "embed" // Embed related documents EmbeddingStrategyReference EmbeddingStrategy = "reference" // Use document references EmbeddingStrategyHybrid EmbeddingStrategy = "hybrid" // Mix of embedding and references EmbeddingStrategyFlatten EmbeddingStrategy = "flatten" // Flatten into single document )
type EnhancedComparisonOptions ¶
type EnhancedComparisonOptions struct {
ComparisonOptions
// Field-level control
IgnoreFields []string `json:"ignore_fields,omitempty"` // e.g., ["comment", "last_updated"]
CompareTimestamps bool `json:"compare_timestamps"` // Whether to compare timestamp fields
ToleranceFields map[string]float64 `json:"tolerance_fields,omitempty"` // Tolerance for numeric fields
// Performance optimization
EnableEarlyExit bool `json:"enable_early_exit"` // Stop on first difference for fast checks
MaxDiffCount int `json:"max_diff_count"` // Limit number of differences tracked
EnableFieldCache bool `json:"enable_field_cache"` // Cache field reflection info
// Schema-specific options
CompareColumnOrder bool `json:"compare_column_order"` // Whether column order matters
CompareIndexOrder bool `json:"compare_index_order"` // Whether index order matters
IgnoreAutoGenerated bool `json:"ignore_auto_generated"` // Ignore auto-generated fields
CompareConstraintDefs bool `json:"compare_constraint_defs"` // Compare constraint definitions
}
Enhanced comparison options for production use
func DefaultEnhancedComparisonOptions ¶
func DefaultEnhancedComparisonOptions() EnhancedComparisonOptions
DefaultEnhancedComparisonOptions returns production-optimized comparison options
func FastComparisonOptions ¶
func FastComparisonOptions() EnhancedComparisonOptions
FastComparisonOptions returns options optimized for quick change detection
type EnrichedDetectionCapabilities ¶
type EnrichedDetectionCapabilities struct {
SchemaDetectionCapabilities // Inherits all schema capabilities
DataClassificationAnalysis bool `json:"data_classification_analysis"` // Use existing data classifications
PurposeAnalysis bool `json:"purpose_analysis"` // Consider intended data usage
AccessPatternAnalysis bool `json:"access_pattern_analysis"` // Use access pattern hints
ComplianceMapping bool `json:"compliance_mapping"` // Map to specific compliance requirements
ContextualAnalysis bool `json:"contextual_analysis"` // Use business context for better accuracy
ImprovedConfidence bool `json:"improved_confidence"` // Higher confidence due to additional context
RiskScoring bool `json:"risk_scoring"` // Enhanced risk assessment
}
EnrichedDetectionCapabilities defines additional capabilities when enrichment data is available
type Enrichment ¶
type EnrichmentCategory ¶
type EnrichmentCategory string
EnrichmentCategory specifies which types of enrichment to include
const ( EnrichmentCategoryPrivacy EnrichmentCategory = "privacy" EnrichmentCategoryClassification EnrichmentCategory = "classification" EnrichmentCategoryPerformance EnrichmentCategory = "performance" EnrichmentCategoryCompliance EnrichmentCategory = "compliance" EnrichmentCategoryDataQuality EnrichmentCategory = "data_quality" EnrichmentCategoryUsage EnrichmentCategory = "usage" EnrichmentCategoryRelationships EnrichmentCategory = "relationships" )
type EnrichmentChange ¶
type EnrichmentChange struct {
ChangeType ChangeType `json:"change_type"`
EnrichmentCategory EnrichmentCategory `json:"enrichment_category"`
ObjectPath string `json:"object_path"`
SourceEnrichment map[string]any `json:"source_enrichment,omitempty"`
TargetEnrichment map[string]any `json:"target_enrichment,omitempty"`
Description string `json:"description"`
Impact EnrichmentImpact `json:"impact"`
}
EnrichmentChange represents a difference in enrichment metadata
type EnrichmentImpact ¶
type EnrichmentImpact string
Enrichment impact levels
const ( EnrichmentImpactNone EnrichmentImpact = "none" // No impact EnrichmentImpactLow EnrichmentImpact = "low" // Minimal impact EnrichmentImpactMedium EnrichmentImpact = "medium" // Moderate impact EnrichmentImpactHigh EnrichmentImpact = "high" // Significant impact EnrichmentImpactCritical EnrichmentImpact = "critical" // Critical impact )
type EnrichmentSummary ¶
type EnrichmentSummary struct {
SchemaID string `json:"schema_id"`
TotalTables int `json:"total_tables"`
TotalColumns int `json:"total_columns"`
PrivilegedTables int `json:"privileged_tables"`
PrivilegedColumns int `json:"privileged_columns"`
ComplianceFrameworks []ComplianceFramework `json:"compliance_frameworks"`
OverallRiskLevel RiskLevel `json:"overall_risk_level"`
HasRecommendations bool `json:"has_recommendations"`
HasPerformanceHints bool `json:"has_performance_hints"`
LastUpdated time.Time `json:"last_updated"`
}
EnrichmentSummary provides a high-level overview of enrichment data
type EnrichmentType ¶
type EnrichmentType string
EnrichmentType defines types of enrichment data needed for conversions
const ( EnrichmentTypeDataClassification EnrichmentType = "data_classification" // Table/column purpose EnrichmentTypeRelationships EnrichmentType = "relationships" // Entity relationships EnrichmentTypeAccessPatterns EnrichmentType = "access_patterns" // How data is accessed EnrichmentTypeBusinessRules EnrichmentType = "business_rules" // Business logic EnrichmentTypePerformanceHints EnrichmentType = "performance_hints" // Performance characteristics EnrichmentTypeDataFlow EnrichmentType = "data_flow" // Data flow patterns )
func GetRequiredEnrichmentTypes ¶
func GetRequiredEnrichmentTypes(source, target dbcapabilities.DataParadigm) []EnrichmentType
GetRequiredEnrichmentTypes returns enrichment types needed for paradigm conversion
type EventTrigger ¶
type Evidence ¶
type Evidence struct {
Type string `json:"type"` // "name_pattern", "data_pattern", "enrichment", "sample_analysis"
Source string `json:"source"` // Which detection component provided this evidence
Pattern string `json:"pattern"` // Regex pattern or rule that matched
MatchedValue *string `json:"matched_value,omitempty"` // Redacted if privacy mode enabled
Confidence float64 `json:"confidence"` // Confidence for this specific evidence
Description string `json:"description"`
}
Evidence represents supporting evidence for a privileged data finding
type ExternalTable ¶
type FailoverGroup ¶
type Federation ¶
type FieldSampleValues ¶
type FieldSampleValues struct {
ColumnSampleValues
NestedFields map[string]FieldSampleValues `json:"nested_fields,omitempty"` // For nested documents
ArraySamples []interface{} `json:"array_samples,omitempty"` // For array fields
}
FieldSampleValues extends ColumnSampleValues for document/object fields
type ForeignDataWrapper ¶
type ForeignTable ¶
type FullDetectionCapabilities ¶
type FullDetectionCapabilities struct {
EnrichedDetectionCapabilities // Inherits all enriched capabilities
ValuePatternAnalysis bool `json:"value_pattern_analysis"` // Analyze actual data patterns
FormatDetection bool `json:"format_detection"` // Detect specific data formats
ContentAnalysis bool `json:"content_analysis"` // Analyze content for PII
StatisticalAnalysis bool `json:"statistical_analysis"` // Statistical analysis of values
EntropyAnalysis bool `json:"entropy_analysis"` // Measure data randomness/structure
FalsePositiveReduction bool `json:"false_positive_reduction"` // Reduce false positives through sampling
ValidationCapability bool `json:"validation_capability"` // Validate pattern assumptions
HighestConfidence bool `json:"highest_confidence"` // Achieve highest possible confidence
ComprehensiveCoverage bool `json:"comprehensive_coverage"` // Most thorough detection possible
}
FullDetectionCapabilities defines additional capabilities when sample data is available
type Graph ¶
type Graph struct {
Name string `json:"name"`
NodeLabels map[string]Node `json:"node_labels,omitempty"`
RelTypes map[string]Relationship `json:"relationship_types,omitempty"`
Indexes map[string]Index `json:"indexes,omitempty"`
Constraints map[string]Constraint `json:"constraints,omitempty"`
}
type GraphEdgeSample ¶
type GraphEdgeStrategy ¶
type GraphEdgeStrategy string
GraphEdgeStrategy defines how foreign keys become graph edges
const ( EdgeStrategyForeignKeys GraphEdgeStrategy = "foreign_keys" // FK relationships → edges EdgeStrategyJunctionTables GraphEdgeStrategy = "junction_tables" // Junction tables → edges EdgeStrategyEnrichmentBased GraphEdgeStrategy = "enrichment_based" // Use enrichment data EdgeStrategyHybrid GraphEdgeStrategy = "hybrid" // Multiple strategies )
type GraphNodeStrategy ¶
type GraphNodeStrategy string
GraphNodeStrategy defines how tables become graph nodes
const ( NodeStrategyEntityTables GraphNodeStrategy = "entity_tables" // Main entity tables → nodes NodeStrategyAllTables GraphNodeStrategy = "all_tables" // All tables → nodes NodeStrategyEnrichmentBased GraphNodeStrategy = "enrichment_based" // Use enrichment to decide NodeStrategyJunctionSplit GraphNodeStrategy = "junction_split" // Junction tables → edges )
type GraphSampleData ¶
type GraphSampleData struct {
GraphName string `json:"graph_name"`
NodeSamples map[string]NodeSampleData `json:"node_samples"` // Samples by node label
EdgeSamples map[string]EdgeSampleData `json:"edge_samples"` // Samples by edge type
NodeCount int64 `json:"node_count"`
EdgeCount int64 `json:"edge_count"`
SampleCount int `json:"sample_count"`
CollectedAt time.Time `json:"collected_at"`
Warnings []string `json:"warnings,omitempty"`
}
GraphSampleData represents sample data from graph databases (Neo4j, EdgeDB)
type GrowthTrend ¶
type GrowthTrend struct {
Direction string `json:"direction"` // "increasing", "decreasing", "stable", "volatile"
Rate *float64 `json:"rate,omitempty"` // Rate of change per unit time
Confidence *float64 `json:"confidence,omitempty"` // 0.0-1.0, confidence in prediction
R2Score *float64 `json:"r2_score,omitempty"` // R² coefficient of determination
}
type Identity ¶
type Identity struct {
Name string `json:"name"`
Table string `json:"table,omitempty"`
Column string `json:"column,omitempty"`
Strategy string `json:"strategy,omitempty"` // always, by_default
Start int64 `json:"start,omitempty"`
Increment int64 `json:"increment,omitempty"`
Cycle bool `json:"cycle,omitempty"`
Options map[string]any `json:"options,omitempty"`
}
type Index ¶
type Index struct {
Name string `json:"name"`
Type IndexType `json:"type,omitempty"` // Use IndexType enum for type safety
Columns []string `json:"columns,omitempty"`
Fields []string `json:"fields,omitempty"`
Expression string `json:"expression,omitempty"`
Predicate string `json:"predicate,omitempty"` // partial index condition
Unique bool `json:"unique,omitempty"`
Options map[string]any `json:"options,omitempty"`
}
type IndexEnrichment ¶
type IndexEnrichment struct {
// Usage statistics
UsageFrequency *float64 `json:"usage_frequency,omitempty"` // Queries per day using this index
Selectivity *float64 `json:"selectivity,omitempty"` // 0.0-1.0, low to high selectivity
EfficiencyScore *float64 `json:"efficiency_score,omitempty"` // 0.0-1.0
// Performance characteristics
ScanRatio *float64 `json:"scan_ratio,omitempty"` // Percentage of scans vs seeks
MaintenanceCost *float64 `json:"maintenance_cost,omitempty"` // Cost of index maintenance
StorageOverhead *int64 `json:"storage_overhead,omitempty"` // Bytes of storage overhead
// Recommendations
IsRedundant bool `json:"is_redundant"` // Covered by another index
ShouldDrop bool `json:"should_drop"` // Recommendation to drop
OptimizationHints []string `json:"optimization_hints,omitempty"`
// Context
CreatedFor string `json:"created_for,omitempty"` // Query pattern this was created for
Context map[string]string `json:"context,omitempty"`
}
IndexEnrichment contains analysis metadata for an index
type IndexPerformance ¶
type IndexPerformance struct {
UsageCount int64 `json:"usage_count,omitempty"`
HitRatio *float64 `json:"hit_ratio,omitempty"` // 0.0-1.0
Selectivity *float64 `json:"selectivity,omitempty"` // 0.0-1.0
LastUsed *time.Time `json:"last_used,omitempty"`
LastAnalyzed *time.Time `json:"last_analyzed,omitempty"`
}
type IndexRecommendation ¶
type IndexRecommendation struct {
Columns []string `json:"columns"`
IndexType IndexType `json:"index_type"`
Reason string `json:"reason"`
EstimatedBenefit string `json:"estimated_benefit"`
Priority ConversionPriority `json:"priority"`
}
IndexRecommendation suggests creating an index
type IndexType ¶
type IndexType string
const ( IndexTypeBTree IndexType = "btree" IndexTypeHash IndexType = "hash" IndexTypeGIN IndexType = "gin" IndexTypeGiST IndexType = "gist" IndexTypeBitmap IndexType = "bitmap" IndexTypeClustered IndexType = "clustered" IndexTypeCovering IndexType = "covering" IndexTypeExpression IndexType = "expression" IndexTypeSparse IndexType = "sparse" IndexTypePartial IndexType = "partial" IndexTypeFullText IndexType = "fulltext" IndexTypeSpatial IndexType = "spatial" IndexTypeVector IndexType = "vector" )
type KeyPatternInfo ¶
type KeyValuePair ¶
type KeyValuePair struct {
Name string `json:"name"` // Key identifier or namespace
Key string `json:"key"` // The actual key
DataType string `json:"data_type"` // string, list, set, sorted_set, hash, stream, etc.
TTL *int64 `json:"ttl,omitempty"` // Time-to-live in seconds
Encoding string `json:"encoding,omitempty"` // Data encoding (e.g., raw, int, ziplist, hashtable)
Labels map[string]string `json:"labels,omitempty"`
Options map[string]any `json:"options,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
type KeyValueSampleData ¶
type KeyValueSampleData struct {
NamespaceName string `json:"namespace_name"` // Redis DB, DynamoDB table
KeyCount int64 `json:"key_count"`
SampleCount int `json:"sample_count"`
KeySamples []KeyValueSampleEntry `json:"key_samples"`
ValueTypes map[string]int `json:"value_types"` // Type distribution
KeyPatterns map[string]KeyPatternInfo `json:"key_patterns"` // Detected key patterns
ValueSamples map[string]ValueSampleInfo `json:"value_samples"` // Sample values by type
CollectedAt time.Time `json:"collected_at"`
Warnings []string `json:"warnings,omitempty"`
}
KeyValueSampleData represents sample data from key-value stores (Redis, DynamoDB)
type KeyValueSampleEntry ¶
type KeyValueSampleEntry struct {
Key string `json:"key"`
Value interface{} `json:"value"`
ValueType string `json:"value_type"`
TTL *int64 `json:"ttl,omitempty"` // Time to live (Redis)
Size *int `json:"size,omitempty"` // Value size in bytes
KeyStructure string `json:"key_structure"` // Detected key pattern
}
KeyValueSampleEntry represents a single key-value sample
type Keyspace ¶
type Keyspace struct {
Name string `json:"name"`
ReplicationStrategy string `json:"replicationStrategy"`
ReplicationOptions map[string]string `json:"replicationOptions"`
DurableWrites bool `json:"durableWrites"`
}
TODO: This should be refactored (currently used by Cassandra)
type MaterializedView ¶
type MaterializedView struct {
Name string `json:"name"`
Definition string `json:"definition"`
RefreshMode string `json:"refresh_mode,omitempty"` // immediate, deferred, manual
RefreshCron string `json:"refresh_cron,omitempty"`
Columns map[string]Column `json:"columns,omitempty"`
Storage map[string]any `json:"storage,omitempty"`
}
type MemoryTable ¶
type MetricsSummary ¶
type MetricsSummary struct {
SchemaID string `json:"schema_id"`
GeneratedAt time.Time `json:"generated_at"`
TotalObjects int64 `json:"total_objects"`
TotalDataContainers int `json:"total_data_containers"`
TotalSizeBytes int64 `json:"total_size_bytes"`
TotalRows int64 `json:"total_rows"`
TotalDocuments int64 `json:"total_documents"`
OverallQualityScore float64 `json:"overall_quality_score"`
HasPerformanceData bool `json:"has_performance_data"`
HasTrendData bool `json:"has_trend_data"`
}
MetricsSummary provides a high-level overview of metrics
type MigrationComplexity ¶
type MigrationComplexity string
Migration complexity levels
const ( MigrationComplexityNone MigrationComplexity = "none" // No migration needed MigrationComplexityLow MigrationComplexity = "low" // Simple changes MigrationComplexityMedium MigrationComplexity = "medium" // Moderate effort MigrationComplexityHigh MigrationComplexity = "high" // Complex migration )
const ( MigrationComplexityTrivial MigrationComplexity = "trivial" MigrationComplexitySimple MigrationComplexity = "simple" MigrationComplexityModerate MigrationComplexity = "moderate" MigrationComplexityComplex MigrationComplexity = "complex" MigrationComplexityExtreme MigrationComplexity = "extreme" )
MigrationComplexity constants (continued from earlier definition)
type ModuleExtension ¶
type MonitorMetric ¶
type NamingConventions ¶
type NamingConventions struct {
CaseSensitive bool `json:"case_sensitive"`
MaxIdentifierLength int `json:"max_identifier_length"`
AllowedCharacters string `json:"allowed_characters"`
ReservedWords []string `json:"reserved_words,omitempty"`
QuoteCharacter string `json:"quote_character"`
PreferredCase string `json:"preferred_case"` // "lower", "upper", "mixed"
}
NamingConventions describes database naming rules
type NodeCounts ¶
type NodeEnrichment ¶
type NodeEnrichment struct {
// Graph characteristics
InDegree int `json:"in_degree"` // Number of incoming relationships
OutDegree int `json:"out_degree"` // Number of outgoing relationships
Centrality *float64 `json:"centrality,omitempty"` // Centrality score in graph
ClusterCoefficient *float64 `json:"cluster_coefficient,omitempty"` // Local clustering coefficient
// Data characteristics
HasPrivilegedData bool `json:"has_privileged_data"`
PrivilegedProperties []string `json:"privileged_properties,omitempty"`
ComplianceImpact []ComplianceFramework `json:"compliance_impact,omitempty"`
// Performance hints
IsFrequentlyQueried bool `json:"is_frequently_queried"`
ShouldIndex []string `json:"should_index,omitempty"` // Properties to index
// Context
BusinessRole string `json:"business_role,omitempty"`
Context map[string]string `json:"context,omitempty"`
}
NodeEnrichment contains analysis metadata for graph nodes
type NodeSampleData ¶
type NodeSampleData struct {
NodeLabel string `json:"node_label"`
Count int64 `json:"count"`
Samples []map[string]interface{} `json:"samples"`
Properties map[string]ColumnSampleValues `json:"properties"`
}
type Notification ¶
type ObjectCapability ¶
type ObjectCapability struct {
// CanStoreData indicates if this object can store actual data values
CanStoreData bool
// CanHaveMetadata indicates if this object has metadata properties
CanHaveMetadata bool
// SupportsNesting indicates if this object can contain nested structures
SupportsNesting bool
// SupportedSelectors lists the selector types this object supports
SupportedSelectors []resource.SelectorType
// IsStreaming indicates if this is a streaming data source
IsStreaming bool
// IsStateless indicates if this object doesn't persist state
IsStateless bool
// RequiresSchema indicates if schema registration is required
RequiresSchema bool
}
ObjectCapability describes the capabilities of a UnifiedModel object type
func GetObjectCapability ¶
func GetObjectCapability(objType resource.ObjectType) ObjectCapability
GetObjectCapability returns the capabilities for a given object type
type ObjectChange ¶
type ObjectChange struct {
ObjectType ObjectType `json:"object_type"`
ObjectName string `json:"object_name"`
ObjectPath string `json:"object_path"`
ChangeType ChangeType `json:"change_type"`
Details []StructuralChange `json:"details,omitempty"` // For modified objects
HasEnrichment bool `json:"has_enrichment"`
EnrichmentImpact *EnrichmentImpact `json:"enrichment_impact,omitempty"`
}
ObjectChange represents an added, removed, or modified object
type ObjectConversionRule ¶
type ObjectConversionRule struct {
SourceObject ObjectType `json:"source_object"`
TargetObjects []ObjectType `json:"target_objects"` // May map to multiple objects
ConversionType ConversionType `json:"conversion_type"`
RequiredContext []string `json:"required_context,omitempty"`
UserDecisions []UserDecision `json:"user_decisions,omitempty"`
AutomationLevel AutomationLevel `json:"automation_level"`
Notes string `json:"notes,omitempty"`
}
ObjectConversionRule defines how to convert a specific object type
func DirectConversion ¶
func DirectConversion(sourceObj, targetObj ObjectType) ObjectConversionRule
DirectConversion creates a direct 1:1 object conversion rule
func DroppedConversion ¶
func DroppedConversion(sourceObj ObjectType, reason string) ObjectConversionRule
DroppedConversion creates a rule for objects that cannot be converted
func EmulatedConversion ¶
func EmulatedConversion(sourceObj ObjectType, emulationObjs []ObjectType, notes string) ObjectConversionRule
EmulatedConversion creates a rule for emulating unsupported objects
func GetObjectConversionRule ¶
func GetObjectConversionRule(source, target dbcapabilities.DatabaseType, objType ObjectType) (ObjectConversionRule, bool)
GetObjectConversionRule is deprecated - use dynamic generation instead
func SplitConversion ¶
func SplitConversion(sourceObj ObjectType, targetObjs []ObjectType, userDecisions []UserDecision) ObjectConversionRule
SplitConversion creates a 1:N object conversion rule
func (ObjectConversionRule) WithRequiredContext ¶
func (rule ObjectConversionRule) WithRequiredContext(context []string) ObjectConversionRule
WithRequiredContext adds required context to a conversion rule
func (ObjectConversionRule) WithUserDecision ¶
func (rule ObjectConversionRule) WithUserDecision(decision UserDecision) ObjectConversionRule
WithUserDecision adds a user decision to a conversion rule
type ObjectCounts ¶
type ObjectCounts struct {
// Structural organization
Catalogs int `json:"catalogs,omitempty"`
Databases int `json:"databases,omitempty"`
Schemas int `json:"schemas,omitempty"`
// Primary Data Containers
Tables int `json:"tables,omitempty"`
Collections int `json:"collections,omitempty"`
Nodes int `json:"nodes,omitempty"`
MemoryTables int `json:"memory_tables,omitempty"`
// Temporary Data Containers
TemporaryTables int `json:"temporary_tables,omitempty"`
TransientTables int `json:"transient_tables,omitempty"`
Caches int `json:"caches,omitempty"`
// Virtual Data Containers
Views int `json:"views,omitempty"`
LiveViews int `json:"live_views,omitempty"`
WindowViews int `json:"window_views,omitempty"`
MaterializedViews int `json:"materialized_views,omitempty"`
ExternalTables int `json:"external_tables,omitempty"`
ForeignTables int `json:"foreign_tables,omitempty"`
// Graph / Vector / Search abstractions
Graphs int `json:"graphs,omitempty"`
VectorIndexes int `json:"vector_indexes,omitempty"`
SearchIndexes int `json:"search_indexes,omitempty"`
// Specialized Data Containers
Vectors int `json:"vectors,omitempty"`
Embeddings int `json:"embeddings,omitempty"`
Documents int64 `json:"documents,omitempty"` // int64 for large document counts
EmbeddedDocuments int `json:"embedded_documents,omitempty"`
Relationships int `json:"relationships,omitempty"`
Paths int `json:"paths,omitempty"`
// Data Organization Containers
Partitions int `json:"partitions,omitempty"`
SubPartitions int `json:"sub_partitions,omitempty"`
Shards int `json:"shards,omitempty"`
Namespaces int `json:"namespaces,omitempty"`
// Structural definition objects
Columns int `json:"columns,omitempty"`
Types int `json:"types,omitempty"`
PropertyKeys int `json:"property_keys,omitempty"`
// Integrity, performance and identity objects
Indexes int `json:"indexes,omitempty"`
Constraints int `json:"constraints,omitempty"`
Sequences int `json:"sequences,omitempty"`
Identities int `json:"identities,omitempty"`
UUIDGenerators int `json:"uuid_generators,omitempty"`
// Executable code objects
Functions int `json:"functions,omitempty"`
Procedures int `json:"procedures,omitempty"`
Methods int `json:"methods,omitempty"`
Triggers int `json:"triggers,omitempty"`
EventTriggers int `json:"event_triggers,omitempty"`
Aggregates int `json:"aggregates,omitempty"`
Operators int `json:"operators,omitempty"`
Modules int `json:"modules,omitempty"`
Packages int `json:"packages,omitempty"`
PackageBodies int `json:"package_bodies,omitempty"`
Macros int `json:"macros,omitempty"`
Rules int `json:"rules,omitempty"`
WindowFuncs int `json:"window_functions,omitempty"`
// Security and access control
Users int `json:"users,omitempty"`
Roles int `json:"roles,omitempty"`
Grants int `json:"grants,omitempty"`
Policies int `json:"policies,omitempty"`
// Physical storage and placement
Tablespaces int `json:"tablespaces,omitempty"`
Segments int `json:"segments,omitempty"`
Extents int `json:"extents,omitempty"`
Pages int `json:"pages,omitempty"`
Filegroups int `json:"filegroups,omitempty"`
Datafiles int `json:"datafiles,omitempty"`
// Connectivity and integration
Servers int `json:"servers,omitempty"`
Connections int `json:"connections,omitempty"`
Endpoints int `json:"endpoints,omitempty"`
ForeignDataWrappers int `json:"foreign_data_wrappers,omitempty"`
UserMappings int `json:"user_mappings,omitempty"`
Federations int `json:"federations,omitempty"`
Replicas int `json:"replicas,omitempty"`
Clusters int `json:"clusters,omitempty"`
// Operational, pipelines and streaming
Tasks int `json:"tasks,omitempty"`
Jobs int `json:"jobs,omitempty"`
Schedules int `json:"schedules,omitempty"`
Pipelines int `json:"pipelines,omitempty"`
Streams int `json:"streams,omitempty"`
// Monitoring and alerting
Events int `json:"events,omitempty"`
Notifications int `json:"notifications,omitempty"`
Alerts int `json:"alerts,omitempty"`
Statistics int `json:"statistics,omitempty"`
Histograms int `json:"histograms,omitempty"`
Monitors int `json:"monitors,omitempty"`
MonitorMetrics int `json:"monitor_metrics,omitempty"`
Thresholds int `json:"thresholds,omitempty"`
// Text processing / search configuration
TextSearchComponents int `json:"text_search_components,omitempty"`
// Metadata and documentation
Comments int `json:"comments,omitempty"`
Annotations int `json:"annotations,omitempty"`
Tags int `json:"tags,omitempty"`
Aliases int `json:"aliases,omitempty"`
Synonyms int `json:"synonyms,omitempty"`
Labels int `json:"labels,omitempty"`
// Backup and recovery, versioning
Snapshots int `json:"snapshots,omitempty"`
Backups int `json:"backups,omitempty"`
Archives int `json:"archives,omitempty"`
RecoveryPoints int `json:"recovery_points,omitempty"`
Versions int `json:"versions,omitempty"`
Migrations int `json:"migrations,omitempty"`
Branches int `json:"branches,omitempty"`
TimeTravel int `json:"time_travel,omitempty"`
// Extensions and customization
Extensions int `json:"extensions,omitempty"`
Plugins int `json:"plugins,omitempty"`
ModuleExtensions int `json:"module_extensions,omitempty"`
TTLSettings int `json:"ttl_settings,omitempty"`
Dimensions int `json:"dimensions,omitempty"`
DistanceMetrics int `json:"distance_metrics,omitempty"`
// Advanced analytics
Projections int `json:"projections,omitempty"`
AnalyticsAggs int `json:"analytics_aggregations,omitempty"`
Transformations int `json:"transformations,omitempty"`
Enrichments int `json:"enrichments,omitempty"`
BufferPools int `json:"buffer_pools,omitempty"`
// Replication & distribution
Publications int `json:"publications,omitempty"`
Subscriptions int `json:"subscriptions,omitempty"`
ReplicationSlots int `json:"replication_slots,omitempty"`
FailoverGroups int `json:"failover_groups,omitempty"`
}
ObjectCounts provides comprehensive counts of all objects in a UnifiedModel
func CountObjects ¶
func CountObjects(model *UnifiedModel) ObjectCounts
CountObjects counts all objects in a UnifiedModel and returns the counts
func (*ObjectCounts) FilterByObjectTypes ¶
func (oc *ObjectCounts) FilterByObjectTypes(objectTypes []ObjectType) ObjectCounts
FilterByObjectTypes returns counts filtered to only include specified object types
func (*ObjectCounts) GetDataContainerCount ¶
func (oc *ObjectCounts) GetDataContainerCount() int
GetDataContainerCount returns the count of primary data containers
func (*ObjectCounts) GetExecutableObjectCount ¶
func (oc *ObjectCounts) GetExecutableObjectCount() int
GetExecutableObjectCount returns the count of executable code objects
func (*ObjectCounts) GetSecurityObjectCount ¶
func (oc *ObjectCounts) GetSecurityObjectCount() int
GetSecurityObjectCount returns the count of security-related objects
func (*ObjectCounts) GetTotalObjectCount ¶
func (oc *ObjectCounts) GetTotalObjectCount() int64
GetTotalObjectCount returns the total number of objects across all categories
type ObjectLimit ¶
type ObjectNames ¶
type ObjectNames struct {
Tables []string `json:"tables"`
Collections []string `json:"collections"`
Views []string `json:"views"`
MaterializedViews []string `json:"materialized_views"`
Indexes []string `json:"indexes"`
Constraints []string `json:"constraints"`
Functions []string `json:"functions"`
Procedures []string `json:"procedures"`
Triggers []string `json:"triggers"`
Sequences []string `json:"sequences"`
Types []string `json:"types"`
Users []string `json:"users"`
Roles []string `json:"roles"`
}
func GetObjectNames ¶
func GetObjectNames(schema *UnifiedModel) ObjectNames
GetObjectNames returns sorted lists of object names by type.
type ObjectReference ¶
type ObjectReference struct {
SourceType string `json:"source_type"` // Type of object making the reference
SourceName string `json:"source_name"` // Name of object making the reference
TargetType string `json:"target_type"` // Type of object being referenced
TargetName string `json:"target_name"` // Name of object being referenced
ReferenceType string `json:"reference_type"` // Type of reference (foreign_key, index_on_table, etc.)
}
func FindObjectReferences ¶
func FindObjectReferences(schema *UnifiedModel, objectType ObjectType, objectName string) []ObjectReference
FindObjectReferences finds all objects that reference a specific object.
type ObjectSample ¶
type ObjectSample struct {
ObjectKey string `json:"object_key"`
Size int64 `json:"size"`
ContentType string `json:"content_type"`
Metadata map[string]interface{} `json:"metadata"`
ContentPreview *string `json:"content_preview,omitempty"` // First few bytes/lines
FileExtension string `json:"file_extension"`
LastModified time.Time `json:"last_modified"`
}
type ObjectSampleData ¶
type ObjectSampleData struct {
BucketName string `json:"bucket_name"`
ObjectCount int64 `json:"object_count"`
SampleCount int `json:"sample_count"`
ObjectSamples []ObjectSample `json:"object_samples"`
MetadataSamples map[string]FieldSampleValues `json:"metadata_samples"` // Object metadata
ContentSamples map[string]ContentSample `json:"content_samples"` // Content snippets by type
PathPatterns []string `json:"path_patterns"`
CollectedAt time.Time `json:"collected_at"`
Warnings []string `json:"warnings,omitempty"`
}
ObjectSampleData represents sample data from object storage (S3, GCS, Azure Blob)
type ObjectSupport ¶
type ObjectSupport struct {
Supported bool `json:"supported"`
SupportLevel SupportLevel `json:"support_level"`
Limitations []string `json:"limitations,omitempty"`
Alternatives []ObjectType `json:"alternatives,omitempty"`
RequiredFields []string `json:"required_fields,omitempty"`
OptionalFields []string `json:"optional_fields,omitempty"`
Notes string `json:"notes,omitempty"`
}
ObjectSupport defines the level of support for a specific UnifiedModel object type
func EmulatedSupport ¶
func EmulatedSupport(alternatives []ObjectType, notes string) ObjectSupport
EmulatedSupport creates an ObjectSupport that can be emulated
func FullSupport ¶
func FullSupport() ObjectSupport
FullSupport creates an ObjectSupport with full support
func GetObjectSupport ¶
func GetObjectSupport(dbType dbcapabilities.DatabaseType, objType ObjectType) (ObjectSupport, bool)
GetObjectSupport returns detailed support information for an object type
func PartialSupport ¶
func PartialSupport(limitations []string, notes string) ObjectSupport
PartialSupport creates an ObjectSupport with partial support
func UnsupportedObject ¶
func UnsupportedObject(alternatives []ObjectType, notes string) ObjectSupport
UnsupportedObject creates an ObjectSupport for unsupported objects
func (ObjectSupport) WithOptionalFields ¶
func (os ObjectSupport) WithOptionalFields(fields []string) ObjectSupport
WithOptionalFields adds optional fields to ObjectSupport
func (ObjectSupport) WithRequiredFields ¶
func (os ObjectSupport) WithRequiredFields(fields []string) ObjectSupport
WithRequiredFields adds required fields to ObjectSupport
type ObjectType ¶
type ObjectType string
Type safety enums for common object types
const ( // Data container types ObjectTypeTable ObjectType = "table" ObjectTypeCollection ObjectType = "collection" ObjectTypeView ObjectType = "view" ObjectTypeMaterializedView ObjectType = "materialized_view" ObjectTypeTemporaryTable ObjectType = "temporary_table" ObjectTypeMemoryTable ObjectType = "memory_table" ObjectTypeExternalTable ObjectType = "external_table" ObjectTypeForeignTable ObjectType = "foreign_table" // Graph types ObjectTypeNode ObjectType = "node" ObjectTypeRelationship ObjectType = "relationship" ObjectTypeGraph ObjectType = "graph" // Vector types ObjectTypeVector ObjectType = "vector" ObjectTypeVectorIndex ObjectType = "vector_index" ObjectTypeEmbedding ObjectType = "embedding" // Search types ObjectTypeSearchIndex ObjectType = "search_index" ObjectTypeDocument ObjectType = "document" ObjectTypeSearchDocument ObjectType = "search_document" // Key-Value types ObjectTypeKeyValue ObjectType = "key_value" ObjectTypeKey ObjectType = "key" // Time-Series types ObjectTypeTimeSeriesPoint ObjectType = "time_series_point" ObjectTypeMetric ObjectType = "metric" ObjectTypeMeasurement ObjectType = "measurement" // Object Storage types ObjectTypeBlob ObjectType = "blob" ObjectTypeObject ObjectType = "object" ObjectTypeBucket ObjectType = "bucket" // Structural definition objects ObjectTypeColumn ObjectType = "column" ObjectTypeField ObjectType = "field" ObjectTypeProperty ObjectType = "property" ObjectTypeType ObjectType = "type" ObjectTypeSequence ObjectType = "sequence" // Integrity and performance objects ObjectTypeIndex ObjectType = "index" ObjectTypeConstraint ObjectType = "constraint" // Executable code objects ObjectTypeFunction ObjectType = "function" ObjectTypeProcedure ObjectType = "procedure" ObjectTypeTrigger ObjectType = "trigger" ObjectTypeAggregate ObjectType = "aggregate" ObjectTypeOperator ObjectType = "operator" ObjectTypePackage ObjectType = "package" ObjectTypeRule ObjectType = "rule" // Security and access control ObjectTypeUser ObjectType = "user" ObjectTypeRole ObjectType = "role" ObjectTypeGrant ObjectType = "grant" ObjectTypePolicy ObjectType = "policy" // Physical storage ObjectTypeTablespace ObjectType = "tablespace" ObjectTypeDatafile ObjectType = "datafile" // Connectivity and integration ObjectTypeServer ObjectType = "server" ObjectTypeConnection ObjectType = "connection" ObjectTypeForeignDataWrapper ObjectType = "foreign_data_wrapper" ObjectTypeUserMapping ObjectType = "user_mapping" // Extensions and customization ObjectTypeExtension ObjectType = "extension" ObjectTypePlugin ObjectType = "plugin" )
func GetObjectAlternatives ¶
func GetObjectAlternatives(dbType dbcapabilities.DatabaseType, objType ObjectType) []ObjectType
GetObjectAlternatives returns alternative object types for unsupported objects
func GetSupportedObjects ¶
func GetSupportedObjects(dbType dbcapabilities.DatabaseType) []ObjectType
GetSupportedObjects returns all object types supported by a database
func GetUnsupportedObjects ¶
func GetUnsupportedObjects(dbType dbcapabilities.DatabaseType) []ObjectType
GetUnsupportedObjects returns object types not supported by a database
func ParseObjectPath ¶
func ParseObjectPath(path string) (ObjectType, []string, error)
ParseObjectPath extracts object type and names from a path
type OptimizationGoal ¶
type OptimizationGoal struct {
Goal OptimizationGoalType `json:"goal"`
Priority ConversionPriority `json:"priority"`
TargetMetric string `json:"target_metric,omitempty"` // e.g., "query_latency_p95"
TargetValue *float64 `json:"target_value,omitempty"` // Target value for metric
Weight float64 `json:"weight"` // Relative importance 0.0-1.0
}
OptimizationGoal specifies what to optimize for during conversion
type OptimizationGoalType ¶
type OptimizationGoalType string
OptimizationGoalType defines what aspect to optimize
const ( OptimizationGoalQueryPerformance OptimizationGoalType = "query_performance" OptimizationGoalStorageSize OptimizationGoalType = "storage_size" OptimizationGoalMigrationSpeed OptimizationGoalType = "migration_speed" OptimizationGoalCost OptimizationGoalType = "cost" OptimizationGoalAvailability OptimizationGoalType = "availability" OptimizationGoalSecurity OptimizationGoalType = "security" OptimizationGoalCompliance OptimizationGoalType = "compliance" OptimizationGoalMaintainability OptimizationGoalType = "maintainability" )
type PackageBody ¶
type ParadigmCompatibility ¶
type ParadigmCompatibility string
ParadigmCompatibility indicates how well paradigms align
const ( ParadigmCompatibilityIdentical ParadigmCompatibility = "identical" // Same paradigm ParadigmCompatibilityCompatible ParadigmCompatibility = "compatible" // Different but compatible ParadigmCompatibilityPartial ParadigmCompatibility = "partial" // Some compatibility ParadigmCompatibilityIncompatible ParadigmCompatibility = "incompatible" // Fundamentally different )
type ParadigmConversionStrategy ¶
type ParadigmConversionStrategy struct {
SourceParadigm dbcapabilities.DataParadigm `json:"source_paradigm"`
TargetParadigm dbcapabilities.DataParadigm `json:"target_paradigm"`
Strategy ConversionStrategy `json:"strategy"`
RequiresEnrichment bool `json:"requires_enrichment"`
EnrichmentTypes []EnrichmentType `json:"enrichment_types,omitempty"`
// Common conversion patterns
TableToCollectionRules []TableToCollectionRule `json:"table_to_collection_rules,omitempty"`
RelationalToGraphRules []RelationalToGraphRule `json:"relational_to_graph_rules,omitempty"`
DocumentToVectorRules []DocumentToVectorRule `json:"document_to_vector_rules,omitempty"`
// User guidance
UserGuidance []string `json:"user_guidance"`
CommonPitfalls []string `json:"common_pitfalls"`
RecommendedTools []string `json:"recommended_tools,omitempty"`
// Success metrics
TypicalSuccessRate float64 `json:"typical_success_rate,omitempty"`
AverageComplexity string `json:"average_complexity,omitempty"`
}
ParadigmConversionStrategy defines high-level conversion approaches between paradigms
func CreateDocumentToVectorStrategy ¶
func CreateDocumentToVectorStrategy() ParadigmConversionStrategy
CreateDocumentToVectorStrategy creates strategy for document to vector conversion
func CreateRelationalToDocumentStrategy ¶
func CreateRelationalToDocumentStrategy() ParadigmConversionStrategy
CreateRelationalToDocumentStrategy creates strategy for relational to document conversion
func CreateRelationalToGraphStrategy ¶
func CreateRelationalToGraphStrategy() ParadigmConversionStrategy
CreateRelationalToGraphStrategy creates strategy for relational to graph conversion
func GetParadigmConversionStrategy ¶
func GetParadigmConversionStrategy(source, target dbcapabilities.DataParadigm) (ParadigmConversionStrategy, bool)
GetParadigmConversionStrategy returns conversion strategy for paradigm pair
type ParadigmPair ¶
type ParadigmPair struct {
Source dbcapabilities.DataParadigm
Target dbcapabilities.DataParadigm
}
ParadigmPair represents a source-target paradigm pair
type PartitionRecommendation ¶
type PartitionRecommendation struct {
PartitionType string `json:"partition_type"` // range, hash, list
PartitionKey []string `json:"partition_key"`
Reason string `json:"reason"`
EstimatedBenefit string `json:"estimated_benefit"`
Priority ConversionPriority `json:"priority"`
}
PartitionRecommendation suggests partitioning a table
type PartitionSampleData ¶
type PartitionSampleData struct {
PartitionKey string `json:"partition_key"`
RowCount int64 `json:"row_count"`
Columns map[string]ColumnSampleValues `json:"columns"`
}
type PendingUserDecision ¶
type PendingUserDecision struct {
DecisionID string `json:"decision_id"`
ObjectType ObjectType `json:"object_type"`
ObjectName string `json:"object_name"`
UserDecision UserDecision `json:"user_decision"`
Context string `json:"context"`
}
PendingUserDecision represents a decision that needs user input
type PerformanceHint ¶
type PerformanceHint struct {
TargetDatabase string `json:"target_database"` // Database technology this applies to
Category string `json:"category"` // indexing, partitioning, etc.
Priority ConversionPriority `json:"priority"`
Hint string `json:"hint"` // The performance suggestion
ObjectPath string `json:"object_path"` // Path to the object (e.g., "tables.users.columns.email")
EstimatedBenefit string `json:"estimated_benefit"` // Expected performance improvement
Context map[string]string `json:"context,omitempty"`
}
PerformanceHint provides database-specific performance optimization suggestions
type PerformanceImpact ¶
type PerformanceImpact struct {
ObjectPath string `json:"object_path"`
ImpactType string `json:"impact_type"` // positive, negative, neutral
AffectedOperations []string `json:"affected_operations"` // read, write, update, delete
EstimatedChange string `json:"estimated_change"` // e.g., "+20% query time"
Mitigation string `json:"mitigation,omitempty"`
}
PerformanceImpact represents a potential performance impact from changes
type PerformanceMetrics ¶
type PerformanceMetrics struct {
// Query performance
AvgQueryTime *float64 `json:"avg_query_time_ms,omitempty"` // Average query time in milliseconds
MedianQueryTime *float64 `json:"median_query_time_ms,omitempty"` // Median query time in milliseconds
P95QueryTime *float64 `json:"p95_query_time_ms,omitempty"` // 95th percentile query time
P99QueryTime *float64 `json:"p99_query_time_ms,omitempty"` // 99th percentile query time
QueriesPerSecond *float64 `json:"queries_per_second,omitempty"` // QPS
SlowQueryCount int64 `json:"slow_query_count,omitempty"` // Number of slow queries
FailedQueryCount int64 `json:"failed_query_count,omitempty"` // Number of failed queries
// Object-level performance
TablePerformance map[string]TablePerformance `json:"table_performance,omitempty"` // Key: table name
IndexPerformance map[string]IndexPerformance `json:"index_performance,omitempty"` // Key: index name
CollectionPerformance map[string]CollectionPerformance `json:"collection_performance,omitempty"` // Key: collection name
// Resource utilization
CPUUtilization *float64 `json:"cpu_utilization_percent,omitempty"` // 0-100
MemoryUtilization *float64 `json:"memory_utilization_percent,omitempty"` // 0-100
IOUtilization *float64 `json:"io_utilization_percent,omitempty"` // 0-100
NetworkUtilization *float64 `json:"network_utilization_mbps,omitempty"` // Mbps
// Connection metrics
ActiveConnections int `json:"active_connections,omitempty"`
MaxConnections int `json:"max_connections,omitempty"`
ConnectionPoolSize int `json:"connection_pool_size,omitempty"`
}
PerformanceMetrics provides performance-related metrics
type PerformanceRequirements ¶
type PerformanceRequirements struct {
MaxQueryLatencyP95 *time.Duration `json:"max_query_latency_p95,omitempty"`
MinThroughputQPS *float64 `json:"min_throughput_qps,omitempty"`
MaxStorageGrowthRate *float64 `json:"max_storage_growth_rate,omitempty"` // GB/day
RequiredAvailability *float64 `json:"required_availability,omitempty"` // 0.99999 for 99.999%
}
PerformanceRequirements specifies performance constraints
type Policy ¶
type Policy struct {
Name string `json:"name"`
Type PolicyType `json:"type"` // Use PolicyType enum for type safety
Scope string `json:"scope"` // database, schema, table, column, function, etc.
Object string `json:"object,omitempty"`
Definition string `json:"definition"`
Options map[string]any `json:"options,omitempty"`
}
type PolicyType ¶
type PolicyType string
const ( PolicyTypeRowSecurity PolicyType = "row_security" PolicyTypeColumnMasking PolicyType = "column_masking" PolicyTypeDataMasking PolicyType = "data_masking" PolicyTypeAccessControl PolicyType = "access_control" PolicyTypeAudit PolicyType = "audit" PolicyTypePassword PolicyType = "password" PolicyTypeSession PolicyType = "session" PolicyTypeEncryption PolicyType = "encryption" PolicyTypeRetention PolicyType = "retention" )
type PreservationLevel ¶
type PreservationLevel string
PreservationLevel indicates how strictly data must be preserved
const ( PreservationLevelExact PreservationLevel = "exact" // Bit-for-bit preservation PreservationLevelLogical PreservationLevel = "logical" // Logical equivalent acceptable PreservationLevelSemantic PreservationLevel = "semantic" // Same meaning, format may change PreservationLevelBestEffort PreservationLevel = "best_effort" // Preserve what's possible )
type PreservationRuleType ¶
type PreservationRuleType string
PreservationRuleType categorizes preservation rules
const ( PreservationRuleTypeGeneral PreservationRuleType = "general" PreservationRuleTypePrivacy PreservationRuleType = "privacy" PreservationRuleTypeFinancial PreservationRuleType = "financial" PreservationRuleTypeMedical PreservationRuleType = "medical" PreservationRuleTypeAudit PreservationRuleType = "audit" )
type PrimitiveTypeInfo ¶
type PrimitiveTypeInfo struct {
NativeName string `json:"native_name"`
UnifiedType UnifiedDataType `json:"unified_type"`
HasLength bool `json:"has_length"`
HasPrecision bool `json:"has_precision"`
HasScale bool `json:"has_scale"`
SupportsUnsigned bool `json:"supports_unsigned"`
SupportsNull bool `json:"supports_null"`
DefaultLength *int64 `json:"default_length,omitempty"`
MaxLength *int64 `json:"max_length,omitempty"`
DefaultPrecision *int64 `json:"default_precision,omitempty"`
MaxPrecision *int64 `json:"max_precision,omitempty"`
DefaultScale *int64 `json:"default_scale,omitempty"`
MaxScale *int64 `json:"max_scale,omitempty"`
Aliases []string `json:"aliases,omitempty"`
ConversionHints map[string]string `json:"conversion_hints,omitempty"`
}
PrimitiveTypeInfo describes a primitive data type in a specific database
type PrivilegedDataFinding ¶
type PrivilegedDataFinding struct {
// Location information
ObjectType string `json:"object_type"` // "table", "collection", "key_space", etc.
ObjectName string `json:"object_name"`
FieldName string `json:"field_name"` // Column, field, or key name
FieldPath string `json:"field_path"` // Full path for nested structures
// Classification
DataCategory string `json:"data_category"` // "personal_info", "financial", "health", etc.
SubCategory string `json:"sub_category"` // More specific classification
PiiType string `json:"pii_type"` // "email", "ssn", "credit_card", etc.
Confidence float64 `json:"confidence"` // 0.0-1.0
// Evidence and context
DetectionMethod string `json:"detection_method"` // "schema", "enrichment", "sample_data"
Evidence []Evidence `json:"evidence"` // Supporting evidence for the finding
Context []string `json:"context"` // Contextual information (related fields, etc.)
// Risk and compliance
RiskLevel string `json:"risk_level"` // "low", "medium", "high", "critical"
ComplianceImpact []string `json:"compliance_impact"` // Affected regulations
Sensitivity string `json:"sensitivity"` // "public", "internal", "confidential", "restricted"
// Sample data (if available and not redacted)
ExampleValues []string `json:"example_values,omitempty"`
ValuePatterns []string `json:"value_patterns,omitempty"`
// Recommendations
RecommendedActions []string `json:"recommended_actions"`
EncryptionRequired bool `json:"encryption_required"`
AccessControlRequired bool `json:"access_control_required"`
// Metadata
DetectedAt time.Time `json:"detected_at"`
LastVerified *time.Time `json:"last_verified,omitempty"`
FalsePositive *bool `json:"false_positive,omitempty"`
}
PrivilegedDataFinding represents a detected instance of privileged data
type Projection ¶
type PropertyKey ¶
type Publication ¶
type QualityMetrics ¶
type QualityMetrics struct {
// Overall quality scores
OverallQualityScore float64 `json:"overall_quality_score"` // 0.0-1.0
CompletenessScore float64 `json:"completeness_score"` // 0.0-1.0
ConsistencyScore float64 `json:"consistency_score"` // 0.0-1.0
AccuracyScore float64 `json:"accuracy_score"` // 0.0-1.0
ValidityScore float64 `json:"validity_score"` // 0.0-1.0
// Quality issues
DuplicateRecords int64 `json:"duplicate_records,omitempty"`
InconsistentRecords int64 `json:"inconsistent_records,omitempty"`
MissingRequiredFields int64 `json:"missing_required_fields,omitempty"`
InvalidDataTypes int64 `json:"invalid_data_types,omitempty"`
ConstraintViolations int64 `json:"constraint_violations,omitempty"`
// Object-level quality
TableQuality map[string]TableQuality `json:"table_quality,omitempty"` // Key: table name
CollectionQuality map[string]CollectionQuality `json:"collection_quality,omitempty"` // Key: collection name
ColumnQuality map[string]ColumnQuality `json:"column_quality,omitempty"` // Key: "table.column"
}
QualityMetrics provides data quality indicators
type Recommendation ¶
type Recommendation struct {
ID string `json:"id"`
Type RecommendationType `json:"type"`
Priority ConversionPriority `json:"priority"`
Title string `json:"title"`
Description string `json:"description"`
ObjectType string `json:"object_type,omitempty"`
ObjectName string `json:"object_name,omitempty"`
Action string `json:"action"` // Specific action to take
Rationale string `json:"rationale"` // Why this is recommended
EstimatedImpact string `json:"estimated_impact"` // Expected benefit
ImplementationHint string `json:"implementation_hint,omitempty"`
}
Recommendation represents an actionable recommendation
type RecommendationType ¶
type RecommendationType string
RecommendationType categorizes recommendations
const ( RecommendationTypePerformance RecommendationType = "performance" RecommendationTypeSecurity RecommendationType = "security" RecommendationTypeCompliance RecommendationType = "compliance" RecommendationTypeOptimization RecommendationType = "optimization" RecommendationTypeMigration RecommendationType = "migration" RecommendationTypeDataQuality RecommendationType = "data_quality" )
type RecoveryPoint ¶
type RelationalToGraphRule ¶
type RelationalToGraphRule struct {
Condition string `json:"condition"` // When to apply this rule
TableConversion GraphNodeStrategy `json:"table_conversion"` // How tables become nodes
ForeignKeyStrategy GraphEdgeStrategy `json:"foreign_key_strategy"` // How FKs become edges
RequiredEnrichment []EnrichmentType `json:"required_enrichment,omitempty"`
UserDecisions []UserDecision `json:"user_decisions,omitempty"`
}
RelationalToGraphRule defines how relational schemas convert to graph structures
type Relationship ¶
type RelationshipCounts ¶
type RelationshipEnrichment ¶
type RelationshipEnrichment struct {
// Relationship characteristics
Frequency *int64 `json:"frequency,omitempty"` // Number of instances
Strength *float64 `json:"strength,omitempty"` // 0.0-1.0, weak to strong
IsDirectional bool `json:"is_directional"`
// Performance characteristics
QueryFrequency *float64 `json:"query_frequency,omitempty"` // Traversals per day
TraversalCost *float64 `json:"traversal_cost,omitempty"` // Cost of traversing
// Context
BusinessMeaning string `json:"business_meaning,omitempty"`
Context map[string]string `json:"context,omitempty"`
}
RelationshipEnrichment contains analysis metadata for graph relationships
type RelationshipType ¶
type ReplicationSlot ¶
type ResourceLocation ¶
type ResourceLocation struct {
// Address is the original resource address
Address *resource.ResourceAddress
// ParentObject is the containing object (Table, Collection, Topic, etc.)
ParentObject interface{}
// TargetObject is the specific target (Column, Field, Property, etc.)
TargetObject interface{}
// DataType is the data type of the target
DataType string
// IsNested indicates if this location is within a nested structure
IsNested bool
// NestedPath is the path within nested structures (e.g., JSON path)
NestedPath []string
// IsStreaming indicates if this is a streaming resource
IsStreaming bool
// SchemaInfo contains schema information for structured data
SchemaInfo *ResourceSchemaInfo
}
ResourceLocation represents a resolved location within a resource
func Navigate ¶
func Navigate(ctx context.Context, addr *resource.ResourceAddress) (*ResourceLocation, error)
Navigate resolves a resource address to a specific location
func NavigateDatabase ¶
func NavigateDatabase(um *UnifiedModel, addr *resource.ResourceAddress) (*ResourceLocation, error)
NavigateDatabase navigates a database resource using UnifiedModel
func NavigateMCP ¶
func NavigateMCP(ctx context.Context, addr *resource.ResourceAddress) (*ResourceLocation, error)
NavigateMCP navigates an MCP resource (implementation stub)
func NavigateStream ¶
func NavigateStream(ctx context.Context, addr *resource.ResourceAddress) (*ResourceLocation, error)
NavigateStream navigates a stream resource (implementation stub)
func NavigateWebhook ¶
func NavigateWebhook(ctx context.Context, addr *resource.ResourceAddress) (*ResourceLocation, error)
NavigateWebhook navigates a webhook resource (implementation stub)
type ResourceSchemaInfo ¶
type ResourceSchemaInfo struct {
// Format specifies the schema format (Avro, Protobuf, JSON, etc.)
Format resource.SchemaFormat
// Version is the schema version
Version string
// Fields lists the schema fields
Fields []SchemaField
// Registry is the schema registry URL (for Kafka, etc.)
Registry string
// Definition contains the full schema definition
Definition interface{}
}
ResourceSchemaInfo represents schema information for structured data
type RiskAssessment ¶
type RiskAssessment struct {
OverallRiskScore float64 `json:"overall_risk_score"` // 0.0-1.0
PrivacyRiskScore float64 `json:"privacy_risk_score"` // 0.0-1.0
SecurityRiskScore float64 `json:"security_risk_score"` // 0.0-1.0
ComplianceRiskScore float64 `json:"compliance_risk_score"` // 0.0-1.0
HighRiskObjects []RiskObject `json:"high_risk_objects"`
CriticalFindings []string `json:"critical_findings"`
MitigationStrategies []string `json:"mitigation_strategies"`
}
RiskAssessment provides overall risk analysis
type RiskLevel ¶
type RiskLevel string
RiskLevel indicates the risk level associated with data exposure
type RiskObject ¶
type RiskObject struct {
ObjectType string `json:"object_type"`
ObjectName string `json:"object_name"`
RiskLevel RiskLevel `json:"risk_level"`
RiskFactors []string `json:"risk_factors"`
ImpactScore float64 `json:"impact_score"` // 0.0-1.0
}
RiskObject represents an object with associated risk
type RowMetrics ¶
type RowMetrics struct {
// Global row metrics
TotalRows int64 `json:"total_rows"`
TotalDocuments int64 `json:"total_documents"`
TotalNodes int64 `json:"total_nodes,omitempty"`
TotalRelations int64 `json:"total_relations,omitempty"`
TotalVectors int64 `json:"total_vectors,omitempty"`
// Object-level row metrics
TableRows map[string]TableRows `json:"table_rows,omitempty"` // Key: table name
CollectionDocs map[string]CollectionDocs `json:"collection_docs,omitempty"` // Key: collection name
NodeCounts map[string]NodeCounts `json:"node_counts,omitempty"` // Key: node label
RelationshipCounts map[string]RelationshipCounts `json:"relationship_counts,omitempty"` // Key: relationship type
VectorCounts map[string]VectorCounts `json:"vector_counts,omitempty"` // Key: vector index name
// Growth metrics
DailyGrowthRate *float64 `json:"daily_growth_rate,omitempty"` // Rows per day
WeeklyGrowthRate *float64 `json:"weekly_growth_rate,omitempty"` // Rows per week
MonthlyGrowthRate *float64 `json:"monthly_growth_rate,omitempty"` // Rows per month
}
RowMetrics provides row/document count information
type SampleDataCollector ¶
type SampleDataCollector struct {
// contains filtered or unexported fields
}
SampleDataCollector provides methods for collecting and processing sample data
func NewSampleDataCollector ¶
func NewSampleDataCollector(config SampleDataConfig) *SampleDataCollector
NewSampleDataCollector creates a new sample data collector with the given configuration
func (*SampleDataCollector) ProcessCollectionSample ¶
func (c *SampleDataCollector) ProcessCollectionSample(collectionName string, documents []map[string]interface{}, totalDocCount int64) CollectionSampleData
ProcessCollectionSample processes document collection data
func (*SampleDataCollector) ProcessKeyValueSample ¶
func (c *SampleDataCollector) ProcessKeyValueSample(namespaceName string, keyValuePairs []KeyValueSampleEntry, totalKeyCount int64) KeyValueSampleData
ProcessKeyValueSample processes key-value pair data
func (*SampleDataCollector) ProcessTableSample ¶
func (c *SampleDataCollector) ProcessTableSample(tableName string, rows []map[string]interface{}, totalRowCount int64) TableSampleData
ProcessTableSample processes raw table data into structured sample data
type SampleDataConfig ¶
type SampleDataConfig struct {
MaxRowsPerTable int `json:"max_rows_per_table"`
MaxDocsPerCollection int `json:"max_docs_per_collection"`
MaxKeysPerNamespace int `json:"max_keys_per_namespace"`
MaxNodesPerGraph int `json:"max_nodes_per_graph"`
MaxValuesPerColumn int `json:"max_values_per_column"`
SamplingStrategy string `json:"sampling_strategy"` // "random", "systematic", "stratified"
IncludeNullValues bool `json:"include_null_values"`
IncludeEmptyValues bool `json:"include_empty_values"`
RedactSensitiveData bool `json:"redact_sensitive_data"`
ExcludePatterns []string `json:"exclude_patterns,omitempty"` // Regex patterns to exclude
IncludeOnlyPatterns []string `json:"include_only_patterns,omitempty"` // Regex patterns to include only
MaxStringLength int `json:"max_string_length"` // Truncate long strings
CollectMetadata bool `json:"collect_metadata"` // Include value length, type info
}
SampleDataConfig defines how sample data should be collected and processed
func DefaultSampleDataConfig ¶
func DefaultSampleDataConfig() SampleDataConfig
DefaultSampleDataConfig returns sensible defaults for sample data collection
func PrivacyAwareSampleDataConfig ¶
func PrivacyAwareSampleDataConfig() SampleDataConfig
PrivacyAwareSampleDataConfig returns configuration for privacy-compliant sample collection
type ScalableTypeConverter ¶
type ScalableTypeConverter struct {
// contains filtered or unexported fields
}
ScalableTypeConverter provides database-agnostic type conversion
func NewScalableTypeConverter ¶
func NewScalableTypeConverter() *ScalableTypeConverter
NewScalableTypeConverter creates a new scalable type converter
func (*ScalableTypeConverter) ConvertCustomTypeScalable ¶
func (stc *ScalableTypeConverter) ConvertCustomTypeScalable(customType Type, sourceDB, targetDB dbcapabilities.DatabaseType) (*CustomTypeConversionResult, error)
ConvertCustomTypeScalable converts custom types between any two databases
func (*ScalableTypeConverter) ConvertPrimitiveType ¶
func (stc *ScalableTypeConverter) ConvertPrimitiveType(sourceDB, targetDB dbcapabilities.DatabaseType, sourceType string) (*DataTypeConversionResult, error)
ConvertPrimitiveType converts a primitive type between any two databases
type Schema ¶
type Schema struct {
Name string `json:"name"`
Owner string `json:"owner,omitempty"`
Comment string `json:"comment,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Options map[string]any `json:"options,omitempty"`
Tables map[string]Table `json:"tables,omitempty"`
Views map[string]View `json:"views,omitempty"`
MatViews map[string]MaterializedView `json:"materialized_views,omitempty"`
Sequences map[string]Sequence `json:"sequences,omitempty"`
Types map[string]Type `json:"types,omitempty"`
Functions map[string]Function `json:"functions,omitempty"`
Procedures map[string]Procedure `json:"procedures,omitempty"`
Triggers map[string]Trigger `json:"triggers,omitempty"`
}
type SchemaDetectionCapabilities ¶
type SchemaDetectionCapabilities struct {
ColumnNameAnalysis bool `json:"column_name_analysis"` // Analyze column names for PII patterns
DataTypeAnalysis bool `json:"data_type_analysis"` // Infer sensitivity from data types
ConstraintAnalysis bool `json:"constraint_analysis"` // Analyze constraints for hints
TableContextAnalysis bool `json:"table_context_analysis"` // Consider table name and related columns
ForeignKeyAnalysis bool `json:"foreign_key_analysis"` // Analyze relationships
IndexAnalysis bool `json:"index_analysis"` // Consider which columns are indexed
SupportedPatterns []string `json:"supported_patterns"` // List of built-in detection patterns
ConfidenceRange [2]float64 `json:"confidence_range"` // Min/max confidence achievable
}
SchemaDetectionCapabilities defines what can be detected using only schema information
type SchemaField ¶
type SchemaField struct {
// Name is the field name
Name string
// Type is the field data type
Type string
// Required indicates if the field is required
Required bool
// DefaultVal is the default value
DefaultVal interface{}
// Description is the field description
Description string
// Nested contains nested fields for complex types
Nested []SchemaField
}
SchemaField represents a single field in a schema
type SchemaInfo ¶
type SchemaInfo struct {
DatabaseType string `json:"database_type"`
SchemaID string `json:"schema_id"`
Hash string `json:"hash"`
TotalObjects int `json:"total_objects"`
Tables int `json:"tables"`
Collections int `json:"collections"`
Views int `json:"views"`
MaterializedViews int `json:"materialized_views"`
Indexes int `json:"indexes"`
Constraints int `json:"constraints"`
Functions int `json:"functions"`
Procedures int `json:"procedures"`
IsEmpty bool `json:"is_empty"`
}
func GetSchemaInfo ¶
func GetSchemaInfo(schema *UnifiedModel) SchemaInfo
GetSchemaInfo returns basic information about a schema.
type SearchDocument ¶
type SearchDocument struct {
Name string `json:"name"` // Document identifier or index name
DocumentID string `json:"document_id"` // Unique document ID
Index string `json:"index"` // Index name
Type string `json:"type,omitempty"` // Document type (deprecated in newer Elasticsearch)
Fields map[string]Field `json:"fields"` // Schema fields
Mappings map[string]any `json:"mappings,omitempty"` // Field mappings
Analyzer string `json:"analyzer,omitempty"` // Default analyzer
Score *float64 `json:"score,omitempty"` // Relevance score (for search results)
Labels map[string]string `json:"labels,omitempty"`
Options map[string]any `json:"options,omitempty"`
}
type SearchIndex ¶
type SearchMappingInfo ¶
type SearchSampleData ¶
type SearchSampleData struct {
IndexName string `json:"index_name"`
DocumentCount int64 `json:"document_count"`
SampleCount int `json:"sample_count"`
Documents []map[string]interface{} `json:"documents"`
FieldSamples map[string]FieldSampleValues `json:"field_samples"`
MappingInfo SearchMappingInfo `json:"mapping_info"`
CollectedAt time.Time `json:"collected_at"`
Warnings []string `json:"warnings,omitempty"`
}
SearchSampleData represents sample data from search indexes (Elasticsearch)
type Sequence ¶
type Sequence struct {
Name string `json:"name"`
Start int64 `json:"start,omitempty"`
Increment int64 `json:"increment,omitempty"`
Min *int64 `json:"min,omitempty"`
Max *int64 `json:"max,omitempty"`
Cache *int64 `json:"cache,omitempty"`
Cycle bool `json:"cycle,omitempty"`
Options map[string]any `json:"options,omitempty"`
}
func (*Sequence) UnmarshalJSON ¶
UnmarshalJSON provides custom JSON unmarshaling for Sequence to handle large numbers that exceed int64 range by capping them at the maximum int64 value
type SizeMetrics ¶
type SizeMetrics struct {
// Global size metrics
TotalSizeBytes int64 `json:"total_size_bytes"`
DataSizeBytes int64 `json:"data_size_bytes"`
IndexSizeBytes int64 `json:"index_size_bytes"`
TempSizeBytes int64 `json:"temp_size_bytes,omitempty"`
LogSizeBytes int64 `json:"log_size_bytes,omitempty"`
CompressedSizeBytes int64 `json:"compressed_size_bytes,omitempty"`
// Object-level size metrics
TableSizes map[string]TableSize `json:"table_sizes,omitempty"` // Key: table name
IndexSizes map[string]IndexSize `json:"index_sizes,omitempty"` // Key: index name
CollectionSizes map[string]CollectionSize `json:"collection_sizes,omitempty"` // Key: collection name
ViewSizes map[string]ViewSize `json:"view_sizes,omitempty"` // Key: view name (materialized)
GraphSizes map[string]GraphSize `json:"graph_sizes,omitempty"` // Key: graph name
VectorSizes map[string]VectorSize `json:"vector_sizes,omitempty"` // Key: vector index name
// Storage breakdown
StorageByType map[string]int64 `json:"storage_by_type,omitempty"` // storage type -> bytes
CompressionRatio *float64 `json:"compression_ratio,omitempty"` // compressed/uncompressed ratio
}
SizeMetrics provides size information for database objects
type StructuralChange ¶
type StructuralChange struct {
ChangeType ChangeType `json:"change_type"`
ObjectType ObjectType `json:"object_type"`
ObjectPath string `json:"object_path"` // e.g., "tables.users.columns.email"
SourceValue *string `json:"source_value,omitempty"`
TargetValue *string `json:"target_value,omitempty"`
Description string `json:"description"`
Severity ChangeSeverity `json:"severity"`
IsBreaking bool `json:"is_breaking"` // Breaking change for applications
}
StructuralChange represents a structural difference between schemas
func CompareTablesDetailed ¶
func CompareTablesDetailed(source, target Table, options EnhancedComparisonOptions) []StructuralChange
CompareTablesDetailed performs detailed table-to-table comparison
type SubPartition ¶
type Subscription ¶
type SupportLevel ¶
type SupportLevel string
SupportLevel indicates how well an object type is supported
const ( SupportLevelFull SupportLevel = "full" // Complete support with all features SupportLevelPartial SupportLevel = "partial" // Limited support, some features missing SupportLevelEmulated SupportLevel = "emulated" // Can be simulated using other objects SupportLevelUnsupported SupportLevel = "unsupported" // Not supported at all )
type TTLSetting ¶
type Table ¶
type Table struct {
Name string `json:"name"`
Owner string `json:"owner,omitempty"`
Comment string `json:"comment,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Options map[string]any `json:"options,omitempty"`
Columns map[string]Column `json:"columns"`
Indexes map[string]Index `json:"indexes,omitempty"`
Constraints map[string]Constraint `json:"constraints,omitempty"`
Partitions map[string]Partition `json:"partitions,omitempty"`
SubTables map[string]Table `json:"sub_tables,omitempty"` // e.g., partition children
}
type TableCategory ¶
type TableCategory string
TableCategory represents the classification of a table's purpose and usage pattern
const ( TableCategoryTransactional TableCategory = "transactional" TableCategoryAnalytical TableCategory = "analytical" TableCategoryTimeSeries TableCategory = "time_series" TableCategoryReference TableCategory = "reference" TableCategoryLog TableCategory = "log" TableCategoryAudit TableCategory = "audit" TableCategoryCache TableCategory = "cache" TableCategoryStaging TableCategory = "staging" TableCategoryArchive TableCategory = "archive" TableCategoryConfiguration TableCategory = "configuration" TableCategoryMetadata TableCategory = "metadata" TableCategorySearch TableCategory = "search" TableCategoryQueue TableCategory = "queue" TableCategorySession TableCategory = "session" )
type TableEnrichment ¶
type TableEnrichment struct {
// Classification
PrimaryCategory TableCategory `json:"primary_category"`
ClassificationConfidence float64 `json:"classification_confidence"` // 0.0-1.0
ClassificationScores []CategoryScore `json:"classification_scores"` // All category scores
// Access patterns and performance
AccessPattern AccessPattern `json:"access_pattern"`
EstimatedRows *int64 `json:"estimated_rows,omitempty"`
GrowthRate *float64 `json:"growth_rate,omitempty"` // Estimated rows per day
QueryComplexity *float64 `json:"query_complexity,omitempty"` // 0.0-1.0, simple to complex
// Data characteristics
HasPrivilegedData bool `json:"has_privileged_data"`
PrivilegedColumns []string `json:"privileged_columns,omitempty"`
DataSensitivity float64 `json:"data_sensitivity"` // 0.0-1.0, low to high
// Optimization hints
RecommendedIndexes []IndexRecommendation `json:"recommended_indexes,omitempty"`
RecommendedPartitions []PartitionRecommendation `json:"recommended_partitions,omitempty"`
// Relationships
RelatedTables []string `json:"related_tables,omitempty"` // Tables with FK relationships
DependentTables []string `json:"dependent_tables,omitempty"` // Tables that depend on this one
// Metadata
BusinessPurpose string `json:"business_purpose,omitempty"`
DataRetention *time.Duration `json:"data_retention,omitempty"`
Tags []string `json:"tags,omitempty"`
Context map[string]string `json:"context,omitempty"`
}
TableEnrichment contains analysis metadata for a table
type TablePerformance ¶
type TablePerformance struct {
QueriesPerSecond *float64 `json:"queries_per_second,omitempty"`
AvgQueryTime *float64 `json:"avg_query_time_ms,omitempty"`
ScanRatio *float64 `json:"scan_ratio,omitempty"` // Full table scans / total queries
CacheHitRatio *float64 `json:"cache_hit_ratio,omitempty"` // 0.0-1.0
LastAnalyzed *time.Time `json:"last_analyzed,omitempty"`
}
type TableQuality ¶
type TableQuality struct {
QualityScore float64 `json:"quality_score"` // 0.0-1.0
CompletenessScore float64 `json:"completeness_score"` // 0.0-1.0
ConsistencyScore float64 `json:"consistency_score"` // 0.0-1.0
DuplicateCount int64 `json:"duplicate_count,omitempty"`
MissingDataPercent float64 `json:"missing_data_percent"` // 0-100
LastQualityCheck *time.Time `json:"last_quality_check,omitempty"`
}
type TableSampleData ¶
type TableSampleData struct {
TableName string `json:"table_name"`
RowCount int64 `json:"row_count"` // Total rows in table
SampleCount int `json:"sample_count"` // Number of sampled rows
Columns map[string]ColumnSampleValues `json:"columns"` // Sample values per column
Rows []map[string]interface{} `json:"rows"` // Complete row samples
CollectedAt time.Time `json:"collected_at"`
Warnings []string `json:"warnings,omitempty"`
}
TableSampleData represents sample data from a relational table
type TableToCollectionRule ¶
type TableToCollectionRule struct {
Condition string `json:"condition"` // When to apply this rule
CollectionStrategy CollectionStrategy `json:"collection_strategy"` // How to structure the collection
EmbeddingStrategy EmbeddingStrategy `json:"embedding_strategy"` // How to handle relationships
RequiredEnrichment []EnrichmentType `json:"required_enrichment,omitempty"`
UserDecisions []UserDecision `json:"user_decisions,omitempty"`
}
TableToCollectionRule defines how relational tables convert to document collections
type Tablespace ¶
type TemporaryTable ¶
type TextSearchComponent ¶
type TextSearchComponent struct {
Name string `json:"name"`
Type TextSearchComponentType `json:"type"` // parser, dictionary, template, configuration, analyzer, tokenizer, filter, normalizer
Parser string `json:"parser,omitempty"` // For configuration type
Dictionaries []string `json:"dictionaries,omitempty"` // For configuration type
Chain []string `json:"chain,omitempty"` // For analyzer type (tokenizer + filters)
Options map[string]any `json:"options,omitempty"`
Comment string `json:"comment,omitempty"`
}
type TextSearchComponentType ¶
type TextSearchComponentType string
const ( TextSearchTypeParser TextSearchComponentType = "parser" TextSearchTypeDictionary TextSearchComponentType = "dictionary" TextSearchTypeTemplate TextSearchComponentType = "template" TextSearchTypeConfiguration TextSearchComponentType = "configuration" TextSearchTypeAnalyzer TextSearchComponentType = "analyzer" TextSearchTypeTokenizer TextSearchComponentType = "tokenizer" TextSearchTypeFilter TextSearchComponentType = "filter" TextSearchTypeNormalizer TextSearchComponentType = "normalizer" )
type TimeSeriesDataPoint ¶
type TimeSeriesPoint ¶
type TimeSeriesPoint struct {
Name string `json:"name"` // Measurement or metric name
Timestamp string `json:"timestamp"` // Time point (RFC3339 or epoch)
Tags map[string]string `json:"tags,omitempty"` // Indexed metadata (dimensions)
Fields map[string]Field `json:"fields"` // Actual measurements (values)
Aggregation string `json:"aggregation,omitempty"` // Aggregation function (sum, avg, min, max, count)
Retention string `json:"retention,omitempty"` // Retention policy
Precision string `json:"precision,omitempty"` // Time precision (ns, us, ms, s, m, h)
Labels map[string]string `json:"labels,omitempty"`
Options map[string]any `json:"options,omitempty"`
}
type TimeSeriesSampleData ¶
type TimeSeriesSampleData struct {
SeriesName string `json:"series_name"`
DataPointCount int64 `json:"data_point_count"`
SampleCount int `json:"sample_count"`
TimeRange TimeRange `json:"time_range"`
DataPoints []TimeSeriesDataPoint `json:"data_points"`
MetricSamples map[string]ColumnSampleValues `json:"metric_samples"` // Sample values per metric
TagSamples map[string]ColumnSampleValues `json:"tag_samples"` // Sample tag values
CollectedAt time.Time `json:"collected_at"`
Warnings []string `json:"warnings,omitempty"`
}
TimeSeriesSampleData represents sample data from time-series databases (specialized views)
type TimeTravel ¶
type TransformRuleType ¶
type TransformRuleType string
const ( TransformRuleTypeExpression TransformRuleType = "expression" TransformRuleTypeFunction TransformRuleType = "function" TransformRuleTypeLookup TransformRuleType = "lookup" TransformRuleTypeDefault TransformRuleType = "default" TransformRuleTypeConcat TransformRuleType = "concat" TransformRuleTypeSplit TransformRuleType = "split" TransformRuleTypeFormat TransformRuleType = "format" )
type TransformationStep ¶
type TransientTable ¶
type TrendMetrics ¶
type TrendMetrics struct {
// Data growth trends
DataGrowthTrend GrowthTrend `json:"data_growth_trend"`
QueryVolumeTrend GrowthTrend `json:"query_volume_trend"`
PerformanceTrend GrowthTrend `json:"performance_trend"`
StorageUsageTrend GrowthTrend `json:"storage_usage_trend"`
// Capacity planning
EstimatedFullCapacity *time.Time `json:"estimated_full_capacity,omitempty"` // When storage will be full
ProjectedGrowth6Month *int64 `json:"projected_growth_6_month,omitempty"` // Projected size increase
ProjectedGrowth1Year *int64 `json:"projected_growth_1_year,omitempty"` // Projected size increase
// Object evolution
ObjectCreationRate map[string]float64 `json:"object_creation_rate,omitempty"` // objects created per day by type
ObjectDeletionRate map[string]float64 `json:"object_deletion_rate,omitempty"` // objects deleted per day by type
}
TrendMetrics provides historical trend analysis
type Trigger ¶
type Trigger struct {
Name string `json:"name"`
Table string `json:"table,omitempty"`
Timing string `json:"timing"` // before, after, instead_of
Events []string `json:"events"` // insert, update, delete, truncate
Procedure string `json:"procedure"`
Options map[string]any `json:"options,omitempty"`
}
type TypeConversionCapabilities ¶
type TypeConversionCapabilities struct {
CanCastBetweenNumeric bool `json:"can_cast_between_numeric"`
CanCastToString bool `json:"can_cast_to_string"`
CanCastFromString bool `json:"can_cast_from_string"`
SupportsImplicitCast bool `json:"supports_implicit_cast"`
SupportsExplicitCast bool `json:"supports_explicit_cast"`
CastFunctions map[string]string `json:"cast_functions,omitempty"`
ConversionFunctions map[string]string `json:"conversion_functions,omitempty"`
}
TypeConversionCapabilities describes how types can be converted
type TypeConversionValidation ¶
type TypeConversionValidation struct {
IsSupported bool `json:"is_supported"`
ConversionResult *DataTypeConversionResult `json:"conversion_result,omitempty"`
IsLossyConversion bool `json:"is_lossy_conversion"`
RequiresUserInput bool `json:"requires_user_input"`
Warnings []string `json:"warnings,omitempty"`
Recommendations []string `json:"recommendations,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
}
TypeConversionValidation represents validation results for a type conversion
type TypeConverter ¶
type TypeConverter struct {
// contains filtered or unexported fields
}
TypeConverter provides data type conversion functionality
func NewTypeConverter ¶
func NewTypeConverter() *TypeConverter
NewTypeConverter creates a new type converter
func (*TypeConverter) ConvertColumn ¶
func (tc *TypeConverter) ConvertColumn(column Column, sourceDB, targetDB dbcapabilities.DatabaseType) (Column, error)
ConvertColumn converts a column's data type for schema conversion
func (*TypeConverter) ConvertCustomType ¶
func (tc *TypeConverter) ConvertCustomType(customType Type, sourceDB, targetDB dbcapabilities.DatabaseType) (*CustomTypeConversionResult, error)
ConvertCustomType converts a custom/user-defined type
func (*TypeConverter) ConvertDataType ¶
func (tc *TypeConverter) ConvertDataType(sourceDB, targetDB dbcapabilities.DatabaseType, sourceType string) (*DataTypeConversionResult, error)
ConvertDataType converts a data type from source to target database
func (*TypeConverter) ConvertDataTypeWithCustomTypes ¶
func (tc *TypeConverter) ConvertDataTypeWithCustomTypes(sourceDB, targetDB dbcapabilities.DatabaseType, sourceType string, schema *UnifiedModel) (*DataTypeConversionResult, error)
ConvertDataTypeWithCustomTypes converts a data type, checking for custom types first
func (*TypeConverter) ConvertField ¶
func (tc *TypeConverter) ConvertField(field Field, sourceDB, targetDB dbcapabilities.DatabaseType) (Field, error)
ConvertField converts a field's data type for schema conversion
func (*TypeConverter) ConvertProperty ¶
func (tc *TypeConverter) ConvertProperty(property Property, sourceDB, targetDB dbcapabilities.DatabaseType) (Property, error)
ConvertProperty converts a property's data type for schema conversion
func (*TypeConverter) GetSupportedConversions ¶
func (tc *TypeConverter) GetSupportedConversions(sourceDB, targetDB dbcapabilities.DatabaseType) []DataTypeConversionRule
GetSupportedConversions returns all supported type conversions for a database pair
func (*TypeConverter) IsCustomType ¶
func (tc *TypeConverter) IsCustomType(typeName string, schema *UnifiedModel) bool
IsCustomType determines if a type name refers to a custom type in the schema
func (*TypeConverter) ValidateCustomTypeConversion ¶
func (tc *TypeConverter) ValidateCustomTypeConversion(customType Type, sourceDB, targetDB dbcapabilities.DatabaseType) (*CustomTypeValidation, error)
ValidateCustomTypeConversion validates a custom type conversion
func (*TypeConverter) ValidateTypeConversion ¶
func (tc *TypeConverter) ValidateTypeConversion(sourceDB, targetDB dbcapabilities.DatabaseType, sourceType string) (*TypeConversionValidation, error)
ValidateTypeConversion checks if a type conversion is possible and safe
type UUIDGenerator ¶
type UnifiedDataType ¶
type UnifiedDataType string
UnifiedDataType represents a database-agnostic data type
const ( // Numeric types UnifiedTypeBoolean UnifiedDataType = "boolean" UnifiedTypeInt8 UnifiedDataType = "int8" UnifiedTypeInt16 UnifiedDataType = "int16" UnifiedTypeInt32 UnifiedDataType = "int32" UnifiedTypeInt64 UnifiedDataType = "int64" UnifiedTypeUInt8 UnifiedDataType = "uint8" UnifiedTypeUInt16 UnifiedDataType = "uint16" UnifiedTypeUInt32 UnifiedDataType = "uint32" UnifiedTypeUInt64 UnifiedDataType = "uint64" UnifiedTypeFloat32 UnifiedDataType = "float32" UnifiedTypeFloat64 UnifiedDataType = "float64" UnifiedTypeDecimal UnifiedDataType = "decimal" UnifiedTypeNumeric UnifiedDataType = "numeric" UnifiedTypeMoney UnifiedDataType = "money" // String types UnifiedTypeString UnifiedDataType = "string" UnifiedTypeText UnifiedDataType = "text" UnifiedTypeChar UnifiedDataType = "char" UnifiedTypeVarchar UnifiedDataType = "varchar" UnifiedTypeClob UnifiedDataType = "clob" UnifiedTypeBlob UnifiedDataType = "blob" // Date/Time types UnifiedTypeDate UnifiedDataType = "date" UnifiedTypeTime UnifiedDataType = "time" UnifiedTypeTimestamp UnifiedDataType = "timestamp" UnifiedTypeInterval UnifiedDataType = "interval" // Binary types UnifiedTypeBinary UnifiedDataType = "binary" UnifiedTypeVarbinary UnifiedDataType = "varbinary" UnifiedTypeUUID UnifiedDataType = "uuid" // JSON/Document types UnifiedTypeJSON UnifiedDataType = "json" UnifiedTypeJSONB UnifiedDataType = "jsonb" UnifiedTypeDocument UnifiedDataType = "document" UnifiedTypeObject UnifiedDataType = "object" // Array/Collection types UnifiedTypeArray UnifiedDataType = "array" UnifiedTypeList UnifiedDataType = "list" UnifiedTypeSet UnifiedDataType = "set" UnifiedTypeMap UnifiedDataType = "map" // Geospatial types UnifiedTypePoint UnifiedDataType = "point" UnifiedTypeLineString UnifiedDataType = "linestring" UnifiedTypePolygon UnifiedDataType = "polygon" UnifiedTypeGeometry UnifiedDataType = "geometry" UnifiedTypeGeography UnifiedDataType = "geography" // Vector types UnifiedTypeVector UnifiedDataType = "vector" UnifiedTypeEmbedding UnifiedDataType = "embedding" // Graph types UnifiedTypeNode UnifiedDataType = "node" UnifiedTypeEdge UnifiedDataType = "edge" UnifiedTypeRelation UnifiedDataType = "relation" // Special types UnifiedTypeEnum UnifiedDataType = "enum" UnifiedTypeRange UnifiedDataType = "range" UnifiedTypeXML UnifiedDataType = "xml" UnifiedTypeUnknown UnifiedDataType = "unknown" )
type UnifiedModel ¶
type UnifiedModel struct {
// Primary Data Containers
Tables map[string]Table `json:"tables"` // Tabular Record Sets (Relational, Wide-Column)
Collections map[string]Collection `json:"collections"` // Documents (Document Databases)
Nodes map[string]Node `json:"nodes"` // Graph Nodes (Graph Databases)
Relationships map[string]Relationship `json:"relationships"` // Graph Relationships (Graph Databases)
Embeddings map[string]Embedding `json:"embeddings"` // Vector Embeddings (Vector Databases)
KeyValuePairs map[string]KeyValuePair `json:"key_value_pairs"` // Key-Value Items (Key-Value Stores)
SearchDocuments map[string]SearchDocument `json:"search_documents"` // Search Documents (Search Engines)
TimeSeriesPoints map[string]TimeSeriesPoint `json:"time_series_points"` // Time-Series Data Points (Time-Series Databases)
Blobs map[string]Blob `json:"blobs"` // Binary Large Objects (Object Storage)
// Secondary Data Containers
MemoryTables map[string]MemoryTable `json:"memory_tables"`
// Database Structure Type
DatabaseType dbcapabilities.DatabaseType `json:"database_type"`
// Structural organization (optional levels depending on engine)
Catalogs map[string]Catalog `json:"catalogs"`
Databases map[string]Database `json:"databases"`
Schemas map[string]Schema `json:"schemas"`
// Temporary Data Containers
TemporaryTables map[string]TemporaryTable `json:"temporary_tables"`
TransientTables map[string]TransientTable `json:"transient_tables"`
CacheMechanism string `json:"cache_mechanism,omitempty"`
Caches map[string]Cache `json:"caches"`
// Virtual Data Containers
Views map[string]View `json:"views"`
LiveViews map[string]LiveView `json:"live_views"`
WindowViews map[string]WindowView `json:"window_views"`
MaterializedViews map[string]MaterializedView `json:"materialized_views"`
ExternalTables map[string]ExternalTable `json:"external_tables"`
ForeignTables map[string]ForeignTable `json:"foreign_tables"`
// Graph / Vector / Search abstractions
Graphs map[string]Graph `json:"graphs"`
VectorIndexes map[string]VectorIndex `json:"vector_indexes"`
SearchIndexes map[string]SearchIndex `json:"search_indexes"`
// Specialized Data Containers
Vectors map[string]Vector `json:"vectors"`
Documents map[string]Document `json:"documents"`
EmbeddedDocuments map[string]EmbeddedDocument `json:"embedded_documents"`
Paths map[string]Path `json:"paths"`
// Data Organization Containers
Partitions map[string]Partition `json:"partitions"`
SubPartitions map[string]SubPartition `json:"sub_partitions"`
Shards map[string]Shard `json:"shards"`
Keyspaces map[string]Keyspace `json:"keyspaces"`
Namespaces map[string]Namespace `json:"namespaces"`
// Structural definition objects
Columns map[string]Column `json:"columns"`
Types map[string]Type `json:"types"`
PropertyKeys map[string]PropertyKey `json:"property_keys"`
// Integrity, performance and identity objects
Indexes map[string]Index `json:"indexes"`
Constraints map[string]Constraint `json:"constraints"`
Sequences map[string]Sequence `json:"sequences"`
Identities map[string]Identity `json:"identities"`
UUIDGenerators map[string]UUIDGenerator `json:"uuid_generators"`
// Executable code objects
Functions map[string]Function `json:"functions"`
Procedures map[string]Procedure `json:"procedures"`
Methods map[string]Method `json:"methods"`
Triggers map[string]Trigger `json:"triggers"`
EventTriggers map[string]EventTrigger `json:"event_triggers"`
Aggregates map[string]Aggregate `json:"aggregates"`
Operators map[string]Operator `json:"operators"`
Modules map[string]Module `json:"modules"`
Packages map[string]Package `json:"packages"`
PackageBodies map[string]PackageBody `json:"package_bodies"`
Macros map[string]Macro `json:"macros"`
Rules map[string]Rule `json:"rules"`
WindowFuncs map[string]WindowFunc `json:"window_functions"`
// Security and access control
Users map[string]DBUser `json:"users"`
Roles map[string]DBRole `json:"roles"`
Grants map[string]Grant `json:"grants"`
Policies map[string]Policy `json:"policies"`
// Physical storage and placement
Tablespaces map[string]Tablespace `json:"tablespaces"`
Segments map[string]Segment `json:"segments"`
Extents map[string]Extent `json:"extents"`
Pages map[string]Page `json:"pages"`
Filegroups map[string]Filegroup `json:"filegroups"`
Datafiles map[string]Datafile `json:"datafiles"`
// Connectivity and integration
Servers map[string]Server `json:"servers"`
Connections map[string]Connection `json:"connections"`
Endpoints map[string]Endpoint `json:"endpoints"`
ForeignDataWrappers map[string]ForeignDataWrapper `json:"foreign_data_wrappers"`
UserMappings map[string]UserMapping `json:"user_mappings"`
Federations map[string]Federation `json:"federations"`
Replicas map[string]Replica `json:"replicas"`
Clusters map[string]Cluster `json:"clusters"`
// Operational, pipelines and streaming
Tasks map[string]Task `json:"tasks"`
Jobs map[string]Job `json:"jobs"`
Schedules map[string]Schedule `json:"schedules"`
Pipelines map[string]Pipeline `json:"pipelines"`
Streams map[string]Stream `json:"streams"`
// Monitoring and alerting
Events map[string]Event `json:"events"`
Notifications map[string]Notification `json:"notifications"`
Alerts map[string]Alert `json:"alerts"`
Statistics map[string]Statistic `json:"statistics"`
Histograms map[string]Histogram `json:"histograms"`
Monitors map[string]Monitor `json:"monitors"`
MonitorMetrics map[string]MonitorMetric `json:"monitor_metrics"`
Thresholds map[string]Threshold `json:"thresholds"`
// Text processing / search configuration
TextSearchComponents map[string]TextSearchComponent `json:"text_search_components"`
// Metadata and documentation
Comments map[string]Comment `json:"comments"`
Annotations map[string]Annotation `json:"annotations"`
Tags map[string]Tag `json:"tags"`
Aliases map[string]Alias `json:"aliases"`
Synonyms map[string]Synonym `json:"synonyms"`
Labels map[string]Label `json:"labels"`
// Backup and recovery, versioning
Snapshots map[string]Snapshot `json:"snapshots"`
Backups map[string]Backup `json:"backups"`
Archives map[string]Archive `json:"archives"`
RecoveryPoints map[string]RecoveryPoint `json:"recovery_points"`
Versions map[string]VersionNode `json:"versions"`
Migrations map[string]Migration `json:"migrations"`
Branches map[string]Branch `json:"branches"`
TimeTravel map[string]TimeTravel `json:"time_travel"`
// Extensions and customization
Extensions map[string]Extension `json:"extensions"`
Plugins map[string]Plugin `json:"plugins"`
ModuleExtensions map[string]ModuleExtension `json:"module_extensions"`
TTLSettings map[string]TTLSetting `json:"ttl_settings"`
Dimensions map[string]DimensionSpec `json:"dimensions"`
DistanceMetrics map[string]DistanceMetricSpec `json:"distance_metrics"`
// Advanced analytics
Projections map[string]Projection `json:"projections"`
AnalyticsAggs map[string]AggregationOp `json:"analytics_aggregations"`
Transformations map[string]TransformationStep `json:"transformations"`
Enrichments map[string]Enrichment `json:"enrichments"`
BufferPools map[string]BufferPool `json:"buffer_pools"`
// Replication & distribution
Publications map[string]Publication `json:"publications"`
Subscriptions map[string]Subscription `json:"subscriptions"`
ReplicationSlots map[string]ReplicationSlot `json:"replication_slots"`
FailoverGroups map[string]FailoverGroup `json:"failover_groups"`
}
UnifiedModel is a unified model for all database types
func CloneSchema ¶
func CloneSchema(schema *UnifiedModel) (*UnifiedModel, error)
CloneSchema creates a deep copy of a UnifiedModel schema. This is useful for creating modified versions without affecting the original.
func ConvertFromProto ¶
func ConvertFromProto(pbUM *pb.UnifiedModel) *UnifiedModel
ConvertFromProto converts a protobuf UnifiedModel to Go UnifiedModel
func DeserializeSchema ¶
func DeserializeSchema(data []byte) (*UnifiedModel, error)
DeserializeSchema converts JSON bytes back to a UnifiedModel.
func FilterObjects ¶
func FilterObjects(schema *UnifiedModel, filter func(objectType ObjectType, name string, obj interface{}) bool) *UnifiedModel
FilterObjects returns a new schema containing only objects that match the filter function.
func FromProto ¶
func FromProto(pbUM *pb.UnifiedModel) *UnifiedModel
FromProto is a convenience function that calls ConvertFromProto
func MergeSchemas ¶
func MergeSchemas(base, overlay *UnifiedModel) (*UnifiedModel, error)
MergeSchemas combines two schemas, with the target schema taking precedence. This is useful for applying incremental updates to schemas.
func NewUnifiedModel ¶
func NewUnifiedModel(dbType dbcapabilities.DatabaseType) *UnifiedModel
NewUnifiedModel creates a new UnifiedModel with all maps properly initialized. This ensures consistent JSON serialization across all database adapters. Use this function instead of manually creating UnifiedModel instances to avoid JSON marshaling issues caused by uninitialized (nil) maps.
func (*UnifiedModel) AddCollection ¶
func (schema *UnifiedModel) AddCollection(collection Collection)
AddCollection adds a collection to the schema.
func (*UnifiedModel) AddConstraint ¶
func (schema *UnifiedModel) AddConstraint(constraint Constraint)
AddConstraint adds a constraint to the schema.
func (*UnifiedModel) AddIndex ¶
func (schema *UnifiedModel) AddIndex(index Index)
AddIndex adds an index to the schema.
func (*UnifiedModel) AddTable ¶
func (schema *UnifiedModel) AddTable(table Table)
AddTable adds a table to the schema.
func (*UnifiedModel) ConvertToProto ¶
func (um *UnifiedModel) ConvertToProto() *pb.UnifiedModel
ConvertToProto converts a Go UnifiedModel to protobuf UnifiedModel
func (*UnifiedModel) GetBasicMetrics ¶
func (um *UnifiedModel) GetBasicMetrics(schemaID string) *UnifiedModelMetrics
GetBasicMetrics generates basic metrics (counts and simple calculations) from this UnifiedModel
func (*UnifiedModel) GetCollection ¶
func (schema *UnifiedModel) GetCollection(name string) (*Collection, bool)
GetCollection retrieves a collection by name.
func (*UnifiedModel) GetConstraint ¶
func (schema *UnifiedModel) GetConstraint(name string) (*Constraint, bool)
GetConstraint retrieves a constraint by name.
func (*UnifiedModel) GetFunction ¶
func (schema *UnifiedModel) GetFunction(name string) (*Function, bool)
GetFunction retrieves a function by name.
func (*UnifiedModel) GetIndex ¶
func (schema *UnifiedModel) GetIndex(name string) (*Index, bool)
GetIndex retrieves an index by name.
func (*UnifiedModel) GetObjectsByType ¶
func (schema *UnifiedModel) GetObjectsByType(objectType ObjectType) map[string]interface{}
GetObjectsByType returns all objects of a specific type.
func (*UnifiedModel) GetTable ¶
func (schema *UnifiedModel) GetTable(name string) (*Table, bool)
GetTable retrieves a table by name.
func (*UnifiedModel) GetView ¶
func (schema *UnifiedModel) GetView(name string) (*View, bool)
GetView retrieves a view by name.
func (*UnifiedModel) HasObject ¶
func (schema *UnifiedModel) HasObject(objectType ObjectType, name string) bool
HasObject checks if an object of a specific type and name exists.
func (*UnifiedModel) RemoveCollection ¶
func (schema *UnifiedModel) RemoveCollection(name string) bool
RemoveCollection removes a collection from the schema.
func (*UnifiedModel) RemoveIndex ¶
func (schema *UnifiedModel) RemoveIndex(name string) bool
RemoveIndex removes an index from the schema.
func (*UnifiedModel) RemoveTable ¶
func (schema *UnifiedModel) RemoveTable(name string) bool
RemoveTable removes a table from the schema.
func (*UnifiedModel) ToProto ¶
func (um *UnifiedModel) ToProto() *pb.UnifiedModel
ToProto is a convenience method that calls ConvertToProto
type UnifiedModelEnrichment ¶
type UnifiedModelEnrichment struct {
// Metadata
SchemaID string `json:"schema_id"` // Links to UnifiedModel instance
EnrichmentVersion string `json:"enrichment_version"` // Version of enrichment algorithms used
GeneratedAt time.Time `json:"generated_at"` // When enrichment was computed
GeneratedBy string `json:"generated_by"` // Service/component that generated enrichment
// Object-level enrichments (keyed by object name)
TableEnrichments map[string]TableEnrichment `json:"table_enrichments"`
ColumnEnrichments map[string]ColumnEnrichment `json:"column_enrichments"` // Key format: "table_name.column_name"
IndexEnrichments map[string]IndexEnrichment `json:"index_enrichments"`
ViewEnrichments map[string]ViewEnrichment `json:"view_enrichments"`
// Graph and document enrichments
NodeEnrichments map[string]NodeEnrichment `json:"node_enrichments"`
RelationshipEnrichments map[string]RelationshipEnrichment `json:"relationship_enrichments"`
CollectionEnrichments map[string]CollectionEnrichment `json:"collection_enrichments"`
DocumentEnrichments map[string]DocumentEnrichment `json:"document_enrichments"`
// Global analysis results
ComplianceSummary ComplianceSummary `json:"compliance_summary"`
RiskAssessment RiskAssessment `json:"risk_assessment"`
Recommendations []Recommendation `json:"recommendations"`
PerformanceHints []PerformanceHint `json:"performance_hints"`
}
UnifiedModelEnrichment contains analysis-derived metadata for a UnifiedModel This structure is separate from the core schema to enable: - Exclusion from structural comparisons - Independent versioning of analysis algorithms - Contextual guidance for schema conversion
func NewUnifiedModelEnrichment ¶
func NewUnifiedModelEnrichment(schemaID string) *UnifiedModelEnrichment
NewUnifiedModelEnrichment creates a new enrichment structure with default values
func (*UnifiedModelEnrichment) AddColumnEnrichment ¶
func (e *UnifiedModelEnrichment) AddColumnEnrichment(tableName, columnName string, enrichment ColumnEnrichment)
AddColumnEnrichment adds enrichment data for a column
func (*UnifiedModelEnrichment) AddTableEnrichment ¶
func (e *UnifiedModelEnrichment) AddTableEnrichment(tableName string, enrichment TableEnrichment)
AddTableEnrichment adds enrichment data for a table
func (*UnifiedModelEnrichment) FilterByCategory ¶
func (e *UnifiedModelEnrichment) FilterByCategory(categories []EnrichmentCategory) *UnifiedModelEnrichment
FilterByCategory returns enrichment data filtered by category
func (*UnifiedModelEnrichment) GetColumnEnrichment ¶
func (e *UnifiedModelEnrichment) GetColumnEnrichment(tableName, columnName string) (ColumnEnrichment, bool)
GetColumnEnrichment retrieves enrichment data for a column
func (*UnifiedModelEnrichment) GetColumnsWithPrivilegedData ¶
func (e *UnifiedModelEnrichment) GetColumnsWithPrivilegedData() []string
GetColumnsWithPrivilegedData returns column keys that contain privileged data
func (*UnifiedModelEnrichment) GetComplianceRequirements ¶
func (e *UnifiedModelEnrichment) GetComplianceRequirements() []ComplianceFramework
GetComplianceRequirements returns all compliance frameworks that apply to this schema
func (*UnifiedModelEnrichment) GetEnrichmentSummary ¶
func (e *UnifiedModelEnrichment) GetEnrichmentSummary() EnrichmentSummary
GetEnrichmentSummary returns a summary of the enrichment data
func (*UnifiedModelEnrichment) GetPrivilegedObjects ¶
func (e *UnifiedModelEnrichment) GetPrivilegedObjects() []RiskObject
GetPrivilegedObjects returns all objects containing privileged data
func (*UnifiedModelEnrichment) GetRecommendationsByPriority ¶
func (e *UnifiedModelEnrichment) GetRecommendationsByPriority(priority ConversionPriority) []Recommendation
GetRecommendationsByPriority returns recommendations filtered by priority
func (*UnifiedModelEnrichment) GetRecommendationsByType ¶
func (e *UnifiedModelEnrichment) GetRecommendationsByType(recommendationType RecommendationType) []Recommendation
GetRecommendationsByType returns recommendations filtered by type
func (*UnifiedModelEnrichment) GetTableEnrichment ¶
func (e *UnifiedModelEnrichment) GetTableEnrichment(tableName string) (TableEnrichment, bool)
GetTableEnrichment retrieves enrichment data for a table
func (*UnifiedModelEnrichment) GetTablesWithPrivilegedData ¶
func (e *UnifiedModelEnrichment) GetTablesWithPrivilegedData() []string
GetTablesWithPrivilegedData returns table names that contain privileged data
func (*UnifiedModelEnrichment) HasPrivilegedData ¶
func (e *UnifiedModelEnrichment) HasPrivilegedData() bool
HasPrivilegedData checks if any object contains privileged data
func (*UnifiedModelEnrichment) MergeEnrichment ¶
func (e *UnifiedModelEnrichment) MergeEnrichment(other *UnifiedModelEnrichment) error
MergeEnrichment merges another enrichment into this one
func (*UnifiedModelEnrichment) ValidateEnrichment ¶
func (e *UnifiedModelEnrichment) ValidateEnrichment() []string
ValidateEnrichment validates the enrichment structure for consistency
type UnifiedModelMetrics ¶
type UnifiedModelMetrics struct {
// Linkage and metadata (follows enrichment pattern)
SchemaID string `json:"schema_id"` // Links to UnifiedModel instance
MetricsVersion string `json:"metrics_version"` // Version of metrics algorithms used
GeneratedAt time.Time `json:"generated_at"` // When metrics were computed
GeneratedBy string `json:"generated_by"` // Service/component that generated metrics
SnapshotID string `json:"snapshot_id,omitempty"` // Optional snapshot identifier for time-series
// Core metrics categories
ObjectCounts ObjectCounts `json:"object_counts"` // Counts of all object types
SizeMetrics SizeMetrics `json:"size_metrics"` // Size information (bytes)
RowMetrics RowMetrics `json:"row_metrics"` // Row/document counts
PerformanceMetrics PerformanceMetrics `json:"performance_metrics"` // Query and operation metrics
TrendMetrics TrendMetrics `json:"trend_metrics"` // Growth and trend analysis
CapacityMetrics CapacityMetrics `json:"capacity_metrics"` // Resource utilization
QualityMetrics QualityMetrics `json:"quality_metrics"` // Data quality indicators
}
UnifiedModelMetrics represents comprehensive metrics and analytics for a UnifiedModel schema. This structure is designed to be completely separate from the structural schema, enabling clean separation between schema definition and metrics/analytics.
func GenerateBasicMetrics ¶
func GenerateBasicMetrics(model *UnifiedModel, schemaID string) *UnifiedModelMetrics
GenerateBasicMetrics generates basic metrics (counts and simple calculations) from a UnifiedModel. This provides the foundation metrics that can be computed directly from the schema structure.
func NewUnifiedModelMetrics ¶
func NewUnifiedModelMetrics(schemaID string) *UnifiedModelMetrics
NewUnifiedModelMetrics creates a new, initialized UnifiedModelMetrics instance.
func (*UnifiedModelMetrics) AddCollectionDocs ¶
func (m *UnifiedModelMetrics) AddCollectionDocs(collectionName string, docCount int64)
AddCollectionDocs adds document count information for a specific collection
func (*UnifiedModelMetrics) AddTableRows ¶
func (m *UnifiedModelMetrics) AddTableRows(tableName string, rowCount int64)
AddTableRows adds row count information for a specific table
func (*UnifiedModelMetrics) AddTableSize ¶
func (m *UnifiedModelMetrics) AddTableSize(tableName string, dataSize, indexSize int64)
AddTableSize adds size information for a specific table
func (*UnifiedModelMetrics) GetMetricsSummary ¶
func (m *UnifiedModelMetrics) GetMetricsSummary() MetricsSummary
GetMetricsSummary provides a high-level overview of the metrics data
func (*UnifiedModelMetrics) MergeMetrics ¶
func (m *UnifiedModelMetrics) MergeMetrics(other *UnifiedModelMetrics) error
MergeMetrics merges another UnifiedModelMetrics into the current one This is useful for combining metrics from different sources or time periods
func (*UnifiedModelMetrics) ValidateMetrics ¶
func (m *UnifiedModelMetrics) ValidateMetrics() []string
ValidateMetrics performs basic validation on the metrics data
type UnifiedModelSampleData ¶
type UnifiedModelSampleData struct {
// Metadata
SchemaID string `json:"schema_id"`
CollectedAt time.Time `json:"collected_at"`
CollectedBy string `json:"collected_by"`
SampleVersion string `json:"sample_version"`
// Configuration
SampleConfig SampleDataConfig `json:"sample_config"`
// Sample data by database paradigm
TableSamples map[string]TableSampleData `json:"table_samples"` // Relational tables
CollectionSamples map[string]CollectionSampleData `json:"collection_samples"` // Document collections
KeyValueSamples map[string]KeyValueSampleData `json:"key_value_samples"` // Key-value pairs
GraphSamples map[string]GraphSampleData `json:"graph_samples"` // Graph nodes/edges
ColumnSamples map[string]ColumnSampleData `json:"column_samples"` // Columnar data
SearchSamples map[string]SearchSampleData `json:"search_samples"` // Search index docs
VectorSamples map[string]VectorSampleData `json:"vector_samples"` // Vector embeddings
TimeSeriesSamples map[string]TimeSeriesSampleData `json:"time_series_samples"` // Time-series data
ObjectSamples map[string]ObjectSampleData `json:"object_samples"` // Object storage
// Cross-paradigm samples
CustomSamples map[string]CustomSampleData `json:"custom_samples,omitempty"` // Database-specific structures
// Privacy and security
ContainsPII bool `json:"contains_pii"`
PiiSummary []string `json:"pii_summary,omitempty"`
RedactionApplied bool `json:"redaction_applied"`
RedactionLevel string `json:"redaction_level,omitempty"`
}
UnifiedModelSampleData represents sample data collected from database tables and collections. This data is used exclusively for privileged data detection and is never persisted. It supports all database paradigms: relational, document, key-value, graph, columnar, etc.
func DeserializeSampleData ¶
func DeserializeSampleData(data []byte) (*UnifiedModelSampleData, error)
DeserializeSampleData parses sample data from JSON
func NewUnifiedModelSampleData ¶
func NewUnifiedModelSampleData(schemaID string) *UnifiedModelSampleData
NewUnifiedModelSampleData creates a new, empty sample data structure
func (*UnifiedModelSampleData) EstimateMemoryUsage ¶
func (s *UnifiedModelSampleData) EstimateMemoryUsage() int64
EstimateMemoryUsage provides a rough estimate of memory usage in bytes
func (*UnifiedModelSampleData) GetTotalSampleCount ¶
func (s *UnifiedModelSampleData) GetTotalSampleCount() int
GetTotalSampleCount returns the total number of sample records across all paradigms
func (*UnifiedModelSampleData) HasSampleData ¶
func (s *UnifiedModelSampleData) HasSampleData() bool
HasSampleData checks if any sample data is present
type UnsupportedFeature ¶
type UnsupportedFeature struct {
FeatureType string `json:"feature_type"`
ObjectType ObjectType `json:"object_type"`
ObjectName string `json:"object_name"`
Description string `json:"description"`
Alternatives []string `json:"alternatives,omitempty"`
WorkaroundURL string `json:"workaround_url,omitempty"`
}
UnsupportedFeature represents a feature that cannot be converted
type UserContextManager ¶
type UserContextManager struct {
}
UserContextManager provides utilities for managing user conversion contexts
func NewUserContextManager ¶
func NewUserContextManager() *UserContextManager
NewUserContextManager creates a new user context manager
func (*UserContextManager) ApplyContextToConversionRequest ¶
func (ucm *UserContextManager) ApplyContextToConversionRequest(request *ConversionRequest, context *UserConversionContext) (*ConversionRequest, []ContextApplicationWarning, error)
ApplyContextToConversionRequest applies user context to a conversion request
func (*UserContextManager) CreateUserContext ¶
func (ucm *UserContextManager) CreateUserContext(userID string, sourceDB, targetDB dbcapabilities.DatabaseType) *UserConversionContext
CreateUserContext creates a new user conversion context
func (*UserContextManager) GenerateContextSummary ¶
func (ucm *UserContextManager) GenerateContextSummary(context *UserConversionContext) string
GenerateContextSummary creates a human-readable summary of the user context
func (*UserContextManager) MergeUserContexts ¶
func (ucm *UserContextManager) MergeUserContexts(contexts ...*UserConversionContext) (*UserConversionContext, error)
MergeUserContexts merges multiple user contexts, with later contexts taking precedence
func (*UserContextManager) ValidateUserContext ¶
func (ucm *UserContextManager) ValidateUserContext(context *UserConversionContext) []ValidationError
ValidateUserContext validates a user context for consistency and completeness
type UserContextTemplate ¶
type UserContextTemplate struct {
Name string `json:"name"`
Description string `json:"description"`
Template *UserConversionContext `json:"template"`
}
UserContextTemplate provides templates for common conversion scenarios
func GetCommonTemplates ¶
func GetCommonTemplates() []UserContextTemplate
GetCommonTemplates returns pre-defined templates for common conversion scenarios
type UserConversionContext ¶
type UserConversionContext struct {
// Metadata
ContextID string `json:"context_id"`
UserID string `json:"user_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Description string `json:"description,omitempty"`
// Conversion scope
SourceDatabase dbcapabilities.DatabaseType `json:"source_database"`
TargetDatabase dbcapabilities.DatabaseType `json:"target_database"`
// User preferences and decisions
GlobalPreferences ConversionPreferences `json:"global_preferences"`
ObjectMappings map[string]UserObjectMapping `json:"object_mappings"`
FieldMappings map[string]UserFieldMapping `json:"field_mappings"`
CustomRules []UserConversionRule `json:"custom_rules"`
IgnoredObjects []string `json:"ignored_objects"`
RequiredValidations []UserValidationRule `json:"required_validations"`
}
UserConversionContext represents user-provided context for schema conversions
type UserConversionRule ¶
type UserConversionRule struct {
RuleID string `json:"rule_id"`
Name string `json:"name"`
Description string `json:"description"`
Conditions []UserRuleCondition `json:"conditions"`
Actions []UserRuleAction `json:"actions"`
Priority int `json:"priority"`
Enabled bool `json:"enabled"`
}
UserConversionRule defines custom conversion logic
type UserDataTypeMapping ¶
type UserDataTypeMapping struct {
SourceType string `json:"source_type"`
TargetType string `json:"target_type"`
Parameters map[string]interface{} `json:"parameters,omitempty"`
LossyConversion bool `json:"lossy_conversion"`
Notes string `json:"notes,omitempty"`
}
UserDataTypeMapping defines how data types should be converted
type UserDecision ¶
type UserDecision struct {
DecisionType DecisionType `json:"decision_type"`
Question string `json:"question"`
Options []string `json:"options"`
DefaultOption string `json:"default_option,omitempty"`
Impact string `json:"impact"`
Recommendation string `json:"recommendation,omitempty"`
}
UserDecision represents a decision that requires user input
type UserDecisionResponse ¶
type UserDecisionResponse struct {
DecisionID string `json:"decision_id"`
SelectedOption string `json:"selected_option"`
CustomParameters map[string]interface{} `json:"custom_parameters,omitempty"`
Reasoning string `json:"reasoning,omitempty"`
ApplyToSimilar bool `json:"apply_to_similar"`
}
UserDecisionResponse represents a user's response to a conversion decision
type UserFieldMapping ¶
type UserFieldMapping struct {
SourceObjectName string `json:"source_object_name"`
SourceFieldName string `json:"source_field_name"`
TargetObjectName string `json:"target_object_name,omitempty"`
TargetFieldName string `json:"target_field_name,omitempty"`
DataTypeMapping UserDataTypeMapping `json:"data_type_mapping"`
TransformRules []UserTransformRule `json:"transform_rules,omitempty"`
ValidationRules []UserValidationRule `json:"validation_rules,omitempty"`
DefaultValue interface{} `json:"default_value,omitempty"`
IsRequired bool `json:"is_required"`
}
UserFieldMapping defines field-level conversion rules
type UserMapping ¶
type UserObjectMapping ¶
type UserObjectMapping struct {
SourceObjectName string `json:"source_object_name"`
SourceObjectType ObjectType `json:"source_object_type"`
TargetObjectName string `json:"target_object_name,omitempty"`
TargetObjectType ObjectType `json:"target_object_type"`
ConversionType ConversionType `json:"conversion_type"`
UserDecisions []UserDecisionResponse `json:"user_decisions,omitempty"`
CustomProperties map[string]interface{} `json:"custom_properties,omitempty"`
Notes string `json:"notes,omitempty"`
}
UserObjectMapping defines how a specific object should be converted
type UserRuleAction ¶
type UserRuleAction struct {
ActionType string `json:"action_type"`
Parameters map[string]interface{} `json:"parameters"`
}
UserRuleAction defines what action to take when rule conditions are met
type UserRuleCondition ¶
type UserRuleCondition struct {
Field string `json:"field"`
Operator string `json:"operator"`
Value interface{} `json:"value"`
}
UserRuleCondition defines when a rule should apply
type UserTransformRule ¶
type UserTransformRule struct {
RuleType TransformRuleType `json:"rule_type"`
Expression string `json:"expression,omitempty"`
Parameters map[string]interface{} `json:"parameters,omitempty"`
Description string `json:"description,omitempty"`
}
UserTransformRule defines data transformation rules
type UserValidationRule ¶
type UserValidationRule struct {
RuleType ValidationRuleType `json:"rule_type"`
Expression string `json:"expression,omitempty"`
Parameters map[string]interface{} `json:"parameters,omitempty"`
ErrorLevel ValidationErrorType `json:"error_level"`
Message string `json:"message"`
Description string `json:"description,omitempty"`
}
UserValidationRule defines validation requirements
type ValidationError ¶
type ValidationError struct {
Type ValidationErrorType `json:"type"`
Field string `json:"field"`
Message string `json:"message"`
Suggestion string `json:"suggestion,omitempty"`
}
ValidationError represents a validation issue found in a schema
func ValidateSampleData ¶
func ValidateSampleData(sampleData *UnifiedModelSampleData) []ValidationError
ValidateSampleData performs validation checks on sample data
func ValidateSchema ¶
func ValidateSchema(schema *UnifiedModel) []ValidationError
ValidateSchema validates a UnifiedModel schema for consistency and completeness. This ensures the schema is valid before storage or comparison.
type ValidationErrorType ¶
type ValidationErrorType string
const ( ValidationErrorCritical ValidationErrorType = "critical" // Prevents schema usage ValidationErrorWarning ValidationErrorType = "warning" // Potentially problematic ValidationErrorInfo ValidationErrorType = "info" // Informational )
type ValidationRuleType ¶
type ValidationRuleType string
const ( ValidationRuleTypeRequired ValidationRuleType = "required" ValidationRuleTypeRange ValidationRuleType = "range" ValidationRuleTypePattern ValidationRuleType = "pattern" ValidationRuleTypeUnique ValidationRuleType = "unique" ValidationRuleTypeReference ValidationRuleType = "reference" ValidationRuleTypeCustom ValidationRuleType = "custom" )
type ValueSampleInfo ¶
type VectorCounts ¶
type VectorIndex ¶
type VectorSample ¶
type VectorSample struct {
ID interface{} `json:"id"`
Vector []float64 `json:"vector,omitempty"` // May be redacted for privacy
Metadata map[string]interface{} `json:"metadata"`
Score *float64 `json:"score,omitempty"`
VectorHash *string `json:"vector_hash,omitempty"` // Hash instead of actual vector
}
type VectorSampleData ¶
type VectorSampleData struct {
CollectionName string `json:"collection_name"`
VectorCount int64 `json:"vector_count"`
SampleCount int `json:"sample_count"`
VectorSamples []VectorSample `json:"vector_samples"`
MetadataSamples map[string]FieldSampleValues `json:"metadata_samples"` // Associated metadata
VectorDimensions int `json:"vector_dimensions"`
CollectedAt time.Time `json:"collected_at"`
Warnings []string `json:"warnings,omitempty"`
}
VectorSampleData represents sample data from vector databases (Milvus, Weaviate, Pinecone)
type VectorSize ¶
type VectorStrategy ¶
type VectorStrategy string
VectorStrategy defines how to create vector representations
const ( VectorStrategyTextEmbedding VectorStrategy = "text_embedding" // Embed text fields VectorStrategyNumericFeatures VectorStrategy = "numeric_features" // Use numeric features VectorStrategyMixedEmbedding VectorStrategy = "mixed_embedding" // Combine text and numeric VectorStrategySemanticContent VectorStrategy = "semantic_content" // Focus on semantic meaning VectorStrategyStructuralFeatures VectorStrategy = "structural_features" // Use document structure )
type VersionNode ¶
type ViewEnrichment ¶
type ViewEnrichment struct {
// Complexity analysis
ComplexityScore float64 `json:"complexity_score"` // 0.0-1.0
QueryDepth int `json:"query_depth"` // Nested query levels
TableDependencies []string `json:"table_dependencies"` // Tables referenced
ViewDependencies []string `json:"view_dependencies"` // Other views referenced
// Performance characteristics
EstimatedRowsReturned *int64 `json:"estimated_rows_returned,omitempty"`
ExecutionCost *float64 `json:"execution_cost,omitempty"`
IsOptimizable bool `json:"is_optimizable"`
// Usage patterns
AccessFrequency *float64 `json:"access_frequency,omitempty"` // Queries per day
IsMaterializable bool `json:"is_materializable"` // Good candidate for materialization
// Context
BusinessPurpose string `json:"business_purpose,omitempty"`
Context map[string]string `json:"context,omitempty"`
}
ViewEnrichment contains analysis metadata for views
type WarningType ¶
type WarningType string
Warning types for conversions
const ( WarningTypeFeatureLoss WarningType = "feature_loss" // Feature not supported in target WarningTypeDataTypeLoss WarningType = "data_type_loss" // Data type conversion may lose data WarningTypePerformance WarningType = "performance" // Performance implications WarningTypeCompliance WarningType = "compliance" // Compliance/security concerns WarningTypeCompatibility WarningType = "compatibility" // Compatibility issues WarningTypeValidation WarningType = "validation" // Validation required )
type WindowFunc ¶
Source Files
¶
- classification.go
- comparison.go
- context.go
- conversion_engine.go
- conversion_matrix.go
- conversion_utils.go
- database_capabilities.go
- database_features.go
- database_metadata.go
- database_metadata_registry.go
- detection_levels.go
- enrichment.go
- enrichment_utils.go
- generator.go
- helpers.go
- metrics.go
- metrics_utils.go
- navigator.go
- paradigm_conversion.go
- protobuf_conversion.go
- sample_data.go
- sample_data_utils.go
- type_conversion.go
- unifiedmodel.go
- user_context.go
- user_context_utils.go