Table Management
Manage tables in your Antfly cluster. Tables store your documents and support multiple indexes.
Schema
Schemas define the structure and types of data in your tables using JSON Schema with custom Antfly extensions. While optional, defining a schema provides several benefits:
- Type Safety: Ensures data consistency across documents
- Optimized Indexing: Full Text Index uses type information for appropriate field mappings in Antfly's native full-text index
- Better Search: Type-aware indexing improves search relevance and performance
- Query Optimization: Enables type-specific query operations
JSON Schema Structure
Antfly uses standard JSON Schema with custom extensions:
{
"document_schemas": {
"article": {
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string",
"x-antfly-types": ["text", "keyword"]
},
"body": {
"type": "string",
"x-antfly-types": ["html"]
},
"tags": {
"type": "array",
"items": {"type": "string"},
"x-antfly-types": ["keyword"]
},
"metadata": {
"type": "object",
"properties": {
"author": {"type": "string"}
}
}
},
"additionalProperties": false,
"x-antfly-include-in-all": ["title", "body"]
}
}
}
}
Dynamic Indexing (additionalProperties):
"additionalProperties": false- Reject documents that carry fields not defined inproperties(standard JSON Schema validation); only declared fields exist, so only declared fields are indexed"additionalProperties": true- Store undeclared fields and index them dynamically (flexible but slower)- If not specified, undeclared fields are stored but not indexed
Dynamic indexing only ever applies to undeclared fields. A property
listed in properties is indexed exactly as its declaration says: one
declared with x-antfly-index: false, or with a non-text type such as
blob or embedding, stays out of the text index even when the
enclosing object sets "additionalProperties": true.
Nested Objects:
- Use
"type": "object"with nestedpropertiesfor structured data - Nested objects don't inherit
x-antfly-include-in-allfrom parent - Arrays of objects: Use
"type": "array"with"items": {"type": "object", ...}
Antfly Extensions
x-antfly-types
Array of Antfly type strings specifying how to index a field. Multiple types create multiple field mappings:
- Single type:
"x-antfly-types": ["text"]- Creates standard text field - Multiple types:
"x-antfly-types": ["text", "keyword"]- CreatesfieldName(text) andfieldName.keyword - With search-as-you-type:
"x-antfly-types": ["text", "search_as_you_type"]- CreatesfieldName(text),fieldName._2gram,fieldName._3gram, andfieldName._index_prefix - With substring:
"x-antfly-types": ["text", "substring"]- CreatesfieldName(text) andfieldName._substring, a suffix-indexed companion that answers "contains" queries without scanning the term dictionary
Type Combination Rules:
textandhtmlare mutually exclusive (choose one as primary type)- Primary types (
text,html) can be combined with variants (keyword,search_as_you_type,substring) search_as_you_typeorsubstring+keywordallowed without primary type (auto-addstext)
x-antfly-types remains supported as the compact multi-mapping/search
shorthand. Exact scalar names in that array describe how a field is
searched, but do not opt the field into the typed doc-value storage
required by production order_by.
x-antfly-field
Use an explicit field mapping for fields that participate in exact sort.
Set sortable: true on a keyword, numeric/number/integer,
boolean/bool, datetime/date/timestamp, or link mapping. Antfly derives
the internal typed doc values; doc_values is intentionally not a public
setting. The mapping type must accept the property's JSON Schema value
type. Explicit property mappings take precedence over dynamic templates.
When multiple document types declare the same dotted field path, their
normalized physical mappings must be identical.
{
"created_at": {
"type": "string",
"format": "date-time",
"x-antfly-field": {"type": "date", "sortable": true}
},
"title": {
"type": "string",
"x-antfly-field": {
"type": "text",
"fields": {
"keyword": {"type": "keyword", "sortable": true}
}
}
}
}
Sort the examples above with created_at and title.keyword,
respectively. An analyzed text field is never directly sortable.
Adding sortable: true to an existing table is a physical mapping
change. Once the write or rebuild visibility barrier completes, clients
may issue order_by directly. Antfly validates cold physical coverage on
first use and fails closed when it is incomplete; status reads do not
warm columns, so sort_lifecycle_state may remain declared until that
validation succeeds.
x-antfly-index
Boolean to disable indexing for a field:
{"type": "string", "x-antfly-index": false}
The value is still stored and returned with the document, but nothing at
or below that path is indexed: no text postings, no typed doc values, and
no dynamic indexing even when the enclosing object sets
"additionalProperties": true. On an object or an array's items it
applies to the whole subtree. This is the way to keep a large field that
exists only as the source of an embeddings index out of the text index.
Adding x-antfly-index: false to an existing table is a schema
migration, not an in-place edit: the current full-text index keeps
serving the field's existing postings until the replacement index has
been rebuilt under the new schema, and only then are they gone. The
table does not shrink on the schema update itself.
x-antfly-include-in-all
Schema-level array of field names to include in the special _all field for cross-field search:
{
"x-antfly-include-in-all": ["title", "body", "description"]
}
Only text-based types (text, html, keyword, search_as_you_type, substring, link) are included, and only the primary field (not .keyword, ._2gram, ._3gram, ._index_prefix, or ._substring variants).
Antfly Types
Text Types
text- Full-text searchable with tokenization and analysis. Use for articles, descriptions, searchable content.html- Full-text searchable with HTML tag stripping. Use for HTML content.keyword- Exact-match strings (not analyzed). Use for IDs, tags, categories, filters.search_as_you_type- Search-as-you-type mappings for autocomplete. CreatesfieldName._2gram,fieldName._3gram, andfieldName._index_prefixmappings.substring- Infix ("contains") matching for identifiers, SKUs, paths, and code. CreatesfieldName._substring, which indexes every suffix (2 to 32 bytes) of each lowercased token and of each adjacent token pair joined without a separator, sorag3-weaver,rag3_weaver, andrag3weaverall match amatchorprefixquery forg3weonfieldName._substring. Queries are lowercased, adjacent query tokens are joined the same way, and a query of three or more tokens requires every adjacent pair. Single-character queries never match. Expect the companion to cost several times the size of the text it indexes; opt in per field.link- URL/link field (keyword analyzer).
Numeric and Boolean Types
numeric- Numbers (integers and floats). Use for counts, prices, scores.boolean- True/false values.
Date/Time Types
datetime- Timestamp fields. Use for created/updated dates, events.
Geospatial Types
geopoint- Latitude/longitude point. Use for locations, coordinates.geoshape- Complex geographic shape. Use for boundaries, regions.
Special Types
embedding- Vector embeddings (not indexed in the full-text index). Use for similarity search.blob- Binary data (not indexed). Use for images, files, binary content.
Type Inference
If x-antfly-types is not specified, types are inferred from JSON Schema type:
"type": "string"→["text"]"type": "number"or"integer"→["numeric"]"type": "boolean"→["boolean"]
Automatic Fields
Antfly automatically adds these fields to all document schemas:
_timestamp: Datetime field for document timestamps_summaries: Object field (map of index names to summary text) for AI-generated summaries
Field Naming Conventions
When multiple types are specified, Antfly creates additional field mappings with suffixes:
- Primary field (
textorhtml): Uses original field name - Keyword variant:
fieldName.keyword - Search-as-you-type:
fieldName._2gram,fieldName._3gram, andfieldName._index_prefix - Substring:
fieldName._substring
Example: "x-antfly-types": ["text", "keyword", "search_as_you_type"] creates:
title(text analyzer)title.keyword(keyword analyzer)title._2gram(2-token shingle analyzer)title._3gram(3-token shingle analyzer)title._index_prefix(edge n-gram prefix analyzer)
Best Practices
- Use
textfor searchable content,keywordfor exact matching - Combine types for flexible querying:
["text", "keyword"]enables both full-text and exact search - Add
search_as_you_typefor autocomplete functionality - Use
htmltype for HTML content to strip tags during indexing - Specify
x-antfly-include-in-allfor important searchable fields
Performance Considerations
textandhtmlfields have higher indexing cost due to text analysiskeywordfields are faster to index but don't support partial matchessearch_as_you_typeadds edge n-gram indexing overheadembeddingandblobfields are automatically excluded from text indexing- Multiple types per field increase index size and indexing time
Document TTL (Time-To-Live)
Antfly supports automatic expiration and deletion of documents after a specified duration. Documents are automatically removed by a background cleanup job running on the Raft leader.
Basic Configuration
Configure TTL when creating a table (POST /db/v1/tables/{tableName})
with a ttl policy under schema. The table name is part of the URL:
{
"schema": {
"ttl": {"duration": "24h"},
"document_schemas": {
"session": {
"schema": {
"type": "object",
"properties": {
"user_id": {"type": "string"},
"data": {"type": "object"}
}
}
}
}
}
}
How it works:
- Documents expire after the specified duration from their timestamp
- Uses
_timestampfield by default (automatically added at insertion) - Background cleanup runs every 30 seconds on the Raft leader
- Expired documents are filtered from queries immediately (before cleanup)
- Deletions are batched (1000 documents at a time) and go through Raft consensus
Custom TTL Reference Field
Use a custom timestamp field instead of _timestamp:
{
"schema": {
"ttl": {
"duration": "7d",
"field": "created_at"
},
"document_schemas": {
"event": {
"schema": {
"type": "object",
"properties": {
"created_at": {"type": "string", "format": "date-time"},
"event_type": {"type": "string"}
},
"required": ["created_at"]
}
}
}
}
}
Requirements:
- Custom TTL field must be present in all documents
- Must be in RFC3339 format (e.g.,
2025-01-01T12:00:00Z) - Documents without the field will fail validation
Duration Format
TTL durations use Antfly's integer-component duration format. Supported
units are ns, us, ms, s, m, h, and d:
30s- 30 seconds5m- 5 minutes24h- 24 hours7d- 7 days (treated as 168h)168h- 1 week
Use Cases
Session Management:
{
"schema": {"ttl": {"duration": "1h", "field": "last_accessed"}}
}
Sessions expire 1 hour after last_accessed. Update the timestamp on each access to extend the session.
Temporary Caching:
{
"schema": {"ttl": {"duration": "24h"}}
}
Cache entries expire 24 hours after insertion.
Log Rotation:
{
"schema": {"ttl": {"duration": "30d"}}
}
Logs are automatically deleted after 30 days.
Performance Characteristics
Optimized Storage:
- TTL timestamps stored separately (
:tsuffix keys) for O(1) lookups - No JSON deserialization needed during cleanup scans
- ~100-1000x faster than scanning full document bodies
- Minimal storage overhead (~30 bytes per document)
Query Filtering:
- Single key lookup to check expiration (~microseconds)
- No impact on query latency
- Scales to millions of documents
Cleanup Behavior:
- Runs every 30 seconds (configurable)
- Leader-only operation (prevents duplicate work)
- 5-second grace period ensures writes are fully replicated
- Batched deletions (1000 docs) prevent overwhelming the system
Monitoring
TTL operations are logged with cleanup metrics:
INFO Starting TTL cleanup job ttl_duration=24h cleanup_interval=30s
INFO Cleaned up expired documents count=42 duration=245ms total_expired=1337
Modifying TTL Configuration
Adding TTL to existing table:
- Update the schema with a
ttlpolicy - Applies retroactively to all documents
- Documents already expired are marked for immediate deletion
Removing TTL:
- Set
ttltonull - All expiration processing stops
- Previously expired documents remain
Changing duration:
- Update
ttl.duration - New duration applies immediately to all documents
- Expiration recalculated using existing timestamps
Limitations
- Clock synchronization required: Use NTP to sync clocks across cluster nodes
- Cleanup latency: Expired documents deleted within ~30 seconds (cleanup interval)
- Table-level configuration: TTL applies to all documents in the table
- Timestamp format: Must be RFC3339 or RFC3339Nano
getLakeCatalog
/tables/{tableName}/lake/catalogNative Iceberg catalog operation for managed or external REST authority. Catalog mutations require table admin permission and iceberg_writer policy. These endpoints commit already prepared lake files and automatically schedule matching index publication. A committed response does not imply that those indexes are already searchable. Native row transactions use lake/changes.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X GET "/db/v1/tables/{tableName}/lake/catalog" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/tables/{tableName}/lake/catalog', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/tables/{tableName}/lake/catalog', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/tables/{tableName}/lake/catalog', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/tables/{tableName}/lake/catalog", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"state": "loaded",
"commit_id": "string",
"request_hash": "string",
"metadata_location": "string",
"metadata": {},
"binding_ready": true,
"searchable": true
}initializeLakeCatalog
/tables/{tableName}/lake/catalogNative Iceberg catalog operation for managed or external REST authority. Catalog mutations require table admin permission and iceberg_writer policy. These endpoints commit already prepared lake files and automatically schedule matching index publication. A committed response does not imply that those indexes are already searchable. Native row transactions use lake/changes.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"commit_id": "string",
"schema": {},
"partition-spec": {},
"write-order": {},
"properties": {}
}
Code Examples
curl -X POST "/db/v1/tables/{tableName}/lake/catalog" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"commit_id": "string",
"schema": {},
"partition-spec": {},
"write-order": {},
"properties": {}
}'const response = await fetch('/db/v1/tables/{tableName}/lake/catalog', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"commit_id": "string",
"schema": {},
"partition-spec": {},
"write-order": {},
"properties": {}
})
});
const data = await response.json();fetch('/db/v1/tables/{tableName}/lake/catalog', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"commit_id": "string",
"schema": {},
"partition-spec": {},
"write-order": {},
"properties": {}
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/tables/{tableName}/lake/catalog',
headers=headers,
json={
"commit_id": "string",
"schema": {},
"partition-spec": {},
"write-order": {},
"properties": {}
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"commit_id": "string",
"schema": {},
"partition-spec": {},
"write-order": {},
"properties": {}
}`)
req, _ := http.NewRequest("POST", "/db/v1/tables/{tableName}/lake/catalog", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"state": "loaded",
"commit_id": "string",
"request_hash": "string",
"metadata_location": "string",
"metadata": {},
"binding_ready": true,
"searchable": true
}{
"state": "loaded",
"commit_id": "string",
"request_hash": "string",
"metadata_location": "string",
"metadata": {},
"binding_ready": true,
"searchable": true
}ingestLakeChanges
/tables/{tableName}/lake/changesDurably accept one complete CDC transaction for native WAL-to-Iceberg writing. A stable batch ID, source epoch, key fields and predecessor checkpoint are required. Upserts are complete row images; deletes contain only key fields. Acceptance precedes catalog commitment and index publication. Native text searches compose a bounded accepted-WAL suffix with the pinned archive publication. Requires table admin permission and iceberg_writer policy.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"batch_id": "string",
"source": "string",
"epoch": "string",
"checkpoint": "string",
"expected_checkpoint": "string",
"key_fields": [
"string"
],
"changes": [
{
"op": "upsert",
"row": {}
}
]
}
Code Examples
curl -X POST "/db/v1/tables/{tableName}/lake/changes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"batch_id": "string",
"source": "string",
"epoch": "string",
"checkpoint": "string",
"expected_checkpoint": "string",
"key_fields": [
"string"
],
"changes": [
{
"op": "upsert",
"row": {}
}
]
}'const response = await fetch('/db/v1/tables/{tableName}/lake/changes', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"batch_id": "string",
"source": "string",
"epoch": "string",
"checkpoint": "string",
"expected_checkpoint": "string",
"key_fields": [
"string"
],
"changes": [
{
"op": "upsert",
"row": {}
}
]
})
});
const data = await response.json();fetch('/db/v1/tables/{tableName}/lake/changes', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"batch_id": "string",
"source": "string",
"epoch": "string",
"checkpoint": "string",
"expected_checkpoint": "string",
"key_fields": [
"string"
],
"changes": [
{
"op": "upsert",
"row": {}
}
]
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/tables/{tableName}/lake/changes',
headers=headers,
json={
"batch_id": "string",
"source": "string",
"epoch": "string",
"checkpoint": "string",
"expected_checkpoint": "string",
"key_fields": [
"string"
],
"changes": [
{
"op": "upsert",
"row": {}
}
]
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"batch_id": "string",
"source": "string",
"epoch": "string",
"checkpoint": "string",
"expected_checkpoint": "string",
"key_fields": [
"string"
],
"changes": [
{
"op": "upsert",
"row": {}
}
]
}`)
req, _ := http.NewRequest("POST", "/db/v1/tables/{tableName}/lake/changes", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"state": "string",
"read_receipt": {
"table_id": 0,
"object_generation": 0,
"wal_lsn": 0
},
"wal_lsn": 0,
"table_id": 0,
"object_generation": 0,
"searchable": true
}Maintain a writable Iceberg table
/tables/{tableName}/lake/maintenancePlan or execute bounded compaction, snapshot/file vacuum, or covered WAL cleanup. A stable operation ID resumes saved catalog intents after uncertainty. Defaults to dry run. Destructive file vacuum requires an explicit exclusive ownership and external-reader retention agreement; only native ownership proofs authorize object deletion. Current snapshots, named refs, native serving readers and durable snapshot pins remain protected. Compact and vacuum commits automatically schedule index publication.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"action": "compact",
"operation_id": "string",
"dry_run": true,
"exclusive_ownership": true,
"max_rows": 1,
"max_bytes": 1,
"retain_ms": 600000,
"keep_latest": 1,
"max_deleted": 1
}
Code Examples
curl -X POST "/db/v1/tables/{tableName}/lake/maintenance" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "compact",
"operation_id": "string",
"dry_run": true,
"exclusive_ownership": true,
"max_rows": 1,
"max_bytes": 1,
"retain_ms": 600000,
"keep_latest": 1,
"max_deleted": 1
}'const response = await fetch('/db/v1/tables/{tableName}/lake/maintenance', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"action": "compact",
"operation_id": "string",
"dry_run": true,
"exclusive_ownership": true,
"max_rows": 1,
"max_bytes": 1,
"retain_ms": 600000,
"keep_latest": 1,
"max_deleted": 1
})
});
const data = await response.json();fetch('/db/v1/tables/{tableName}/lake/maintenance', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"action": "compact",
"operation_id": "string",
"dry_run": true,
"exclusive_ownership": true,
"max_rows": 1,
"max_bytes": 1,
"retain_ms": 600000,
"keep_latest": 1,
"max_deleted": 1
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/tables/{tableName}/lake/maintenance',
headers=headers,
json={
"action": "compact",
"operation_id": "string",
"dry_run": true,
"exclusive_ownership": true,
"max_rows": 1,
"max_bytes": 1,
"retain_ms": 600000,
"keep_latest": 1,
"max_deleted": 1
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"action": "compact",
"operation_id": "string",
"dry_run": true,
"exclusive_ownership": true,
"max_rows": 1,
"max_bytes": 1,
"retain_ms": 600000,
"keep_latest": 1,
"max_deleted": 1
}`)
req, _ := http.NewRequest("POST", "/db/v1/tables/{tableName}/lake/maintenance", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{}commitLakeCatalog
/tables/{tableName}/lake/commitsNative Iceberg catalog operation for managed or external REST authority. Catalog mutations require table admin permission and iceberg_writer policy. These endpoints commit already prepared lake files and automatically schedule matching index publication. A committed response does not imply that those indexes are already searchable. Native row transactions use lake/changes.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"commit_id": "string",
"expected_metadata_location": "string",
"requirements": [
{}
],
"updates": [
{}
]
}
Code Examples
curl -X POST "/db/v1/tables/{tableName}/lake/commits" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"commit_id": "string",
"expected_metadata_location": "string",
"requirements": [
{}
],
"updates": [
{}
]
}'const response = await fetch('/db/v1/tables/{tableName}/lake/commits', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"commit_id": "string",
"expected_metadata_location": "string",
"requirements": [
{}
],
"updates": [
{}
]
})
});
const data = await response.json();fetch('/db/v1/tables/{tableName}/lake/commits', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"commit_id": "string",
"expected_metadata_location": "string",
"requirements": [
{}
],
"updates": [
{}
]
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/tables/{tableName}/lake/commits',
headers=headers,
json={
"commit_id": "string",
"expected_metadata_location": "string",
"requirements": [
{}
],
"updates": [
{}
]
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"commit_id": "string",
"expected_metadata_location": "string",
"requirements": [
{}
],
"updates": [
{}
]
}`)
req, _ := http.NewRequest("POST", "/db/v1/tables/{tableName}/lake/commits", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"state": "loaded",
"commit_id": "string",
"request_hash": "string",
"metadata_location": "string",
"metadata": {},
"binding_ready": true,
"searchable": true
}{
"state": "loaded",
"commit_id": "string",
"request_hash": "string",
"metadata_location": "string",
"metadata": {},
"binding_ready": true,
"searchable": true
}getLakeCommitOutcome
/tables/{tableName}/lake/commits/{commitId}Native Iceberg catalog operation for managed or external REST authority. Catalog mutations require table admin permission and iceberg_writer policy. These endpoints commit already prepared lake files and automatically schedule matching index publication. A committed response does not imply that those indexes are already searchable. Native row transactions use lake/changes.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X GET "/db/v1/tables/{tableName}/lake/commits/{commitId}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/tables/{tableName}/lake/commits/{commitId}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/tables/{tableName}/lake/commits/{commitId}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/tables/{tableName}/lake/commits/{commitId}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/tables/{tableName}/lake/commits/{commitId}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"state": "loaded",
"commit_id": "string",
"request_hash": "string",
"metadata_location": "string",
"metadata": {},
"binding_ready": true,
"searchable": true
}List all tables
/tablesProvide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
prefix | string | query | No | Filter tables by name prefix (e.g., "prod_") |
pattern | string | query | No | Filter tables by regex pattern (e.g., "^prod_.*_v[0-9]+$") |
limit | integer | query | No | Maximum catalog rows examined per page (1-1000). Omit for the complete list. Authorization may return fewer rows; follow X-Antfly-Next-Cursor even for an empty page. |
cursor | string | query | No | Opaque continuation from X-Antfly-Next-Cursor, bound to the same scope and prefix. Defaults to 100 rows when limit is omitted. Catalog DDL invalidates the cursor with 409; restart the listing. |
Code Examples
curl -X GET "/db/v1/tables?prefix=prod_&pattern=^user_.*&limit=value&cursor=value" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/tables?prefix=prod_&pattern=^user_.*&limit=value&cursor=value', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/tables?prefix=prod_&pattern=^user_.*&limit=value&cursor=value', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/tables?prefix=prod_&pattern=^user_.*&limit=value&cursor=value', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/tables?prefix=prod_&pattern=^user_.*&limit=value&cursor=value", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
[
{
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"name": "string",
"description": "Table for user data",
"indexes": {},
"shards": {},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"migration": {
"state": "rebuilding",
"read_schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
],
"field_capabilities": [
{
"name": "string",
"field": "string",
"path_pattern": "string",
"field_pattern": "string",
"match_mapping_type": "string",
"emitted_name": "string",
"document_schema": "string",
"type": "search_as_you_type",
"query_modes": [
"full_text"
],
"sortable": true,
"provenance": "string",
"missing_null_policy": "string",
"sort_lifecycle_state": "unsupported",
"analyzer": "string",
"index_sort_position": 0,
"index_sort_order": "asc"
}
]
}
]{
"code": "string",
"error": "An error message",
"message": "string",
"retryable": true,
"retry_after_ms": 1
}Create a new table
/tables/{tableName}Creates a new table with optional schema definition, indexes, and configuration.
Use Cases
Simple table for unstructured data:
{
"num_shards": 1
}
Table with full-text search:
{
"num_shards": 3,
"schema": {
"document_schemas": {
"article": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"x-antfly-types": ["keyword"]
},
"title": {
"type": "string",
"x-antfly-types": ["text", "keyword"]
},
"body": {
"type": "string",
"x-antfly-types": ["text"]
}
},
"x-antfly-include-in-all": ["title", "body"]
}
}
},
"default_type": "article"
},
"indexes": {
"search_idx": {
"type": "full_text"
}
}
}
Table with vector similarity search:
{
"num_shards": 5,
"description": "Product catalog with semantic search",
"schema": {
"document_schemas": {
"product": {
"schema": {
"type": "object",
"properties": {
"product_id": {
"type": "string",
"x-antfly-types": ["keyword"]
},
"name": {
"type": "string",
"x-antfly-types": ["text", "keyword"]
},
"description": {
"type": "string",
"x-antfly-types": ["text"]
},
"price": {
"type": "number",
"x-antfly-types": ["numeric"]
}
},
"x-antfly-include-in-all": ["name", "description"]
}
}
},
"default_type": "product"
},
"indexes": {
"semantic_idx": {
"type": "embeddings",
"field": "description",
"embedder": {
"provider": "ollama",
"model": "all-minilm",
"url": "http://localhost:11434"
}
}
}
}
Best Practices
- Define schema for core fields to improve performance
- Start with fewer shards for small datasets (1-3)
- Use meaningful table names (e.g., "products", "users", "articles")
- Consider adding both full-text and vector indexes for hybrid search
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
}
Code Examples
curl -X POST "/db/v1/tables/{tableName}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
}'const response = await fetch('/db/v1/tables/{tableName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
})
});
const data = await response.json();fetch('/db/v1/tables/{tableName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/tables/{tableName}',
headers=headers,
json={
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
}`)
req, _ := http.NewRequest("POST", "/db/v1/tables/{tableName}", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"name": "string",
"description": "Table for user data",
"indexes": {},
"shards": {},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"migration": {
"state": "rebuilding",
"read_schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
],
"field_capabilities": [
{
"name": "string",
"field": "string",
"path_pattern": "string",
"field_pattern": "string",
"match_mapping_type": "string",
"emitted_name": "string",
"document_schema": "string",
"type": "search_as_you_type",
"query_modes": [
"full_text"
],
"sortable": true,
"provenance": "string",
"missing_null_policy": "string",
"sort_lifecycle_state": "unsupported",
"analyzer": "string",
"index_sort_position": 0,
"index_sort_order": "asc"
}
]
}{
"code": "string",
"error": "An error message",
"message": "string",
"retryable": true,
"retry_after_ms": 1
}Drop a table
/tables/{tableName}Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X DELETE "/db/v1/tables/{tableName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/tables/{tableName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/tables/{tableName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.delete('/db/v1/tables/{tableName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "/db/v1/tables/{tableName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
Get table details
/tables/{tableName}Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X GET "/db/v1/tables/{tableName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/tables/{tableName}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/tables/{tableName}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/tables/{tableName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/tables/{tableName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"name": "string",
"description": "Table for user data",
"indexes": {},
"shards": {},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"migration": {
"state": "rebuilding",
"read_schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
],
"field_capabilities": [
{
"name": "string",
"field": "string",
"path_pattern": "string",
"field_pattern": "string",
"match_mapping_type": "string",
"emitted_name": "string",
"document_schema": "string",
"type": "search_as_you_type",
"query_modes": [
"full_text"
],
"sortable": true,
"provenance": "string",
"missing_null_policy": "string",
"sort_lifecycle_state": "unsupported",
"analyzer": "string",
"index_sort_position": 0,
"index_sort_order": "asc"
}
]
}Adopt stored write destinations with the current credential
/tables/{tableName}/destination-authorizationReauthorizes the table's existing CDC routes and graph resolver destinations using the caller's current permissions. This idempotent operation is intended for upgrading tables created before durable destination authorization was introduced, and for explicitly transferring destination ownership after a credential is rotated. The caller needs admin permission on the source table and write permission on every eventual destination table.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X POST "/db/v1/tables/{tableName}/destination-authorization" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/tables/{tableName}/destination-authorization', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/tables/{tableName}/destination-authorization', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post('/db/v1/tables/{tableName}/destination-authorization', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "/db/v1/tables/{tableName}/destination-authorization", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"table": "string",
"status": "authorized"
}{
"code": "string",
"error": "An error message",
"message": "string",
"retryable": true,
"retry_after_ms": 1
}{
"code": "string",
"error": "An error message",
"message": "string",
"retryable": true,
"retry_after_ms": 1
}Replace a table's schema
/tables/{tableName}/schemaReplaces the complete table schema. Properties omitted from the request are removed. Use PATCH on this path for a partial JSON Merge Patch update.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
If-Match | string | header | No | Strong schema ETag returned by a previous schema mutation, for example "schema-0". A mismatch returns 409 instead of overwriting a concurrent update. |
Request Body
Example:
{
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
Code Examples
curl -X PUT "/db/v1/tables/{tableName}/schema" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}'const response = await fetch('/db/v1/tables/{tableName}/schema', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
})
});
const data = await response.json();fetch('/db/v1/tables/{tableName}/schema', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.put(
'/db/v1/tables/{tableName}/schema',
headers=headers,
json={
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}`)
req, _ := http.NewRequest("PUT", "/db/v1/tables/{tableName}/schema", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"name": "string",
"description": "Table for user data",
"indexes": {},
"shards": {},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"migration": {
"state": "rebuilding",
"read_schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
],
"field_capabilities": [
{
"name": "string",
"field": "string",
"path_pattern": "string",
"field_pattern": "string",
"match_mapping_type": "string",
"emitted_name": "string",
"document_schema": "string",
"type": "search_as_you_type",
"query_modes": [
"full_text"
],
"sortable": true,
"provenance": "string",
"missing_null_policy": "string",
"sort_lifecycle_state": "unsupported",
"analyzer": "string",
"index_sort_position": 0,
"index_sort_order": "asc"
}
]
}{
"job_id": "string",
"idempotency_key": "string",
"attempt_id": 0,
"scope": "table",
"table_name": "string",
"backup_id": "string",
"phase": "queued",
"cancel_requested": true,
"durability_pending_table_count": 0,
"published_table_count": 0,
"completed_table_count": 0,
"total_table_count": 0,
"result": {
"restore": "triggered",
"durability": "pending",
"status": "completed",
"triggered_table_count": 0,
"committed_table_count": 0,
"durability_pending_table_count": 0,
"skipped_table_count": 0,
"failed_table_count": 0,
"failure_details": [
{
"table_name": "string",
"error": "string",
"table_name_truncated": true
}
],
"failure_details_truncated": true
},
"error": "string",
"created_at_ms": 0,
"updated_at_ms": 0,
"expires_at_ms": 0
}Patch a table's schema
/tables/{tableName}/schemaApplies an RFC 7396 JSON Merge Patch to the current table schema. Object members are merged recursively and a null value removes that member. Antfly validates and versions the resulting complete schema atomically.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
If-Match | string | header | No | Strong schema ETag returned by a previous schema mutation, for example "schema-0". A mismatch returns 409 instead of overwriting a concurrent update. |
Request Body
Example:
{}
Code Examples
curl -X PATCH "/db/v1/tables/{tableName}/schema" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch('/db/v1/tables/{tableName}/schema', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
});
const data = await response.json();fetch('/db/v1/tables/{tableName}/schema', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.patch(
'/db/v1/tables/{tableName}/schema',
headers=headers,
json={}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{}`)
req, _ := http.NewRequest("PATCH", "/db/v1/tables/{tableName}/schema", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"name": "string",
"description": "Table for user data",
"indexes": {},
"shards": {},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"migration": {
"state": "rebuilding",
"read_schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
],
"field_capabilities": [
{
"name": "string",
"field": "string",
"path_pattern": "string",
"field_pattern": "string",
"match_mapping_type": "string",
"emitted_name": "string",
"document_schema": "string",
"type": "search_as_you_type",
"query_modes": [
"full_text"
],
"sortable": true,
"provenance": "string",
"missing_null_policy": "string",
"sort_lifecycle_state": "unsupported",
"analyzer": "string",
"index_sort_position": 0,
"index_sort_order": "asc"
}
]
}{
"job_id": "string",
"idempotency_key": "string",
"attempt_id": 0,
"scope": "table",
"table_name": "string",
"backup_id": "string",
"phase": "queued",
"cancel_requested": true,
"durability_pending_table_count": 0,
"published_table_count": 0,
"completed_table_count": 0,
"total_table_count": 0,
"result": {
"restore": "triggered",
"durability": "pending",
"status": "completed",
"triggered_table_count": 0,
"committed_table_count": 0,
"durability_pending_table_count": 0,
"skipped_table_count": 0,
"failed_table_count": 0,
"failure_details": [
{
"table_name": "string",
"error": "string",
"table_name_truncated": true
}
],
"failure_details_truncated": true
},
"error": "string",
"created_at_ms": 0,
"updated_at_ms": 0,
"expires_at_ms": 0
}List saved query sources
/sourcesProvide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X GET "/db/v1/sources" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/sources', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/sources', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/sources', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/sources", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
[
{
"source_id": 0,
"name": "string",
"source": {
"saved": "string",
"union": [
{
"table": "string"
}
],
"overlay": {
"base": {
"table": "string"
},
"changes": {
"table": "string"
},
"key": [
"string"
],
"tombstone_field": "string"
}
}
}
]Get saved query source
/sources/{sourceName}Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X GET "/db/v1/sources/{sourceName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/sources/{sourceName}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/sources/{sourceName}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/sources/{sourceName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/sources/{sourceName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"source_id": 0,
"name": "string",
"source": {
"saved": "string",
"union": [
{
"table": "string"
}
],
"overlay": {
"base": {
"table": "string"
},
"changes": {
"table": "string"
},
"key": [
"string"
],
"tombstone_field": "string"
}
}
}Create saved query source
/sources/{sourceName}Creates an immutable union or keyed overlay in the Antfly metadata catalog. Reads require permission on the saved name and every input table. Drop and recreate to change a definition; existing cursors cannot switch incarnations.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"source": {
"saved": "string",
"union": [
{
"table": "string"
}
],
"overlay": {
"base": {
"table": "string"
},
"changes": {
"table": "string"
},
"key": [
"string"
],
"tombstone_field": "string"
}
}
}
Code Examples
curl -X POST "/db/v1/sources/{sourceName}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": {
"saved": "string",
"union": [
{
"table": "string"
}
],
"overlay": {
"base": {
"table": "string"
},
"changes": {
"table": "string"
},
"key": [
"string"
],
"tombstone_field": "string"
}
}
}'const response = await fetch('/db/v1/sources/{sourceName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"source": {
"saved": "string",
"union": [
{
"table": "string"
}
],
"overlay": {
"base": {
"table": "string"
},
"changes": {
"table": "string"
},
"key": [
"string"
],
"tombstone_field": "string"
}
}
})
});
const data = await response.json();fetch('/db/v1/sources/{sourceName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"source": {
"saved": "string",
"union": [
{
"table": "string"
}
],
"overlay": {
"base": {
"table": "string"
},
"changes": {
"table": "string"
},
"key": [
"string"
],
"tombstone_field": "string"
}
}
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/sources/{sourceName}',
headers=headers,
json={
"source": {
"saved": "string",
"union": [
{
"table": "string"
}
],
"overlay": {
"base": {
"table": "string"
},
"changes": {
"table": "string"
},
"key": [
"string"
],
"tombstone_field": "string"
}
}
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"source": {
"saved": "string",
"union": [
{
"table": "string"
}
],
"overlay": {
"base": {
"table": "string"
},
"changes": {
"table": "string"
},
"key": [
"string"
],
"tombstone_field": "string"
}
}
}`)
req, _ := http.NewRequest("POST", "/db/v1/sources/{sourceName}", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"source_id": 0,
"name": "string",
"source": {
"saved": "string",
"union": [
{
"table": "string"
}
],
"overlay": {
"base": {
"table": "string"
},
"changes": {
"table": "string"
},
"key": [
"string"
],
"tombstone_field": "string"
}
}
}{
"status": "committed_visibility_pending"
}Drop saved query source
/sources/{sourceName}Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X DELETE "/db/v1/sources/{sourceName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/sources/{sourceName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/sources/{sourceName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.delete('/db/v1/sources/{sourceName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "/db/v1/sources/{sourceName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
List tablespaces
/tablespacesLists tablespace catalog objects visible to the caller.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X GET "/db/v1/tablespaces" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/tablespaces', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/tablespaces', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/tablespaces', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/tablespaces", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
[
{
"tablespace_id": 42,
"name": "fastspace",
"location_json": "\"/var/lib/antfly/fastspace\"",
"placement_policy_json": "{}"
}
]Get tablespace
/tablespaces/{tablespaceName}Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X GET "/db/v1/tablespaces/{tablespaceName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/tablespaces/{tablespaceName}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/tablespaces/{tablespaceName}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/tablespaces/{tablespaceName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/tablespaces/{tablespaceName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"tablespace_id": 42,
"name": "fastspace",
"location_json": "\"/var/lib/antfly/fastspace\"",
"placement_policy_json": "{}"
}Create tablespace
/tablespaces/{tablespaceName}Creates a tablespace catalog object. The server applies the same lifecycle semantics as CREATE TABLESPACE.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"location_json": "\"/var/lib/antfly/fastspace\"",
"placement_policy_json": "{}"
}
Code Examples
curl -X POST "/db/v1/tablespaces/{tablespaceName}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"location_json": "\"/var/lib/antfly/fastspace\"",
"placement_policy_json": "{}"
}'const response = await fetch('/db/v1/tablespaces/{tablespaceName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"location_json": "\"/var/lib/antfly/fastspace\"",
"placement_policy_json": "{}"
})
});
const data = await response.json();fetch('/db/v1/tablespaces/{tablespaceName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"location_json": "\"/var/lib/antfly/fastspace\"",
"placement_policy_json": "{}"
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/tablespaces/{tablespaceName}',
headers=headers,
json={
"location_json": "\"/var/lib/antfly/fastspace\"",
"placement_policy_json": "{}"
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"location_json": "\"/var/lib/antfly/fastspace\"",
"placement_policy_json": "{}"
}`)
req, _ := http.NewRequest("POST", "/db/v1/tablespaces/{tablespaceName}", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"tablespace_id": 42,
"name": "fastspace",
"location_json": "\"/var/lib/antfly/fastspace\"",
"placement_policy_json": "{}"
}{
"status": "committed_visibility_pending"
}{
"code": "string",
"error": "An error message",
"message": "string",
"retryable": true,
"retry_after_ms": 1
}Drop tablespace
/tablespaces/{tablespaceName}Drops a tablespace catalog object. Table placement by tablespace is fail-closed until native placement planning consumes tablespace policy.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X DELETE "/db/v1/tablespaces/{tablespaceName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/tablespaces/{tablespaceName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/tablespaces/{tablespaceName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.delete('/db/v1/tablespaces/{tablespaceName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "/db/v1/tablespaces/{tablespaceName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
List databases
/databasesLists database catalog objects visible to the caller. Shorthand table APIs resolve through the caller's current/default database.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X GET "/db/v1/databases" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/databases', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/databases", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
[
{
"database_id": 22,
"name": "tenant_ops",
"settings_json": "{}",
"tablespace_name": "fastspace"
}
]Get database
/databases/{databaseName}Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X GET "/db/v1/databases/{databaseName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/databases/{databaseName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/databases/{databaseName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"database_id": 22,
"name": "tenant_ops",
"settings_json": "{}",
"tablespace_name": "fastspace"
}Create database
/databases/{databaseName}Creates a database catalog object. The server applies the same semantics as CREATE DATABASE.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X POST "/db/v1/databases/{databaseName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post('/db/v1/databases/{databaseName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "/db/v1/databases/{databaseName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"database_id": 22,
"name": "tenant_ops",
"settings_json": "{}",
"tablespace_name": "fastspace"
}{
"status": "committed_visibility_pending"
}{
"code": "string",
"error": "An error message",
"message": "string",
"retryable": true,
"retry_after_ms": 1
}Drop database
/databases/{databaseName}Drops an empty database catalog object. Non-empty databases fail with a conflict.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X DELETE "/db/v1/databases/{databaseName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.delete('/db/v1/databases/{databaseName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "/db/v1/databases/{databaseName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"code": "string",
"error": "An error message",
"message": "string",
"retryable": true,
"retry_after_ms": 1
}Set database tablespace
/databases/{databaseName}/tablespaceBinds the database catalog object to an existing tablespace.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"tablespace_name": "fastspace"
}
Code Examples
curl -X PUT "/db/v1/databases/{databaseName}/tablespace" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tablespace_name": "fastspace"
}'const response = await fetch('/db/v1/databases/{databaseName}/tablespace', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tablespace_name": "fastspace"
})
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/tablespace', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tablespace_name": "fastspace"
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.put(
'/db/v1/databases/{databaseName}/tablespace',
headers=headers,
json={
"tablespace_name": "fastspace"
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"tablespace_name": "fastspace"
}`)
req, _ := http.NewRequest("PUT", "/db/v1/databases/{databaseName}/tablespace", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"database_id": 22,
"name": "tenant_ops",
"settings_json": "{}",
"tablespace_name": "fastspace"
}{
"status": "committed_visibility_pending"
}Clear database tablespace
/databases/{databaseName}/tablespaceClears the database catalog object's durable tablespace binding.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X DELETE "/db/v1/databases/{databaseName}/tablespace" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}/tablespace', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/tablespace', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.delete('/db/v1/databases/{databaseName}/tablespace', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "/db/v1/databases/{databaseName}/tablespace", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"database_id": 22,
"name": "tenant_ops",
"settings_json": "{}",
"tablespace_name": "fastspace"
}{
"status": "committed_visibility_pending"
}List namespaces
/databases/{databaseName}/namespacesLists namespace catalog objects inside a database. PostgreSQL schemas map to these namespaces.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X GET "/db/v1/databases/{databaseName}/namespaces" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}/namespaces', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/databases/{databaseName}/namespaces', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/databases/{databaseName}/namespaces", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
[
{
"namespace_id": 222,
"database_id": 22,
"database_name": "tenant_ops",
"name": "analytics",
"tablespace_name": "fastspace"
}
]Create namespace
/databases/{databaseName}/namespaces/{namespaceName}Creates a namespace catalog object in a database. The server applies the same semantics as CREATE SCHEMA for the selected database.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X POST "/db/v1/databases/{databaseName}/namespaces/{namespaceName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post('/db/v1/databases/{databaseName}/namespaces/{namespaceName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"namespace_id": 222,
"database_id": 22,
"database_name": "tenant_ops",
"name": "analytics",
"tablespace_name": "fastspace"
}{
"status": "committed_visibility_pending"
}{
"code": "string",
"error": "An error message",
"message": "string",
"retryable": true,
"retry_after_ms": 1
}Drop namespace
/databases/{databaseName}/namespaces/{namespaceName}Drops an empty namespace catalog object. Non-empty namespaces fail with a conflict.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X DELETE "/db/v1/databases/{databaseName}/namespaces/{namespaceName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.delete('/db/v1/databases/{databaseName}/namespaces/{namespaceName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"code": "string",
"error": "An error message",
"message": "string",
"retryable": true,
"retry_after_ms": 1
}Set namespace tablespace
/databases/{databaseName}/namespaces/{namespaceName}/tablespaceBinds the namespace catalog object to an existing tablespace.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"tablespace_name": "fastspace"
}
Code Examples
curl -X PUT "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tablespace" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tablespace_name": "fastspace"
}'const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tablespace', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tablespace_name": "fastspace"
})
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tablespace', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tablespace_name": "fastspace"
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.put(
'/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tablespace',
headers=headers,
json={
"tablespace_name": "fastspace"
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"tablespace_name": "fastspace"
}`)
req, _ := http.NewRequest("PUT", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tablespace", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"namespace_id": 222,
"database_id": 22,
"database_name": "tenant_ops",
"name": "analytics",
"tablespace_name": "fastspace"
}{
"status": "committed_visibility_pending"
}Clear namespace tablespace
/databases/{databaseName}/namespaces/{namespaceName}/tablespaceClears the namespace catalog object's durable tablespace binding.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X DELETE "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tablespace" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tablespace', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tablespace', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.delete('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tablespace', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tablespace", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"namespace_id": 222,
"database_id": 22,
"database_name": "tenant_ops",
"name": "analytics",
"tablespace_name": "fastspace"
}{
"status": "committed_visibility_pending"
}List tables in namespace
/databases/{databaseName}/namespaces/{namespaceName}/tablesLists table catalog objects under an explicit database and namespace.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
prefix | string | query | No | Filter tables by name prefix. |
limit | integer | query | No | Maximum catalog rows examined per page (1-1000). Omit for the complete list. Authorization may return fewer rows; follow X-Antfly-Next-Cursor even for an empty page. |
cursor | string | query | No | Opaque continuation from X-Antfly-Next-Cursor, bound to the same scope and prefix. Defaults to 100 rows when limit is omitted. Catalog DDL invalidates the cursor with 409; restart the listing. |
Code Examples
curl -X GET "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables?prefix=value&limit=value&cursor=value" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables?prefix=value&limit=value&cursor=value', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables?prefix=value&limit=value&cursor=value', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables?prefix=value&limit=value&cursor=value', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables?prefix=value&limit=value&cursor=value", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
[
{
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"name": "string",
"description": "Table for user data",
"indexes": {},
"shards": {},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"migration": {
"state": "rebuilding",
"read_schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
],
"field_capabilities": [
{
"name": "string",
"field": "string",
"path_pattern": "string",
"field_pattern": "string",
"match_mapping_type": "string",
"emitted_name": "string",
"document_schema": "string",
"type": "search_as_you_type",
"query_modes": [
"full_text"
],
"sortable": true,
"provenance": "string",
"missing_null_policy": "string",
"sort_lifecycle_state": "unsupported",
"analyzer": "string",
"index_sort_position": 0,
"index_sort_order": "asc"
}
]
}
]{
"code": "string",
"error": "An error message",
"message": "string",
"retryable": true,
"retry_after_ms": 1
}Get namespace table details
/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}Gets a table through an explicit database and namespace route.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X GET "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"name": "string",
"description": "Table for user data",
"indexes": {},
"shards": {},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"migration": {
"state": "rebuilding",
"read_schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
],
"field_capabilities": [
{
"name": "string",
"field": "string",
"path_pattern": "string",
"field_pattern": "string",
"match_mapping_type": "string",
"emitted_name": "string",
"document_schema": "string",
"type": "search_as_you_type",
"query_modes": [
"full_text"
],
"sortable": true,
"provenance": "string",
"missing_null_policy": "string",
"sort_lifecycle_state": "unsupported",
"analyzer": "string",
"index_sort_position": 0,
"index_sort_order": "asc"
}
]
}Create namespace table
/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}Creates a table through an explicit database and namespace route.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
}
Code Examples
curl -X POST "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
}'const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
})
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}',
headers=headers,
json={
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"tablespace_name": "string",
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"num_shards": 3,
"description": "User profiles with embeddings for semantic search",
"indexes": {
"search_index": {
"type": "full_text"
},
"embedding_index": {
"type": "embeddings",
"dimension": 384,
"embedder": {
"provider": "ollama",
"model": "all-minilm"
}
}
},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
]
}`)
req, _ := http.NewRequest("POST", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"name": "string",
"description": "Table for user data",
"indexes": {},
"shards": {},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"migration": {
"state": "rebuilding",
"read_schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
],
"field_capabilities": [
{
"name": "string",
"field": "string",
"path_pattern": "string",
"field_pattern": "string",
"match_mapping_type": "string",
"emitted_name": "string",
"document_schema": "string",
"type": "search_as_you_type",
"query_modes": [
"full_text"
],
"sortable": true,
"provenance": "string",
"missing_null_policy": "string",
"sort_lifecycle_state": "unsupported",
"analyzer": "string",
"index_sort_position": 0,
"index_sort_order": "asc"
}
]
}Drop namespace table
/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}Drops a table through an explicit database and namespace route.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X DELETE "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.delete('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
Replace a table's schema
/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schemaReplaces the complete table schema. Properties omitted from the request are removed. Use PATCH on this path for a partial JSON Merge Patch update.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
If-Match | string | header | No | Strong schema ETag returned by a previous schema mutation, for example "schema-0". A mismatch returns 409 instead of overwriting a concurrent update. |
Request Body
Example:
{
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
Code Examples
curl -X PUT "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schema" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}'const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schema', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
})
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schema', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.put(
'/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schema',
headers=headers,
json={
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}`)
req, _ := http.NewRequest("PUT", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schema", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"name": "string",
"description": "Table for user data",
"indexes": {},
"shards": {},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"migration": {
"state": "rebuilding",
"read_schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
],
"field_capabilities": [
{
"name": "string",
"field": "string",
"path_pattern": "string",
"field_pattern": "string",
"match_mapping_type": "string",
"emitted_name": "string",
"document_schema": "string",
"type": "search_as_you_type",
"query_modes": [
"full_text"
],
"sortable": true,
"provenance": "string",
"missing_null_policy": "string",
"sort_lifecycle_state": "unsupported",
"analyzer": "string",
"index_sort_position": 0,
"index_sort_order": "asc"
}
]
}Patch a table's schema
/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schemaApplies an RFC 7396 JSON Merge Patch to the current table schema. Object members are merged recursively and a null value removes that member. Antfly validates and versions the resulting complete schema atomically.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
If-Match | string | header | No | Strong schema ETag returned by a previous schema mutation, for example "schema-0". A mismatch returns 409 instead of overwriting a concurrent update. |
Request Body
Example:
{}
Code Examples
curl -X PATCH "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schema" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schema', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schema', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.patch(
'/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schema',
headers=headers,
json={}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{}`)
req, _ := http.NewRequest("PATCH", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/schema", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
{
"storage": {
"engine": "local",
"dense_embeddings": "primary_lsm"
},
"name": "string",
"description": "Table for user data",
"indexes": {},
"shards": {},
"schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
},
"migration": {
"state": "rebuilding",
"read_schema": {
"version": 0,
"storage_mode": "document",
"base_source": {
"kind": "external",
"table_id": "string",
"format": "parquet",
"uri": "string",
"schema_fingerprint": "string",
"write_policy": "read_only",
"object_mutability": "mutable",
"credentials": {
"ref": "string",
"scope": "string"
},
"snapshot": {
"mode": "current",
"id": "string",
"digest": "string"
},
"catalog": {
"type": "managed",
"connection": "string",
"uri": "string",
"namespace": [
"string"
],
"name": "string",
"warehouse": "string"
}
},
"column_defaults": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"generated_columns": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"checks": [
{
"name": "string",
"column": "string",
"op": "is_null",
"value": null,
"collation": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
}
}
],
"unique_constraints": [
{
"name": "string",
"origin": "constraint",
"primary": true,
"columns": [
"string"
],
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
],
"nulls_not_distinct": true,
"deferrable": true,
"timing": "immediate"
}
],
"foreign_keys": [
{
"name": "string",
"child_columns": [
"string"
],
"parent_table": "string",
"parent_columns": [
"string"
],
"on_delete": "restrict",
"on_update": "restrict",
"timing": "immediate",
"match": "simple",
"deferrable": true
}
],
"relational_indexes": [
{
"description": "string",
"name": "string",
"keys": [
{
"column": "string",
"expression": {
"op": "literal",
"type": "string",
"sql_type": "text",
"numeric_modifier": {
"precision": 1,
"scale": -1000
},
"value": null,
"column": "string",
"collation": "string",
"args": [
"..."
]
},
"result_type": "string",
"collation": "string",
"direction": "asc",
"nulls": "default"
}
],
"include_columns": [
"string"
],
"where": [
{
"column": "string",
"op": "is_null",
"value": null,
"collation": "string"
}
]
}
],
"default_type": "string",
"enforce_types": true,
"document_schemas": {},
"ttl": {
"duration": "string",
"field": "string"
},
"ttl_field": "string",
"ttl_duration": "string",
"dynamic_templates": [
{
"name": "string",
"match": "string",
"unmatch": "string",
"path_match": "string",
"path_unmatch": "string",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer": "string",
"index": true,
"store": true,
"include_in_all": true,
"sortable": true,
"missing_null_policy": "missing_rejected"
}
}
]
}
},
"replication_sources": [
{
"type": "postgres",
"dsn": "${secret:pg_dsn}",
"postgres_table": "users",
"key_template": "id",
"slot_name": "string",
"publication_name": "string",
"on_update": [
{
"op": "$set",
"path": "email",
"value": "{{user_email}}"
},
{
"op": "$set",
"path": "score",
"value": "{{score}}"
},
{
"op": "$merge",
"value": "{{metadata}}"
},
{
"op": "$set",
"path": "active",
"value": true
}
],
"on_delete": [
{
"op": "$set",
"path": "active",
"value": false
}
],
"publication_filter": {
"term": "string",
"field": "string",
"boost": 0
},
"routes": [
{
"target_table": "premium_users",
"where": {
"term": "premium",
"field": "tier"
}
},
{
"target_table": "free_users",
"where": {
"term": "free",
"field": "tier"
}
}
],
"require_exact_cutover": true,
"status": {
"source_kind": "string",
"external_table": "string",
"cutover_mode": "string",
"slot_name": "string",
"publication_name": "string",
"phase": "string",
"checkpoint": "string",
"snapshot_offset": 0,
"prepared_checkpoint": "string",
"stream_checkpoint": "string",
"last_error": "string",
"failure_class": "string",
"lag_records": 0,
"lag_millis": 0,
"consecutive_failures": 0,
"last_source_commit_at_ms": 0,
"last_success_at_ms": 0,
"last_change_applied_at_ms": 0,
"updated_at_ms": 0
},
"action_hint": {
"action": "string",
"reason": "string",
"reseed_exact_cutover_path": "string"
}
}
],
"field_capabilities": [
{
"name": "string",
"field": "string",
"path_pattern": "string",
"field_pattern": "string",
"match_mapping_type": "string",
"emitted_name": "string",
"document_schema": "string",
"type": "search_as_you_type",
"query_modes": [
"full_text"
],
"sortable": true,
"provenance": "string",
"missing_null_policy": "string",
"sort_lifecycle_state": "unsupported",
"analyzer": "string",
"index_sort_position": 0,
"index_sort_order": "asc"
}
]
}Rename catalog resource
/databases/{databaseName}/renameProvide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
databaseName | string | path | Yes |
Request Body
Example:
{
"name": "string"
}
Code Examples
curl -X POST "/db/v1/databases/{databaseName}/rename" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string"
}'const response = await fetch('/db/v1/databases/{databaseName}/rename', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "string"
})
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/rename', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "string"
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/databases/{databaseName}/rename',
headers=headers,
json={
"name": "string"
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"name": "string"
}`)
req, _ := http.NewRequest("POST", "/db/v1/databases/{databaseName}/rename", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
Rename catalog resource
/databases/{databaseName}/namespaces/{namespaceName}/renameProvide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
databaseName | string | path | Yes | |
namespaceName | string | path | Yes |
Request Body
Example:
{
"name": "string"
}
Code Examples
curl -X POST "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/rename" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string"
}'const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/rename', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "string"
})
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/rename', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "string"
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/databases/{databaseName}/namespaces/{namespaceName}/rename',
headers=headers,
json={
"name": "string"
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"name": "string"
}`)
req, _ := http.NewRequest("POST", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/rename", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
Rename catalog resource
/tablespaces/{tablespaceName}/renameProvide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
tablespaceName | string | path | Yes |
Request Body
Example:
{
"name": "string"
}
Code Examples
curl -X POST "/db/v1/tablespaces/{tablespaceName}/rename" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string"
}'const response = await fetch('/db/v1/tablespaces/{tablespaceName}/rename', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "string"
})
});
const data = await response.json();fetch('/db/v1/tablespaces/{tablespaceName}/rename', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "string"
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/tablespaces/{tablespaceName}/rename',
headers=headers,
json={
"name": "string"
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"name": "string"
}`)
req, _ := http.NewRequest("POST", "/db/v1/tablespaces/{tablespaceName}/rename", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
Rename catalog resource
/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/renameProvide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
databaseName | string | path | Yes | |
namespaceName | string | path | Yes | |
tableName | string | path | Yes |
Request Body
Example:
{
"name": "string"
}
Code Examples
curl -X POST "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/rename" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string"
}'const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/rename', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "string"
})
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/rename', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "string"
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(
'/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/rename',
headers=headers,
json={
"name": "string"
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"name": "string"
}`)
req, _ := http.NewRequest("POST", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/rename", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
Set namespace tablespace
/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespaceBinds the namespace catalog object to an existing tablespace.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"tablespace_name": "fastspace"
}
Code Examples
curl -X PUT "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespace" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tablespace_name": "fastspace"
}'const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespace', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tablespace_name": "fastspace"
})
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespace', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tablespace_name": "fastspace"
})
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.put(
'/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespace',
headers=headers,
json={
"tablespace_name": "fastspace"
}
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body := []byte(`{
"tablespace_name": "fastspace"
}`)
req, _ := http.NewRequest("PUT", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespace", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}Responses
Clear namespace tablespace
/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespaceClears the namespace catalog object's durable tablespace binding.
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Code Examples
curl -X DELETE "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespace" \
-H "Authorization: Bearer YOUR_API_KEY"const response = await fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespace', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();fetch('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespace', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.delete('/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespace', headers=headers)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "/db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/tablespace", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}