Skip to content

Commit 6f06a7f

Browse files
add example query (#927)
* add example query * prettier-fix --------- Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
1 parent e73e821 commit 6f06a7f

File tree

1 file changed

+26
-0
lines changed
  • dashboard/starter-example/app/query

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// import { db } from "@vercel/postgres";
2+
3+
// const client = await db.connect();
4+
5+
// async function listInvoices() {
6+
// const data = await client.sql`
7+
// SELECT invoices.amount, customers.name
8+
// FROM invoices
9+
// JOIN customers ON invoices.customer_id = customers.id
10+
// WHERE invoices.amount = 666;
11+
// `;
12+
13+
// return data.rows;
14+
// }
15+
16+
export async function GET() {
17+
return Response.json({
18+
message:
19+
'Uncomment this file and remove this line. You can delete this file when you are finished.',
20+
});
21+
// try {
22+
// return Response.json(await listInvoices());
23+
// } catch (error) {
24+
// return Response.json({ error }, { status: 500 });
25+
// }
26+
}

0 commit comments

Comments
 (0)