aiskillstore/marketplace / skills/abdulsamad94/database-orm
database-orm
VerifiedInteraction with NeonDB Postgres using Drizzle ORM.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 1.0 KB |
| skill-report.json | config | 17.7 KB |
SKILL.md
View on GitHub---
name: database-orm
description: Interaction with NeonDB Postgres using Drizzle ORM.
---
# Database Logic
## Stack
- **Database**: Neon (Serverless Postgres)
- **ORM**: Drizzle ORM
- **Driver**: `@neondatabase/serverless`
## Connection
The database connection is initialized in `db/index.ts`.
```ts
import { neon } from '@neondatabase/serverless';
import { drizzle } from 'drizzle-orm/neon-http';
const sql = neon(process.env.DATABASE_URL!);
export const db = drizzle(sql);
```
## Schema
Schema definitions are in `db/schema.ts`.
- `users`, `sessions`, `accounts`, `verifications`: Auth tables.
- `analyses`, `chatbot_history`: App specific tables.
## Operations
Example of a database query:
```ts
import { db } from "@/db";
import { users } from "@/db/schema";
import { eq } from "drizzle-orm";
// Select
const user = await db.select().from(users).where(eq(users.email, "test@example.com"));
// Insert
await db.insert(users).values({ ... });
```
## Migrations
- Generate: `npx drizzle-kit generate`
- Push: `npx drizzle-kit push` (or migrate script)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |