NAV Navigation
Shell HTTP JavaScript Ruby Python PHP Java Go

Postgres API v0.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Manage your PostgreSQL database using a RESTful API.

This is still in early development, so most of the functionality is read-only.

The goal of this API is to enable the full management of a Postgres database using a RESTful interface. This includes adding tables, columns, roles, and users at runtime, as well as running ad-hoc queries.

Made by Supabase: https://supabase.io

Getting started

Usage

Basic usage

curl -X GET http://localhost:1337/ \
-H 'Content-Type: application/json' \
-H 'X-Connection-Encrypted: ENCRYPTED_STRING'
const data = await fetch('http://localhost:1337', {
method: 'GET',
headers: {
    'Content-Type': 'application/json',
    'X-Connection-Encrypted': 'ENCRYPTED_STRING'
}
})

For security reasons, this API is best self-hosted and set up with ENV_VARS with the default connection string.

If you want to use this with multiple Postgres instances, you can pass the connection string as a header but it must be encrypted.

Self Hosting

https://github.com/supabase/pg-api

We support several different methods for self-hosting, detailed in the repository.

Authentication

Authentication is not provided. Make sure you use this inside a secure network or behind a secure API proxy.

Email: Support Web: Support License: Apache 2.0

/config

Get all configs

Code samples

# You can also use wget
curl -X GET /config \
  -H 'Accept: application/json'

GET /config HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/config',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/config',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/config', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/config', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/config");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/config", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /config

Example responses

200 Response

[
  {
    "name": "string",
    "setting": "string",
    "category": "string",
    "group": "string",
    "subgroup": "string",
    "unit": "string",
    "short_desc": "string",
    "extra_desc": "string",
    "context": "string",
    "vartype": "string",
    "source": "string",
    "min_val": "string",
    "max_val": "string",
    "enumvals": [
      "string"
    ],
    "boot_val": "string",
    "reset_val": "string",
    "sourcefile": "string",
    "sourceline": 0,
    "pending_restart": true
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Config] false none none
» name string false none none
» setting string false none none
» category string false none none
» group string false none none
» subgroup string false none none
» unit string¦null false none none
» short_desc string false none none
» extra_desc string¦null false none none
» context string false none none
» vartype string false none none
» source string false none none
» min_val string¦null false none none
» max_val string¦null false none none
» enumvals [string]¦null false none none
» boot_val string false none none
» reset_val string false none none
» sourcefile string¦null false none none
» sourceline integer¦null false none none
» pending_restart boolean false none none

/config/version

Get version

Code samples

# You can also use wget
curl -X GET /config/version \
  -H 'Accept: application/json'

GET /config/version HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/config/version',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/config/version',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/config/version', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/config/version', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/config/version");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/config/version", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /config/version

Example responses

200 Response

{
  "version": "string",
  "version_number": 0,
  "active_connections": 0,
  "max_connections": 0
}

Responses

Status Meaning Description Schema
200 OK Successful operation Version

/query

Make a query

Code samples

# You can also use wget
curl -X POST /query \
  -H 'Accept: application/json'

POST /query HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/query',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.post '/query',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.post('/query', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/query', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/query");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/query", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /query

Example responses

200 Response

[
  {}
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

/columns

Get all columns

Code samples

# You can also use wget
curl -X GET /columns \
  -H 'Accept: application/json'

GET /columns HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/columns',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/columns',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/columns', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/columns', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/columns");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/columns", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /columns

Parameters

Name In Type Required Description
include_system_schemas query boolean false none

Example responses

200 Response

[
  {
    "table_id": 0,
    "schema": "string",
    "table": "string",
    "id": "string",
    "ordinal_position": 0,
    "name": "string",
    "default_value": "string",
    "data_type": "string",
    "format": "string",
    "description": "string",
    "is_identity": true,
    "identity_generation": "string",
    "is_nullable": true,
    "is_updatable": true,
    "enums": [
      "string"
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Column] false none none
» table_id integer false none none
» schema string false none none
» table string false none none
» id string false none none
» ordinal_position integer false none none
» name string false none none
» default_value string false none none
» data_type string false none none
» format string false none none
» description string false none none
» is_identity boolean false none none
» identity_generation string false none none
» is_nullable boolean false none none
» is_updatable boolean false none none
» enums [string] false none none

Add a column

Code samples

# You can also use wget
curl -X POST /columns \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /columns HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "string",
  "table_id": 0,
  "type": "string",
  "default_value": "string",
  "is_identity": true,
  "is_nullable": true,
  "is_primary_key": true,
  "is_unique": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/columns',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post '/columns',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/columns', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/columns', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/columns");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/columns", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /columns

Body parameter

{
  "name": "string",
  "table_id": 0,
  "type": "string",
  "default_value": "string",
  "is_identity": true,
  "is_nullable": true,
  "is_primary_key": true,
  "is_unique": true
}

Parameters

Name In Type Required Description
body body object true none
» name body string true none
» table_id body integer true none
» type body string true none
» default_value body string false none
» is_identity body boolean false none
» is_nullable body boolean false none
» is_primary_key body boolean false none
» is_unique body boolean false none

Example responses

200 Response

{
  "table_id": 0,
  "schema": "string",
  "table": "string",
  "id": "string",
  "ordinal_position": 0,
  "name": "string",
  "default_value": "string",
  "data_type": "string",
  "format": "string",
  "description": "string",
  "is_identity": true,
  "identity_generation": "string",
  "is_nullable": true,
  "is_updatable": true,
  "enums": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation Column

Update a column by ID

Code samples

# You can also use wget
curl -X PATCH /columns/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

PATCH /columns/{id} HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "string",
  "type": "string",
  "drop_default": true,
  "default_value": "string",
  "is_nullable": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/columns/{id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch '/columns/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('/columns/{id}', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/columns/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/columns/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/columns/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /columns/{id}

Body parameter

{
  "name": "string",
  "type": "string",
  "drop_default": true,
  "default_value": "string",
  "is_nullable": true
}

Parameters

Name In Type Required Description
body body object true none
» name body string false none
» type body string false none
» drop_default body boolean false none
» default_value body string false none
» is_nullable body boolean false none
id path string true none

Example responses

200 Response

{
  "table_id": 0,
  "schema": "string",
  "table": "string",
  "id": "string",
  "ordinal_position": 0,
  "name": "string",
  "default_value": "string",
  "data_type": "string",
  "format": "string",
  "description": "string",
  "is_identity": true,
  "identity_generation": "string",
  "is_nullable": true,
  "is_updatable": true,
  "enums": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation Column

Delete a column by ID

Code samples

# You can also use wget
curl -X DELETE /columns/{id} \
  -H 'Accept: application/json'

DELETE /columns/{id} HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/columns/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.delete '/columns/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.delete('/columns/{id}', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/columns/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/columns/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/columns/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /columns/{id}

Parameters

Name In Type Required Description
id path string true none

Example responses

200 Response

{
  "table_id": 0,
  "schema": "string",
  "table": "string",
  "id": "string",
  "ordinal_position": 0,
  "name": "string",
  "default_value": "string",
  "data_type": "string",
  "format": "string",
  "description": "string",
  "is_identity": true,
  "identity_generation": "string",
  "is_nullable": true,
  "is_updatable": true,
  "enums": [
    "string"
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation Column

/extensions

Get all extensions

Code samples

# You can also use wget
curl -X GET /extensions \
  -H 'Accept: application/json'

GET /extensions HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/extensions',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/extensions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/extensions', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/extensions', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/extensions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/extensions", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /extensions

Example responses

200 Response

[
  {
    "name": "string",
    "comment": "string",
    "default_version": "string",
    "installed_version": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Extension] false none none
» name string false none none
» comment string false none none
» default_version string false none none
» installed_version string false none none

Install an extension

Code samples

# You can also use wget
curl -X POST /extensions \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /extensions HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "string",
  "schema": "string",
  "version": "string",
  "cascade": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/extensions',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post '/extensions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/extensions', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/extensions', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/extensions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/extensions", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /extensions

Body parameter

{
  "name": "string",
  "schema": "string",
  "version": "string",
  "cascade": true
}

Parameters

Name In Type Required Description
body body object true none
» name body string true none
» schema body string false none
» version body string false none
» cascade body boolean false none

Example responses

200 Response

{
  "name": "string",
  "comment": "string",
  "default_version": "string",
  "installed_version": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Extension

Update/modify an extension by ID

Code samples

# You can also use wget
curl -X PATCH /extensions/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

PATCH /extensions/{id} HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "update": true,
  "version": "string",
  "schema": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/extensions/{id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch '/extensions/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('/extensions/{id}', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/extensions/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/extensions/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/extensions/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /extensions/{id}

Body parameter

{
  "update": true,
  "version": "string",
  "schema": "string"
}

Parameters

Name In Type Required Description
body body object true none
» update body boolean false none
» version body string false none
» schema body string false none
id path integer true none

Example responses

200 Response

{
  "name": "string",
  "comment": "string",
  "default_version": "string",
  "installed_version": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Extension

Uninstall an extension by ID

Code samples

# You can also use wget
curl -X DELETE /extensions/{id} \
  -H 'Accept: application/json'

DELETE /extensions/{id} HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/extensions/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.delete '/extensions/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.delete('/extensions/{id}', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/extensions/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/extensions/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/extensions/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /extensions/{id}

Parameters

Name In Type Required Description
id path integer true none

Example responses

200 Response

{
  "name": "string",
  "comment": "string",
  "default_version": "string",
  "installed_version": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Extension

/functions

Get all functions

Code samples

# You can also use wget
curl -X GET /functions \
  -H 'Accept: application/json'

GET /functions HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/functions',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/functions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/functions', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/functions', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/functions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/functions", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /functions

Parameters

Name In Type Required Description
include_system_schemas query boolean false none

Example responses

200 Response

[
  {
    "id": 0,
    "schema": "string",
    "name": "string",
    "language": "string",
    "definition": "string",
    "argument_types": "string",
    "return_type": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Function] false none none
» id integer false none none
» schema string false none none
» name string false none none
» language string false none none
» definition string false none none
» argument_types string false none none
» return_type string false none none

/policies

Get all policies

Code samples

# You can also use wget
curl -X GET /policies \
  -H 'Accept: application/json'

GET /policies HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/policies',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/policies',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/policies', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/policies', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/policies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/policies", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /policies

Parameters

Name In Type Required Description
include_system_schemas query boolean false none

Example responses

200 Response

[
  {
    "id": 0,
    "name": "string",
    "schema": "string",
    "table": "string",
    "table_id": 0,
    "action": "PERMISSIVE",
    "roles": [
      "string"
    ],
    "command": "string",
    "definition": "string",
    "check": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Policy] false none none
» id integer false none none
» name string false none none
» schema string false none none
» table string false none none
» table_id integer false none none
» action string false none none
» roles [string] false none none
» command string false none none
» definition string false none none
» check string¦null false none none

Enumerated Values

Property Value
action PERMISSIVE
action RESTRICTIVE

Create a policy

Code samples

# You can also use wget
curl -X POST /policies \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /policies HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "string",
  "schema": "string",
  "table": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/policies',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post '/policies',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/policies', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/policies', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/policies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/policies", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /policies

Body parameter

{
  "name": "string",
  "schema": "string",
  "table": "string"
}

Parameters

Name In Type Required Description
body body object true none
» name body string true none
» schema body string false none
» table body string true none

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "schema": "string",
  "table": "string",
  "table_id": 0,
  "action": "PERMISSIVE",
  "roles": [
    "string"
  ],
  "command": "string",
  "definition": "string",
  "check": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Policy

Update a policy by ID

Code samples

# You can also use wget
curl -X PATCH /policies/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

PATCH /policies/{id} HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "string",
  "schema": "string",
  "table": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/policies/{id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch '/policies/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('/policies/{id}', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/policies/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/policies/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/policies/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /policies/{id}

Body parameter

{
  "name": "string",
  "schema": "string",
  "table": "string"
}

Parameters

Name In Type Required Description
body body object true none
» name body string false none
» schema body string false none
» table body string false none
id path integer true none

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "schema": "string",
  "table": "string",
  "table_id": 0,
  "action": "PERMISSIVE",
  "roles": [
    "string"
  ],
  "command": "string",
  "definition": "string",
  "check": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Policy

Delete a policy by ID

Code samples

# You can also use wget
curl -X DELETE /policies/{id} \
  -H 'Accept: application/json'

DELETE /policies/{id} HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/policies/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.delete '/policies/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.delete('/policies/{id}', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/policies/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/policies/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/policies/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /policies/{id}

Parameters

Name In Type Required Description
id path integer true none

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "schema": "string",
  "table": "string",
  "table_id": 0,
  "action": "PERMISSIVE",
  "roles": [
    "string"
  ],
  "command": "string",
  "definition": "string",
  "check": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Policy

/roles

Get all roles

Code samples

# You can also use wget
curl -X GET /roles \
  -H 'Accept: application/json'

GET /roles HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/roles',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/roles',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/roles', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/roles', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/roles");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/roles", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /roles

Parameters

Name In Type Required Description
include_system_schemas query boolean false none

Example responses

200 Response

[
  {
    "id": 0,
    "name": "string",
    "is_superuser": true,
    "can_create_db": true,
    "can_create_role": true,
    "inherit_role": true,
    "can_login": true,
    "is_replication_role": true,
    "can_bypass_rls": true,
    "active_connections": 0,
    "connection_limit": 0,
    "password": "string",
    "valid_until": "string",
    "config": "string",
    "grants": [
      {
        "table_id": 0,
        "grantor": "string",
        "grantee": "string",
        "catalog": "string",
        "schema": "string",
        "table_name": "string",
        "privilege_type": "string",
        "is_grantable": true,
        "with_hierarchy": true
      }
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Role] false none none
» id integer false none none
» name string false none none
» is_superuser boolean false none none
» can_create_db boolean false none none
» can_create_role boolean false none none
» inherit_role boolean false none none
» can_login boolean false none none
» is_replication_role boolean false none none
» can_bypass_rls boolean false none none
» active_connections integer false none none
» connection_limit integer false none none
» password string false none none
» valid_until string¦null false none none
» config string¦null false none none
» grants [Grant] false none none
»» table_id integer false none none
»» grantor string false none none
»» grantee string false none none
»» catalog string false none none
»» schema string false none none
»» table_name string false none none
»» privilege_type string false none none
»» is_grantable boolean false none none
»» with_hierarchy boolean false none none

Create a role

Code samples

# You can also use wget
curl -X POST /roles \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /roles HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "string",
  "is_superuser": true,
  "can_create_db": true,
  "can_create_role": true,
  "inherit_role": true,
  "can_login": true,
  "is_replication_role": true,
  "can_bypass_rls": true,
  "connection_limit": 0,
  "password": "string",
  "valid_until": "string",
  "member_of": [
    "string"
  ],
  "members": [
    "string"
  ],
  "admins": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/roles',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post '/roles',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/roles', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/roles', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/roles");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/roles", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /roles

Body parameter

{
  "name": "string",
  "is_superuser": true,
  "can_create_db": true,
  "can_create_role": true,
  "inherit_role": true,
  "can_login": true,
  "is_replication_role": true,
  "can_bypass_rls": true,
  "connection_limit": 0,
  "password": "string",
  "valid_until": "string",
  "member_of": [
    "string"
  ],
  "members": [
    "string"
  ],
  "admins": [
    "string"
  ]
}

Parameters

Name In Type Required Description
body body object true none
» name body string true none
» is_superuser body boolean false none
» can_create_db body boolean false none
» can_create_role body boolean false none
» inherit_role body boolean false none
» can_login body boolean false none
» is_replication_role body boolean false none
» can_bypass_rls body boolean false none
» connection_limit body integer false none
» password body string false none
» valid_until body string false none
» member_of body [string] false none
» members body [string] false none
» admins body [string] false none

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "is_superuser": true,
  "can_create_db": true,
  "can_create_role": true,
  "inherit_role": true,
  "can_login": true,
  "is_replication_role": true,
  "can_bypass_rls": true,
  "active_connections": 0,
  "connection_limit": 0,
  "password": "string",
  "valid_until": "string",
  "config": "string",
  "grants": [
    {
      "table_id": 0,
      "grantor": "string",
      "grantee": "string",
      "catalog": "string",
      "schema": "string",
      "table_name": "string",
      "privilege_type": "string",
      "is_grantable": true,
      "with_hierarchy": true
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation Role

Update a role by ID

Code samples

# You can also use wget
curl -X PATCH /roles/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

PATCH /roles/{id} HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "string",
  "is_superuser": true,
  "can_create_db": true,
  "can_create_role": true,
  "inherit_role": true,
  "can_login": true,
  "is_replication_role": true,
  "can_bypass_rls": true,
  "connection_limit": 0,
  "password": "string",
  "valid_until": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/roles/{id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch '/roles/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('/roles/{id}', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/roles/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/roles/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/roles/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /roles/{id}

Body parameter

{
  "name": "string",
  "is_superuser": true,
  "can_create_db": true,
  "can_create_role": true,
  "inherit_role": true,
  "can_login": true,
  "is_replication_role": true,
  "can_bypass_rls": true,
  "connection_limit": 0,
  "password": "string",
  "valid_until": "string"
}

Parameters

Name In Type Required Description
body body object true none
» name body string false none
» is_superuser body boolean false none
» can_create_db body boolean false none
» can_create_role body boolean false none
» inherit_role body boolean false none
» can_login body boolean false none
» is_replication_role body boolean false none
» can_bypass_rls body boolean false none
» connection_limit body integer false none
» password body string false none
» valid_until body string false none
id path integer true none

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "is_superuser": true,
  "can_create_db": true,
  "can_create_role": true,
  "inherit_role": true,
  "can_login": true,
  "is_replication_role": true,
  "can_bypass_rls": true,
  "active_connections": 0,
  "connection_limit": 0,
  "password": "string",
  "valid_until": "string",
  "config": "string",
  "grants": [
    {
      "table_id": 0,
      "grantor": "string",
      "grantee": "string",
      "catalog": "string",
      "schema": "string",
      "table_name": "string",
      "privilege_type": "string",
      "is_grantable": true,
      "with_hierarchy": true
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation Role

Delete a role by ID

Code samples

# You can also use wget
curl -X DELETE /roles/{id} \
  -H 'Accept: application/json'

DELETE /roles/{id} HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/roles/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.delete '/roles/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.delete('/roles/{id}', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/roles/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/roles/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/roles/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /roles/{id}

Parameters

Name In Type Required Description
id path integer true none

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "is_superuser": true,
  "can_create_db": true,
  "can_create_role": true,
  "inherit_role": true,
  "can_login": true,
  "is_replication_role": true,
  "can_bypass_rls": true,
  "active_connections": 0,
  "connection_limit": 0,
  "password": "string",
  "valid_until": "string",
  "config": "string",
  "grants": [
    {
      "table_id": 0,
      "grantor": "string",
      "grantee": "string",
      "catalog": "string",
      "schema": "string",
      "table_name": "string",
      "privilege_type": "string",
      "is_grantable": true,
      "with_hierarchy": true
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation Role

/schemas

Get all schemas

Code samples

# You can also use wget
curl -X GET /schemas \
  -H 'Accept: application/json'

GET /schemas HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/schemas',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/schemas',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/schemas', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/schemas', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/schemas");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/schemas", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /schemas

Parameters

Name In Type Required Description
include_system_schemas query boolean false none

Example responses

200 Response

[
  {
    "id": 0,
    "catalog_name": "string",
    "name": "string",
    "owner": "string",
    "default_character_set_catalog": "string",
    "default_character_set_schema": "string",
    "default_character_set_name": "string",
    "sql_path": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Schema] false none none
» id integer false none none
» catalog_name string false none none
» name string false none none
» owner string false none none
» default_character_set_catalog string¦null false none none
» default_character_set_schema string¦null false none none
» default_character_set_name string¦null false none none
» sql_path string¦null false none none

Create a schema

Code samples

# You can also use wget
curl -X POST /schemas \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /schemas HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "string",
  "owner": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/schemas',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post '/schemas',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/schemas', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/schemas', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/schemas");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/schemas", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /schemas

Body parameter

{
  "name": "string",
  "owner": "string"
}

Parameters

Name In Type Required Description
body body object true none
» name body string true none
» owner body string true none

Example responses

200 Response

{
  "id": 0,
  "catalog_name": "string",
  "name": "string",
  "owner": "string",
  "default_character_set_catalog": "string",
  "default_character_set_schema": "string",
  "default_character_set_name": "string",
  "sql_path": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Schema

Update a schema by ID

Code samples

# You can also use wget
curl -X PATCH /schemas/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

PATCH /schemas/{id} HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "string",
  "owner": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/schemas/{id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch '/schemas/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('/schemas/{id}', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/schemas/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/schemas/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/schemas/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /schemas/{id}

Body parameter

{
  "name": "string",
  "owner": "string"
}

Parameters

Name In Type Required Description
body body object true none
» name body string false none
» owner body string false none
id path integer true none

Example responses

200 Response

{
  "id": 0,
  "catalog_name": "string",
  "name": "string",
  "owner": "string",
  "default_character_set_catalog": "string",
  "default_character_set_schema": "string",
  "default_character_set_name": "string",
  "sql_path": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Schema

Delete a schema by ID

Code samples

# You can also use wget
curl -X DELETE /schemas/{id} \
  -H 'Accept: application/json'

DELETE /schemas/{id} HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/schemas/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.delete '/schemas/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.delete('/schemas/{id}', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/schemas/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/schemas/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/schemas/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /schemas/{id}

Parameters

Name In Type Required Description
id path integer true none

Example responses

200 Response

{
  "id": 0,
  "catalog_name": "string",
  "name": "string",
  "owner": "string",
  "default_character_set_catalog": "string",
  "default_character_set_schema": "string",
  "default_character_set_name": "string",
  "sql_path": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful operation Schema

/tables

Get all tables

Code samples

# You can also use wget
curl -X GET /tables \
  -H 'Accept: application/json'

GET /tables HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/tables',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/tables',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/tables', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/tables', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/tables");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/tables", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /tables

Parameters

Name In Type Required Description
include_system_schemas query boolean false none

Example responses

200 Response

[
  {
    "id": 0,
    "catalog": "string",
    "schema": "string",
    "name": "string",
    "is_insertable_into": true,
    "rls_enabled": true,
    "rls_forced": true,
    "is_typed": true,
    "bytes": 0,
    "size": "string",
    "seq_scan_count": 0,
    "seq_row_read_count": 0,
    "idx_scan_count": 0,
    "idx_row_read_count": 0,
    "row_ins_count": 0,
    "row_upd_count": 0,
    "row_del_count": 0,
    "row_hot_upd_count": 0,
    "live_row_count": 0,
    "dead_row_count": 0,
    "rows_mod_since_analyze": 0,
    "last_vacuum": "string",
    "last_autovacuum": "string",
    "last_analyze": "string",
    "last_autoanalyze": "string",
    "vacuum_count": 0,
    "autovacuum_count": 0,
    "analyze_count": 0,
    "autoanalyze_count": 0,
    "columns": [
      {
        "table_id": 0,
        "schema": "string",
        "table": "string",
        "id": "string",
        "ordinal_position": 0,
        "name": "string",
        "default_value": "string",
        "data_type": "string",
        "format": "string",
        "description": "string",
        "is_identity": true,
        "identity_generation": "string",
        "is_nullable": true,
        "is_updatable": true,
        "enums": [
          "string"
        ]
      }
    ],
    "grants": [
      {
        "table_id": 0,
        "grantor": "string",
        "grantee": "string",
        "catalog": "string",
        "schema": "string",
        "table_name": "string",
        "privilege_type": "string",
        "is_grantable": true,
        "with_hierarchy": true
      }
    ],
    "policies": [
      {
        "id": 0,
        "name": "string",
        "schema": "string",
        "table": "string",
        "table_id": 0,
        "action": "PERMISSIVE",
        "roles": [
          "string"
        ],
        "command": "string",
        "definition": "string",
        "check": "string"
      }
    ],
    "primary_keys": [
      {
        "schema": "string",
        "table_name": "string",
        "name": "string",
        "table_id": 0
      }
    ],
    "relationships": [
      {
        "source_schema": "string",
        "source_table_name": "string",
        "source_column_name": "string",
        "target_table_schema": "string",
        "target_table_name": "string",
        "target_column_name": "string",
        "constraint_name": "string"
      }
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Table] false none none
» id integer false none none
» catalog string false none none
» schema string false none none
» name string false none none
» is_insertable_into boolean false none none
» rls_enabled boolean false none none
» rls_forced boolean false none none
» is_typed boolean false none none
» bytes integer false none none
» size string false none none
» seq_scan_count integer false none none
» seq_row_read_count integer false none none
» idx_scan_count integer false none none
» idx_row_read_count integer false none none
» row_ins_count integer false none none
» row_upd_count integer false none none
» row_del_count integer false none none
» row_hot_upd_count integer false none none
» live_row_count integer false none none
» dead_row_count integer false none none
» rows_mod_since_analyze integer false none none
» last_vacuum string¦null false none none
» last_autovacuum string¦null false none none
» last_analyze string¦null false none none
» last_autoanalyze string¦null false none none
» vacuum_count integer false none none
» autovacuum_count integer false none none
» analyze_count integer false none none
» autoanalyze_count integer false none none
» columns [Column] false none none
»» table_id integer false none none
»» schema string false none none
»» table string false none none
»» id string false none none
»» ordinal_position integer false none none
»» name string false none none
»» default_value string false none none
»» data_type string false none none
»» format string false none none
»» description string false none none
»» is_identity boolean false none none
»» identity_generation string false none none
»» is_nullable boolean false none none
»» is_updatable boolean false none none
»» enums [string] false none none
» grants [Grant] false none none
»» table_id integer false none none
»» grantor string false none none
»» grantee string false none none
»» catalog string false none none
»» schema string false none none
»» table_name string false none none
»» privilege_type string false none none
»» is_grantable boolean false none none
»» with_hierarchy boolean false none none
» policies [Policy] false none none
»» id integer false none none
»» name string false none none
»» schema string false none none
»» table string false none none
»» table_id integer false none none
»» action string false none none
»» roles [string] false none none
»» command string false none none
»» definition string false none none
»» check string¦null false none none
» primary_keys [object] false none none
»» schema string false none none
»» table_name string false none none
»» name string false none none
»» table_id integer false none none
» relationships [object] false none none
»» source_schema string false none none
»» source_table_name string false none none
»» source_column_name string false none none
»» target_table_schema string false none none
»» target_table_name string false none none
»» target_column_name string false none none
»» constraint_name string false none none

Enumerated Values

Property Value
action PERMISSIVE
action RESTRICTIVE

Create a table

Code samples

# You can also use wget
curl -X POST /tables \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /tables HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "string",
  "schema": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/tables',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post '/tables',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/tables', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/tables', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/tables");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/tables", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /tables

Body parameter

{
  "name": "string",
  "schema": "string"
}

Parameters

Name In Type Required Description
body body object true none
» name body string true none
» schema body string false none

Example responses

200 Response

{
  "id": 0,
  "catalog": "string",
  "schema": "string",
  "name": "string",
  "is_insertable_into": true,
  "rls_enabled": true,
  "rls_forced": true,
  "is_typed": true,
  "bytes": 0,
  "size": "string",
  "seq_scan_count": 0,
  "seq_row_read_count": 0,
  "idx_scan_count": 0,
  "idx_row_read_count": 0,
  "row_ins_count": 0,
  "row_upd_count": 0,
  "row_del_count": 0,
  "row_hot_upd_count": 0,
  "live_row_count": 0,
  "dead_row_count": 0,
  "rows_mod_since_analyze": 0,
  "last_vacuum": "string",
  "last_autovacuum": "string",
  "last_analyze": "string",
  "last_autoanalyze": "string",
  "vacuum_count": 0,
  "autovacuum_count": 0,
  "analyze_count": 0,
  "autoanalyze_count": 0,
  "columns": [
    {
      "table_id": 0,
      "schema": "string",
      "table": "string",
      "id": "string",
      "ordinal_position": 0,
      "name": "string",
      "default_value": "string",
      "data_type": "string",
      "format": "string",
      "description": "string",
      "is_identity": true,
      "identity_generation": "string",
      "is_nullable": true,
      "is_updatable": true,
      "enums": [
        "string"
      ]
    }
  ],
  "grants": [
    {
      "table_id": 0,
      "grantor": "string",
      "grantee": "string",
      "catalog": "string",
      "schema": "string",
      "table_name": "string",
      "privilege_type": "string",
      "is_grantable": true,
      "with_hierarchy": true
    }
  ],
  "policies": [
    {
      "id": 0,
      "name": "string",
      "schema": "string",
      "table": "string",
      "table_id": 0,
      "action": "PERMISSIVE",
      "roles": [
        "string"
      ],
      "command": "string",
      "definition": "string",
      "check": "string"
    }
  ],
  "primary_keys": [
    {
      "schema": "string",
      "table_name": "string",
      "name": "string",
      "table_id": 0
    }
  ],
  "relationships": [
    {
      "source_schema": "string",
      "source_table_name": "string",
      "source_column_name": "string",
      "target_table_schema": "string",
      "target_table_name": "string",
      "target_column_name": "string",
      "constraint_name": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation Table

Update a table by ID

Code samples

# You can also use wget
curl -X PATCH /tables/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

PATCH /tables/{id} HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "schema": "string",
  "name": "string",
  "rls_enabled": true,
  "rls_forced": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/tables/{id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch '/tables/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('/tables/{id}', headers = headers)

print(r.json())

 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/tables/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/tables/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/tables/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /tables/{id}

Body parameter

{
  "schema": "string",
  "name": "string",
  "rls_enabled": true,
  "rls_forced": true
}

Parameters

Name In Type Required Description
body body object true none
» schema body string false none
» name body string false none
» rls_enabled body boolean false none
» rls_forced body boolean false none
id path integer true none

Example responses

200 Response

{
  "id": 0,
  "catalog": "string",
  "schema": "string",
  "name": "string",
  "is_insertable_into": true,
  "rls_enabled": true,
  "rls_forced": true,
  "is_typed": true,
  "bytes": 0,
  "size": "string",
  "seq_scan_count": 0,
  "seq_row_read_count": 0,
  "idx_scan_count": 0,
  "idx_row_read_count": 0,
  "row_ins_count": 0,
  "row_upd_count": 0,
  "row_del_count": 0,
  "row_hot_upd_count": 0,
  "live_row_count": 0,
  "dead_row_count": 0,
  "rows_mod_since_analyze": 0,
  "last_vacuum": "string",
  "last_autovacuum": "string",
  "last_analyze": "string",
  "last_autoanalyze": "string",
  "vacuum_count": 0,
  "autovacuum_count": 0,
  "analyze_count": 0,
  "autoanalyze_count": 0,
  "columns": [
    {
      "table_id": 0,
      "schema": "string",
      "table": "string",
      "id": "string",
      "ordinal_position": 0,
      "name": "string",
      "default_value": "string",
      "data_type": "string",
      "format": "string",
      "description": "string",
      "is_identity": true,
      "identity_generation": "string",
      "is_nullable": true,
      "is_updatable": true,
      "enums": [
        "string"
      ]
    }
  ],
  "grants": [
    {
      "table_id": 0,
      "grantor": "string",
      "grantee": "string",
      "catalog": "string",
      "schema": "string",
      "table_name": "string",
      "privilege_type": "string",
      "is_grantable": true,
      "with_hierarchy": true
    }
  ],
  "policies": [
    {
      "id": 0,
      "name": "string",
      "schema": "string",
      "table": "string",
      "table_id": 0,
      "action": "PERMISSIVE",
      "roles": [
        "string"
      ],
      "command": "string",
      "definition": "string",
      "check": "string"
    }
  ],
  "primary_keys": [
    {
      "schema": "string",
      "table_name": "string",
      "name": "string",
      "table_id": 0
    }
  ],
  "relationships": [
    {
      "source_schema": "string",
      "source_table_name": "string",
      "source_column_name": "string",
      "target_table_schema": "string",
      "target_table_name": "string",
      "target_column_name": "string",
      "constraint_name": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation Table

Delete a table by ID

Code samples

# You can also use wget
curl -X DELETE /tables/{id} \
  -H 'Accept: application/json'

DELETE /tables/{id} HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/tables/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.delete '/tables/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.delete('/tables/{id}', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/tables/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/tables/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/tables/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /tables/{id}

Parameters

Name In Type Required Description
id path integer true none

Example responses

200 Response

{
  "id": 0,
  "catalog": "string",
  "schema": "string",
  "name": "string",
  "is_insertable_into": true,
  "rls_enabled": true,
  "rls_forced": true,
  "is_typed": true,
  "bytes": 0,
  "size": "string",
  "seq_scan_count": 0,
  "seq_row_read_count": 0,
  "idx_scan_count": 0,
  "idx_row_read_count": 0,
  "row_ins_count": 0,
  "row_upd_count": 0,
  "row_del_count": 0,
  "row_hot_upd_count": 0,
  "live_row_count": 0,
  "dead_row_count": 0,
  "rows_mod_since_analyze": 0,
  "last_vacuum": "string",
  "last_autovacuum": "string",
  "last_analyze": "string",
  "last_autoanalyze": "string",
  "vacuum_count": 0,
  "autovacuum_count": 0,
  "analyze_count": 0,
  "autoanalyze_count": 0,
  "columns": [
    {
      "table_id": 0,
      "schema": "string",
      "table": "string",
      "id": "string",
      "ordinal_position": 0,
      "name": "string",
      "default_value": "string",
      "data_type": "string",
      "format": "string",
      "description": "string",
      "is_identity": true,
      "identity_generation": "string",
      "is_nullable": true,
      "is_updatable": true,
      "enums": [
        "string"
      ]
    }
  ],
  "grants": [
    {
      "table_id": 0,
      "grantor": "string",
      "grantee": "string",
      "catalog": "string",
      "schema": "string",
      "table_name": "string",
      "privilege_type": "string",
      "is_grantable": true,
      "with_hierarchy": true
    }
  ],
  "policies": [
    {
      "id": 0,
      "name": "string",
      "schema": "string",
      "table": "string",
      "table_id": 0,
      "action": "PERMISSIVE",
      "roles": [
        "string"
      ],
      "command": "string",
      "definition": "string",
      "check": "string"
    }
  ],
  "primary_keys": [
    {
      "schema": "string",
      "table_name": "string",
      "name": "string",
      "table_id": 0
    }
  ],
  "relationships": [
    {
      "source_schema": "string",
      "source_table_name": "string",
      "source_column_name": "string",
      "target_table_schema": "string",
      "target_table_name": "string",
      "target_column_name": "string",
      "constraint_name": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful operation Table

/types

Get all types

Code samples

# You can also use wget
curl -X GET /types \
  -H 'Accept: application/json'

GET /types HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/types',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/types',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/types', headers = headers)

print(r.json())

 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/types', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/types");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/types", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /types

Parameters

Name In Type Required Description
include_system_schemas query boolean false none

Example responses

200 Response

[
  {
    "id": 0,
    "name": "string",
    "schema": "string",
    "format": "string",
    "description": "string",
    "enums": [
      "string"
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK Successful operation Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Type] false none none
» id integer false none none
» name string false none none
» schema string false none none
» format string false none none
» description string¦null false none none
» enums [string] false none none

Schemas

Column

{
  "table_id": 0,
  "schema": "string",
  "table": "string",
  "id": "string",
  "ordinal_position": 0,
  "name": "string",
  "default_value": "string",
  "data_type": "string",
  "format": "string",
  "description": "string",
  "is_identity": true,
  "identity_generation": "string",
  "is_nullable": true,
  "is_updatable": true,
  "enums": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
table_id integer false none none
schema string false none none
table string false none none
id string false none none
ordinal_position integer false none none
name string false none none
default_value string false none none
data_type string false none none
format string false none none
description string false none none
is_identity boolean false none none
identity_generation string false none none
is_nullable boolean false none none
is_updatable boolean false none none
enums [string] false none none

Config

{
  "name": "string",
  "setting": "string",
  "category": "string",
  "group": "string",
  "subgroup": "string",
  "unit": "string",
  "short_desc": "string",
  "extra_desc": "string",
  "context": "string",
  "vartype": "string",
  "source": "string",
  "min_val": "string",
  "max_val": "string",
  "enumvals": [
    "string"
  ],
  "boot_val": "string",
  "reset_val": "string",
  "sourcefile": "string",
  "sourceline": 0,
  "pending_restart": true
}

Properties

Name Type Required Restrictions Description
name string false none none
setting string false none none
category string false none none
group string false none none
subgroup string false none none
unit string¦null false none none
short_desc string false none none
extra_desc string¦null false none none
context string false none none
vartype string false none none
source string false none none
min_val string¦null false none none
max_val string¦null false none none
enumvals [string]¦null false none none
boot_val string false none none
reset_val string false none none
sourcefile string¦null false none none
sourceline integer¦null false none none
pending_restart boolean false none none

Extension

{
  "name": "string",
  "comment": "string",
  "default_version": "string",
  "installed_version": "string"
}

Properties

Name Type Required Restrictions Description
name string false none none
comment string false none none
default_version string false none none
installed_version string false none none

Function

{
  "id": 0,
  "schema": "string",
  "name": "string",
  "language": "string",
  "definition": "string",
  "argument_types": "string",
  "return_type": "string"
}

Properties

Name Type Required Restrictions Description
id integer false none none
schema string false none none
name string false none none
language string false none none
definition string false none none
argument_types string false none none
return_type string false none none

Grant

{
  "table_id": 0,
  "grantor": "string",
  "grantee": "string",
  "catalog": "string",
  "schema": "string",
  "table_name": "string",
  "privilege_type": "string",
  "is_grantable": true,
  "with_hierarchy": true
}

Properties

Name Type Required Restrictions Description
table_id integer false none none
grantor string false none none
grantee string false none none
catalog string false none none
schema string false none none
table_name string false none none
privilege_type string false none none
is_grantable boolean false none none
with_hierarchy boolean false none none

Policy

{
  "id": 0,
  "name": "string",
  "schema": "string",
  "table": "string",
  "table_id": 0,
  "action": "PERMISSIVE",
  "roles": [
    "string"
  ],
  "command": "string",
  "definition": "string",
  "check": "string"
}

Properties

Name Type Required Restrictions Description
id integer false none none
name string false none none
schema string false none none
table string false none none
table_id integer false none none
action string false none none
roles [string] false none none
command string false none none
definition string false none none
check string¦null false none none

Enumerated Values

Property Value
action PERMISSIVE
action RESTRICTIVE

Role

{
  "id": 0,
  "name": "string",
  "is_superuser": true,
  "can_create_db": true,
  "can_create_role": true,
  "inherit_role": true,
  "can_login": true,
  "is_replication_role": true,
  "can_bypass_rls": true,
  "active_connections": 0,
  "connection_limit": 0,
  "password": "string",
  "valid_until": "string",
  "config": "string",
  "grants": [
    {
      "table_id": 0,
      "grantor": "string",
      "grantee": "string",
      "catalog": "string",
      "schema": "string",
      "table_name": "string",
      "privilege_type": "string",
      "is_grantable": true,
      "with_hierarchy": true
    }
  ]
}

Properties

Name Type Required Restrictions Description
id integer false none none
name string false none none
is_superuser boolean false none none
can_create_db boolean false none none
can_create_role boolean false none none
inherit_role boolean false none none
can_login boolean false none none
is_replication_role boolean false none none
can_bypass_rls boolean false none none
active_connections integer false none none
connection_limit integer false none none
password string false none none
valid_until string¦null false none none
config string¦null false none none
grants [Grant] false none none

Schema

{
  "id": 0,
  "catalog_name": "string",
  "name": "string",
  "owner": "string",
  "default_character_set_catalog": "string",
  "default_character_set_schema": "string",
  "default_character_set_name": "string",
  "sql_path": "string"
}

Properties

Name Type Required Restrictions Description
id integer false none none
catalog_name string false none none
name string false none none
owner string false none none
default_character_set_catalog string¦null false none none
default_character_set_schema string¦null false none none
default_character_set_name string¦null false none none
sql_path string¦null false none none

Table

{
  "id": 0,
  "catalog": "string",
  "schema": "string",
  "name": "string",
  "is_insertable_into": true,
  "rls_enabled": true,
  "rls_forced": true,
  "is_typed": true,
  "bytes": 0,
  "size": "string",
  "seq_scan_count": 0,
  "seq_row_read_count": 0,
  "idx_scan_count": 0,
  "idx_row_read_count": 0,
  "row_ins_count": 0,
  "row_upd_count": 0,
  "row_del_count": 0,
  "row_hot_upd_count": 0,
  "live_row_count": 0,
  "dead_row_count": 0,
  "rows_mod_since_analyze": 0,
  "last_vacuum": "string",
  "last_autovacuum": "string",
  "last_analyze": "string",
  "last_autoanalyze": "string",
  "vacuum_count": 0,
  "autovacuum_count": 0,
  "analyze_count": 0,
  "autoanalyze_count": 0,
  "columns": [
    {
      "table_id": 0,
      "schema": "string",
      "table": "string",
      "id": "string",
      "ordinal_position": 0,
      "name": "string",
      "default_value": "string",
      "data_type": "string",
      "format": "string",
      "description": "string",
      "is_identity": true,
      "identity_generation": "string",
      "is_nullable": true,
      "is_updatable": true,
      "enums": [
        "string"
      ]
    }
  ],
  "grants": [
    {
      "table_id": 0,
      "grantor": "string",
      "grantee": "string",
      "catalog": "string",
      "schema": "string",
      "table_name": "string",
      "privilege_type": "string",
      "is_grantable": true,
      "with_hierarchy": true
    }
  ],
  "policies": [
    {
      "id": 0,
      "name": "string",
      "schema": "string",
      "table": "string",
      "table_id": 0,
      "action": "PERMISSIVE",
      "roles": [
        "string"
      ],
      "command": "string",
      "definition": "string",
      "check": "string"
    }
  ],
  "primary_keys": [
    {
      "schema": "string",
      "table_name": "string",
      "name": "string",
      "table_id": 0
    }
  ],
  "relationships": [
    {
      "source_schema": "string",
      "source_table_name": "string",
      "source_column_name": "string",
      "target_table_schema": "string",
      "target_table_name": "string",
      "target_column_name": "string",
      "constraint_name": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
id integer false none none
catalog string false none none
schema string false none none
name string false none none
is_insertable_into boolean false none none
rls_enabled boolean false none none
rls_forced boolean false none none
is_typed boolean false none none
bytes integer false none none
size string false none none
seq_scan_count integer false none none
seq_row_read_count integer false none none
idx_scan_count integer false none none
idx_row_read_count integer false none none
row_ins_count integer false none none
row_upd_count integer false none none
row_del_count integer false none none
row_hot_upd_count integer false none none
live_row_count integer false none none
dead_row_count integer false none none
rows_mod_since_analyze integer false none none
last_vacuum string¦null false none none
last_autovacuum string¦null false none none
last_analyze string¦null false none none
last_autoanalyze string¦null false none none
vacuum_count integer false none none
autovacuum_count integer false none none
analyze_count integer false none none
autoanalyze_count integer false none none
columns [Column] false none none
grants [Grant] false none none
policies [Policy] false none none
primary_keys [object] false none none
» schema string false none none
» table_name string false none none
» name string false none none
» table_id integer false none none
relationships [object] false none none
» source_schema string false none none
» source_table_name string false none none
» source_column_name string false none none
» target_table_schema string false none none
» target_table_name string false none none
» target_column_name string false none none
» constraint_name string false none none

Type

{
  "id": 0,
  "name": "string",
  "schema": "string",
  "format": "string",
  "description": "string",
  "enums": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
id integer false none none
name string false none none
schema string false none none
format string false none none
description string¦null false none none
enums [string] false none none

Version

{
  "version": "string",
  "version_number": 0,
  "active_connections": 0,
  "max_connections": 0
}

Properties

Name Type Required Restrictions Description
version string false none none
version_number integer false none none
active_connections integer false none none
max_connections integer false none none