Skip to content

Commit

Permalink
Merge pull request #33 from zeviance/fix_d1_error_not_authorized_dbms
Browse files Browse the repository at this point in the history
Fix D1_ERROR: not authorized
  • Loading branch information
JacobLinCool committed Jan 27, 2024
2 parents 0abfbdc + 22ef08e commit c454141
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/routes/api/db/[database]/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export const GET: RequestHandler = async ({ params, locals, url, fetch, platform
throw error(404, "No tables found");
}
const results = tables.results.filter(({ name }) => {
// Avoid all Cloudflare internal table names.
if (name.startsWith("_cf_")) {
return false;
}
if (name.startsWith("sqlite_") || name.startsWith("d1_")) {
return !!platform?.env.SHOW_INTERNAL_TABLES;
}
Expand Down

0 comments on commit c454141

Please sign in to comment.