Adding `@ignore` removes types (m-n relation) from the Kysely index file.
Description and expected behavior
Adding the @ignore on a particular field should ignore that particular field only. But upon adding this various m-n relation types in the Kysely index file are removed upon running the npx zenstack generate codegen command.
Screenshots
Environment (please complete the following information):
- ZenStack version:
2.9.1 - Prisma version:
6.5.0 - Database type: Postgresql (supabase)
Additional Context Note that only the types are affected. The actual tables are not affected.
Hi @AliNectar , how is Kysely involved here? Are you using a prisma kysely generator?
@ymc9 correct. part of the config:
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions","tracing"]
binaryTargets = ["darwin-arm64", "rhel-openssl-3.0.x", "debian-openssl-1.1.x", "debian-openssl-3.0.x", "darwin", "linux-arm64-openssl-3.0.x"]
}
generator kysely {
provider = "prisma-kysely"
// Optionally provide a destination directory for the generated file
// and a filename of your choice
output = "../kysely"
fileName = "index.ts"
// Optionally generate runtime enums to a separate file
// enumFileName = "enums.ts"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
extensions = [vector, uuid_ossp(map: "uuid-ossp", schema: "extensions")]
}
Have you checked if the generated Prisma schema is correct? The Kysely generator is run by the standard Prisma generate command.
There were no changes in the generated Prisma schema file. (only the expected change of adding @ignore). But note that we use supabase. And supabase implicitly creates tables for many to many relations and so these tables are not present in the schema file itself (.zmodel or prisma file). But the codegen step for Kysely correctly outputs the types for these many to many relations normally.
There were no changes in the generated Prisma schema file. (only the expected change of adding @ignore). But note that we use supabase. And supabase implicitly creates tables for many to many relations and so these tables are not present in the schema file itself (.zmodel or prisma file). But the codegen step for Kysely correctly outputs the types for these many to many relations normally.
If you use supabase as a standard postgres, database schema is managed by Prisma. Prisma has native support for implicit many-to-many relations and it creates the underlying tables for you during migration.
Have you checked if the prisma schema generated by zenstack is correct? If so, have you tried running prisma generate directly and see if it works? @AliNectar