Skip to content
Back to skills

072 Configuration 607dd334

ASecurity

**wrangler.jsonc:**

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
databasestypescriptsqlbackend

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 072-configuration_607dd334 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 072 Configuration 607dd334?

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

Security grade badge for 072 Configuration 607dd334
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-072-configuration-607dd334/badge)](https://www.skillsdirectory.com/skills/tools-only-072-configuration-607dd334)

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

SKILL.md
# DO Storage Configuration

## SQLite-backed (Recommended)

**wrangler.jsonc:**

```jsonc
{
  "migrations": [
    {
      "tag": "v1",
      "new_sqlite_classes": ["Counter", "Session", "RateLimiter"],
    },
  ],
}
```

**Migration lifecycle:** Migrations run once per deployment. Existing DO instances get new storage backend on next invocation. Renaming/removing classes requires `renamed_classes` or `deleted_classes` entries.

## KV-backed (Legacy)

**wrangler.jsonc:**

```jsonc
{
  "migrations": [
    {
      "tag": "v1",
      "new_classes": ["OldCounter"],
    },
  ],
}
```

## TypeScript Setup

```typescript
export class MyDurableObject extends DurableObject {
  sql: SqlStorage

  constructor(ctx: DurableObjectState, env: Env) {
    super(ctx, env)
    this.sql = ctx.storage.sql

    // Initialize schema
    this.sql.exec(`
      CREATE TABLE IF NOT EXISTS users(
        id INTEGER PRIMARY KEY,
        name TEXT NOT NULL,
        email TEXT UNIQUE
      );
    `)
  }
}

// Binding
interface Env {
  MY_DO: DurableObjectNamespace
}

export default {
  async fetch(request: Request, env: Env): Promise<Response> {
    const id = env.MY_DO.idFromName('singleton')
    const stub = env.MY_DO.get(id)

    // Modern RPC: call methods directly (recommended)
    const result = await stub.someMethod()
    return Response.json(result)

    // Legacy: forward request (still works)
    // return stub.fetch(request);
  },
}
```

## CPU Limits

```jsonc
{
  "limits": {
    "cpu_ms": 300000, // 5 minutes (default 30s)
  },
}
```

## Location Control

```typescript
// Jurisdiction (GDPR/FedRAMP)
const euNamespace = env.MY_DO.jurisdiction('eu')
const id = euNamespace.newUniqueId()
const stub = euNamespace.get(id)

// Location hint (best effort)
const stub = env.MY_DO.get(id, { locationHint: 'enam' })
// Hints: wnam, enam, sam, weur, eeur, apac, oc, afr, me
```

## Initialization

```typescript
export class Counter extends DurableObject {
  value: number

  constructor(ctx: DurableObjectState, env: Env) {
    super(ctx, env)

    // Block concurrent requests during init
    ctx.blockConcurrencyWhile(async () => {
      this.value = (await ctx.storage.get('value')) || 0
    })
  }
}
```

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.