schema

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schema

type Schema struct {
	SchemaDoc schemaType
	// contains filtered or unexported fields
}

Schema data stucture for schema package

func Init

func Init(crud *crud.Module, removeProjectScope bool) *Schema

Init creates a new instance of the schema object

func (*Schema) GetCollectionSchema

func (s *Schema) GetCollectionSchema(ctx context.Context, project, dbType string) (map[string]*config.TableRule, error)

GetCollectionSchema returns schemas of collection aka tables for specified project & database

func (*Schema) Inspector

func (s *Schema) Inspector(ctx context.Context, dbType, project, col string) (schemaCollection, error)

Inspector does something

func (*Schema) SchemaCreation

func (s *Schema) SchemaCreation(ctx context.Context, dbType, col, project string, parsedSchema schemaType) error

SchemaCreation creates or alters tables of sql

func (*Schema) SchemaInspection

func (s *Schema) SchemaInspection(ctx context.Context, dbType, project, col string) (string, error)

SchemaInspection resturn schema in schema definition language (SDL)

func (*Schema) SchemaModifyAll

func (s *Schema) SchemaModifyAll(ctx context.Context, dbType, project string, tables map[string]*config.TableRule) error

SchemaModifyAll modifies all the tables provided

func (*Schema) SetConfig

func (s *Schema) SetConfig(conf config.Crud, project string) error

SetConfig modifies the tables according to the schema on save

func (*Schema) ValidateCreateOperation

func (s *Schema) ValidateCreateOperation(dbType, col string, req *model.CreateRequest) error

ValidateCreateOperation validates schema on create operation

func (*Schema) ValidateUpdateOperation

func (s *Schema) ValidateUpdateOperation(dbType, col string, updateDoc map[string]interface{}) error

ValidateUpdateOperation validates the types of schema during a update request

Jump to

Keyboard shortcuts

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