Proper query results inference
Drizzle with Next 13.4.2 & Vercel Postgres Timeout
I think I don't really understand migrations local sqlite.
DB_URL=file:dev.db
) in a nextjs & trpc setup. I'm trying drizzle for the first time & I did follow the steps mentioned https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/sqlite-core/README.md#-quick-start. I ran npx drizzle-kit generate:sqlite
& it succesfully generated a migration. Good Job Drizzle!
The problem is how do I push these migrations to my dev.db
file? Do I need to push them manually? Am I missing something?
I was planning to later use Turso & switch to it but even in the case of turso, I think I would have to manually write each migration in the db shell. Drizzle Kit does not have a push command for sqlite. I'm using drizzle-kit: v0.17.6 drizzle-orm: v0.25.4
. Any help is appreciated as I'm tired reading docs & searching for similar issues here....Connecting to Vercel Postgres
insertID not returned correctly when using custom UUID
``export const users = mysqlTable("users", {
id: varchar("id", { length: 36 })
.primaryKey()
.default(sql
(uuid())`)
.notNull(),...weird ilike postgres behavior
Cannot make a .all() query on an empty table (Bun SQLITE)
TypeError: null is not an object (evaluating 'this.values(s).map')
Self referencing nullable ID field not assigneable in a `eq` statement
Custom `Select` object returns type `any`
select
clause.
The data structure returned is correct but there is a typescript error casting it to any. Is there a way to fix this or am I misusing select?
```ts...schema generates wrong index
MySQL (Planetscale): Cannot read properties of undefined (reading 'name')
Deploying Next.js w/ Drizzle on Vercel with Turborepo
drizzle-orm
as a shared package.
A bit of context - I'm using a monorepo with drizzle and share the tables, types and schemas across all my apps by having a shared packages/database
library - that my Next.js app is consuming.
One issue I've had is that in order to get drizzle-orm
working in my monorepo I've had to install it globally ie. in my root level package.json
. ...uuid missing in drizzle-orm/mysql-core?
DatabaseError: Duplicate column name 'id'
numeric returns string when querying with Postgres
Need help transform a nested prisma query to drizzle
Type error for eq()
Expected 1 arguments, but got 2.
in a statement like this: .where(and(eq(menu.id, form.data.id)), eq(menu.userId, session.userId));
.where(and(eq(menu.id, form.data.id)), eq(menu.userId, session.userId));
InArray Function not Working
Raw sql nullable types, sql<Type | undefined>
const result = await db.select({
customField: sql<Type | null>`...`
const result = await db.select({
customField: sql<Type | null>`...`
Using with NestJS and Zod
drizzle-zod
and nestjs-zod
together to create Zod schemas and classes for insert and select. I mostly got it to work, even with Swagger! However, I'm running into a problem with one of the create schemas. My table is defined:
```ts
export const addresses = pgTable('addresses', {
id: uuid('id').defaultRandom().primaryKey(),...