DT
Drizzle TeamLiam
How to apply migrations on postgres in a serverless enviroment?
Hello,
I want to apply postgres migrations to my vercel DB. I see that the push command does not work for postgres and am therefore attempting to use the migrate function like so:
However this does not seem like the best way to do this as that would make it so migrations are applied only one I am attempting to make a call instead of at something like build time as far as I can tell. Additionally, it is additional imports that will have to be loaded in the serverless and/or edge environment. Is there a better way to do this?
NinjaBunny•322d ago
you have to migrate the schema to the database
NinjaBunny•322d ago
NinjaBunny•322d ago
or if you're using pg you would swap out the conection
connection
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
7.4KMembers
View on DiscordWant results from more Discord servers?
More PostsError when trying to generate a migration schemaanyone any ideas to what the problem is? It was working fine yesterday and now it throws an error whModelling self relationsI have a table `categories` with a parent fields:
```
{
id: text("id").notNull().primaryKey(),
.Issue running migrations to DBI am having an issue running migrations to Neon. I checked that everything is exporting const variabIt is possible to have prepared statements inside transactions?Is there a way to insert prepared queries inside a transaction ?type config findMany or findFirstHi,
I've one question i don't find the way to type correctly findMany()
Like:
export async functionAny idea on how to pass a pool from postgres-pool to drizzle?Passing a single client works, but for better connection management it would help to be able to passHow to get another linked tables count?I am new to Drizzle ORM and I wanted to get another tables data in my api.
This is my api
```ts
impI created a next auth adapter for postgres-jsThe open PR was not working for me so I created a new adapter. I added it to a starter project so pe.prepare() in Next.js App RouterHello! I'm trying to use PostgresQL prepared statement in the Next.js App Router and I have been getDeleting records w/ sqlite-core.Hello all, hoping to find some clarity/direction. So I'm trying to delete a record using;
```ts
expCan't figure out how to design relational queryI have three tables
- categories
- products
- media
I want to retrieve products that belong to a padrizzle-zod@0.4.4 with drizzle-orm@0.26.5added drizzle-zod to my project and I am getting this error when starting the dev server
- error ./