Skip to content
v0.5.1GitHub

Using

Creates a relational table from an uploaded CSV/TSV file: infers one LuraDB type per column, then imports every row through the existing DML write path -- a row that fails is logged, the import continues. Requires DDL access, enforced the same way the `/sql` handler enforces a DDL statement.

applies to v0.5.1
POST
/store-api/rel/{domain}/tables/from-file
curl --request POST \
--url 'https://example.com/store-api/rel/example/tables/from-file?name=example&format=example' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/plain' \
--data example
domain
required
string

Relational domain

name
required
string

Name of the table to create

format
required
string

“csv” or “tsv” – no format sniffing

header
boolean

Whether the first line is a header row (default true)

pk
string

Existing (normalized) column to use as primary key; omitted -> synthetic _row column

Raw CSV/TSV file bytes – Content-Type is not enforced, format decides

Media typetext/plain
string

Table created and its rows imported (imported/failed counts, per-row error log)

Media typeapplication/json
object
columns
required
Array<object>
object
name
required
string
primary_key
required
boolean
source_header
string | null
type
required
string
errors
required
Array<object>
object
error
required
string
row
required
integer format: int64
failed
required
integer format: int64
imported
required
integer format: int64
table
required
string

Example generated

{
"columns": [
{
"name": "example",
"primary_key": true,
"source_header": "example",
"type": "example"
}
],
"errors": [
{
"error": "example",
"row": 1
}
],
"failed": 1,
"imported": 1,
"table": "example"
}

Missing/invalid name or format, empty file, too many columns, invalid header UTF-8, or an unknown pk column

Media typetext/plain
string

Missing DDL access on the domain

Media typetext/plain
string

Domain not found

Media typetext/plain
string

A table or view with that name already exists

Media typetext/plain
string

Domain is being deleted

Media typetext/plain
string

Body exceeds rel.import_body_limit_bytes

Media typetext/plain
string

Per-domain request budget exceeded

Media typetext/plain
string

Relational engine disabled

Media typetext/plain
string

Insufficient Storage — disk space or memory runs short; the write was not applied. Reads go on; retry after the seconds in Retry-After.

Media typetext/plain
string
Retry-After
integer