DB
Read and write a SQLite store. The operation knob reshapes the knobs and outputs. Knobs are templates: {tag} pulls from a wired source and {{secret.X}} resolves a secret. In SQL a wired {tag} is bound as a parameter, so it is always a value, never SQL. An insert or update stores a data: URL value as text.
Fired. It runs when an event or a value lands on trigger, and pulls its other inputs at that moment.
Inputs
Section titled “Inputs”| Port | Type | Notes |
|---|---|---|
trigger |
event | Fires the node |
db |
db | |
tag |
any | Optional, grows: one socket per wire |
Outputs
Section titled “Outputs”| Port | Type | Notes |
|---|---|---|
rows |
json | Only when operation is query or find |
affected |
int | Only when operation is exec, update or delete |
row_id |
int | Only when operation is insert |
trigger |
event |
Right-click a knob and pick Convert to input to drive it from a wire.
| Knob | Kind | Default | Notes |
|---|---|---|---|
operation |
choice | query |
query, exec, insert, find, update, delete |
sql |
text block | empty | {tag} and {{secret.NAME}} work here; only when operation is query or exec; placeholder SELECT * FROM chat_history WHERE role = {tag} |
table |
text | empty | {tag} and {{secret.NAME}} work here; lists the tables of the wired database; only when operation is insert, find, update or delete; placeholder pick a table |
fields |
text block | empty | {tag} and {{secret.NAME}} work here; only when operation is insert or update |
where |
text block | empty | {tag} and {{secret.NAME}} work here; only when operation is find, update or delete; placeholder id = {row_id} |
Placeholder for fields
role = usercontent = {chat}Example
Section titled “Example”Every read and write on a Database. insert takes one column = value per line, find, update and delete take where lines, and query and exec run your own SQL. An insert into a notes table with these fields writes one row per fire:
title = {title}body = {reply}A {tag} from a wire is always bound as a value, never pasted into the SQL, so a webhook body or a model reply cannot change the statement.
More in Store
Section titled “More in Store”- Database: An embedded SQLite database.
- KV: Read and write a key-value store.
- KV Store: A key-value store that keeps its values between runs.
- Vector Store: A vector store kept in a file on this machine.
- Vectors: Index and search an embedded vector store.