base

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldEdgeInfoEqual added in v0.0.38

func FieldEdgeInfoEqual(existing, edge *FieldEdgeInfo) bool

func GetCamelName

func GetCamelName(s string) string

func GetFKeyName

func GetFKeyName(tableName string, dbColNames ...string) string

generate a name for the foreignkey of the sort contacts_user_id_fkey. It takes the table name, the name of the column that references a foreign column in a foreign table and the fkey keyword to generate this only applies for single column fkeys

func GetNameFromParts

func GetNameFromParts(nameParts []string) string

func GetPrimaryKeyName

func GetPrimaryKeyName(tableName string, dbColNames ...string) string

func GetSnakeCaseName

func GetSnakeCaseName(s string) string

returns name such as tableName or file name

func GetUniqueKeyName

func GetUniqueKeyName(tableName string, dbColNames ...string) string

func PolymorphicOptionsEqual added in v0.0.38

func PolymorphicOptionsEqual(existing, p *PolymorphicOptions) bool

func TranslateIDSuffix added in v0.1.0

func TranslateIDSuffix(fieldName string) (string, bool)

Types

type FieldEdgeInfo

type FieldEdgeInfo struct {
	Schema        string                  `json:"schema,omitempty"`
	InverseEdge   *input.InverseFieldEdge `json:"inverseEdge,omitempty"`
	Polymorphic   *PolymorphicOptions     `json:"polymorphic,omitempty"`
	IndexEdge     *input.IndexEdgeOptions `json:"indexEdge,omitempty"`
	EdgeConstName string                  `json:"edgeConstName,omitempty"`
}

common things needed across edges/fields etc only allowed to import input

func NewFieldEdgeInfo

func NewFieldEdgeInfo(fieldName string, polymorphic *input.PolymorphicOptions, unique bool) (*FieldEdgeInfo, error)

func (*FieldEdgeInfo) EdgeName

func (f *FieldEdgeInfo) EdgeName() string

func (*FieldEdgeInfo) GetEdgeConstName added in v0.1.0

func (f *FieldEdgeInfo) GetEdgeConstName() string

type Language

type Language string
const GoLang Language = "Golang"

GoLang indicates we're generating for golang

const TypeScript Language = "TypeScript"

TypeScript indicates we're generating for TypeScript

type PolymorphicOptions

type PolymorphicOptions struct {
	*input.PolymorphicOptions
	NodeTypeField string `json:"nodeTypeField,omitempty"`
	// is this a unique field vs say an indexed field
	Unique bool `json:"unique,omitempty"`
}

Jump to

Keyboard shortcuts

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