ui

package
v1.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadConfig

type LoadConfig struct {
	SourceType string
	FilePath   string
	ConnString string
}

LoadConfig holds the configuration for loading a database

type SaveConfig

type SaveConfig struct {
	TargetType string
	FilePath   string
	ConnString string
}

SaveConfig holds the configuration for saving a database

type SchemaEditor

type SchemaEditor struct {
	// contains filtered or unexported fields
}

SchemaEditor represents the interactive schema editor

func NewSchemaEditor

func NewSchemaEditor(db *models.Database) *SchemaEditor

NewSchemaEditor creates a new schema editor

func NewSchemaEditorWithConfigs

func NewSchemaEditorWithConfigs(db *models.Database, loadConfig *LoadConfig, saveConfig *SaveConfig) *SchemaEditor

NewSchemaEditorWithConfigs creates a new schema editor with load/save configurations

func (*SchemaEditor) CreateColumn

func (se *SchemaEditor) CreateColumn(schemaIndex, tableIndex int, name, dataType string, isPrimaryKey, isNotNull bool) *models.Column

CreateColumn creates a new column and adds it to a table

func (*SchemaEditor) CreateSchema

func (se *SchemaEditor) CreateSchema(name, description string) *models.Schema

CreateSchema creates a new schema and adds it to the database

func (*SchemaEditor) CreateTable

func (se *SchemaEditor) CreateTable(schemaIndex int, name, description string) *models.Table

CreateTable creates a new table and adds it to a schema

func (*SchemaEditor) DeleteColumn

func (se *SchemaEditor) DeleteColumn(schemaIndex, tableIndex int, columnName string) bool

DeleteColumn removes a column from a table

func (*SchemaEditor) DeleteSchema

func (se *SchemaEditor) DeleteSchema(schemaIndex int) bool

DeleteSchema removes a schema from the database

func (*SchemaEditor) DeleteTable

func (se *SchemaEditor) DeleteTable(schemaIndex, tableIndex int) bool

DeleteTable removes a table from a schema

func (*SchemaEditor) GetAllColumns

func (se *SchemaEditor) GetAllColumns(schemaIndex, tableIndex int) map[string]*models.Column

GetAllColumns returns all columns in a table

func (*SchemaEditor) GetAllSchemas

func (se *SchemaEditor) GetAllSchemas() []*models.Schema

GetAllSchemas returns all schemas

func (*SchemaEditor) GetAllTables

func (se *SchemaEditor) GetAllTables() []*models.Table

GetAllTables returns all tables across all schemas

func (*SchemaEditor) GetColumn

func (se *SchemaEditor) GetColumn(schemaIndex, tableIndex int, columnName string) *models.Column

GetColumn returns a column by name

func (*SchemaEditor) GetDatabase

func (se *SchemaEditor) GetDatabase() *models.Database

GetDatabase returns the current database

func (*SchemaEditor) GetSchema

func (se *SchemaEditor) GetSchema(schemaIndex int) *models.Schema

GetSchema returns a schema by index

func (*SchemaEditor) GetTable

func (se *SchemaEditor) GetTable(schemaIndex, tableIndex int) *models.Table

GetTable returns a table by schema and table index

func (*SchemaEditor) GetTablesInSchema

func (se *SchemaEditor) GetTablesInSchema(schemaIndex int) []*models.Table

GetTablesInSchema returns all tables in a specific schema

func (*SchemaEditor) Run

func (se *SchemaEditor) Run() error

Run starts the interactive editor

func (*SchemaEditor) UpdateColumn

func (se *SchemaEditor) UpdateColumn(schemaIndex, tableIndex int, oldName, newName, dataType string, isPrimaryKey, isNotNull bool, defaultValue interface{}, description string) bool

UpdateColumn updates an existing column's properties

func (*SchemaEditor) UpdateSchema

func (se *SchemaEditor) UpdateSchema(schemaIndex int, name, owner, description string)

UpdateSchema updates an existing schema's properties

func (*SchemaEditor) UpdateTable

func (se *SchemaEditor) UpdateTable(schemaIndex, tableIndex int, name, description string)

UpdateTable updates an existing table's properties

Jump to

Keyboard shortcuts

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