source: database/drizzle/schema/todos.ts@ fdd776b

main
Last change on this file since fdd776b was 8ee4553, checked in by Bati <no-reply@…>, 7 months ago

scaffold Vike app with Bati

  • Property mode set to 100644
File size: 467 bytes
RevLine 
[8ee4553]1import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
2
3// Example of defining a schema in Drizzle ORM:
4export const todoTable = sqliteTable("todos", {
5 id: integer("id", { mode: "number" }).primaryKey({ autoIncrement: true }),
6 text: text("text", { length: 50 }).notNull(),
7});
8
9// You can then infer the types for selecting and inserting
10export type TodoItem = typeof todoTable.$inferSelect;
11export type TodoInsert = typeof todoTable.$inferInsert;
Note: See TracBrowser for help on using the repository browser.