Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/content/docs/fundamentals/account/change-super-admin.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
---
import postgres from 'postgres';

export default {
async fetch(request, env, ctx): Promise<Response> {
// Hyperdrive provides a unique generated connection string to connect to
// your database via Hyperdrive that can be used with your existing tools
const sql = postgres(env.HYPERDRIVE.connectionString);

try {
// Sample SQL query
const results = await sql`SELECT * FROM pg_tables`;

// Close the client after the response is returned
ctx.waitUntil(sql.end());

return Response.json(results);
} catch (e) {
return Response.json({ error: e instanceof Error ? e.message : e }, { status: 500 });
}
},

} satisfies ExportedHandler<{ HYPERDRIVE: Hyperdrive }>;---
Comment on lines +1 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR appears to be adding code for a Hyperdrive database connection to a documentation file about changing Super Administrators. This code doesn't seem to belong in this documentation file and would break the MDX formatting. The file should only contain documentation content related to changing Super Administrators in Cloudflare accounts.

pcx_content_type: how-to
title: Change Super Administrator

Expand Down