Typescript Error

Anyone know why this is happening? I upgraded my drizzle version so maybe something changed?
No description
6 Replies
Headless
Headless2d ago
Any ideas? Was the type changed in newer versions? ;c
Sillvva
Sillvva2d ago
Looks like MySqlRawQueryResult is a tuple. The first element response[0] is of type ResultSetHeader which has the affectedRows property. Try response?.[0]?.affectedRows
Headless
Headless2d ago
This worked thank you, where did you find the type? I could not find it in docs anywhere
Sillvva
Sillvva2d ago
It's not in the docs as far as I can tell. I searched for MySqlRawQueryResult in the source code
Sillvva
Sillvva2d ago
If you import the type like this
import type { MySqlRawQueryResult } from "drizzle-orm/mysql2";
import type { MySqlRawQueryResult } from "drizzle-orm/mysql2";
In VS Code, you can right click and go to type definition.
No description
Sillvva
Sillvva2d ago
That shows a type like:
export type MySqlRawQueryResult = [ResultSetHeader, FieldPacket[]];
export type MySqlRawQueryResult = [ResultSetHeader, FieldPacket[]];
And you can keep following the type definitions
Want results from more Discord servers?
Add your server
More Posts
Warning: You need to pass an instance of Client:ClientCould someone explain / show me what changes I need to apply to the config file? Thanks in advance! Prepared insert statement with customTypeWhen using prepared insert statement with customType the `Placeholder` object gets passed to the `toDrizzle ORM + Supabase Enforce SSLI'm trying to connect with a direct pool connection (transaction mode). I'm deploying to Supabase DeCan't infer relationship one-to-oneI'm trying to follow the relationship docs to set a relationship between a user and a role, but I'm Cannot set null value to FK - null value in column "X" of relation "Y" violates not-null constraintHi everyone, I'm trying to create a userId column, fk to users.id but optional (so I don't set the nDrizzle complains when I'm trying to insert into a table.I have a schema that looks like this: ```ts export const Organization = pGtable( "Organization",Is it possible to use the Query API to select many-to-many relations?In prisma I can do this to select the entities from the "other side" of a many-to-many join: ```jsonHow can I configure `drizzle-kit introspect` to generate a schema with a schema?I'm using [this](https://orm.drizzle.team/learn/migrate/migrate-from-prisma) guide to migrate from PCan't Push Schema to AWS Aurora - Is My Config Correct?Hi guys! I'm moving from Vercel Postgres to AWS Aurora and I'm just trying to `npx drizzle-kit pusNo matter what I try, npm run migrate defaults to my .env file. Npm run generate works just fine.Hey, I am trying to set dynamic variable paths. When I run npm run migrate, it always defaults to my