© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
3 replies
rdobovic

DrizzleORM with JSDoc (insert problem)

Hi, I am trying to use drizzle with jsdoc in my project. I created the schema and everything works when I run it but for some reason jsdoc in VSCode is complaining when I try to insert anything besides the fields that must be specified like primary keys and fields with
.notNull().unique()
.notNull().unique()
. Any ideas why this might happen?

Here is a part of my schema:
// @ts-check

const guilds = mysqlTable('guilds', {
    id: varchar('guild_id', { length: 20 }).primaryKey(),
    whitelisted: boolean('whitelisted').notNull().default(false),
    verifiedRoleId: varchar('verified_role_id', { length: 20 }),
    unverifiedRoleId: varchar('unverified_role_id', { length: 20 }),
});
exports.guilds = guilds;

/**
 * @typedef {typeof guilds.$inferSelect} GuildRecord
 */
// @ts-check

const guilds = mysqlTable('guilds', {
    id: varchar('guild_id', { length: 20 }).primaryKey(),
    whitelisted: boolean('whitelisted').notNull().default(false),
    verifiedRoleId: varchar('verified_role_id', { length: 20 }),
    unverifiedRoleId: varchar('unverified_role_id', { length: 20 }),
});
exports.guilds = guilds;

/**
 * @typedef {typeof guilds.$inferSelect} GuildRecord
 */

And if I try to do something like:
// @ts-check

const mysql = require('mysql2');
const { drizzle } = require('drizzle-orm/mysql2');
const { guilds } = require('./schema.js');

const pool = mysql.createPool({
    // ...
});

const db = drizzle(pool);
db.insert(guilds).values({ id: 'someid', whitelisted: true, });
// @ts-check

const mysql = require('mysql2');
const { drizzle } = require('drizzle-orm/mysql2');
const { guilds } = require('./schema.js');

const pool = mysql.createPool({
    // ...
});

const db = drizzle(pool);
db.insert(guilds).values({ id: 'someid', whitelisted: true, });

it underlines
.values
.values
, I don't understand why. The error it shows is:
No overload matches this call.
No overload matches this call.

Any ideas would be greatly appreciated :)
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Problem with insert timestamp in postgres
Drizzle TeamDTDrizzle Team / help
3y ago
DrizzleOrm + GraphQL + NestJs
Drizzle TeamDTDrizzle Team / help
11mo ago
Issues with NextJS + Turso + DrizzleORM + LuciaAuth
Drizzle TeamDTDrizzle Team / help
2y ago
`with` with insert
Drizzle TeamDTDrizzle Team / help
2y ago