Databases
These endpoints are specific to database connections.
Retrieve query schema
It executes the provided query on a source database connection and returns the result schema along with the first rows.
Request
-
:id
int RequiredThe ID of the source database connection on which the query will be executed.
-
query
string RequiredThe query to execute to read the result schema along with sample rows for reference. It must contain the "limit" placeholder and cannot be longer than 16,777,215 characters.
-
limit
intThe maximum number of rows to return along with the schema. The maximum is 100; the default is 0, meaning no rows are returned.
Response
-
schema
nullable schemaThe schema of the query. It will be null if there are no supported columns.
-
rows
array of object with json valuesThe rows.
-
issues
nullable array of stringThe issues encountered while reading the table, such as unsupported columns, which did not prevent processing. If it is not null, it contains at least one issue.
curl https://example.com/v1/connections/1371036433/query \ -H "Authorization: Bearer api_xxxxxxx" \ --json '{ "query": "SELECT name, email FROM users", "limit": 50 }' {
"schema": {
"kind": "object",
"properties": [
{
"name": "first_name",
"type": {
"kind": "string"
},
"nullable": true
},
{
"name": "last_name",
"type": {
"kind": "string"
},
"nullable": true
}
]
},
"rows": [
{
"first_name": "John",
"last_name": "Mitchell"
},
{
"first_name": "Emily",
"last_name": "Carter"
},
{
"first_name": "Michael",
"last_name": "Reynolds"
}
],
"issues": [
"Column \"mac_addr\" cannot be imported because its type \"MACADDR\" is not supported"
]
}Retrieve table schema
Returns the schema of a specified database table of a destination database connection.
Request
-
:id
int RequiredThe database destination connection where the table is located.
-
name
string RequiredThe name of the table.
Response
-
schema
nullable schemaThe schema of the table. It will be null if there are no supported columns.
-
issues
nullable array of stringThe issues encountered while reading the table, such as unsupported columns, which did not prevent processing. If it is not null, it contains at least one issue.
curl -G https://example.com/v1/connections/1371036433/tables \ -H "Authorization: Bearer api_xxxxxxx" \ -d "name=users" {
"schema": {
"kind": "object",
"properties": [
{
"name": "first_name",
"type": {
"kind": "string"
},
"nullable": true
},
{
"name": "last_name",
"type": {
"kind": "string"
},
"nullable": true
}
]
},
"issues": [
"Column \"mac_addr\" cannot be imported because its type \"MACADDR\" is not supported"
]
}