D1 doesn't have a connection URL as traditional databases. Either you query D1 through a Worker usin

D1 doesn't have a connection URL as traditional databases. Either you query D1 through a Worker using the D1 binding (https://developers.cloudflare.com/d1/worker-api/) which is the fastest and most performant, or you should use the D1 REST API (https://developers.cloudflare.com/api/resources/d1/subresources/database/methods/query/).

I do not recommend the REST API if you will do several database queries (round trips), since it's not meant to be used yet in your hot paths. It's slow at the moment, more rate limited than the Workers binding, and you won't have a nice experience. We are improving this in the following months but it's a long ongoing process.
Was this page helpful?