o2sql

JSON →
library 4.0.20 ·javascript
verified Jun 5, 2026

o2sql is a lightweight JavaScript library for programmatically generating PostgreSQL queries with parameterized values. It provides a fluent API to build SELECT, INSERT, UPDATE, and DELETE statements, abstracting the SQL generation into an AST (Abstract Syntax Tree) that can be converted to `{ sql, values }` objects compatible with node-postgres (`pg`). Version 4.0.20 has no known breaking changes from earlier v4 releases. Key differentiators: simple, minimal API; automatic identifier quoting; direct integration with the `pg` library via `.toParams()`. It does not support MySQL despite the keyword.