schema

package
v0.0.0-...-260b785 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schema

type Schema struct {
	SchemaDoc model.Type
	// contains filtered or unexported fields
}

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) GetSchema

func (s *Schema) GetSchema(dbAlias, col string) (model.Fields, bool)

GetSchema function gets schema

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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