libSQL
libSQL works with the tables of your libSQL or Turso database from a flow: it reads rows, adds new ones, changes or deletes existing ones and runs SQL queries.
There are two components named libSQL. This one works row by row with your tables. The other libSQL stores data that can later be searched by meaning.
When to use it
- Your application keeps its data in Turso and you want to read or update it from a flow.
- Giving an agent access to look up records.
- Saving a process’s results in a table.
Configuration
The Operation field decides what the component does and which fields appear:
Insert(default): adds rows to a table.Get: reads rows from a table, with or without conditions.Update: changes values in the rows that meet a condition.Delete: deletes the rows that meet a condition.Custom Query: runs the SQL query you write.DatabaseInfo: describes the database’s tables and columns, useful so an agent knows what is there.
Once you pick the credential, Table Name fills with your database’s tables.
You need a libSQL / Turso credential with your database address and token. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The libSQL / Turso credential with the connection details. |
| Operation (required) | What the component does. Default: Insert. |
| Table Name (required) | The table to work on. With Insert in Custom mode you can type a new name and the table is created if it does not exist. |
| Mode | With Insert. Dynamic (default): one field per table column appears so you fill its values. Custom: Ingest Data appears to insert the data coming from another component. |
| Select Filter Type | With Get, Update and Delete, how you write the conditions. String (default): in Filter String, such as age > 25 AND city = 'Madrid'. Build Manually: you say how many conditions you want and a field appears for each one. |
| Filter String | The conditions rows must meet. Texts go in single quotes and numbers without quotes. |
| Field To Update | With Update. How many columns you want to change; a field appears for each one’s new value. |
| Custom Query (required) | With Custom Query. The SQL query to run, for example SELECT * FROM customers WHERE city = 'Seville'. |
| Limit | With Get, the maximum number of rows returned. Default: 10. |
Advanced options
| Field | What it does |
|---|---|
| Return All | With Get, returns every row regardless of Limit. Off by default. |
Output
The Data output holds the result: the rows read with Get or Custom Query, or confirmation of what was inserted, changed or deleted. The Database Info output holds the description of the tables with DatabaseInfo.
In tool mode, an agent can use the component to look up or change data by itself. See Tool Mode.
Example
A booking app keeps appointments in Turso.
- Add libSQL with the libSQL / Turso credential.
- Choose
Update, theappointmentstable, the conditionid = 120in Filter String and1in Field To Update. - In the field that appears, type the new status:
confirmed.
Good practices
- Use a read-only credential if the component will only look things up.
- Before letting an agent use
UpdateorDelete, test the conditions withGetto see which rows would be affected.