curl --request POST \
--url https://api.platform.infino.ws/v1/schema/{database} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"table_name": "<string>",
"encoding": "<string>",
"expected_schema_id": 1,
"patch": {}
}
'import requests
url = "https://api.platform.infino.ws/v1/schema/{database}"
payload = {
"table_name": "<string>",
"encoding": "<string>",
"expected_schema_id": 1,
"patch": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({table_name: '<string>', encoding: '<string>', expected_schema_id: 1, patch: {}})
};
fetch('https://api.platform.infino.ws/v1/schema/{database}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.platform.infino.ws/v1/schema/{database}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'table_name' => '<string>',
'encoding' => '<string>',
'expected_schema_id' => 1,
'patch' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.platform.infino.ws/v1/schema/{database}"
payload := strings.NewReader("{\n \"table_name\": \"<string>\",\n \"encoding\": \"<string>\",\n \"expected_schema_id\": 1,\n \"patch\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.platform.infino.ws/v1/schema/{database}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"table_name\": \"<string>\",\n \"encoding\": \"<string>\",\n \"expected_schema_id\": 1,\n \"patch\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platform.infino.ws/v1/schema/{database}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"table_name\": \"<string>\",\n \"encoding\": \"<string>\",\n \"expected_schema_id\": 1,\n \"patch\": {}\n}"
response = http.request(request)
puts response.read_body[
{
"type": "<string>",
"dim": 1,
"fields": "<array>",
"item": "<string>",
"key": "<unknown>",
"name": "<string>",
"nullable": true,
"precision": 1,
"scale": 123,
"tz": "<string>",
"value": "<unknown>"
}
]Describe or change a table's schema
With table_name alone, return the table’s columns. With patch, change the schema — adding, retyping, renaming, indexing or retiring a column, or creating the table when there is none — and return the schema document that results. A patch needs the manage capability.
curl --request POST \
--url https://api.platform.infino.ws/v1/schema/{database} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"table_name": "<string>",
"encoding": "<string>",
"expected_schema_id": 1,
"patch": {}
}
'import requests
url = "https://api.platform.infino.ws/v1/schema/{database}"
payload = {
"table_name": "<string>",
"encoding": "<string>",
"expected_schema_id": 1,
"patch": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({table_name: '<string>', encoding: '<string>', expected_schema_id: 1, patch: {}})
};
fetch('https://api.platform.infino.ws/v1/schema/{database}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.platform.infino.ws/v1/schema/{database}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'table_name' => '<string>',
'encoding' => '<string>',
'expected_schema_id' => 1,
'patch' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.platform.infino.ws/v1/schema/{database}"
payload := strings.NewReader("{\n \"table_name\": \"<string>\",\n \"encoding\": \"<string>\",\n \"expected_schema_id\": 1,\n \"patch\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.platform.infino.ws/v1/schema/{database}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"table_name\": \"<string>\",\n \"encoding\": \"<string>\",\n \"expected_schema_id\": 1,\n \"patch\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platform.infino.ws/v1/schema/{database}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"table_name\": \"<string>\",\n \"encoding\": \"<string>\",\n \"expected_schema_id\": 1,\n \"patch\": {}\n}"
response = http.request(request)
puts response.read_body[
{
"type": "<string>",
"dim": 1,
"fields": "<array>",
"item": "<string>",
"key": "<unknown>",
"name": "<string>",
"nullable": true,
"precision": 1,
"scale": 123,
"tz": "<string>",
"value": "<unknown>"
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Target database.
Body
POST /v1/schema/{database}: one op, two shapes. With table_name alone
it describes the table; with patch it changes the schema — or creates
the table when there is none — and describes the result.
The two shapes answer differently. A describe answers the
[{name, type, nullable, …}] column-descriptor array, which is what it
has always answered; encoding asks for the other forms. A write answers
the schema document ([SchemaDocument]), which is what carries the
schema_id the next compare-and-set needs.
Response encoding of a describe. Omitted (the default) returns the
[{name, type, nullable, …}] column-descriptor array; "document"
returns the schema document ([SchemaDocument]), which adds each
column's stable id, its index and its metadata; "ipc" returns an
Arrow IPC schema message carrying the Arrow shape of the columns. Any
other value is a 400.
Only a describe takes it: sending it together with patch is a 400,
because a write always answers the document.
Compare-and-set against the document's schema_id: the write is
refused with 409 when the schema has moved.
x >= 0The schema write, in the document's own shape: fields to add or
change (matched by id when given, else by name; dropped: true
retires one), max_fields, max_depth. Nothing is
dropped by omission, and applying what a describe returned changes
nothing. Requires the manage capability; a patch that is present
and not null counts as a write, whether the body is sent as an object
or as an array, which serde fills by position.
Response
A describe answers the table's columns as the [{name, type, nullable, …}] descriptor array by default, the schema document under encoding: "document", and an Arrow IPC schema message under encoding: "ipc". A write answers the schema document that resulted — the patch applied, or the table created from it.
- object[]
- object
One column as POST /v1/schema/{database} describes it by default. name, type and nullable describe a column and a struct's own fields; a map's key/value, and a list's item when the element is itself nested, are types rather than fields and carry type and its keys alone. This is the create_table descriptor vocabulary widened to every type a table can hold — see SchemaField for which of them create_table accepts back. A column's stable id, its index and its metadata are not in this shape; ask for encoding: "document" to get those.
The type tag: a scalar spelling ("i64", "large_utf8",
"timestamp_ms", …), or "vector", "list", "large_list",
"fixed_size_list", "struct", "map", "decimal", "decimal256".
A type with no spelling at all falls back to Arrow's own display name.
Element count of a vector or fixed_size_list.
x >= 0A struct's own fields.
The element's bare scalar spelling, or its own type keys.
A map's key type.
Absent when this describes a type rather than a field — a map's
key/value, or a nested list item.
Absent alongside name, for the same reason.
Total digits of a decimal.
x >= 0Digits after the point of a decimal; may be negative.
IANA time zone of a zoned timestamp.
A map's value type.
