ListSqlConstructs
curl --request GET \
--url https://developer.synq.io/api/sql-insights/v1/constructs \
--header 'Authorization: Bearer <token>'import requests
url = "https://developer.synq.io/api/sql-insights/v1/constructs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://developer.synq.io/api/sql-insights/v1/constructs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://developer.synq.io/api/sql-insights/v1/constructs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://developer.synq.io/api/sql-insights/v1/constructs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://developer.synq.io/api/sql-insights/v1/constructs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/sql-insights/v1/constructs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"sqlConstructs": [
{
"sqlConstruct": "SQL_CONSTRUCT_UNSPECIFIED",
"count": 123
}
]
}synq.entities.sql_insights.v1.SqlInsightsService
ListSqlConstructs
ListSqlConstructs returns the distribution of SQL constructs across all entities in the workspace. Every count is a number of entities, not a number of occurrences: an entity whose SQL contains five GROUP BY clauses adds one to the HAS_GROUP_BY count, not five. The result is workspace-scoped (derived from the authenticated request) — no entity paths are supplied. Useful for building filter/autocomplete UIs and for high-level “shape of our SQL” analytics.
GET
/
api
/
sql-insights
/
v1
/
constructs
ListSqlConstructs
curl --request GET \
--url https://developer.synq.io/api/sql-insights/v1/constructs \
--header 'Authorization: Bearer <token>'import requests
url = "https://developer.synq.io/api/sql-insights/v1/constructs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://developer.synq.io/api/sql-insights/v1/constructs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://developer.synq.io/api/sql-insights/v1/constructs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://developer.synq.io/api/sql-insights/v1/constructs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://developer.synq.io/api/sql-insights/v1/constructs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/sql-insights/v1/constructs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"sqlConstructs": [
{
"sqlConstruct": "SQL_CONSTRUCT_UNSPECIFIED",
"count": 123
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
200 - application/json
Success
ListSqlConstructsResponse reports how many of the workspace's entities use each SQL construct.
One entry per construct that appears at least once in the workspace.
Show child attributes
Show child attributes