A Row object in SDK corresponds to a single row in a worker’s table.

Initialize

You can either initialize a Row from scratch, or using an already initialized Table object, both methods are shown below.

import {Brainbase, Row} from "brainbase-ai"

// From scratch
const row = Row(api_key="YOUR_API_KEY", table_id="TABLE_ID", row_id="ROW_ID")

// From table
const row = table.row(id="ROW_ID")

Populate

The SDK provides a convenience function for populating a column in the specified row. This will extract the necessary information and fill in the column for the row.

import {Brainbase, Row} from "brainbase-ai"

row.populate(column_keys=["KEY_1", "KEY_2"])

Delete

import {Brainbase, Row} from "brainbase-ai"

row.delete()

Run Action

You can run a worker action on a selected row using the run function. How to create Action.

import {Brainbase, Row} from "brainbase-ai"

row.run(action)