diff --git a/generator/generator.go b/generator/generator.go index 73a55573..66173c50 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -14,11 +14,13 @@ import ( // Root describes the generator output 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"` + Generator Generator `json:"generator"` + OtherGenerators []Generator `json:"otherGenerators"` + SchemaPath string `json:"schemaPath"` + // Version contains the version hash of the Prisma engine + Version string `json:"version"` + DMMF dmmf.Document `json:"DMMF"` + Datasources []Datasource `json:"datasources"` // Datamodel provides the raw string of the Prisma datamodel. Datamodel string `json:"datamodel"` // BinaryPaths (optional) diff --git a/generator/run.go b/generator/run.go index c4541c52..9f1ba347 100644 --- a/generator/run.go +++ b/generator/run.go @@ -40,6 +40,10 @@ func addDefaults(input *Root) { func Run(input *Root) error { addDefaults(input) + if input.Version != binaries.EngineVersion { + fmt.Printf("\nwarning: prisma CLI version mismatch detected. CLI version: %s, internal version: %s (%s); please see https://github.com/steebchen/prisma-client-go/issues/1099 for details\n\n", input.Version, binaries.EngineVersion, binaries.PrismaVersion) + } + if input.Generator.Config.DisableGitignore != "true" && input.Generator.Config.DisableGoBinaries != "true" { logger.Debug.Printf("writing gitignore file") // generate a gitignore into the folder