writers

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeFilename added in v1.0.7

func SanitizeFilename(name string) string

SanitizeFilename removes quotes, comments, and invalid characters from identifiers to make them safe for use in filenames. This handles: - Double and single quotes: "table_name" or 'table_name' -> table_name - DBML comments: table [note: 'description'] -> table - Invalid filename characters: replaced with underscores

Types

type Writer

type Writer interface {
	// WriteDatabase takes a Database model and writes it to the desired format
	WriteDatabase(db *models.Database) error

	// WriteSchema takes a Schema model and writes it to the desired format
	WriteSchema(schema *models.Schema) error

	// WriteTable takes a Table model and writes it to the desired format
	WriteTable(table *models.Table) error
}

Writer defines the interface for writing database specifications to various output formats at different granularity levels

type WriterOptions

type WriterOptions struct {
	// OutputPath is the path where the output should be written
	OutputPath string

	// PackageName is the Go package name (for code generation)
	PackageName string

	// Additional options can be added here as needed
	Metadata map[string]interface{}
}

WriterOptions contains common options for writers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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