0.0.17 • Published 6 months ago

pgbuddy v0.0.17

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

PgBuddy

A no-nonsense, type-safe and tiny query builder wrapping postgres.js.

PGBuddy banner

Features

  • 🛡️ Type-safe queries with TypeScript
  • 🔒 SQL injection prevention
  • 🎯 Simple CRUD operation builders
  • 📦 Thin wrapper over postgres.js

Installation

npm install pgbuddy postgres

Quick Start

import postgres from 'postgres';
import { PgBuddy } from 'pgbuddy';

const sql = postgres('postgres://username:password@localhost:5432/dbname');
const pgBuddy = new PgBuddy(sql);

interface User {
  id: number;
  email: string;
}

const userTable = pgBuddy.table<User>('users');

// Simple type-safe queries
await userTable.select({
  where: { email: 'user@example.com' }
});

Documentation

PgBuddy provides type-safe wrappers for common database operations. For complete documentation, visit:

Advanced Features

PgBuddy is a wrapper around postgres.js. For advanced PostgreSQL features like:

  • Transactions
  • Prepared Statements
  • Listen/Notify
  • Copy Operations
  • Custom Types
  • Connection Pooling

Please refer to the postgres.js documentation.

License

MIT

Contributing

Contributions welcome! Please read our contributing guidelines first.

0.0.17

6 months ago

0.0.16

6 months ago

0.0.15

6 months ago

0.0.14

6 months ago

0.0.13

6 months ago

0.0.10

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago