Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // List of tables that will be included. Others are ignored Only map[string][]string // List of tables that will be should be ignored. Others are included Except map[string][]string // The name you wish to assign to your generated models package Pkgname string NoFactory bool `yaml:"no_factory"` }
type Datamodel ¶
type Datamodel struct { Models []Model `json:"models"` Enums []struct { Name string `json:"name"` Values []EnumValue `json:"values"` // DBName (optional) DBName string `json:"dBName"` } `json:"enums"` }
func (Datamodel) ModelByName ¶
type Document ¶
type Document struct {
Datamodel Datamodel `json:"datamodel"`
}
Document describes the root of the AST.
type EnumValue ¶
type EnumValue struct { Name string `json:"name"` // DBName (optional) DBName string `json:"dBName"` }
EnumValue contains detailed information about an enum type.
type Field ¶
type Field struct { Kind FieldKind `json:"kind"` Name string `json:"name"` IsRequired bool `json:"isRequired"` IsList bool `json:"isList"` IsUnique bool `json:"isUnique"` IsReadOnly bool `json:"isReadOnly"` IsID bool `json:"isId"` Type string `json:"type"` // DBName (optional) DBName string `json:"dBName"` IsGenerated bool `json:"isGenerated"` IsUpdatedAt bool `json:"isUpdatedAt"` Documentation string `json:"documentation"` // RelationFromFields (optional) RelationFromFields []string `json:"relationFromFields"` // RelationToFields (optional) RelationToFields []string `json:"relationToFields"` // RelationOnDelete (optional) RelationOnDelete string `json:"relationOnDelete"` // RelationName (optional) RelationName string `json:"relationName"` // HasDefaultValue HasDefaultValue bool `json:"hasDefaultValue"` Default fieldDefault `json:"default"` }
Field describes properties of a single model field.
type Model ¶
type Model struct { Name string `json:"name"` IsEmbedded bool `json:"isEmbedded"` DBName string `json:"dbName"` Fields []Field `json:"fields"` UniqueIndexes []UniqueIndex `json:"uniqueIndexes"` PrimaryKey PrimaryKey `json:"primaryKey"` }
Model describes a Prisma type model, which usually maps to a database table or collection.
type PrimaryKey ¶
type UniqueIndex ¶
Click to show internal directories.
Click to hide internal directories.