transform

package
v1.0.34 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package transform provides validation and transformation utilities for database models.

Overview

The transform package contains a Transformer type that provides methods for validating and normalizing database schemas. It ensures schema correctness and consistency across different format conversions.

Features

  • Database validation (structure and naming conventions)
  • Schema validation (completeness and integrity)
  • Table validation (column definitions and constraints)
  • Data type normalization

Usage

transformer := transform.NewTransformer()
err := transformer.ValidateDatabase(db)
if err != nil {
    log.Fatal("Invalid database schema:", err)
}

Validation Scope

The transformer validates:

  • Required fields presence
  • Naming convention adherence
  • Data type compatibility
  • Constraint consistency
  • Relationship integrity

Note: Some validation methods are currently stubs and will be implemented as needed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transformer

type Transformer struct{}

Transformer provides utilities for transforming database models

func NewTransformer

func NewTransformer() *Transformer

NewTransformer creates a new Transformer instance

func (*Transformer) NormalizeDatabase

func (t *Transformer) NormalizeDatabase(db *models.Database) (*models.Database, error)

NormalizeDatabase normalizes a database model to a standard format

func (*Transformer) NormalizeSchema

func (t *Transformer) NormalizeSchema(schema *models.Schema) (*models.Schema, error)

NormalizeSchema normalizes a schema model to a standard format

func (*Transformer) NormalizeTable

func (t *Transformer) NormalizeTable(table *models.Table) (*models.Table, error)

NormalizeTable normalizes a table model to a standard format

func (*Transformer) ValidateDatabase

func (t *Transformer) ValidateDatabase(db *models.Database) error

ValidateDatabase validates a database model for correctness

func (*Transformer) ValidateSchema

func (t *Transformer) ValidateSchema(schema *models.Schema) error

ValidateSchema validates a schema model for correctness

func (*Transformer) ValidateTable

func (t *Transformer) ValidateTable(table *models.Table) error

ValidateTable validates a table model for correctness

Jump to

Keyboard shortcuts

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