Skip to content
Back to skills

Web Db

ASecurity

How to use @owlmeans/web-db — browser IndexedDB-backed storage service for client-side persistence. Auto-invoked when importing the web DB service.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 22, 2026
businesstypescriptreact

Works with

  • cli

Security analysis

A100/100

Scanned October 6, 2026

npx -y skills add owlmeans/common --skill web-db --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Web Db?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Web Db
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/owlmeans-web-db-common/badge)](https://www.skillsdirectory.com/skills/owlmeans-web-db-common)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: web-db
description: How to use @owlmeans/web-db — browser IndexedDB-backed storage service for client-side persistence. Auto-invoked when importing the web DB service.
user-invocable: false
---
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->

# @owlmeans/web-db

**Layer:** Web (React)
**Install:** `"@owlmeans/web-db": "^0.1.18-rc.49"` in `dependencies`

## Key Exports

| Export | Description |
|--------|-------------|
| `appendWebDbService(context, alias?)` | Register the service on a client context and return the context |
| `makeWebDbService(alias?)` | The bare service, when you register it yourself |
| `WebDbService` | The `ClientDbService` contract from [[client-resource]] — `initialize(alias?)`, `erase()` |
| `DEFAULT_ALIAS` | `client-db`, the same alias `@owlmeans/client-resource` looks for |

## Usage

```typescript
import { appendWebDbService } from '@owlmeans/web-db'
import { appendClientResource } from '@owlmeans/client-resource'

appendWebDbService(context)
appendClientResource<Config, Context, Project>(context, 'projects')
```

This package supplies the **storage**, not the query surface: it hands
`@owlmeans/client-resource` a `ClientDb` over `idb-keyval`, and that resource is what answers
`get`/`load`/`list`/`count`/`create`/`update`/`save`/`delete`/`take`/`purge`, criteria and `{ sort }`
included. Every read walks the whole store: all records are loaded out of IndexedDB and the criteria
applied in memory. `list(where)` with no `size` therefore answers **every** match, and `size: 0`
says the same explicitly; a `size` does slice `page * size` out of what was already read, so paging
saves the read nothing. `page` without `size` raises
`UnsupportedArgumentError('page-without-size')`.

`initialize(alias)` returns one `ClientDb` per alias, memoised, and prefixes every key with that
alias, so two resources on one browser never collide. `erase()` clears the **whole** IndexedDB
store, every alias at once — a per-resource wipe is `ClientResource.erase()`.

## Depends On

- `@owlmeans/client-resource`, `@owlmeans/client-context`, `@owlmeans/context`
- `idb-keyval` (runtime) — IndexedDB behind it

## Related

- [[client-resource]] — the resource this service backs

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…