Index of every page on this site: llms.txt
All skills
theprimeagen avatar

/hyperdrive-drizzle

@fa570dd
by theprimeagentheprimeagen/skills237 stars
8
Run it yourself
  • 1 file
  • 1.4 KB
  • Updated 9 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/theprimeagen/skills/hyperdrive-drizzle

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈5 tokens for metadata: the name and description. ≈370 when used: this file.

SKILL.md has missing or invalid fields
  • The name in the SKILL.md header is missing or is not text.
  • The description in the SKILL.md header is missing or is not text.
Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

hyperdrive-drizzle

Rules

  1. Create the Postgres/Drizzle client inside each Worker invocation (fetch, queue, scheduled, or Durable Object method) using env.HYPERDRIVE.connectionString; never create global pools or long-lived shared clients.
  2. Migrations must ALWAYS run through Drizzle (drizzle-kit generate, drizzle-kit migrate, or project bun run db:* scripts); never hand-roll migration SQL or apply schema changes manually.
  3. Keep schema and migrations in lockstep: change schema.ts, generate a migration, and run the migration before deploying code that depends on it.

Example 1: Drizzle in a Worker (Hyperdrive connection)

import { Client } from "pg";
import { drizzle } from "drizzle-orm/node-postgres";
import { users } from "./db/schema";

export default {
  async fetch(_request, env): Promise<Response> {
    const client = new Client({
      connectionString: env.HYPERDRIVE.connectionString,
    });

    await client.connect();
    const db = drizzle(client);

    const result = await db.select().from(users).limit(1);
    return Response.json(result[0] ?? null);
  },
} satisfies ExportedHandler<{ HYPERDRIVE: Hyperdrive }>;

Example 2: Migration scripts (Drizzle-only workflow)

{
  "scripts": {
    "db:generate": "drizzle-kit generate",
    "db:migrate:local": "drizzle-kit migrate --config drizzle.local.config.ts",
    "db:migrate:remote": "drizzle-kit migrate --config drizzle.remote.config.ts"
  }
}

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at fa570dd. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Dormantupdated 9 months ago

README badge

README badge for theprimeagen/skills/hyperdrive-drizzle