source: database/drizzle/queries/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: 321 bytes
RevLine 
[8ee4553]1import type { dbSqlite } from "../db";
2import { todoTable } from "../schema/todos";
3
4export function insertTodo(db: ReturnType<typeof dbSqlite>, text: string) {
5 return db.insert(todoTable).values({ text });
6}
7
8export function getAllTodos(db: ReturnType<typeof dbSqlite>) {
9 return db.select().from(todoTable).all();
10}
Note: See TracBrowser for help on using the repository browser.