✏️
Write to Vault
base.db.writeBase SetVaultSaves a row to one of your Vault tables. Pick a table, fill in each column's value, and optionally turn on 'update if exists' to avoid duplicate rows — perfect for tracking coins, XP, or anything per-user.
When to use this
- →Turn on "Update if row already exists" to avoid duplicates — a must for per-user data
- →Use + Add / − Sub mode on number fields to increment directly — no Math piece needed!
- →The 🔑 unique key column (like user_id) is what determines which row to update
On the canvas
This is what Write to Vault looks like when you place it on your flow. Each field below is something you configure in the inspector panel.
✏️Vault
Write to Vault
base.db.writetablerequired
Pick a table…
upsert
boolean…
Config fields
| Field | Type | Req | What it does |
|---|---|---|---|
tablePick a table… | text | yes | Table 🗄️ |
upsert | boolean | — | Update if row already exists ✏️ |
Output ports
outputMoves on after the data is saved
📐
In TypeScript, this would be…
Not something you need to write — just a look at what Kitcord does for you.
TypeScript
await db.run(
`INSERT INTO coins (user_id, coins) VALUES (?, ?)
ON CONFLICT(user_id) DO UPDATE SET coins = excluded.coins`,
[userId, newCoins],
);More Vault pieces