Documentation ¶
Overview ¶
Package generator acts as a prisma generator
Index ¶
Constants ¶
View Source
const DefaultPackageName = "db"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BinaryPaths ¶
type BinaryPaths struct { // MigrationEngine (optional) MigrationEngine map[string]string `json:"migrationEngine"` // key target, value path // QueryEngine (optional) QueryEngine map[string]string `json:"queryEngine"` // IntrospectionEngine (optional) IntrospectionEngine map[string]string `json:"introspectionEngine"` }
BinaryPaths holds the information of the paths to the Prisma binaries.
type BinaryTarget ¶
type Config ¶
type Config struct { EngineType string `json:"engineType"` Package types.String `json:"package"` DisableGitignore string `json:"disableGitignore"` DisableGoBinaries string `json:"disableGoBinaries"` }
Config describes the options for the Prisma Client Go generator
type ConnectorType ¶
type ConnectorType string
ConnectorType describes the Database of this generator.
const ( ConnectorTypeMySQL ConnectorType = "mysql" ConnectorTypeMongo ConnectorType = "mongo" ConnectorTypeSQLite ConnectorType = "sqlite" ConnectorTypePostgreSQL ConnectorType = "postgresql" )
ConnectorType values
type Datasource ¶
type Datasource struct { Name types.String `json:"name"` ConnectorType ConnectorType `json:"connectorType"` URL EnvValue `json:"url"` Config interface{} `json:"config"` }
Datasource describes a Prisma data source of any database type.
type EnvValue ¶
type EnvValue struct { // FromEnvVar (optional) FromEnvVar string `json:"fromEnvVar"` Value string `json:"value"` }
EnvValue contains a string value and optionally information if, and if yes from where, an env var is used for this value.
type Generator ¶
type Generator struct { // Output holds the file path of where the client gets generated in. Output *Value `json:"output"` Name types.String `json:"name"` Provider *Value `json:"provider"` Config Config `json:"config"` BinaryTargets []BinaryTarget `json:"binaryTargets"` // PinnedBinaryTarget (optional) PinnedBinaryTarget string `json:"pinnedBinaryTarget"` }
Generator describes a generator defined in the Prisma schema.
type Root ¶
type Root struct { Generator Generator `json:"generator"` OtherGenerators []Generator `json:"otherGenerators"` SchemaPath string `json:"schemaPath"` DMMF dmmf.Document `json:"DMMF"` Datasources []Datasource `json:"datasources"` // Datamodel provides the raw string of the Prisma datamodel. Datamodel string `json:"datamodel"` // BinaryPaths (optional) BinaryPaths BinaryPaths `json:"binaryPaths"` AST *transform.AST `json:"ast"` }
Root describes the generator output root.
func (*Root) GetEngineType ¶
Click to show internal directories.
Click to hide internal directories.