zenstack
zenstack copied to clipboard
[BUG] zmodel does not support calling @default(dbgenerated()) with no parameters
Description and expected behavior
Description Prisma does not support have first-class support for Postgres generated columns but they still kind of work if you :
- Write the migration yourself
- Declare them in the prisma schema as optional with
@default(dbgenerated())(see the prisma docs)
generatedField String? @default(dbgenerated()) /// note the empty argument
Issue
However, zmodels don't seem to allow calling dbgenerated() without arguments. Running zenstack generate with the previous example will output the following error :
missing argument for parameter "expr"
Expected behavior
zmodels should allow @default(dbgenerated()) and generate the prisma schema accordingly
Environment
- ZenStack version: 2.0.2
- Prisma version: 5.10.2
- Database type: Postgresql