BASE Logo Welcome to APIBASE

TLC Data Model TLC Data Model

APIBASE stores data using a deterministic coordinate model called TLC — Table · Line · Column.

Every value inside a BASE has a fixed TLC coordinate.

$data[table][line][column]

Internal Storage Structure

TLC describes how data is stored internally in the BASE.

Table
 ↓
Line
 ↓
Column

Example coordinate:

$data[2][1][2]

Table Registry

Table 0 stores the registry of all tables in the BASE.

$data[0][0][1] = 'authors';
$data[0][0][2] = 'books';
$data[0][0][3] = 'publishers';

Table Structure

Each table defines its column schema on line 0.

$data[2][0][1] = 'id_book';
$data[2][0][2] = 'title';
$data[2][0][3] = 'author_id';

Records

Data records start at line 1.

$data[2][1][1] = '1';
$data[2][1][2] = 'Dune';
$data[2][1][3] = '1';

$data[2][2][1] = '2';
$data[2][2][2] = 'Foundation';
$data[2][2][3] = '2';

Relations

Tables reference each other using identifier fields.

$data[1][1][1] = '1';
$data[1][1][2] = 'Frank Herbert';

$data[2][1][3] = '1';

The value 1 links the book to its author.

From API Request to Coordinate

HTTP requests resolve directly to TLC coordinates.

GET /hive/get/books/T2/L1/C2

Internal lookup:

$data[2][1][2]
In APIBASE, the coordinate itself is the query.

TLC as a Request Language

TLC is not only an internal storage model. It is also the coordinate language used by the API.

In API requests:

  • T selects a table
  • L95 selects one record by primary identifier
  • L selects all records in the table
  • C selects a column
/api/get/T2
/api/get/T2/L95
/api/get/T2/L95/C2
Inside the BASE, line means physical storage. Inside the API, L95 means the record whose primary identifier is 95.

The Symbols of APIBASE

TLC remains the core coordinate system of APIBASE. Filtering extends TLC with an operator and a value parameter.

T
Table
T5
L
Primary or all rows
L95 or L
C
Column
C3
O
Operator
O28
V
Value
?V=N.D

The core coordinate system is still TLC. Operators and values extend TLC for filtering.

Filtering with Operators

APIBASE can filter rows by extending TLC with:

T / L / C / O ?V=

This means:

  • T → target table
  • L → inspect all rows
  • C → evaluate one column
  • O → apply an operator
  • V → provide the comparison value

Example:

/api/get/T14/L/C4/O28?V=N.D

This request means:

  • T14 → target table 14
  • L → inspect all rows
  • C4 → evaluate column 4
  • O28 → operator 28 = LIKE
  • V=N.D → match the value "N.D"

Result: return all rows from table 14 where column 4 contains the string N.D.

Common Operator Patterns

/api/get/T14/L/C4/O28?V=N.D
/api/get/T14/L/C7/O7?V=100
/api/get/T14/L/C7/O32?V=101_110
/api/get/T14/L/C7/O33?V=294_388_482
  • O28 → LIKE
  • O7 → greater than
  • O32 → BETWEEN using min_max
  • O33 → LIST using v1_v2_v3
APIBASE keeps coordinates in the path and passes the comparison value through ?V=.

Supported Operators

The full operator registry may contain more entries, but the following operators are currently supported by the API filtering layer.

ID Symbol Name Meaning Example
1 == Equal Matches values that are equal /api/get/T14/L/C7/O1?V=100
3 != Not equal Matches values that are different /api/get/T14/L/C7/O3?V=100
6 < Less than Matches values lower than the target /api/get/T14/L/C7/O6?V=100
7 > Greater than Matches values greater than the target /api/get/T14/L/C7/O7?V=100
8 <= Less than or equal Matches values lower than or equal to the target /api/get/T14/L/C7/O8?V=100
9 >= Greater than or equal Matches values greater than or equal to the target /api/get/T14/L/C7/O9?V=100
28 LIKE Like Checks whether the value contains the target string /api/get/T14/L/C4/O28?V=N.D
32 BETWEEN Between Checks whether the value falls between two bounds /api/get/T14/L/C7/O32?V=101_110
33 LIST List Checks whether the value belongs to a list /api/get/T14/L/C7/O33?V=294_388_482
For BETWEEN and LIST, APIBASE uses the underscore character _ inside V as a separator.

TLC vs SQL

Traditional databases use SQL queries:

SELECT author
FROM authors
WHERE id_author = 2

APIBASE uses coordinate navigation:

/api/get/T2/L2/C2

APIBASE can also filter using operators:

/api/get/T14/L/C4/O28?V=N.D
SQL asks the database to search. TLC directly navigates to the data. Operators extend TLC when filtering is needed.

Self-Descriptive API Responses

APIBASE responses describe both the data and its structure.

{
  "status": "success",
  "data": "Socrates",
  "header": {
    "1": "id_author",
    "2": "author"
  },
  "tlc": {
    "table": 2,
    "line": 2,
    "column": 2
  },
  "rows": 3
}

Output Modes

  • default — raw JSON
  • assoc — associative object
  • meta — data + schema
  • raw — plain text value
GET /api/get/T2/L2/C2
GET /api/get/T2/L2/C2?format=assoc
GET /api/get/T2/L2/C2?format=meta
GET /api/get/T2/L2/C2?format=raw

Why TLC?

  • Coordinates instead of queries
  • Deterministic storage
  • No query planner
  • No hidden database state
  • Self-descriptive responses
  • Filtering without SQL