Skip to main content
DynamoSQL supports two shapes for the data field in an execute-mode response. Set options.responseType in the request body to control which you receive.

Row Format (default)

"responseType": "row"data is an array of arrays. Each inner array is one row; values are ordered to match the columns array. This format is compact and well-suited for tabular display, streaming to a spreadsheet, or passing into a table-rendering component.

Object Format

"responseType": "object"data is an array of objects. Each object maps column names to their values. This format is more ergonomic in dynamic languages where you want to access fields by name without tracking column positions manually.

Both Formats Include

  • columns — ordered array of column name strings
  • firstRowIdx — absolute offset of the first row in this page (always 0 on the first page)
  • resumeIdx — present when more rows exist; pass as options.resumeIdx on the next request
  • planTime — parse + plan + optimize time in milliseconds
  • execTime — total elapsed time including DynamoDB I/O in milliseconds

Example

Request:
{
  "sql": "SELECT id, name FROM myschema.users LIMIT 2",
  "mode": "execute",
  "options": {
    "responseType": "row"
  }
}
{
  "success": true,
  "data": {
    "columns": ["id", "name"],
    "data": [
      ["u-001", "Alice"],
      ["u-002", "Bob"]
    ],
    "firstRowIdx": 0,
    "planTime": 2,
    "execTime": 18
  }
}
Response format has no effect in plan mode. Plan responses always use the plan result shape (plan, weight, normalizedSql, planTime) regardless of responseType.