Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join

D1 connection string

are there any plans on offering a conection string to be able to visualize and manipulate a db with dabatabes visualizer like dbeaver? the d1 database explorer is honestly the worst feature there is from you. I can't search, I can't filter. It's so basic. Why don't you just rely on existent (open source) software for this? this vendor locking seems really silly...

Minimum D1 permissions for HTTP API

Can you try make a token with just edit?

Low latency D1 for hourly config updates

If you rarely update that config and you have many requests needing it, then you can have D1 as the source of truth where you write your config updates, and then also put them in Workers KV. Your worker can read from Workers KV when a stale value (up to 60s) is OK for that case, and go to D1 if you need the latest/freshest configuration. Using the local CDN Cache API from your worker sometimes give you faster lookups than Workers KV as well, but it also depends on your scenario. It's not clear from what you said above. This design can give you the speed when you can use cached values and have D1 as a fallback for your endpoints that need the latest....

Migration timeout

What is your database ID?
I've just send you a DM.
Are other queries working, and only that specific migration failing?...

Durable Objecte SQLite

Yeah, SQLite in DO launched a few months ago, but it has been used by D1 for more than a year now. If you also want to see how to think about using many DOs check out https://developers.cloudflare.com/reference-architecture/diagrams/storage/durable-object-control-data-plane-pattern/ I have a real example implementing that pattern explained in https://www.lambrospetrou.com/articles/tiddlyflare/...

Is anyone aware of an existing tool that

Is anyone aware of an existing tool that will take a D1 export and save the file directly to R2? I know I can do all this programmatically but I was hoping there was a simpler way or a pre-existing tool for it already. Thanks

How would I get just the `results` from

How would I get just the results from the return Response.json(results) area? I'm getting this:
{"success":true,"meta":{"served_by":"v3-prod","duration":0.1977,"changes":0,"last_row_id":0,"changed_db":false,"size_after":16384,"rows_read":1,"rows_written":0},"results":[{"test":"a"}]}
{"success":true,"meta":{"served_by":"v3-prod","duration":0.1977,"changes":0,"last_row_id":0,"changed_db":false,"size_after":16384,"rows_read":1,"rows_written":0},"results":[{"test":"a"}]}
...

yes i did this query

yes i did this query ```js const [total_records, users] = await Promise.all([ prisma.user.count({ where: whereClause...

No, it first fails on parsing the sql

No, it first fails on parsing the sql because of the missing quotes around the dates. Once i fixed that it succeeds parsing the sql and then breaks with the d1_reset_do error. I wrote a script to chunk the inserts in the dump so hopefully that works out but the export 100% has some issue...

Hmm unless I'm missing something, this

Hmm unless I'm missing something, this doesn't seem to be possible? It'd be really helpful to be able to develop locally and see the metrics to help designing database and estimating costs. .all and .batch do return those metrics, but it's very intrusive to modify your code....

Thank you!!! ddbb159c-feb2-4ff0-a86c-

Thank you!!! ddbb159c-feb2-4ff0-a86c-022d0d3b336a

I'm trying to import data from an sql

I'm trying to import data from an sql file trough the http api but getting statement too long: SQLITE_TOOBIG error. The whole sql file is 24mb and has one insert statement per line (each statement ends with a semicolon followed by a line break). The table has 13 columns I'm inserting into. The longer insert statement line is 751 byte. Are there any limitations for the D1 HTTP API I'm not aware of? Could this be a bug? Or I'm maybe doing something wrong? Update: Problem was with quotes not been escaped. Escaped those by doubling them and the problem was solved!...

Unexplained row reads in billable usage

Did anyone else had any unexplained reporting in billable usage for D1? On the 25th of October it's saying it suddenly had 1 million row reads, though it's not verifiable through the D1 analytics page, see thread for screenshots:

Hello. I'm getting this error when

Hello. I'm getting this error when running npx drizzle-kit push command. Anyone know what's going on? ``` [āœ“] Pulling schema from database... Error: 7500: not authorized: SQLITE_AUTH...

We are also seeing this error.

We are also seeing this error. We are trying to deploy the code using npx wrangler deploy Partial toml file ```toml...

I'm trying to run multiple SQL

I'm trying to run multiple SQL statements at once. - When running multiple multi-line queries via D1 REST API everything works. - When running multiple multi-line queries via env.DB.exec(), I get an error. It can only parse multiple queries if each query is only a single line. works via db.exec() ```sql...

yes, there is a .sqlite file in .

yes, there is a .sqlite file in .wrangler directory. you can open that in Navicat.

Is the D1 HTTP API down right now?

Is the D1 HTTP API down right now?

hi all. I am using import API for D1

hi all. I am using import API for D1 https://developers.cloudflare.com/api/operations/cloudflare-d1-import-database. Does anybody used it before and are any limits on the file size? I am getting 500 internal server all the time. Thank you

I switched and couldn't believe how easy

I switched and couldn't believe how easy it was and how beautiful multi-tenant works with Turso.