const example = sqliteTable("example", {
id: text("id").primaryKey(),
required: text("required").notNull(),
optional: text("optional"),
});
type NewExample = typeof example.$inferInsert;
// resolves in:
// type NewExample = {
// id: string;
// required: string;
// }
type Example = typeof example.$inferSelect;
// resolves in:
// type Example = {
// id: string;
// required: string;
// optional: string;
// }
// my expectation:
// type Example = {
// id: string;
// required: string;
// optional?: string;
// }
//
// or
//
// type Example = {
// id: string;
// required: string;
// optional: string | undefined;
// }
const example = sqliteTable("example", {
id: text("id").primaryKey(),
required: text("required").notNull(),
optional: text("optional"),
});
type NewExample = typeof example.$inferInsert;
// resolves in:
// type NewExample = {
// id: string;
// required: string;
// }
type Example = typeof example.$inferSelect;
// resolves in:
// type Example = {
// id: string;
// required: string;
// optional: string;
// }
// my expectation:
// type Example = {
// id: string;
// required: string;
// optional?: string;
// }
//
// or
//
// type Example = {
// id: string;
// required: string;
// optional: string | undefined;
// }