File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
src/content/docs/hyperdrive Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919 RelatedProduct ,
2020 Tabs ,
2121 TabItem ,
22+ LinkButton
2223} from " ~/components" ;
2324
2425<Description >
@@ -48,23 +49,24 @@ export default {
4849 // your database via Hyperdrive that can be used with your existing tools
4950 const sql = postgres (env .HYPERDRIVE .connectionString );
5051
51- try {
52- // Sample SQL query
53- const results = await sql ` SELECT * FROM pg_tables ` ;
52+ try {
53+ // Sample SQL query
54+ const results = await sql ` SELECT * FROM pg_tables ` ;
5455
55- // Close the client after the response is returned
56- ctx .waitUntil (sql .end ());
56+ // Close the client after the response is returned
57+ ctx .waitUntil (sql .end ());
5758
58- return Response .json (results );
59- } catch (e ) {
60- return Response .json ({ error: e instanceof Error ? e .message : e }, { status: 500 });
61- }
62- },
59+ return Response .json (results );
60+ } catch (e ) {
61+ return Response .json ({ error: e instanceof Error ? e .message : e }, { status: 500 });
62+ }
63+ },
6364} satisfies ExportedHandler <{ HYPERDRIVE: Hyperdrive }>;
6465```
66+
6567 </TabItem >
6668 <TabItem label = " wrangler.jsonc" >
67- ``` jsonc
69+ ``` json
6870 {
6971 "$schema" : " node_modules/wrangler/config-schema.json" ,
7072 "name" : " WORKER-NAME" ,
@@ -89,7 +91,7 @@ export default {
8991</TabItem >
9092</Tabs >
9193
92- Get started [ using Hyperdrive from a Workers application ] ( /hyperdrive/get-started/ ) .
94+ < LinkButton href = " /hyperdrive/get-started/" >Get started</ LinkButton >
9395
9496</TabItem >
9597</Tabs >
You can’t perform that action at this time.
0 commit comments