Database Nodes

> Read and write data using Brickr's built-in key-value store and table database.

Database nodes connect your flow to Brickr's data storage systems. There are two categories: KV (Key-Value) nodes for simple key-based storage, and Table nodes for structured relational data. All database nodes require sequence connections because they perform side effects.

KV (Key-Value) Database

KV nodes provide simple, fast storage where each entry is identified by a unique string key. Use KV storage for configuration values, counters, session data, caching, and any data that fits a key-value pattern.

brickr-db-create

Creates a new key-value entry in the database. Fails if the key already exists.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | key | Input | string | | value | Input | any | | success | Output | boolean | | sequence out | Output | sequence |

brickr-db-set

Sets a value for a key, creating it if it does not exist or overwriting if it does.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | key | Input | string | | value | Input | any | | success | Output | boolean | | sequence out | Output | sequence |

Use brickr-db-create when you want to ensure the key is new (e.g., preventing duplicate usernames). Use brickr-db-set when you want to update or create regardless.

brickr-db-get

Retrieves a value by key. Returns the raw stored value.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | key | Input | string | | value | Output | any | | found | Output | boolean | | sequence out | Output | sequence |

brickr-db-get-string

Retrieves a value by key and returns it as a string.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | key | Input | string | | value | Output | string | | found | Output | boolean | | sequence out | Output | sequence |

brickr-db-get-json

Retrieves a value by key and parses it as JSON, returning a structured object.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | key | Input | string | | value | Output | object | | found | Output | boolean | | sequence out | Output | sequence |

brickr-db-list-all

Lists all key-value entries in the database.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | entries | Output | object:array | | sequence out | Output | sequence |

Use the typed get nodes (brickr-db-get-string, brickr-db-get-json) when you know the type of the stored value. This avoids the need for manual type conversion downstream.

Table Database

Table nodes work with structured, relational data organized into rows and columns. Tables must be created in the Dashboard before they can be used in your routes.

Navigate to Dashboard > Databases to create and manage your tables. Once created, they appear as options in table database nodes.

On Fail pin

All table read and write nodes have an On Fail sequence output in addition to the normal sequence out. When an operation fails (row not found, access denied, invalid data), execution branches to the On Fail path exclusively -- the normal sequence out does not fire. The error output on every table node carries the error message as a string.

Connect the On Fail pin to a return-json node that returns an appropriate error response. This is cleaner than checking a boolean error flag.

---

get-database-table

Retrieves all rows from a specified table.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | table | Input | enum-value:BrickrTable | | limit | Input | number | | offset | Input | number | | table_id | Output | enum-value:BrickrTable | | rows | Output | object:array | | error | Output | string | | sequence out | Output | sequence |

When a table is selected, the rows output is automatically typed to that table's row structure.

---

get-table-row-ids

Retrieves all row IDs from a table as an array of enum values.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | table | Input | enum-value:BrickrTable | | row_ids | Output | enum-value:BrickrTableRow:array | | error | Output | string | | on fail | Output | sequence | | sequence out | Output | sequence |

---

get-table-row-names

Retrieves all row names (IDs) from a table as a plain string:array. Use this when you need the row names as strings rather than typed enum values -- for example, to pass them to a for-each loop, return them in a JSON response, or do string comparisons.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | table | Input | enum-value:BrickrTable | | row_names | Output | string:array | | error | Output | string | | on fail | Output | sequence | | sequence out | Output | sequence |

---

get-table-row

Retrieves a single row from a table by its row ID (selected from a dropdown of existing rows).

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | table | Input | enum-value:BrickrTable | | row_id | Input | enum-value:BrickrTableRow | | table_id | Output | enum-value:BrickrTable | | row_id | Output | enum-value:BrickrTableRow | | row | Output | object | | error | Output | string | | on fail | Output | sequence | | sequence out | Output | sequence |

When a table is selected, row is automatically typed to that table's structure.

---

get-table-row-by-name

Retrieves a single row using a string row name supplied at runtime. Use this when the row name comes from another node's output (e.g., a loop, a request parameter, or a stored value) rather than a static dropdown selection.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | table | Input | enum-value:BrickrTable | | row_name | Input | string | | table_id | Output | enum-value:BrickrTable | | row_name | Output | string | | row | Output | object | | error | Output | string | | on fail | Output | sequence | | sequence out | Output | sequence |

When a table is selected, row is automatically typed to that table's structure.

Use get-table-row when you want to pick a row from a static dropdown in the builder. Use get-table-row-by-name when the row name is determined at runtime from a variable or input.

---

get-table-row-by-value

Finds the first row where a specified column matches a given value.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | table | Input | enum-value:BrickrTable | | column_name | Input | enum-value:BrickrTableColumn | | match_value | Input | matches selected column type | | found | Output | boolean | | table_id | Output | enum-value:BrickrTable | | row_id | Output | enum-value:BrickrTableRow | | error | Output | string | | on fail | Output | sequence | | sequence out | Output | sequence |

This node returns the matching row_id. Pass it to get-table-row or get-table-row-by-name to retrieve the full row object.

---

create-table-row

Inserts a new row into a table.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | table | Input | enum-value:BrickrTable | | row_id | Input | string (optional) | | row_data | Input | object | | table_id | Output | enum-value:BrickrTable | | row_id | Output | enum-value:BrickrTableRow | | success | Output | enum-value:TableRowCreateStatus | | row | Output | object | | error | Output | string | | on fail | Output | sequence | | sequence out | Output | sequence |

If you do not provide row_id, Brickr generates one automatically. Custom row IDs must be unique within the selected table.

---

update-table-row

Updates an existing row in a table by its row ID.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | table | Input | enum-value:BrickrTable | | row_id | Input | enum-value:BrickrTableRow | | row_data | Input | object | | table_id | Output | enum-value:BrickrTable | | row_id | Output | enum-value:BrickrTableRow | | row | Output | object | | error | Output | string | | on fail | Output | sequence | | sequence out | Output | sequence |

---

delete-table-row

Deletes a row from a table by its row ID.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | table | Input | enum-value:BrickrTable | | row_id | Input | enum-value:BrickrTableRow | | table_id | Output | enum-value:BrickrTable | | row_id | Output | enum-value:BrickrTableRow | | success | Output | boolean | | error | Output | string | | on fail | Output | sequence | | sequence out | Output | sequence |

Deleting a row is permanent. There is no undo. Consider using a "soft delete" pattern by adding a deleted boolean column and using update-table-row instead.