Tabi FAQ

Short answers for the questions that show up after the Manage Tabi Tables and Tabi Row Operations how-tos.

How do I add an index?

Set unique: true on a column when you create or PATCH the table. That creates a per-column UNIQUE index.

There is no general indexes API. You cannot create a non-unique index or a composite index through the public API today. Foreign keys are also not supported.

UNIQUE can be added later. It cannot be removed. PostgreSQL still allows multiple NULL values in a UNIQUE column.

See Tabi Limitations.

Which type name should I use for timestamps?

Use timestamptz (or the alias timestamp). Both store as timestamptz.

DateTime is not a Tabi column type. timestampz is a misspelling and will fail.

Full alias list: Manage Tabi Tables.

Why do pages of selectMany drop or duplicate rows?

You paginated with offset and no stable orderBy. Always pass orderBy on a unique column (id or createdAt). This matters most once offset is large (hundreds to 1000+).

await tabi.customer.data.MyTable.selectMany({
  where: { data_type: "company" },
  limit: 50,
  offset: page * 50,
  orderBy: { id: "asc" },
});

Details: Tabi Best Practices.

How do I add a column?

PATCH /tables/{id} supports adding or dropping columns only. You cannot rename a column or change its type.

The payload in Manage Tabi Tables sends the new column object(s) in columns. Do not treat PATCH as a way to rebuild the whole schema.

Example UNIQUE column on create:

curl -X POST https://eu1.polyapi.io/tables \
  -H "Authorization: Bearer $TOKEN" -H "content-type: application/json" \
  -d '{"name":"MyTable","context":"app.data","columns":[
    {"name":"external_id","type":"text","required":true,"unique":true,"primary":false}
  ]}'

Can I query inside jsonb?

Limited. Store payloads in jsonb, and filter on top-level columns.

Does column schema enforce types at runtime?

No. Right now schema is only used to generated SDK hints and docs, not database checks.

Tabi vs Vari

Use Tabi for structured, high-volume rows and filtering. Use Vari Variables for small config objects and secrets.