D1

Raw D1 Database query

Changed on

Returns the query result rows as arrays rather than objects. This is a performance-optimized version of the /query endpoint.

post/d1/database/{database_id}/raw

Request

  • Base URL: /cdn-cgi/local/explorer/api (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /cdn-cgi/local/explorer/api/d1/database/{database_id}/raw
  • Auth: none declared

Path parameters

database_idstring required

D1 database identifier (UUID).

Example:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Request body

OR

Example request

{
  "params": [
    "firstParam",
    "secondParam"
  ],
  "sql": "SELECT * FROM myTable WHERE field = ? OR field = ?;"
}

Changes