{"library":"pg-query-string","title":"pg-query-string","description":"pg-query-string is a small library (v0.1.7, stable) for building PostgreSQL query strings with parameterized values. It is a fork of squel, hardcoded to PostgreSQL, with type coercion and ES6 class-based schema/table constructs. Current version is 0.1.7, no recent updates. Key differentiator: produces both SQL text and parameter arrays for safe execution.","language":"javascript","status":"maintenance","last_verified":"Sat May 09","install":{"commands":["npm install pg-query-string"],"cli":null},"imports":["import { Table } from 'pg-query-string'","import { Schema } from 'pg-query-string'","const { Table } = await import('pg-query-string')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { Schema, Table } from 'pg-query-string';\n\nconst schema = new Schema('my_schema');\nconst table = schema.table('users', {\n  id: 'uuid',\n  username: 'text',\n  active: 'boolean'\n});\n\nconst result = table.update(\n  { active: true },\n  { id: 1 }\n);\n\nconsole.log(result.text);\n// UPDATE \"my_schema\".users SET active = $1::boolean WHERE (id = $2::uuid)\nconsole.log(result.values);\n// [ true, 1 ]","lang":"typescript","description":"Creates a schema and table with typed columns, then builds an UPDATE query with parameterized values.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}