schema.prisma
generator kysely {
provider = "prisma-kysely"
output = "../../build/prisma/primary"
fileName = "types.ts"
unsupportedFilename = "unsupported-types.ts"
}
model Payment {
id BigInt @id @default(autoincrement())
amount Unsupported("money_with_currency")?
}
types.ts (generated by prisma-kysely)
import UnsupportedTypes from '~/unsupported-types';
export type Payment = {
id: Generated<bigint>;
amount: UnsupportedTypes['money_with_currency'] | null;
}
unsupported-types.ts (defined by us manually)
export type MoneyWithCurrency = {
amount: bigint;
currency: CurrencyCode;
}
export const Unsupported = {
'money_with_currency': MoneyWithCurrency
} as const;
Would this be possible? We're currently stuck with this and realised that Prisma wouldn't support custom type just for Postgres use case. Would be great if we can make this happen. Thanks.
schema.prisma
types.ts (generated by prisma-kysely)
unsupported-types.ts (defined by us manually)
Would this be possible? We're currently stuck with this and realised that Prisma wouldn't support custom type just for Postgres use case. Would be great if we can make this happen. Thanks.