typescript: No overload matches this call.
Overload 1 of 2, '(left: Aliased<null>, right: AnyColumn | Placeholder<string, any> | SQLWrapper | null): SQL<unknown>', gave the following error.
Argument of type 'MySqlInt<{ tableName: "cuentas"; name: "padre_id"; data: number; driverParam: string | number; notNull: false; hasDefault: false; }>' is not assignable to parameter of type 'Aliased<null>'.
Type 'MySqlInt<{ tableName: "cuentas"; name: "padre_id"; data: number; driverParam: string | number; notNull: false; hasDefault: false; }>' is missing the following properties from type 'Aliased<null>': sql, fieldAlias, getSQL
Overload 2 of 2, '(left: MySqlInt<{ tableName: "cuentas"; name: "padre_id"; data: number; driverParam: string | number; notNull: false; hasDefault: false; }>, right: number | AnyColumn | Placeholder<...> | SQLWrapper): SQL<...>', gave the following error.
Argument of type 'null' is not assignable to parameter of type 'number | AnyColumn | Placeholder<string, any> | SQLWrapper'. [2769]typescript: No overload matches this call.
Overload 1 of 2, '(left: Aliased<null>, right: AnyColumn | Placeholder<string, any> | SQLWrapper | null): SQL<unknown>', gave the following error.
Argument of type 'MySqlInt<{ tableName: "cuentas"; name: "padre_id"; data: number; driverParam: string | number; notNull: false; hasDefault: false; }>' is not assignable to parameter of type 'Aliased<null>'.
Type 'MySqlInt<{ tableName: "cuentas"; name: "padre_id"; data: number; driverParam: string | number; notNull: false; hasDefault: false; }>' is missing the following properties from type 'Aliased<null>': sql, fieldAlias, getSQL
Overload 2 of 2, '(left: MySqlInt<{ tableName: "cuentas"; name: "padre_id"; data: number; driverParam: string | number; notNull: false; hasDefault: false; }>, right: number | AnyColumn | Placeholder<...> | SQLWrapper): SQL<...>', gave the following error.
Argument of type 'null' is not assignable to parameter of type 'number | AnyColumn | Placeholder<string, any> | SQLWrapper'. [2769]import { relations } from "drizzle-orm";
import { int, mysqlTable, serial, varchar } from "drizzle-orm/mysql-core";
export const account = mysqlTable("account", {
id: serial("id").primaryKey(),
name: varchar("name", { length: 256 }),
parentId: int("parentId"),
});
export const accountRelations = relations(account, ({ one }) => ({
parent: one(account, {
fields: [account.parentId],
references: [account.id],
}),
}));import { relations } from "drizzle-orm";
import { int, mysqlTable, serial, varchar } from "drizzle-orm/mysql-core";
export const account = mysqlTable("account", {
id: serial("id").primaryKey(),
name: varchar("name", { length: 256 }),
parentId: int("parentId"),
});
export const accountRelations = relations(account, ({ one }) => ({
parent: one(account, {
fields: [account.parentId],
references: [account.id],
}),
}));import { drizzle } from "drizzle-orm/mysql2";
import mysql from "mysql2/promise";
import * as schema from "./schema";
const poolConnection = mysql.createPool({
host: "host",
user: "user",
database: "database",
password: "password",
});
export const db = drizzle(poolConnection, { schema });
await db.query.account.findMany({
where: (account, { eq }) => eq(account.parentId, null) // ERRORS HERE
})import { drizzle } from "drizzle-orm/mysql2";
import mysql from "mysql2/promise";
import * as schema from "./schema";
const poolConnection = mysql.createPool({
host: "host",
user: "user",
database: "database",
password: "password",
});
export const db = drizzle(poolConnection, { schema });
await db.query.account.findMany({
where: (account, { eq }) => eq(account.parentId, null) // ERRORS HERE
}).notNull().notNull() anywhere