Svelte and Drizzle and types?
Using Drizzle and NextJS, Drizzle provides types based on the schema.
Using Drizzle with Svelte, all JS functionality works but none of the Drizzle provided types work. Instead, all auto types are: "any". Any thoughts?
For example, using this schema.ts in NextJS
import { pgTable } from 'drizzle-orm/pg-core';
const myTable = pgTable('my_table', {...});
correctly produces the type:
const myTable: PgTableWithColumns<{
name: "my_table";
schema: undefined;
columns: { ... };
}>
but using the same schema.ts code in Svelte-kit incorrectly produces 'any' as a type.
const myTable:any
1 Reply
this might be a sveltekit specific issue, sometimes the typescript server will assign
any
as the type for load functions and same happens with drizzle types