Tables and data modeling · AutessaDB
Foreign keys and joins
AutessaDB supports relations: an Integer column can be a foreign key to a row in another table, and a join query follows those links with filters across the joined tables. Each joined table keeps its own security, so a join never shows a row the caller could not read on its own.
-- the problem
Real data is related, and duplicating it goes stale
Customers have orders, tickets have comments, contracts have clauses. Copying a customer name into every order means fixing it in a hundred places later. Foreign keys keep one source of truth and let queries pull related rows together.
What you get
- Any Integer column can be a foreign key that points at a row in another table.
- Foreign-key columns are always indexed, so filtering on them stays fast.
- Join queries take a main table, a list of joins and optional WHERE groups applied after the join.
- A join needs READ on every table in it.
- A reference to a row the caller cannot see is treated as if that row does not exist.
- The builder query panel can add joins and sorts without writing any request by hand.
-- how it works
How does foreign keys and joins work in AutessaDB?
Add the link
On an Integer column, choose the table it points to. The column now holds the id of a row there.
Write rows
Insert child rows with the parent id in the foreign-key column, by hand, from a script or from an agent.
Join
Run a join query from the builder, the CLI (query join-query) or the API, with filters on the joined result.
-- every option
Join query options
| option | what it does |
|---|---|
| tableId | The main (left) table. |
| joins | The tables to join and their join conditions. |
| whereGroups | Optional filters applied after the join, in the standard condition format. |
| groupsLogicalOperator | How the filter groups combine: AND or OR. |
| Permission | READ on every table in the join. |
-- example
Full reference in the AutessaDB CLI docs and the API reference.
-- permissions
Who can do what?
| access | can |
|---|---|
| ADMIN | Add or remove foreign-key columns as part of the schema. |
| READ (on each table) | Run join queries across those tables. |
-- faq
Questions about foreign keys and joins
Does AutessaDB support foreign keys?
Yes. An Integer column can be a foreign key to a row in another table, and those columns are always indexed.
Do joins respect row-level security?
Yes. A join needs READ on every table in it, each table applies its own row rules, and a referenced row the caller cannot see is treated as if it does not exist.
Can I join tables in the data lake?
Yes, with SQL. Data lake tables join in read-only SQL in the SQL Workbench, and the semantic layer documents how they relate.
100% customizable, code and all
Make AutessaDB fully your own.
Use it out of the box, then change anything. Ask Autobot, Autessa’s AI builder, for a new field, screen, report, workflow or agent and it builds it into your copy of the app. Or open the code and edit it yourself. Nothing is locked: the app, its data and its code are yours.
Start free and make it yours