SQL · Example Payload

Sql Select Query Example

Example of executing a parameterized SQL SELECT query via a database HTTP API

ANSI StandardData ManagementDatabaseISO StandardQuery LanguageRelational DatabaseSQL

Sql Select Query Example is an example object payload from SQL, with 4 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

titledescriptionrequestresponse

Example Payload

sql-select-query-example.json Raw ↑
{
  "title": "Execute a Parameterized SELECT Query",
  "description": "Example of executing a parameterized SQL SELECT query via a database HTTP API",
  "request": {
    "method": "POST",
    "url": "https://api.example-db-service.com/v1/query",
    "headers": {
      "Content-Type": "application/json",
      "Authorization": "Bearer <token>"
    },
    "body": {
      "sql": "SELECT id, name, email, created_at FROM users WHERE active = $1 ORDER BY name LIMIT $2",
      "parameters": [true, 50],
      "timeout": 10000
    }
  },
  "response": {
    "status": 200,
    "body": {
      "columns": [
        { "name": "id", "type": "INTEGER", "nullable": false, "primaryKey": true },
        { "name": "name", "type": "VARCHAR", "nullable": false },
        { "name": "email", "type": "VARCHAR", "nullable": true },
        { "name": "created_at", "type": "TIMESTAMP", "nullable": false }
      ],
      "rows": [
        [1, "Alice Smith", "alice@example.com", "2024-01-15T10:30:00Z"],
        [2, "Bob Jones", "bob@example.com", "2024-02-20T14:00:00Z"]
      ],
      "rowCount": 2,
      "executionTime": 5.3
    }
  }
}