Documentation
¶
Index ¶
- func NewBulkService(repo interfaces.DatabaseRepo) servicesInterface.Bulk
- func NewMigrationService(repo interfaces.DatabaseRepo) servicesInterface.MigrationService
- func NewPerformanceService(repo interfaces.DatabaseRepo) servicesInterface.Performance
- func NewRelationshipService(repo interfaces.DatabaseRepo) servicesInterface.RelationshipService
- func NewTableService(repo interfaces.DatabaseRepo) servicesInterface.Table
- func ParseAggregatesFilter(value interface{}, params *models.QueryParams) error
- func ParseFullTextFilter(value interface{}, params *models.QueryParams) error
- func ParseJoinsFilter(value interface{}, params *models.QueryParams) error
- func ParseSelectFilter(value interface{}, params *models.QueryParams) error
- type BulkService
- func (s *BulkService) BulkDelete(tableName string, ids []interface{}, idColumn string) (int64, error)
- func (s *BulkService) BulkInsert(tableName string, records []map[string]interface{}) ([]map[string]interface{}, error)
- func (s *BulkService) BulkUpdate(tableName string, updates []map[string]interface{}, whereColumn string) (int64, error)
- func (s *BulkService) Upsert(tableName string, data map[string]interface{}, conflictColumns []string, ...) (map[string]interface{}, error)
- type Migration
- type MigrationService
- type PerformanceService
- func (s *PerformanceService) AnalyzeTablePerformance(tableName string) (map[string]interface{}, error)
- func (s *PerformanceService) CreateCustomIndex(tableName, indexName string, columns []string) error
- func (s *PerformanceService) CreateIndexes(tableName string) error
- func (s *PerformanceService) GetPerformanceMetrics() (map[string]interface{}, error)
- func (s *PerformanceService) IsCommonFilterColumn(columnName string) bool
- func (s *PerformanceService) IsForeignKeyColumn(columnName string, foreignKeys []models.ForeignKey) bool
- func (s *PerformanceService) OptimizeQuery(query string) ([]string, error)
- type RelationshipService
- func (s *RelationshipService) AddRelationshipData(relationship *models.RelationshipDefinition, ...) (*models.RelationshipDataResponse, error)
- func (s *RelationshipService) CreateRelationship(req models.CreateRelationshipRequest) (*models.RelationshipDefinition, error)
- func (s *RelationshipService) DeleteRelationship(relationship *models.RelationshipDefinition, dropConstraints bool, ...) error
- func (s *RelationshipService) RemoveRelationshipData(relationship *models.RelationshipDefinition, ...) (*models.RelationshipDataResponse, error)
- func (s *RelationshipService) SetRelationshipData(relationship *models.RelationshipDefinition, ...) (*models.RelationshipDataResponse, error)
- type TableService
- func (s *TableService) AddColumn(tableName string, req models.AddColumnRequest) error
- func (s *TableService) AlterTable(tableName string, req models.AlterTableRequest) error
- func (s *TableService) BuildComplexQuery(tableName string, filters map[string]interface{}) (models.QueryParams, error)
- func (s *TableService) CreateFunction(ctx context.Context, functionName string, functionSQL string) error
- func (s *TableService) CreateRecord(tableName string, data map[string]interface{}) (map[string]interface{}, error)
- func (s *TableService) CreateSchema(ctx context.Context, schemaName string) error
- func (s *TableService) CreateTable(req models.CreateTableRequest) error
- func (s *TableService) CreateView(ctx context.Context, viewName string, viewSQL string) error
- func (s *TableService) DeleteRecord(tableName string, id interface{}) error
- func (s *TableService) DropTable(ctx context.Context, tableName string) error
- func (s *TableService) GetByFunction(ctx context.Context, functionName string, args map[string]interface{}) ([]map[string]interface{}, error)
- func (s *TableService) GetTableData(tableName string, params models.QueryParams) ([]map[string]interface{}, error)
- func (s *TableService) GetTables(schema string) ([]models.Table, error)
- func (s *TableService) UpdateRecord(tableName string, id interface{}, data map[string]interface{}) (map[string]interface{}, error)
- func (s *TableService) ValidateAlterTableRequest(req models.AlterTableRequest) error
- func (s *TableService) ValidateCreateTableRequest(req models.CreateTableRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBulkService ¶
func NewBulkService(repo interfaces.DatabaseRepo) servicesInterface.Bulk
func NewMigrationService ¶
func NewMigrationService(repo interfaces.DatabaseRepo) servicesInterface.MigrationService
func NewPerformanceService ¶
func NewPerformanceService(repo interfaces.DatabaseRepo) servicesInterface.Performance
func NewRelationshipService ¶
func NewRelationshipService(repo interfaces.DatabaseRepo) servicesInterface.RelationshipService
func NewTableService ¶
func NewTableService(repo interfaces.DatabaseRepo) servicesInterface.Table
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
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 (s *RelationshipService) AddRelationshipData(relationship *models.RelationshipDefinition, req models.RelationshipDataRequest) (*models.RelationshipDataResponse, error)
func (*RelationshipService) CreateRelationship ¶
func (s *RelationshipService) CreateRelationship(req models.CreateRelationshipRequest) (*models.RelationshipDefinition, error)
func (*RelationshipService) DeleteRelationship ¶
func (s *RelationshipService) DeleteRelationship(relationship *models.RelationshipDefinition, dropConstraints bool, dropJoinTable bool) error
func (*RelationshipService) RemoveRelationshipData ¶
func (s *RelationshipService) RemoveRelationshipData(relationship *models.RelationshipDefinition, req models.RelationshipDataRequest) (*models.RelationshipDataResponse, error)
func (*RelationshipService) SetRelationshipData ¶
func (s *RelationshipService) SetRelationshipData(relationship *models.RelationshipDefinition, req models.RelationshipDataRequest) (*models.RelationshipDataResponse, error)
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 (*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 (*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 (*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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.