curl --request GET \
--url https://developer.synq.io/api/sql-insights/v1/join-patterns \
--header 'Authorization: Bearer <token>'import requests
url = "https://developer.synq.io/api/sql-insights/v1/join-patterns"
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/join-patterns', 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/join-patterns",
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/join-patterns"
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/join-patterns")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/sql-insights/v1/join-patterns")
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{
"patterns": [
{
"key": [
{
"column": {
"entityId": "<string>",
"column": "<string>",
"derivation": "JOIN_SIDE_DERIVATION_UNSPECIFIED",
"expression": "<string>"
},
"other": {
"entityId": "<string>",
"column": "<string>",
"derivation": "JOIN_SIDE_DERIVATION_UNSPECIFIED",
"expression": "<string>"
},
"kind": "JOIN_KIND_UNSPECIFIED",
"operator": "JOIN_OPERATOR_UNSPECIFIED",
"leads": true,
"joinType": "JOIN_TYPE_UNSPECIFIED",
"nativeJoinType": "<string>"
}
],
"filters": [
"<string>"
],
"evidenceKinds": [
"JOIN_EVIDENCE_KIND_UNSPECIFIED"
],
"sources": [
{
"entityId": "<string>",
"statementIndex": 123,
"joinIndex": 123
}
],
"queryLog": {
"queries": 123,
"distinctLogins": 123,
"firstHour": "2023-01-15T01:30:15.01Z",
"lastHour": "2023-01-15T01:30:15.01Z",
"issuers": [
{
"platform": "<string>",
"entityId": "<string>",
"queries": 123,
"distinctLogins": 123,
"kind": "JOIN_ISSUER_KIND_UNSPECIFIED"
}
],
"sampleQueryId": "<string>"
},
"joinTypes": [
{
"kind": "JOIN_KIND_UNSPECIFIED",
"joinType": "JOIN_TYPE_UNSPECIFIED",
"nativeJoinType": "<string>",
"keeps": "JOIN_KEEPS_UNSPECIFIED",
"filters": [
"<string>"
],
"sources": [
{
"entityId": "<string>",
"statementIndex": 123,
"joinIndex": 123
}
],
"queryLog": {
"queries": 123,
"distinctLogins": 123,
"firstHour": "2023-01-15T01:30:15.01Z",
"lastHour": "2023-01-15T01:30:15.01Z",
"issuers": [
{
"platform": "<string>",
"entityId": "<string>",
"queries": 123,
"distinctLogins": 123,
"kind": "JOIN_ISSUER_KIND_UNSPECIFIED"
}
],
"sampleQueryId": "<string>"
}
}
],
"relationship": {
"semanticModelEntityId": "<string>",
"declarerEntityId": "<string>",
"name": "<string>",
"state": "RELATIONSHIP_STATE_UNSPECIFIED",
"cardinality": "CARDINALITY_UNSPECIFIED"
}
}
],
"queryLogCoveredHours": 123,
"queryLogLeftOut": {
"coalesceQualityQueries": 123,
"coalesceLogins": 123,
"serviceAccounts": 123
},
"entityIds": [
"<string>"
]
}ListJoinPatterns
List how other SQL joins a table, or one of its columns:
every join key that the SQL of a table, view or model in the workspace
uses to join the requested entity, read from the requested entity’s side,
and which SQL makes it. It is the reverse of BatchSqlDetails joins, which
say how building one entity joins others: here the requested entity is the
one being joined.
The requested entity is taken together with every entity that is the same object, like a dbt model, the table it builds and that table in a catalog, so asking about any of them returns the joins on all of them.
curl --request GET \
--url https://developer.synq.io/api/sql-insights/v1/join-patterns \
--header 'Authorization: Bearer <token>'import requests
url = "https://developer.synq.io/api/sql-insights/v1/join-patterns"
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/join-patterns', 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/join-patterns",
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/join-patterns"
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/join-patterns")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/sql-insights/v1/join-patterns")
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{
"patterns": [
{
"key": [
{
"column": {
"entityId": "<string>",
"column": "<string>",
"derivation": "JOIN_SIDE_DERIVATION_UNSPECIFIED",
"expression": "<string>"
},
"other": {
"entityId": "<string>",
"column": "<string>",
"derivation": "JOIN_SIDE_DERIVATION_UNSPECIFIED",
"expression": "<string>"
},
"kind": "JOIN_KIND_UNSPECIFIED",
"operator": "JOIN_OPERATOR_UNSPECIFIED",
"leads": true,
"joinType": "JOIN_TYPE_UNSPECIFIED",
"nativeJoinType": "<string>"
}
],
"filters": [
"<string>"
],
"evidenceKinds": [
"JOIN_EVIDENCE_KIND_UNSPECIFIED"
],
"sources": [
{
"entityId": "<string>",
"statementIndex": 123,
"joinIndex": 123
}
],
"queryLog": {
"queries": 123,
"distinctLogins": 123,
"firstHour": "2023-01-15T01:30:15.01Z",
"lastHour": "2023-01-15T01:30:15.01Z",
"issuers": [
{
"platform": "<string>",
"entityId": "<string>",
"queries": 123,
"distinctLogins": 123,
"kind": "JOIN_ISSUER_KIND_UNSPECIFIED"
}
],
"sampleQueryId": "<string>"
},
"joinTypes": [
{
"kind": "JOIN_KIND_UNSPECIFIED",
"joinType": "JOIN_TYPE_UNSPECIFIED",
"nativeJoinType": "<string>",
"keeps": "JOIN_KEEPS_UNSPECIFIED",
"filters": [
"<string>"
],
"sources": [
{
"entityId": "<string>",
"statementIndex": 123,
"joinIndex": 123
}
],
"queryLog": {
"queries": 123,
"distinctLogins": 123,
"firstHour": "2023-01-15T01:30:15.01Z",
"lastHour": "2023-01-15T01:30:15.01Z",
"issuers": [
{
"platform": "<string>",
"entityId": "<string>",
"queries": 123,
"distinctLogins": 123,
"kind": "JOIN_ISSUER_KIND_UNSPECIFIED"
}
],
"sampleQueryId": "<string>"
}
}
],
"relationship": {
"semanticModelEntityId": "<string>",
"declarerEntityId": "<string>",
"name": "<string>",
"state": "RELATIONSHIP_STATE_UNSPECIFIED",
"cardinality": "CARDINALITY_UNSPECIFIED"
}
}
],
"queryLogCoveredHours": 123,
"queryLogLeftOut": {
"coalesceQualityQueries": 123,
"coalesceLogins": 123,
"serviceAccounts": 123
},
"entityIds": [
"<string>"
]
}Authorizations
Query Parameters
Set to return only how the entity is joined with this other entity, which
answers "how do I join these two tables". A key that also compares a third
table keeps only its comparisons with this one. Like entity_id, it
matches every entity that is the same object. Leave empty for joins with
any entity.
4096Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive.
Response
Success
ListJoinPatternsResponse lists the join patterns of the requested entity.