agentsclimarketplace

Database orm

Skill bg-szy/TOP-SKILLS/skills/marketplace/database-orm

Interaction with NeonDB Postgres using Drizzle ORM.From its SKILL.md

Install
npx -y skills add bg-szy/TOP-SKILLS --skill database-orm

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.0 KB, 255 tokens by cl100k_base, 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)

What ships with it: 1 file

17.7 KB alongside SKILL.md

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.