diff --git a/src/content/docs/d1/worker-api/return-object.mdx b/src/content/docs/d1/worker-api/return-object.mdx index fc588aeacd351ec..a7ca9573b9da965 100644 --- a/src/content/docs/d1/worker-api/return-object.mdx +++ b/src/content/docs/d1/worker-api/return-object.mdx @@ -25,6 +25,11 @@ The methods [`D1PreparedStatement::run`](/d1/worker-api/prepared-statements/#run success: boolean, // true if the operation was successful, false otherwise meta: { served_by: string // the version of Cloudflare's backend Worker that returned the result + served_by_region: string // the region of the database instance that executed the query + served_by_primary: boolean // true if (and only if) the database instance that executed the query was the primary + timings: { + sql_duration_ms: number // the duration of the SQL query execution by the database instance (not including any network time) + } duration: number, // the duration of the SQL query execution only, in milliseconds changes: number, // the number of changes made to the database last_row_id: number, // the last inserted row ID, only applies when the table is defined without the `WITHOUT ROWID` option @@ -45,16 +50,21 @@ const stmt = env.DB.prepare("SELECT * FROM Customers WHERE CompanyName = ?").bin const returnValue = await stmt.run(); return Response.json(returnValue) ``` -```js +```json { "success": true, "meta": { "served_by": "miniflare.db", - "duration": 1, + "served_by_region": "WEUR", + "served_by_primary": true, + "timings": { + "sql_duration_ms": 0.2552 + }, + "duration": 0.2552, "changes": 0, "last_row_id": 0, "changed_db": false, - "size_after": 8192, + "size_after": 16384, "rows_read": 4, "rows_written": 0 },