# sqlite-storage

> Claude/Codex skill by [@val-town](https://omgskills.com/library/val-town/index.md) · 10 stars · Updated 2026-10-13

Use when a val needs to store structured or relational data. Covers the std/sqlite API, parameterized queries, transactions, and the val-scoped vs organization-scoped database distinction.

## Install

```sh
git clone https://github.com/val-town/plugins /tmp/plugins && ln -s /tmp/plugins/plugin/skills/sqlite-storage ~/.claude/skills/sqlite-storage
```

## From README

SQLite Storage Val Town provides built-in SQLite via the std/sqlite module. Reach for it whenever a val needs relational or structured persistent data. For simple key/value data, prefer std/blob instead. Basic Transactions Use sqlite.batch for atomic multi-statement transactions — all succeed or all roll back: Per-val vs organization databases The import path determines which database you get. Both expose the same @libsql/client API (execute, batch) and return rows as keyed objects (Record \[\]): std/sqlite/main.ts — val-scoped database, isolated to this val. The default for new vals, and what you almost always want. std/sqlite/global.ts — organization-scoped database, shared across every val owned by the same account. (Your personal account counts as its own organization here, so this database is shared across all of your vals.) Do not switch an existing val between these import paths — it changes which database the val reads and writes.

## Links

- HTML page: https://omgskills.com/library/val-town/plugins/plugin/skills/sqlite-storage/
- GitHub: https://github.com/val-town/plugins
- Author: [@val-town](https://omgskills.com/library/val-town/index.md)

## More from this repo

- [blob-storage](https://omgskills.com/library/val-town/plugins/plugin/skills/blob-storage/index.md) — Used when a val needs simple key/value persistence — JSON documents, cached responses, uploaded files, or binary assets.
   - [@val-town](https://omgskills.com/library/val-town/index.md) · 10 stars
- [client-side-js](https://omgskills.com/library/val-town/plugins/plugin/skills/client-side-js/index.md) — Used when a val needs to ship JavaScript that runs in the browser — React apps, vanilla DOM scripts, canvas/games,...
   - [@val-town](https://omgskills.com/library/val-town/index.md) · 10 stars
- [create-skill](https://omgskills.com/library/val-town/plugins/plugin/skills/create-skill/index.md) — Used when the user wants to persist a preference, skill, or knowledge.
   - [@val-town](https://omgskills.com/library/val-town/index.md) · 10 stars
