createInsertSchema fails to infer

Hello I've got:

export const facts = pgTable(
    "facts",
    {
        id: serial("id").primaryKey(),
        guildId: bigint("guild_id", { mode: "number" }).notNull(),
        userId: varchar("user_id").notNull(),
        content: text("content").notNull(),
        vector: vector("vector", { dimensions: 1536 }).notNull(),
    },
    (table) => ({
        embeddingIndex: index("embedding_idx").using(
            "hnsw",
            table.vector.op("vector_cosine_ops"),
        ),
    }),
);

export const insertFactSchema = createInsertSchema(facts);
export type NewFact = z.infer<typeof insertFactSchema>;


However, NewFact evaluates to:

type NewFact = {
    [x: string]: never;
}


What am I doing wrong?
Was this page helpful?