You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constrows=awaitdb.prepare(`SELECT * FROM Customers`).all();
Describe the bug
When using the all() method with Cloudflare D1, the full D1Result object is returned:
{success: boolean,// true if the operation was successful, false otherwisemeta: {served_by: string// the version of Cloudflare's backend Worker that returned the resultduration: number,// the duration of the SQL query execution only, in millisecondschanges: number,// the number of changes made to the databaselast_row_id: number,// the last inserted row ID, only applies when the table is defined without the `WITHOUT ROWID` optionchanged_db: boolean,// true if something on the database was changedsize_after: number,// the size of the database after the query is successfully appliedrows_read: number,// the number of rows read (scanned) by this queryrows_written: number// the number of rows written by this query}results: array|null,// [] if empty, or null if it does not apply}
The method should probably only return the content of the results attribute without the success and meta attributes. The other two methods run and get return the expected result.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
Cloudflare D1
Reproduction
Describe the bug
When using the
all()
method with Cloudflare D1, the fullD1Result
object is returned:https://developers.cloudflare.com/d1/worker-api/return-object/#d1result
The method should probably only return the content of the
results
attribute without thesuccess
andmeta
attributes. The other two methodsrun
andget
return the expected result.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: