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(),...Many-to-Many joins results in weird values
Is drizzle fully framework agnostic?
Typing columns based on Table
paginateQuery
function that would let me pass in the table and then an array of only columns from that table would be accepted. Is there any way to do this with the Drizzle types? I feel like I have gotten close a few times but nothing fully gets there. Thanks!
```ts
const getFilterSql = <TColumn extends AnyPgColumn>(
filter: string,...Does onConflictDoUpdate work with composite primary keys?
Support for multiple with statements?
use constant in between operator

Type error: Could not find a declaration file for module 'drizzle-kit'.

Typescript error that doesn't make a whole lot of sense when calling db.select or db.insert

Are default values not transferred over via drizzle-zod?
default([])
in my schema
file that when I create a Zod object, I have to re-do the defaults?Replace on Insert
.ignore()
option added to insert, but is there an equivalent .replace()
or someway to flag it in the code?
I'm doing an insert many by passing through an array of values (e.g. await db.insert(ActivityTable).values(values);
) which is effectively an over write of existing data as well as new data...Is there a way to modify the select() on an existing query ?
const query = db.select().from(myTable)
const query = db.select().from(myTable)
The inferred type of '<tableName>' cannot be named without a reference to '.pnpm/zod@3.21.4
drizzle-zod
but I keep getting this error...
Any idea on where it comes from ?
Thank you !...Migration failure on fresh DB
Using Vercel Postgres and developing locally
drizzle
(and other platform specific stuff like sql
) from drizzle-orm/vercel-postgres
or drizzle-orm/node-postgres
based on NODE_ENV
?
I see the sample Next.js project has been updated for Vercel Postgres: https://github.com/vercel/examples/blob/main/storage/postgres-drizzle/lib/drizzle.ts...Custom Type interpreted as String
Can I use queryBuilder for inserts?
queryBuilder
(https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/pg-core/README.md#query-builder) since I wouldn't need to connect to a DB to generate the SQL queries, but seems like queryBuilder
only supports select()
at the moment. Do I need to connect to a local DB if I want to generate insert()
queries?I ran introspect:pg to initialize my schema, then created a new migration. How should I deploy this?
drizzle.__drizzle_migrations
table. It'd be nice to have a way to know that the old migrations - the ones that were generated by introspect:pg and just reflect the existing state of the database - won't run. Is this the right way to look at it? Thanks!Transaction rollback