services

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAggregatesFilter

func ParseAggregatesFilter(value interface{}, params *models.QueryParams) error

func ParseFullTextFilter

func ParseFullTextFilter(value interface{}, params *models.QueryParams) error

func ParseJoinsFilter

func ParseJoinsFilter(value interface{}, params *models.QueryParams) error

func ParseSelectFilter

func ParseSelectFilter(value interface{}, params *models.QueryParams) error

Types

type BulkService

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

func (*BulkService) BulkDelete

func (s *BulkService) BulkDelete(tableName string, ids []interface{}, idColumn string) (int64, error)

BulkDelete deletes multiple records using the repository

func (*BulkService) BulkInsert

func (s *BulkService) BulkInsert(tableName string, records []map[string]interface{}) ([]map[string]interface{}, error)

BulkInsert inserts multiple records using the repository

func (*BulkService) BulkUpdate

func (s *BulkService) BulkUpdate(tableName string, updates []map[string]interface{}, whereColumn string) (int64, error)

BulkUpdate updates multiple records using the repository

func (*BulkService) Upsert

func (s *BulkService) Upsert(tableName string, data map[string]interface{}, conflictColumns []string, updateColumns []string) (map[string]interface{}, error)

Upsert performs insert or update based on conflict using the repository

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 struct {
	// contains filtered or unexported fields
}

func (*MigrationService) GetMigrationHistory

func (s *MigrationService) GetMigrationHistory() ([]servicesInterface.Migration, error)

func (*MigrationService) InitializeMigrationTable

func (s *MigrationService) InitializeMigrationTable() error

func (*MigrationService) RunMigration

func (s *MigrationService) RunMigration(name, sql string) error

type PerformanceService

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

func (*PerformanceService) AnalyzeTablePerformance

func (s *PerformanceService) AnalyzeTablePerformance(tableName string) (map[string]interface{}, error)

AnalyzeTablePerformance analyzes performance of a specific table

func (*PerformanceService) CreateCustomIndex

func (s *PerformanceService) CreateCustomIndex(tableName, indexName string, columns []string) error

CreateCustomIndex creates a custom index on specified columns

func (*PerformanceService) CreateIndexes

func (s *PerformanceService) CreateIndexes(tableName string) error

CreateIndexes automatically creates indexes for frequently queried columns

func (*PerformanceService) GetPerformanceMetrics

func (s *PerformanceService) GetPerformanceMetrics() (map[string]interface{}, error)

GetPerformanceMetrics returns database performance metrics

func (*PerformanceService) IsCommonFilterColumn

func (s *PerformanceService) IsCommonFilterColumn(columnName string) bool

func (*PerformanceService) IsForeignKeyColumn

func (s *PerformanceService) IsForeignKeyColumn(columnName string, foreignKeys []models.ForeignKey) bool

func (*PerformanceService) OptimizeQuery

func (s *PerformanceService) OptimizeQuery(query string) ([]string, error)

OptimizeQuery provides query optimization suggestions

type RelationshipService

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

func (*RelationshipService) AddRelationshipData

func (*RelationshipService) CreateRelationship

func (*RelationshipService) DeleteRelationship

func (s *RelationshipService) DeleteRelationship(relationship *models.RelationshipDefinition, dropConstraints bool, dropJoinTable bool) error

func (*RelationshipService) RemoveRelationshipData

func (*RelationshipService) SetRelationshipData

type TableService

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

func (*TableService) AddColumn

func (s *TableService) AddColumn(tableName string, req models.AddColumnRequest) error

func (*TableService) AlterTable

func (s *TableService) AlterTable(tableName string, req models.AlterTableRequest) error

func (*TableService) BuildComplexQuery

func (s *TableService) BuildComplexQuery(tableName string, filters map[string]interface{}) (models.QueryParams, error)

Query building helpers

func (*TableService) CreateFunction

func (s *TableService) CreateFunction(ctx context.Context, functionName string, functionSQL string) error

func (*TableService) CreateRecord

func (s *TableService) CreateRecord(tableName string, data map[string]interface{}) (map[string]interface{}, error)

func (*TableService) CreateSchema

func (s *TableService) CreateSchema(ctx context.Context, schemaName string) error

func (*TableService) CreateTable

func (s *TableService) CreateTable(req models.CreateTableRequest) error

DDL operations

func (*TableService) CreateView

func (s *TableService) CreateView(ctx context.Context, viewName string, viewSQL string) error

func (*TableService) DeleteRecord

func (s *TableService) DeleteRecord(tableName string, id interface{}) error

func (*TableService) DropTable

func (s *TableService) DropTable(ctx context.Context, tableName string) error

func (*TableService) GetByFunction

func (s *TableService) GetByFunction(ctx context.Context, functionName string, args map[string]interface{}) ([]map[string]interface{}, error)

func (*TableService) GetTableData

func (s *TableService) GetTableData(tableName string, params models.QueryParams) ([]map[string]interface{}, error)

Data operations with advanced features

func (*TableService) GetTables

func (s *TableService) GetTables(schema string) ([]models.Table, error)

Schema introspection

func (*TableService) UpdateRecord

func (s *TableService) UpdateRecord(tableName string, id interface{}, data map[string]interface{}) (map[string]interface{}, error)

func (*TableService) ValidateAlterTableRequest

func (s *TableService) ValidateAlterTableRequest(req models.AlterTableRequest) error

func (*TableService) ValidateCreateTableRequest

func (s *TableService) ValidateCreateTableRequest(req models.CreateTableRequest) error

Validation helpers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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