
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
pgsql-codegen
Advanced tools
Generate fully-typed TypeScript classes and interfaces from a live PostgreSQL schema via introspection.
Converts your PostgreSQL tables into idiomatic TypeScript code — fast, predictable, and schema-aware.
🧠 Intelligent Introspection Pulls schema structure using native SQL introspection — no GraphQL required.
🧱 Interface + Class Output
Generates matching interface + class pairs for each table using PascalCase naming.
🧹 Schema-Aware Output
Writes files into schemas/<schema>.ts, grouped and re-exported from an index.ts.
🔗 Type Mapping for Postgres Primitives
Supports UUID, Timestamp, Boolean, Text, Int, and nullable detection.
🪴 Auto Imports from _common.ts Deduplicates and imports shared scalar types intelligently.
🧪 Snapshot-Ready for Testing Babel AST-based output is stable and perfect for inline snapshot tests.
npm install pg-codegen
import { generateCodeTree } from 'pg-codegen';
import getIntrospectionRows from 'pg-codegen/introspect';
const rows = await getIntrospectionRows({
client: pgClient,
introspectionOptions: {
pgLegacyFunctionsOnly: false,
pgIgnoreRBAC: true
},
namespacesToIntrospect: ['my_schema'],
includeExtensions: false
});
const output = generateCodeTree(rows, {
includeUUID: true,
includeTimestamps: true
});
// Example: write output['schemas/my_schema.ts'] to disk
// schemas/_common.ts
export type UUID = string;
export type Timestamp = string;
// schemas/my_schema.ts
import { UUID, Timestamp } from './_common';
export interface Users {
id: UUID;
email: string;
created_at: Timestamp;
}
export class Users implements Users {
id: UUID;
email: string;
created_at: Timestamp;
constructor(data: Users) {
this.id = data.id;
this.email = data.email;
this.created_at = data.created_at;
}
}
SET LOCAL) into queries—ideal for setting role, jwt.claims, and other session settings.libpg_query, converting SQL into parse trees.SELECT, INSERT, UPDATE, DELETE, and stored procedure calls—supports advanced SQL features like JOIN, GROUP BY, and schema-qualified queries.AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
FAQs
PostgreSQL Codegen
We found that pgsql-codegen demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.