Ganbatte
Ganbatte
Explore posts from servers
DTDrizzle Team
Created by Ganbatte on 11/9/2024 in #help
Issues Using RLS with Supabase Through Drizzle
First of all, thanks for your response. Could you please describe exactly what you mean? Sorry, I'm just very new to backend stuff.
4 replies
DTDrizzle Team
Created by Ganbatte on 10/25/2024 in #help
Middleware Issues in Next.js Using Drizzle, Supabase, and NextAuth
Thanks for the suggestion! I’m a bit confused, though since the documentation link you sent seems to focus on Cloudflare workers, which is a bit different from Next.js. Were you suggesting I should configure something in next.config.js? My connection string in the environment variables works fine, and I set up Drizzle according to the documentation on their site (I shared the setups in the screenshots above). Could you help clarify what you think might be causing the issue?
9 replies
DTDrizzle Team
Created by Ganbatte on 10/25/2024 in #help
Middleware Issues in Next.js Using Drizzle, Supabase, and NextAuth
No description
9 replies
DTDrizzle Team
Created by Ganbatte on 10/25/2024 in #help
Middleware Issues in Next.js Using Drizzle, Supabase, and NextAuth
I'm sure that Drizzle is causing the problem because I separated the auth into edge and no edge, and when I remove the database calls, the login works fine. I just don't understand what the issue could be.
9 replies
DTDrizzle Team
Created by Boby on 10/22/2024 in #help
I am getting an error when I defined the db
Maybe try this: import { neon } from '@neondatabase/serverless'; import { drizzle } from 'drizzle-orm/neon-http'; import * as schema from './schema'; const sql = neon(process.env.NEON_DATABASE_URL!); const db = drizzle(sql, { schema }); export default db; It is worked for me.
11 replies
DTDrizzle Team
Created by Ganbatte on 8/14/2024 in #help
Help Needed with Drizzlekit Migration Issue
Here's an image showing how it looked before:https://ibb.co/FYcxSG4 along with a snippet of the schema: //Orders export const orders = pgTable('orders', { id: serial('id').primaryKey(), userID: text('userID') .notNull() .references(() => users.id, { onDelete: 'cascade' }), total: real('total').notNull(), status: text('status').notNull(), receiptURL: text('receiptURL'), paymentIntentID: text('paymentIntentID'), created: timestamp('created').defaultNow().notNull(), }); export const orderProduct = pgTable('orderProduct', { id: serial('id').primaryKey(), quantity: real('quantity').notNull(), variantID: serial('variantID') .notNull() .references(() => productVariants.id, { onDelete: 'cascade' }), productID: serial('productID') .notNull() .references(() => products.id, { onDelete: 'cascade' }), orderID: serial('orderID') .notNull() .references(() => orders.id, { onDelete: 'cascade' }), // created: timestamp('created').defaultNow().notNull(), }); //Orders relations export const orderRelations = relations(orders, ({ one, many }) => ({ user: one(users, { fields: [orders.userID], references: [users.id], relationName: 'orders', }), orderProducts: many(orderProduct, { relationName: 'orderProduct', }), })); export const orderProductRelations = relations(orderProduct, ({ one }) => ({ orders: one(orders, { fields: [orderProduct.orderID], references: [orders.id], relationName: 'orderProduct', }), product: one(products, { fields: [orderProduct.productID], references: [products.id], relationName: 'products', }), variant: one(productVariants, { fields: [orderProduct.variantID], references: [productVariants.id], relationName: 'productVariants', }), }));
2 replies
DTDrizzle Team
Created by Ganbatte on 7/17/2024 in #help
How to Reference a Column Type in Drizzle
oh yes, Thank you so much!
4 replies