interfaces

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bulk

type Bulk interface {
	BulkInsert(tableName string, records []map[string]interface{}) ([]map[string]interface{}, error)
	Upsert(tableName string, data map[string]interface{}, conflictColumns []string, updateColumns []string) (map[string]interface{}, error)
	BulkUpdate(tableName string, updates []map[string]interface{}, whereColumn string) (int64, error)
	BulkDelete(tableName string, ids []interface{}, idColumn string) (int64, error)
}

type Migration

type Migration struct {
	ID         int       `db:"id"`
	Name       string    `db:"name"`
	SQL        string    `db:"sql"`
	ExecutedAt time.Time `db:"executed_at"`
	Checksum   string    `db:"checksum"`
}

type MigrationService

type MigrationService interface {
	InitializeMigrationTable() error
	RunMigration(name, sql string) error
	GetMigrationHistory() ([]Migration, error)
}

type Performance

type Performance interface {
	CreateIndexes(tableName string) error
	OptimizeQuery(query string) ([]string, error)
	GetPerformanceMetrics() (map[string]interface{}, error)
	CreateCustomIndex(tableName, indexName string, columns []string) error
	AnalyzeTablePerformance(tableName string) (map[string]interface{}, error)
}

type RelationshipService

type RelationshipService interface {
	CreateRelationship(req models.CreateRelationshipRequest) (*models.RelationshipDefinition, error)
	DeleteRelationship(relationship *models.RelationshipDefinition, dropConstraints bool, dropJoinTable bool) error
	SetRelationshipData(relationship *models.RelationshipDefinition, req models.RelationshipDataRequest) (*models.RelationshipDataResponse, error)
	AddRelationshipData(relationship *models.RelationshipDefinition, req models.RelationshipDataRequest) (*models.RelationshipDataResponse, error)
	RemoveRelationshipData(relationship *models.RelationshipDefinition, req models.RelationshipDataRequest) (*models.RelationshipDataResponse, error)
}

type Table

type Table interface {
	// Schema introspection
	GetTables(schema string) ([]models.Table, error)

	// Data operations
	GetTableData(tableName string, params models.QueryParams) ([]map[string]interface{}, error)
	CreateRecord(tableName string, data map[string]interface{}) (map[string]interface{}, error)
	UpdateRecord(tableName string, id interface{}, data map[string]interface{}) (map[string]interface{}, error)
	DeleteRecord(tableName string, id interface{}) error

	// DDL operations
	CreateTable(req models.CreateTableRequest) error
	AddColumn(tableName string, req models.AddColumnRequest) error
	AlterTable(tableName string, req models.AlterTableRequest) error

	// Utilities
	BuildComplexQuery(tableName string, filters map[string]interface{}) (models.QueryParams, error)
	CreateSchema(ctx context.Context, schemaName string) error
	DropTable(ctx context.Context, tableName string) error
	CreateView(ctx context.Context, viewName string, viewSQL string) error
	CreateFunction(ctx context.Context, functionName string, functionSQL string) error
	GetByFunction(ctx context.Context, functionName string, args map[string]interface{}) ([]map[string]interface{}, error)
}

Jump to

Keyboard shortcuts

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