generateschema

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionObjectCall

func ActionObjectCall(a *input.Action) *kv.Object

func ConstraintObjectCall

func ConstraintObjectCall(c *input.Constraint) *kv.Object

func EdgeGroupObjectCall

func EdgeGroupObjectCall(eg *input.AssocEdgeGroup) *kv.Object

func EdgeObjectCall

func EdgeObjectCall(e *input.AssocEdge) *kv.Object

this should be everything we need just need to test it

func FieldObjectCall

func FieldObjectCall(f *input.Field) string

returns "" or {primaryKey: true...}

func GenerateFromInputSchema

func GenerateFromInputSchema(cfg *codegen.Config, s *input.Schema) error

func GenerateSingleSchema

func GenerateSingleSchema(cfg *codegen.Config, data *CodegenData, node string) error

func IndexObjectCall

func IndexObjectCall(i *input.Index) *kv.Object

func ParseAndGenerateSchema

func ParseAndGenerateSchema(cfg *codegen.Config, node string, fields []string) error

TODO test ...

Types

type CodegenData

type CodegenData struct {
	Package         *codegen.ImportPackage
	Node            string
	EnumTable       bool
	TableName       string
	HideFromGraphQL bool
	Fields          []*input.Field
	Edges           []*input.AssocEdge
	Actions         []*input.Action
	EdgeGroups      []*input.AssocEdgeGroup
	Constraints     []*input.Constraint
	Indices         []*input.Index
	DBRows          kv.List
	Class           string
}

func NewCodegenDataFromInputNode

func NewCodegenDataFromInputNode(cfg *codegen.Config, node string, n *input.Node) *CodegenData

func NewEnumCodegenData

func NewEnumCodegenData(cfg *codegen.Config, schema, col string, values []string) *CodegenData

func (*CodegenData) DBRowsCall

func (c *CodegenData) DBRowsCall() string

func (*CodegenData) Schema added in v0.1.0

func (c *CodegenData) Schema() string

Jump to

Keyboard shortcuts

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