Your personal library for code snippets. Contribute to a public knowledge base, keep snippets private, collaborate in team workspaces, or share via a secret link.
Sign in instantly — no approval needed. Your snippets are ready the moment you're signed in.
Save snippets
Any language, any time
Multi-file blueprints
Document full setups with tabs
Public library
Browse and contribute community knowledge
Share snippets
Public links or private secret URLs
Team workspaces
Private spaces for your team's code
Find instantly
Search, filter, tag
import { Pool } from "pg";
const pool = new Pool({
connectionString:
process.env.DATABASE_URL,
ssl: { rejectUnauthorized: false },
});
export async function query<T>(
sql: string,
params?: unknown[]
): Promise<T[]> {
const { rows } = await pool.query(
sql,
params
);
return rows as T[];
}