drizzle select() -> Expected 0 arguments, but got 1

Hey, when I try to make a select statement, I get this error: Expected 0 arguments, but got 1.ts(2554) On runtime it works but it still shows this error. Is this a known problem?
(alias) getTableColumns<SQLiteTableWithColumns<{
name: "merchant_customer";
schema: undefined;
columns: {
id: SQLiteColumn<{
name: "id";
tableName: "merchant_customer";
dataType: "string";
columnType: "SQLiteText";
data: string;
driverParam: string;
... 8 more ...;
generated: undefined;
}, {}, {
...;
}>;
merchantId: SQLiteColumn<...>;
customerId: SQLiteColumn<...>;
mollieCustomerId: SQLiteColumn<...>;
createdAt: SQLiteColumn<...>;
};
dialect: "sqlite";
}>>(table: SQLiteTableWithColumns<...>): {
...;
}
import getTableColumns
(alias) getTableColumns<SQLiteTableWithColumns<{
name: "merchant_customer";
schema: undefined;
columns: {
id: SQLiteColumn<{
name: "id";
tableName: "merchant_customer";
dataType: "string";
columnType: "SQLiteText";
data: string;
driverParam: string;
... 8 more ...;
generated: undefined;
}, {}, {
...;
}>;
merchantId: SQLiteColumn<...>;
customerId: SQLiteColumn<...>;
mollieCustomerId: SQLiteColumn<...>;
createdAt: SQLiteColumn<...>;
};
dialect: "sqlite";
}>>(table: SQLiteTableWithColumns<...>): {
...;
}
import getTableColumns
2 Replies
louis
louisOP3mo ago
Here the select statement I want to do
const merchantCustomers = await locals.db.select({
...getTableColumns(merchantCustomer),
name: organization.name,
})
.from(merchantCustomer)
.leftJoin(organization, eq(merchantCustomer.customerId, organization.id))
.where(eq(merchantCustomer.merchantId, sessionData.session.activeOrganizationId));
const merchantCustomers = await locals.db.select({
...getTableColumns(merchantCustomer),
name: organization.name,
})
.from(merchantCustomer)
.leftJoin(organization, eq(merchantCustomer.customerId, organization.id))
.where(eq(merchantCustomer.merchantId, sessionData.session.activeOrganizationId));
TOSL
TOSL3mo ago
I don't see an obvious issue. Can you try just restarting your typescript server

Did you find this page helpful?