helpers

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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustWhereClause

func AdjustWhereClause(ctx context.Context, dbAlias string, dbType model.DBType, col string, schemaDoc model.Type, find map[string]interface{}) error

AdjustWhereClause adjusts where clause to take care of types

func CrudPostProcess

func CrudPostProcess(ctx context.Context, dbAlias, dbType, col string, schemaDoc model.Type, result interface{}) error

CrudPostProcess unmarshalls the json field in read request

func GetConstraintName

func GetConstraintName(tableName, columnName string) string

GetConstraintName generates constraint name for joint fields

func Parser

func Parser(dbSchemas config.DatabaseSchemas) (model.Type, error)

Parser function parses the schema im module

func SchemaValidator

func SchemaValidator(ctx context.Context, dbAlias, dbType, col string, collectionFields model.Fields, doc map[string]interface{}) (map[string]interface{}, error)

SchemaValidator validates provided doc object against it's schema

func ValidateCreateOperation

func ValidateCreateOperation(ctx context.Context, dbAlias, dbType, col string, schemaDoc model.Type, req *model.CreateRequest) error

ValidateCreateOperation validates req body against provided schema

func ValidateUpdateOperation

func ValidateUpdateOperation(ctx context.Context, dbAlias, dbType, col, op string, updateDoc, find map[string]interface{}, schemaDoc model.Type) error

ValidateUpdateOperation validates the types of schema during a update request

Types

This section is empty.

Jump to

Keyboard shortcuts

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