TS query types dont match + no return types

I'm trying to query data from my db after importing the Item table from my schema.
const data = await db.select().from(Item)

As you can see in the screenshot and the error message below typescript seems to have trouble with that. Item table definition is being imported from another typescript project within the repo which might have to do with it?

Argument of type 'PgTableWithColumns<{ name: "item"; schema: undefined; columns: { id: PgInteger<{ tableName: "item"; name: "id"; data: number; driverParam: string | number; hasDefault: false; notNull: true; }>; type: PgInteger<...>; ... 29 more ...; eventTermId: PgText<...>; }; }>' is not assignable to parameter of type 'AnyPgTable | Subquery<string, unknown> | PgViewBase<string, boolean, ColumnsSelection> | SQL<unknown>'.
  Type 'PgTable<{ name: "item"; schema: undefined; columns: { id: PgInteger<{ tableName: "item"; name: "id"; data: number; driverParam: string | number; hasDefault: false; notNull: true; }>; type: PgInteger<...>; ... 29 more ...; eventTermId: PgText<...>; }; }> & { ...; }' is missing the following properties from type 'SQL<unknown>': queryChunks, shouldInlineParams, append, toQuery, and 6 more.ts(2345)
image.png
Was this page helpful?