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
|
| Rev | Line | |
|---|
| [8ee4553] | 1 | import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|---|
| 2 |
|
|---|
| 3 | // Example of defining a schema in Drizzle ORM:
|
|---|
| 4 | export 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
|
|---|
| 10 | export type TodoItem = typeof todoTable.$inferSelect;
|
|---|
| 11 | export type TodoInsert = typeof todoTable.$inferInsert;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.