POST
/
db
/
query
JavaScript
import Worqhat from 'worqhat';

const client = new Worqhat({
  apiKey: 'My API Key',
});

const response = await client.db.executeQuery({
  query: "SELECT * FROM users WHERE status = 'active' LIMIT 10",
});

console.log(response.data);
{
  "success": true,
  "data": [
    {}
  ],
  "query": "SELECT * FROM users WHERE status = 'active' LIMIT 10",
  "executionTime": 42
}

Authorizations

Authorization
string
header
required

API key authentication. Format - "Bearer YOUR_API_KEY"

Body

application/json
query
string
required

SQL query to execute

Example:

"SELECT * FROM users WHERE status = 'active' LIMIT 10"

Response

Query executed successfully

success
boolean
Example:

true

data
object[]
query
string

The executed SQL query

Example:

"SELECT * FROM users WHERE status = 'active' LIMIT 10"

executionTime
integer

Query execution time in milliseconds

Example:

42