Documentation ¶
Index ¶
- type Schema
- func (s *Schema) CheckIfEventingIsPossible(dbAlias, col string, obj map[string]interface{}, isFind bool) (findForUpdate map[string]interface{}, present bool)
- func (s *Schema) GetCollectionSchema(ctx context.Context, project, dbAlias string) (map[string]*config.TableRule, error)
- func (s *Schema) GetSchema(dbAlias, col string) (model.Fields, bool)
- func (s *Schema) GetSchemaForDB(ctx context.Context, dbAlias, col, format string) ([]interface{}, error)
- func (s *Schema) Inspector(ctx context.Context, dbAlias, dbType, project, col string, ...) (model.Collection, error)
- func (s *Schema) SchemaCreation(ctx context.Context, dbAlias, tableName, logicalDBName string, ...) error
- func (s *Schema) SchemaInspection(ctx context.Context, dbAlias, project, col string, realSchema model.Collection) (string, error)
- func (s *Schema) SchemaModifyAll(ctx context.Context, dbAlias, logicalDBName string, ...) error
- func (s *Schema) SetDatabaseSchema(c config.DatabaseSchemas, project string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schema ¶
Schema data stucture for schema package
func Init ¶
func Init(clusterID string, crud model.CrudSchemaInterface) *Schema
Init creates a new instance of the schema object
func (*Schema) CheckIfEventingIsPossible ¶
func (s *Schema) CheckIfEventingIsPossible(dbAlias, col string, obj map[string]interface{}, isFind bool) (findForUpdate map[string]interface{}, present bool)
CheckIfEventingIsPossible checks if eventing is possible
func (*Schema) GetCollectionSchema ¶
func (s *Schema) GetCollectionSchema(ctx context.Context, project, dbAlias string) (map[string]*config.TableRule, error)
GetCollectionSchema returns schemas of collection aka tables for specified project & database
func (*Schema) GetSchemaForDB ¶
func (s *Schema) GetSchemaForDB(ctx context.Context, dbAlias, col, format string) ([]interface{}, error)
GetSchemaForDB gets schema of specified database & collection If * is provided for database or collection. It will get all the databases and collection
func (*Schema) Inspector ¶
func (s *Schema) Inspector(ctx context.Context, dbAlias, dbType, project, col string, realSchema model.Collection) (model.Collection, error)
Inspector generates schema
func (*Schema) SchemaCreation ¶
func (s *Schema) SchemaCreation(ctx context.Context, dbAlias, tableName, logicalDBName string, parsedSchema model.Type) error
SchemaCreation creates or alters tables of sql
func (*Schema) SchemaInspection ¶
func (s *Schema) SchemaInspection(ctx context.Context, dbAlias, project, col string, realSchema model.Collection) (string, error)
SchemaInspection returns the schema in schema definition language (SDL)
func (*Schema) SchemaModifyAll ¶
func (s *Schema) SchemaModifyAll(ctx context.Context, dbAlias, logicalDBName string, dbSchemas config.DatabaseSchemas) error
SchemaModifyAll modifies all the tables provided
func (*Schema) SetDatabaseSchema ¶
func (s *Schema) SetDatabaseSchema(c config.DatabaseSchemas, project string) error
SetDatabaseSchema modifies the tables according to the schema on save