main
|
Last change
on this file since 66bf4fd 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
|
| Line | |
|---|
| 1 | import type { dbSqlite } from "../db";
|
|---|
| 2 | import { todoTable } from "../schema/todos";
|
|---|
| 3 |
|
|---|
| 4 | export function insertTodo(db: ReturnType<typeof dbSqlite>, text: string) {
|
|---|
| 5 | return db.insert(todoTable).values({ text });
|
|---|
| 6 | }
|
|---|
| 7 |
|
|---|
| 8 | export function getAllTodos(db: ReturnType<typeof dbSqlite>) {
|
|---|
| 9 | return db.select().from(todoTable).all();
|
|---|
| 10 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.