/webda:webda-storesfrom webda
Reads, writes, and queries Webda models using the repository pattern. Also handles switching between memory, file, MongoDB, and PostgreSQL stores.
Ships in webda. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Reading, writing or querying models, reacting to data changes, or changing where the data is stored.
Code never talks to a store: it uses the model. The store is configuration.
import { useLog } from "@webda/core";
import { UuidModel, useRepository } from "@webda/models";
export class Note extends UuidModel {
text!: string;
archived!: boolean;
}
export async function examples() {
const note = await Note.create({ text: "Hello", archived: false });
const loaded = await Note.ref(note.getUUID()).get();
await Note.ref(note.getUUID()).patch({ archived: true });
const { results, continuationToken } = await Note.query("archived = false ORDER BY text LIMIT 10");
const same = await Note.query("text = ?", [loaded.text]);
for await (const item of Note.iterate("archived = true")) {
await item.delete();
}
useRepository(Note).on("Created", event => useLog("INFO", "Note created", event));
return { results, continuationToken, same };
}
Pass user input as query parameters (? or :name), never by building the query string.
The default store is the Registry service. To switch, replace it in webda.config.json and add the package:
| Store | Package | Registry configuration | Connection |
|---|---|---|---|
| memory (default) | @webda/core | none (persisted to .registry) | |
| files | @webda/fs | { "type": "Webda/FileStore", "folder": "./data" } | |
| MongoDB | @webda/mongo | { "type": "Webda/MongoStore", "collection": "registry" } | WEBDA_MONGO_URL |
| PostgreSQL | @webda/postgres | { "type": "Webda/PostgresStore", "table": "registry" } | PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE |
@Inject("Registry") store; store.save(...) → Model.create / Model.ref(id).patch / Model.query
`text = '${input}'` in a query → Note.query("text = ?", [input])
Credentials in webda.config.json → environment variables (.env.example)
npm test. For MongoDB or PostgreSQL, start the database (docker compose up -d) and cp .env.example .env: tests load .env automatically; for npm run debug or npm run serve, export the variables first (set -a; . ./.env; set +a).
Written for Webda 4.0.0-beta.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub loopingz/webda.io --plugin webda7 skills in this plugin
/webda-configurationUse when changing webda.config.json, application parameters, the parameters of a service or the per-environment deployments of a Webda app/webda-deployUse when deploying a Webda app, adding a deployment environment or building a container image or Lambda package/webda-modelsUse when adding or changing a Webda model, its fields, validation, primary key or relations to other models/webda-operationsUse when exposing behaviour to clients as an operation, or enabling REST, GraphQL, gRPC or MCP in a Webda app/webda-servicesUse when adding or changing a Webda service, its parameters, its lifecycle or when wiring it in webda.config.json/webda-testingUse when writing, running or fixing tests of a Webda app, its models, services or operationsOther plugins' skills for the same job