Chelabase
ManagementSql editor

Save a SQL query

POST
/v1/databases/{id}/sql-queries

Saves a query for the caller. A user keeps at most 500 per database.

Authorization

bearer
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Database id

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name*string

1-120 characters after trimming; unique per user and database, ignoring case.

pg_database?|

The Postgres database the editor last ran it in (up to 63 bytes; empty is stored as null).

role?|

The role the editor last ran it as (up to 63 bytes; empty is stored as null); absent: the owner.

sql*string

1 byte to 1 MiB.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/databases/497f6eca-6276-4993-bfeb-53cbbbba6f08/sql-queries" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "sql": "string"  }'
{  "created_at": "2019-08-24T14:15:22Z",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "pg_database": "string",  "role": "string",  "sql": "string",  "updated_at": "2019-08-24T14:15:22Z",  "version": 0}