createInsertSchema fails to infer
Hello I've got:
However,
What am I doing wrong?
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>;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,
NewFactNewFact evaluates to: type NewFact = {
[x: string]: never;
}type NewFact = {
[x: string]: never;
}What am I doing wrong?