{"id":16193426,"url":"https://github.com/pyramation/pg-query-string","last_synced_at":"2025-04-07T15:17:57.125Z","repository":{"id":57322633,"uuid":"297530382","full_name":"pyramation/pg-query-string","owner":"pyramation","description":"sql query string builder","archived":false,"fork":false,"pushed_at":"2020-10-02T06:08:15.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T08:44:51.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyramation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-22T03:58:55.000Z","updated_at":"2020-10-02T06:08:17.000Z","dependencies_parsed_at":"2022-08-26T01:11:20.227Z","dependency_job_id":null,"html_url":"https://github.com/pyramation/pg-query-string","commit_stats":null,"previous_names":["pyramation/sql-query"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fpg-query-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fpg-query-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fpg-query-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fpg-query-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyramation","download_url":"https://codeload.github.com/pyramation/pg-query-string/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675598,"owners_count":20977378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T08:14:50.532Z","updated_at":"2025-04-07T15:17:57.104Z","avatar_url":"https://github.com/pyramation.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pg-query-string [![Build Status](https://travis-ci.org/pyramation/pg-query-string.svg?branch=master)](https://travis-ci.org/pyramation/pg-query-string)\n\n```sh\nnpm install pg-query-string\n```\n\nThanks to https://github.com/hiddentao/squel\n\nThis is essentially squel, however a few changes:\n\n* built with babel instead of gulp\n* hard-coded to postgres \n* added type coersions \n* classes handy for testing\n\n```js\nimport { Table, Schema } from 'pg-query-string';\n\nconst schema = new Schema('my-schema');\nconst table = schema.table('users', {\n  id: 'uuid',\n  username: 'text',\n  email: 'email',\n  password: 'password',\n  active: 'boolean',\n  tags: 'text[]'\n});\n\ntable.update(\n  {\n    active: true,\n    tags: ['pyramation']\n  },\n  {\n    id: 1\n  }\n);\n```\n\nWhich produces the following object\n\n```\nObject {\n  \"text\": \"UPDATE \\\\\"my-schema\\\\\".users SET active = $1::boolean, tags = ($2::text[]) WHERE (id = $3::uuid)\",\n  \"values\": Array [\n    true,\n    Array [\n      \"pyramation\",\n    ],\n    1,\n  ],\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyramation%2Fpg-query-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyramation%2Fpg-query-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyramation%2Fpg-query-string/lists"}