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

was anyone able to use Prisma + D1? My

was anyone able to use Prisma + D1? My app works locally but when I deploy it to Cloudflare i'm getting the error: fs.readdir is not implemented yet. Why would Prisma need access to the filesystem if it is configured to connect to D1? Its a real showstopper for me. I guess i will have to self-host the app if there is no solution.

status dashboard says no, but just for

status dashboard says no, but just for my sanity there's no known issue with d1 is there? getting sudden huge spikes in latency (47,000ms) for very simple requests which were fine previously ``` const findActivityStartTime = performance.now(); const activity = await prisma.activity.findFirst({...

This is good advice, but it’s not

This is good advice, but it’s not exactly the same as D1, for example time travel backups doesn’t exist for durable objects (afaik) and no API support

how do you make this work, are you

how do you make this work, are you deploying a worker inside the account to act as a proxy?

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?

Migration timeout

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

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