1
2
3
4
5
6
7
8
9
10
11
12
13
import { rpc } from "https://esm.town/v/std/rpc?v=5";
import { InStatement, sqlite } from "https://esm.town/v/std/sqlite?v=4";
export default rpc(async (statement: InStatement) => {
try {
const res = await sqlite.execute(statement);
return res[0];
} catch (e) {
throw new Response(e.message, {
status: 500,
});
}
});