Skip to content

[SQLite-kit] Support custom base API URL for d1-http#5531

Open
GoodGoodJM wants to merge 1 commit intodrizzle-team:mainfrom
GoodGoodJM:feat/d1-http-custom-api-url
Open

[SQLite-kit] Support custom base API URL for d1-http#5531
GoodGoodJM wants to merge 1 commit intodrizzle-team:mainfrom
GoodGoodJM:feat/d1-http-custom-api-url

Conversation

@GoodGoodJM
Copy link
Copy Markdown

The d1-http driver has the Cloudflare API base URL hardcoded. Wrangler supports overriding this via CLOUDFLARE_BASE_API_URL but drizzle-kit has no equivalent, so custom endpoints like proxies or testing environments can't be used.

Added an optional baseApiUrl field to d1-http credentials. Falls back to https://api.cloudflare.com/client/v4 when not specified.

// drizzle.config.ts
export default defineConfig({
  dialect: 'sqlite',
  driver: 'd1-http',
  dbCredentials: {
    accountId: '...',
    databaseId: '...',
    token: '...',
    baseApiUrl: 'https://custom.endpoint.com/client/v4', // optional
  },
});

Allow configuring baseApiUrl in d1-http credentials to support
custom Cloudflare API endpoints, similar to wrangler's behavior.
Defaults to https://api.cloudflare.com/client/v4 when not specified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant