Kyrre Gjerstad
Explore posts from serversDTDrizzle Team
•Created by Kyrre Gjerstad on 12/31/2024 in #help
Which db provider for Edge connection with transactions
Hi! I'm trying to figure out which postgres client to use for edge compatibility in my Next.js app. I'm currently running on Vercel Node runtime, but working on migrating my app over to the edge runtime. I'm currently using supabase (as vanilla postgres), but I'm having issues getting the serverless edge compatible connection to work. I looked at neon, but looks like the serverless driver does not support transactions. I need support for transactions since I'm using them extensively with Drizzle.
Current setup:
- Next.js app using edge runtime
- Drizzle ORM with postgres-js
- Running Postgres locally in Docker
- Using transactions for data consistency
I'd appreciate any guidance on which client would be the best fit for edge compatibility while maintaining transaction support. Has anyone successfully migrated a similar setup to edge runtime?
Thanks!
2 replies
TTCTheo's Typesafe Cult
•Created by Kyrre Gjerstad on 10/6/2024 in #questions
Monorepo module resolution issue
Hi everyone,
I'm facing an issue with a Next.js application in a pnpm monorepo workspace and would appreciate any help. It's probably just some config issue from my side, but I've been pulling my hair out over this the last few days!
I have a monorepo using pnpm with two packages:
I can successfully import and use code from the api package in the next package as long as the api package does not use TypeScript path aliases.
When I enable path aliases in the api package's tsconfig.json, the Next.js build and dev server process fails. TypeScript and ESLint in the next package recognize the imports and types without issues, but the Next.js build throws module resolution errors related to the path aliases used in the api package.
I want to be able to:
- Use path aliases in every package for cleaner imports.
- Import the api package into the next package without having to build the api package separately.
- Let Next.js handle the build process, including resolving the path aliases used in the api package.
I've created a minimal repo to reproduce the issue. Any help would be greatly appreciated!
https://github.com/kyrregjerstad/next-monorepo
2 replies
DTDrizzle Team
•Created by Kyrre Gjerstad on 3/22/2024 in #help
mysql2 driver in edge middleware
Hi all,
is it possible to use the mysql2 driver in NextJs edge middleware?
I was previously running
import { drizzle } from 'drizzle-orm/planetscale-serverless';
which worked great, but i'm now migrating away from planetscale. The problem i'm facing is that when i switch to import { drizzle } from 'drizzle-orm/mysql2';
i get the following error in NextJs:
edgeFunction is not a function
which suggest that something is relying on a node api somewhere.
I'm currently running my db on AWS RDS. Any suggestions how to deal with this?
Thanks!6 replies
DTDrizzle Team
•Created by Kyrre Gjerstad on 1/29/2024 in #help
Cannot drop index 'PRIMARY' - planetscale
when I try to push to planetscale I get the error:
In order to successfully push I need to drop all the tables before pushing. I'm using the
Foreign key constraints
Beta at planetscale. When running push with the verbose flag, i see the following:
I'm running drizzle-kit": 0.20.13
.
my tables:
4 replies