Skip to content

Prisma generate or introspect don't work when nativeTypes preview is enabled #4064

@mydnicq

Description

@mydnicq

Bug description

When you have in your prisma schema enabled nativeTypes preview feature, running prisma generate or prisma introspect throws error:

Error: Schema Parsing P1012

Get config 
error: The preview feature "nativeTypes" is not known. Expected one of: 
  -->  schema.prisma:8
   | 
 7 |   url             = env("DATABASE_URL")
 8 |   previewFeatures = ["nativeTypes"]
   | 

How to reproduce

Have schema like

datasource db {
  provider        = "postgresql"
  url             = env("DATABASE_URL")
  previewFeatures = ["nativeTypes"]
}

model campaign {
  id            Int                    @id @default(autoincrement())
  start_date    DateTime               @db.Date
}

and run

prisma generate

Expected behavior

Client should be generated.

I couldn't find any relevant documentation about nativeTypes feature so it's possible that I made some configuration wrong.

Environment & setup

@prisma/cli          : 2.10.0
@prisma/client       : 2.10.0
Current platform     : darwin
Query Engine         : query-engine af1ae11a423edfb5d24092a85be11fa77c5e499c (at node_modules/@prisma/cli/query-engine-darwin)
Migration Engine     : migration-engine-cli af1ae11a423edfb5d24092a85be11fa77c5e499c (at node_modules/@prisma/cli/migration-engine-darwin)
Introspection Engine : introspection-core af1ae11a423edfb5d24092a85be11fa77c5e499c (at node_modules/@prisma/cli/introspection-engine-darwin)
Format Binary        : prisma-fmt af1ae11a423edfb5d24092a85be11fa77c5e499c (at node_modules/@prisma/cli/prisma-fmt-darwin)
Studio               : 0.304.0

Metadata

Metadata

Assignees

Labels

bug/0-unknownBug is new, does not have information for reproduction or reproduction could not be confirmed.kind/bugA reported bug.topic: native database typestopic: previewFeaturesIssue touches on an preview feature flag

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions