Concepts
Abacus is an Object Event Database: it records things and what happened to them, for any domain. Its Schema looks like Postgres: an Object is a table, an Attribute is a column, and an Object Event is a row.
Objects
An Object is a table. It has an Id, a Label and up to 31 Attributes.
Attributes
An Attribute is a column of one Object. It has an Id, a Label and one Scalar Type. CopyAttributes copies Attributes to other Objects.
An Object that models a person might have these Attributes:
| Id | Scalar Type |
|---|---|
| FirstName | String |
| LastName | String |
| Age | Int |
Scalar Types
A Scalar Type is the kind of value an Attribute holds. Abacus has ten:
| Scalar Type | Postgres column type |
|---|---|
Int | int |
Float | float |
Numeric | numeric |
Boolean | bool |
String | see below |
Json | see below |
DateTime | timestamptz |
DateTimeZone | text |
DateInterval | interval |
UuidV7 | uuid |
A String or Json value is stored once, in a table shared by every Object, and its column holds a number that points to it. A query reads the value itself.
Object Events
An Object Event is a row of an Object: what one thing looked like at one moment. CreateObjectEvents writes them.
An Object Event may carry any of its Object's Attributes; the rest are empty. Abacus stores each as it is given.
FirstName (String) | LastName (String) | Age (Int) |
|---|---|---|
| FIRST_NAME | LAST_NAME | 30 |
| FIRST_NAME | LAST_NAME | 31 |
| FIRST_NAME | NEW_LAST_NAME | 32 |
Aliases
An Alias is a name a value can carry, so a query can match the value by that name. Only an Int, String or Json value can carry Aliases, and one Alias may name many values.
For example, a Jira status can be stored as its status id, an Int, carrying its status name as an Alias. This Where matches every status id named To Do:
Where: { Binary: { Left: { Attribute: { Id: { In: "Questions.StatusHistory.Status" }, ObjectReference: "S" } }, Operator: Equal, Right: { Alias: "To Do" } } }
An Alias can only be compared with Equal to an Attribute; anywhere else it is refused.
Selecting Object Events
SelectObjectEvents reads Object Events with a query shaped like a Postgres SELECT: Select, Distinct, From, Where, GroupBy, Having, Order and Limit, where From names Objects as tables. It answers with Columns, the name of each column, and Rows, where each row lists its values in the same order as Columns.
ExplainSelectObjectEvents takes the same query and answers with the plan Postgres would follow.