Tables and data modeling · AutessaDB
Computed columns
AutessaDB computed columns fill themselves: a column's default can be an AutessaScript snippet that reads the row's other columns and returns a value. It runs in the background after each write, in dependency order, and recomputes only when a column it depends on changes.
-- the problem
Derived values drift when people maintain them by hand
A full name, a risk score, a due date ten days after intake: if someone has to remember to update it, it will be wrong somewhere. A computed column keeps the derived value next to its inputs and recomputes it whenever they change.
What you get
- Write the value in AutessaScript: read sibling values with variables.get('column_name') and return with response.setResponse(...).
- Variables arrive natively typed: numbers as numbers, booleans as booleans, text as strings, media as their stored file path.
- On insert every computed column runs; on update only those whose dependencies changed run again.
- Computed columns that depend on other computed columns run after them and see the fresh value.
- A circular dependency is rejected and none of the involved columns compute.
- Writes return at once with a COMPUTING status, and the value lands shortly after, so the write is never blocked.
- Bulk writes can compute immediately, defer the work, or skip it.
-- how it works
How does computed columns work in AutessaDB?
Pick Computed
On a column, set the default value to Computed instead of Static.
Write the script
Read the columns you need and return a string; the platform converts it to the column type.
Declare dependencies
List every column the script reads. That list decides when it recomputes and in what order.
Write rows as usual
Insert or update from anywhere; the computed value appears once the background run finishes.
-- every option
How computed columns behave
| option | what it does |
|---|---|
| When it runs | Asynchronously after the write: every computed column on insert, dependent ones on update. |
| dependsOn | The columns the script reads. Drives recompute and ordering; undeclared reads go stale on updates. |
| Empty values | Empty columns are absent from variables, so guard with variables.has('name'). |
| Built-in fields | id, created_at and updated_at are available to the script. |
| Return value | A string, converted to the column type (text as-is, numbers parsed, multi-select from its combined form). |
| Explicit writes | If an update writes the computed column directly, it is not recomputed over that value in the same update. |
| Append-only tables | Computed columns are not allowed on append-only tables. |
-- example
Full reference in the AutessaDB CLI docs and the API reference.
-- permissions
Who can do what?
| access | can |
|---|---|
| ADMIN | Add or change a computed column as part of the schema. |
| WRITE | Write the rows that make computed columns run. |
-- relations
How it connects
autessadb feature
Triggers
When the derived value should start work elsewhere, key a trigger on it.
autessa platform
Scripts and tools
Computed columns use the same AutessaScript language as the scripts you build in Autessa.
autessadb feature
Bulk writes
Choose immediate, deferred or skipped computation for large loads.
-- faq
Questions about computed columns
What language are computed columns written in?
AutessaScript, the same JavaScript-based language Autessa uses for script tools, with a slimmer context focused on the row.
Do computed columns slow down writes?
No. They run in the background after the write returns; the response reports COMPUTING until the value lands.
What happens with circular dependencies?
They are rejected. If computed columns depend on each other in a loop, none of them compute until the cycle is removed.
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