Fail first deployment with typesafe raw query

The prisma generate --sql needs the queried tables/models to exist in the database. So if it's the first time you deploy, this build command will fail. prisma generate --sql --no-engine && prisma migrate deploy && next build But without --sql it will also fail. So first you'll have to remove the --sql and deploy. It will fail, but at least it generates the db structure. Then you'll have to add --sql back and deploy again. Then it will be ok. I've learned this the hard way. So the question is how to deploy the first time without failure?
1 Reply
RaphaelEtim
RaphaelEtim4w ago
Hi @Anh Nguyen This is a known issue and we do have an open feature request to address this limitation. You may also want to take a look at this hacky workaround commented here
GitHub
Remove requirement for a running database when using TypedSQL · Iss...
Problem When using the new TypedSQL functionality of Prisma ORM, you need to have a running database. This is because the functionality relies on the database to parse the SQL and return type infor...
GitHub
Preview feature feedback: typedSql · prisma prisma · Discussion #...
TypedSQL is a new feature of Prisma ORM which lets you write your raw SQL queries in a fully type-safe manner. Documentation: https://www.prisma.io/docs/orm/prisma-client/using-raw-sql/typedsql Ann...
Want results from more Discord servers?
Add your server