We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Below is my attempt of using this extension with trpc, is there anything that stops it from working with trpc?
import { PrismaClient } from "@prisma/client"; import { env } from "~/env.mjs"; import { supabaseRowLevelSecurity } from "~/supabase/useSupabaseRowLevelSecurity"; const globalForPrisma = globalThis as unknown as { prisma: PrismaClient | undefined; }; // current method /* export const prisma = globalForPrisma.prisma ?? new PrismaClient({ log: env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"], }); */ // new method export const prisma = globalForPrisma.prisma ?? new PrismaClient({ log: env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"], datasources: { db: { url: env.DATABASE_URL } }, }).$extends(supabaseRowLevelSecurity()); if (env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
We have an error on this line
if (env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
Type 'PrismaClient<PrismaClientOptions, never, DefaultArgs> | DynamicClientExtensionThis<TypeMap<InternalArgs & { result: {}; model: {}; query: {}; client: {}; }, PrismaClientOptions>, TypeMapCb, { ...; }, {}>' is not assignable to type 'PrismaClient<PrismaClientOptions, never, DefaultArgs> | undefined'. Type 'DynamicClientExtensionThis<TypeMap<InternalArgs & { result: {}; model: {}; query: {}; client: {}; }, PrismaClientOptions>, TypeMapCb, { result: {}; model: {}; query: {}; client: {}; }, {}>' is not assignable to type 'PrismaClient<PrismaClientOptions, never, DefaultArgs> | undefined'. Type 'DynamicClientExtensionThis<TypeMap<InternalArgs & { result: {}; model: {}; query: {}; client: {}; }, PrismaClientOptions>, TypeMapCb, { result: {}; model: {}; query: {}; client: {}; }, {}>' is missing the following properties from type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>': $on, $usets(2322)
I renamed useSupabaseRowLevelSecurity to supabaseRowLevelSecurity.
Can this extension still work with trpc?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Below is my attempt of using this extension with trpc, is there anything that stops it from working with trpc?
We have an error on this line
if (env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
I renamed useSupabaseRowLevelSecurity to supabaseRowLevelSecurity.
Can this extension still work with trpc?
The text was updated successfully, but these errors were encountered: