changelogs/drizzle-valibot/0.3.1.md
import { singlestoreTable, text, int } from 'drizzle-orm/singlestore-core';
import { createSelectSchema } from 'drizzle-valibot';
import { parse } from 'valibot';
const users = singlestoreTable('users', {
id: int().primaryKey(),
name: text().notNull(),
age: int().notNull()
});
const userSelectSchema = createSelectSchema(users);
const rows = await db.select({ id: users.id, name: users.name }).from(users).limit(1);
const parsed: { id: number; name: string; age: number } = parse(userSelectSchema, rows[0]); // Error: `age` is not returned in the above query
const rows = await db.select().from(users).limit(1);
const parsed: { id: number; name: string; age: number } = parse(userSelectSchema, rows[0]); // Will parse successfully