Report hasn't been filed before.
What version of drizzle-orm are you using?
0.43.1
What version of drizzle-kit are you using?
0.31.1
Other packages
[email protected]
Describe the Bug
The very example on the documentation causes this:
(from https://orm.drizzle.team/docs/valibot)
import { pgTable, text, integer } from 'drizzle-orm/pg-core';
import { createSelectSchema } from 'drizzle-valibot';
import { parse } from 'valibot';
const users = pgTable('users', {
id: integer().generatedAlwaysAsIdentity().primaryKey(),
name: text().notNull(),
age: integer().notNull()
});
const userSelectSchema = createSelectSchema(users);
const rows = await db.select().from(users).limit(1);
// error: Property 'id' is missing in type '{ name: string; age: number; }' but required in type '{ id: number; name: string; age: number; }'. (ts 2741)
const parsed: { id: number; name: string; age: number } = parse(userSelectSchema, rows[0]);
This does not happen, for example, if the id is declared with uuid().defaultRandom(). The DB does return the ID on a query regardless of course, so this is just a typing bug.