BASE Logo Welcome to APIBASE

TLC Data Model The TLC Data Model

APIBASE organizes data using a deterministic physical model called TLC — Table · Line · Column.

In this model, every piece of information has a fixed, predictable coordinate within a BASE file. This structure allows the engine to navigate directly to the data without the need for a complex query planner.

$data[table][line][column]
TLC describes the internal PHP array structure used for storage. While the API uses a similar language, the TLC model defines how data is physically laid out.

1. The Table Registry (Table 0)

Every BASE contains a reserved table at index 0. This is the registry that maps table IDs to their logical names.

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

Note: Table 0, Line 0 is the starting point for all discovery within the BASE.

2. Table Schemas (Line 0)

Within any given table, Line 0 is reserved for the schema (column headers). This makes the BASE file self-descriptive.

// Structure for Table 2 (books)
$data[2][0][1] = 'id_book';
$data[2][0][2] = 'title';
$data[2][0][3] = 'author_id';

3. Data Records (Line 1+)

Actual data records begin at Line 1. Each line represents a physical slot in the storage array.

$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';
Important: In the physical TLC model, "Line" refers to the array index (the physical storage slot). When using the API, "L" usually refers to the record's primary identifier.

4. Deterministic Relations

Relations in APIBASE are explicit. One cell simply contains the value of another record's primary identifier.

// Author in Table 1, Line 1
$data[1][1][1] = '1';
$data[1][1][2] = 'Frank Herbert';

// Book in Table 2, Line 1 referencing Author ID '1'
$data[2][1][3] = '1';
There are no hidden "joins" at the storage level. Relations are maintained through clear, addressable values.