Database orm
Skill ComeOnOliver/skillshub/skills/aiskillstore/marketplace/abdulsamad94/database-orm
🧠The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.
npx -y skills add ComeOnOliver/skillshub --skill database-ormAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its author says it does
Copied from the file, not written here
Interaction with NeonDB Postgres using Drizzle ORM.
SKILL.md
1.0 KB, as published. Nobody here has run it
Database Logic
Stack
- Database: Neon (Serverless Postgres)
- ORM: Drizzle ORM
- Driver:
@neondatabase/serverless
Connection
The database connection is initialized in db/index.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:
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, "[email protected]"));
// Insert
await db.insert(users).values({ ... });
Migrations
- Generate:
npx drizzle-kit generate - Push:
npx drizzle-kit push(or migrate script)