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

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...

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.

Thanks guys for this brainstorm.

Thanks guys for this brainstorm. Multiple independent DB's isn't something I can do. I needed one DB, with read and write replicas. Where the write happens also to the nearest DB but would eventually propagate to all others.

Do you have to use the REST API? Might

Do you have to use the REST API? Might be easier to use the D1 API in Workers directly.

Hi, I am having troubble setting up

Hi, I am having troubble setting up drizzle with the local d1 database, when running bun drizzle-kit migrate i receive the following error: ```bash $ bun db:migrate $ drizzle-kit migrate No config path provided, using default 'drizzle.config.ts'...

Anyone know why BLOB fields return

Anyone know why BLOB fields return number[] instead of ArrayBuffer? Seems weird because the docs show that they should map to ArrayBuffers.

I'm using nuxt + drizzle orm +

I'm using nuxt + drizzle orm + cloudflare D1. I can insert, delete, update data from drizzle studio (binded with D1), but I defined api and make api calls from by webapp page to perform those actions, it returns status 200 (OK) but nothing changes in database...

Hi folks. i have a bunch of data in a

Hi folks. i have a bunch of data in a csv file which i would like to dump into my table i d1 db. Which is the best way to do this? Seems like d1 doesn't support csv yet (cmiiw)

Hi All, I am facing an issue using D1

Hi All, I am facing an issue using D1 locally. The issue is my worker cannot see any of the DB objects I have created. First, I setup my DB with some DDL: wrangler d1 execute appdb-dev --local --file=./1.sql...
Next