
Security News
vlt 1.5.0 Adds Agent Skills Management
vlt 1.5.0 links skills from JavaScript dependencies to coding agents, with lockfile versioning and Socket data to filter out known malicious packages.
@pgsql/transform
Advanced tools
@pgsql/transform is a TypeScript library for transforming PostgreSQL ASTs between different PostgreSQL versions. It serves as a crucial component for building a single source of truth deparser that can handle SQL from multiple PostgreSQL versions while maintaining backward compatibility.
The transform package enables you to:
This package only supports ASTs derived from SQL that is parseable by PostgreSQL 17. This means:
This design ensures all transformed ASTs can be reliably deparsed using the latest PostgreSQL grammar.
npm install @pgsql/transform
import { ASTTransformer } from '@pgsql/transform';
const transformer = new ASTTransformer();
// Transform any version to PG17
const pg17Ast = transformer.transformToLatest(pg13Ast, 13);
// Transform between specific versions
const pg15Ast = transformer.transform(pg13Ast, 13, 15);
// Convenience methods
const result = transformer.transform13To17(pg13Ast);
For better performance when you know source and target versions:
import { PG13ToPG17Transformer } from '@pgsql/transform';
const transformer = new PG13ToPG17Transformer();
const pg17Ast = transformer.transform(pg13Ast);
import { parse } from '@pgsql/parser';
import { deparse } from 'pgsql-deparser';
import { PG13ToPG17Transformer } from '@pgsql/transform';
// Parse with older version
const pg13Ast = await parse('SELECT * FROM users', { version: 13 });
// Transform to latest
const transformer = new PG13ToPG17Transformer();
const pg17Ast = transformer.transform(pg13Ast);
// Deparse with latest grammar
const sql = await deparse(pg17Ast);
Incremental: PG13 → PG14 → PG15 → PG16 → PG17
Direct: PG13 → PG17, PG14 → PG17, etc.
| From | To | Transformer |
|---|---|---|
| PG13 | PG14, PG15, PG16, PG17 | V13ToV14Transformer, PG13ToPG17Transformer |
| PG14 | PG15, PG16, PG17 | V14ToV15Transformer, PG14ToPG17Transformer |
| PG15 | PG16, PG17 | V15ToV16Transformer, PG15ToPG17Transformer |
| PG16 | PG17 | V16ToV17Transformer, PG16ToPG17Transformer |
The transform package fits into the broader pgsql-parser ecosystem:
This enables a single source of truth for SQL generation while supporting legacy codebases.
🛠 Built by the Constructive team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on GitHub.
pgsql-parser.pgsql-parser for parsing and deparsing SQL 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 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 Software code or Software CLI, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
FAQs
AST-based SQL transformation, qualification, classification and closure analysis for PostgreSQL
The npm package @pgsql/transform receives a total of 2,579 weekly downloads. As such, @pgsql/transform popularity was classified as popular.
We found that @pgsql/transform 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.

Security News
vlt 1.5.0 links skills from JavaScript dependencies to coding agents, with lockfile versioning and Socket data to filter out known malicious packages.

Security News
Rust 1.100 will add opt-in dependency cooldowns to Cargo, giving security scanners and maintainers time to catch malicious crate releases.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.