We have a requirement where we need a dedicated server to read specific files and then update a D1 d

We have a requirement where we need a dedicated server to read specific files and then update a D1 database. I found the D1 REST (HTTP) API to insert values into D1 from outside a worker environment.

However:
I can only insert a small batch at a time.

{
  sql: 'INSERT INTO "table" ("a", "b", "c") VALUES (?, ?, ?)',
  params: [...],
}


With that I can insert up to
33
entries at a time before the server hits me with a
500 Internal Server Error
. When concatinating the SQL query myself I found that I can go up to a query length of
10000
characters. Depending on the length of my input values I can insert more than
3000
entries at a time with this method. This could be however a security risk as I understand.

Is there a more secure yet fast way to insert a lot of values into D1 from outside a worker environment?
Was this page helpful?