diff --git a/src/runtime/database/server/api/_hub/database/[command].post.ts b/src/runtime/database/server/api/_hub/database/[command].post.ts index c70a0688..1f7d5680 100644 --- a/src/runtime/database/server/api/_hub/database/[command].post.ts +++ b/src/runtime/database/server/api/_hub/database/[command].post.ts @@ -15,7 +15,7 @@ export default eventHandler(async (event) => { // https://developers.cloudflare.com/d1/build-databases/query-databases/ const { command } = await getValidatedRouterParams(event, z.object({ - command: z.enum(['first', 'all', 'raw', 'run', 'dump', 'exec', 'batch']) + command: z.enum(['first', 'all', 'raw', 'run', 'exec', 'batch']) }).parse) const db = hubDatabase() @@ -23,9 +23,6 @@ export default eventHandler(async (event) => { const { query } = await readValidatedBody(event, statementValidation.pick({ query: true }).parse) return db.exec(query) } - if (command === 'dump') { - return db.dump() - } if (command === 'first') { const { query, params, colName } = await readValidatedBody(event, z.intersection( statementValidation, diff --git a/src/runtime/database/server/utils/database.ts b/src/runtime/database/server/utils/database.ts index d115bd45..a80e4c34 100644 --- a/src/runtime/database/server/utils/database.ts +++ b/src/runtime/database/server/utils/database.ts @@ -71,9 +71,6 @@ export function proxyHubDatabase(projectUrl: string, secretKey?: string, headers body: { query } }).catch(handleProxyError) }, - async dump() { - return d1API('/dump').catch(handleProxyError) - }, prepare(query: string) { const stmt = { _body: { diff --git a/src/types/database.ts b/src/types/database.ts index e751623b..0edc8bda 100644 --- a/src/types/database.ts +++ b/src/types/database.ts @@ -1,3 +1,5 @@ import type { D1Database as CFD1Database } from '@cloudflare/workers-types/experimental' -export type D1Database = CFD1Database +type OmitDump = Omit + +export type D1Database = OmitDump