Database Operations

> Perform CRUD operations on your tables directly from the Builder.

Brickr provides database nodes that let you read and write data as part of your flow. These nodes connect to your tables and execute operations when the flow runs.

Insert

The DB Insert node adds a new row to a table.

  • Input: An object with column names as keys and values to insert
  • Output: The inserted row (including its generated row_id)

Use this to save form submissions, create new records from API requests, or generate data programmatically.

Select

The DB Select node retrieves rows from a table.

  • Input: Table name, optional conditions, optional limit and offset
  • Output: An array of matching rows

Conditions

Conditions let you filter which rows are returned. You can filter by:

  • Equals -- Column value matches exactly
  • Not equals -- Column value does not match
  • Greater than / Less than -- Numeric comparisons
  • Contains -- Text contains a substring
  • Is null / Is not null -- Check for missing values

Multiple conditions can be combined -- all conditions must be true for a row to match (AND logic).

Use the limit and offset inputs for pagination. For example, limit=10 and offset=20 returns rows 21 through 30.

Update

The DB Update node modifies existing rows in a table.

  • Input: Table name, conditions to match rows, and an object with the fields to update
  • Output: The number of rows updated

If no conditions are provided, the update will affect all rows in the table. Always include conditions to target specific rows.

Delete

The DB Delete node removes rows from a table.

  • Input: Table name and conditions to match rows
  • Output: The number of rows deleted

Deleted rows cannot be recovered. Always double-check your conditions before executing a delete operation.

Find One

The DB Find One node retrieves a single row matching the given conditions.

  • Input: Table name and conditions
  • Output: A single row object, or null if no match is found

This is useful when you need exactly one record, such as looking up a user by row ID or email.

Count

The DB Count node returns the number of rows matching the given conditions.

  • Input: Table name and optional conditions
  • Output: A number

Use this for analytics, pagination (total pages), or conditional logic based on record counts.

Query

The DB Query node lets you run a raw SQL query against your database for advanced use cases not covered by the standard operation nodes.

  • Input: SQL query string and optional parameters
  • Output: Query results

Use parameterized queries to prevent SQL injection. Pass dynamic values through the parameters input rather than concatenating them into the query string.

Operation summary

| Node | Action | Returns | |------|--------|---------| | DB Insert | Add a row | Inserted row | | DB Select | Read rows | Array of rows | | DB Update | Modify rows | Count of updated rows | | DB Delete | Remove rows | Count of deleted rows | | DB Find One | Read one row | Single row or null | | DB Count | Count rows | Number | | DB Query | Raw SQL | Query results |

What's next?

| Topic | Description | |-------|-------------| | Tables | Define your schema | | Relations | Link tables together | | Builder | Learn the visual editor |