K
Docs
API ReferencePiecesWrite to Vault
✏️

Write to Vault

base.db.writeBase SetVault

Saves 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.

✏️
Write to Vault
base.db.write
Vault
tablerequired
Pick a table…
upsert
boolean

Config fields

FieldTypeReqWhat it does
table
Pick a table…
textyesTable 🗄️
upsertbooleanUpdate 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],
);