{"_id":"pg-template-tag","_rev":"10-a6e53eb3c93c3605f7bdeff2164edbf9","name":"pg-template-tag","description":"ECMAScript 6 (2015) template tag function to write queries for node-postgres.","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"pg-template-tag","version":"0.0.1","description":"ECMAScript 6 (2015) template tag function to write queries for node-postgres.","repository":{"type":"git","url":"git+https://github.com/xecycle/pg-template-tag.git"},"files":["*.js","README.md"],"scripts":{"prepublish":"node build.js","test":"mocha test.js"},"keywords":["pg","postgre","postgres"],"author":{"name":"Carl Lei"},"license":"Public domain","devDependencies":{"babel-core":"^5.8.3","mocha":"^2.2.5"},"gitHead":"52052ddc9ea24c200b793e6124e055e69ee90b43","bugs":{"url":"https://github.com/xecycle/pg-template-tag/issues"},"homepage":"https://github.com/xecycle/pg-template-tag#readme","_id":"pg-template-tag@0.0.1","_shasum":"bad400605f19deeecbd72e736f35f704ef642744","_from":".","_npmVersion":"2.10.0","_nodeVersion":"0.12.7","_npmUser":{"name":"xecycle","email":"xecycle@gmail.com"},"maintainers":[{"name":"xecycle","email":"xecycle@gmail.com"}],"dist":{"shasum":"bad400605f19deeecbd72e736f35f704ef642744","tarball":"https://registry.npmjs.org/pg-template-tag/-/pg-template-tag-0.0.1.tgz","integrity":"sha512-vVs7YUB9NRDCyx/ctjihsHw/2a4iDeSewm0Bw5qnEyBjDanT482q+39iIKqV0tv8aKGLXFFG217xvhBLtwcMPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAmdC5o3nG0Uj7HiFpLm/T3Ig+g9kcatqRnXIix8h4CmAiEApeyilrUnuIhr4CIGnkx8EDCQhQ+W3CavP3/dRarBpLg="}]},"directories":{}},"0.0.2":{"name":"pg-template-tag","version":"0.0.2","description":"ECMAScript 6 (2015) template tag function to write queries for node-postgres.","repository":{"type":"git","url":"git+https://github.com/xecycle/pg-template-tag.git"},"files":["*.js","README.md"],"scripts":{"prepublish":"node build.js","test":"mocha test.js"},"keywords":["pg","postgre","postgres"],"author":{"name":"Carl Lei"},"license":"SAX-PD","devDependencies":{"babel-core":"^5.8.3","mocha":"^2.2.5"},"gitHead":"d169e4b54cc9fabd1ae52bcad9a44491e50bc62b","bugs":{"url":"https://github.com/xecycle/pg-template-tag/issues"},"homepage":"https://github.com/xecycle/pg-template-tag#readme","_id":"pg-template-tag@0.0.2","_shasum":"a6a4de9bb01595a8ef2f83377942f04c3e684f9a","_from":".","_npmVersion":"2.10.0","_nodeVersion":"0.12.7","_npmUser":{"name":"xecycle","email":"xecycle@gmail.com"},"maintainers":[{"name":"xecycle","email":"xecycle@gmail.com"}],"dist":{"shasum":"a6a4de9bb01595a8ef2f83377942f04c3e684f9a","tarball":"https://registry.npmjs.org/pg-template-tag/-/pg-template-tag-0.0.2.tgz","integrity":"sha512-N5J6PETRx54yBZlX9XlSd5lA+7KDuefN/oG7Rv3+uG7dwhwlm2iuu9V9D2axzMrszZJan5CPydNA0dwEI9BwBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID6JOkbYM5fOICpvgt7ul1Hbgt8YG5OFAmhhKLQWrChVAiEAvprqxd+AzCwbPpjjg+Fro0B+4/Pb1COdnE0qX75ZA2Q="}]},"directories":{}},"0.0.3":{"name":"pg-template-tag","version":"0.0.3","description":"ECMAScript 6 (2015) template tag function to write queries for node-postgres.","repository":{"type":"git","url":"git+https://github.com/xecycle/pg-template-tag.git"},"files":["*.js","README.md"],"scripts":{"prepublish":"node build.js","test":"mocha test.js"},"keywords":["pg","postgre","postgres"],"author":{"name":"Carl Lei"},"license":"SAX-PD","devDependencies":{"babel-core":"^5.8.22","mocha":"^2.2.5"},"gitHead":"092195ccf473c9445c1ed540aca6ad584a7277cc","bugs":{"url":"https://github.com/xecycle/pg-template-tag/issues"},"homepage":"https://github.com/xecycle/pg-template-tag#readme","_id":"pg-template-tag@0.0.3","_shasum":"ee151ad5e1d59563a6c88f4d588f53349daf2f1f","_from":".","_npmVersion":"2.13.4","_nodeVersion":"0.12.7","_npmUser":{"name":"xecycle","email":"xecycle@gmail.com"},"dist":{"shasum":"ee151ad5e1d59563a6c88f4d588f53349daf2f1f","tarball":"https://registry.npmjs.org/pg-template-tag/-/pg-template-tag-0.0.3.tgz","integrity":"sha512-C3gocTGqXqWTTgGO0K3SOwuH94WtsR6BiZLSTKm1+0oYTzeKZRuArdY2YMvHRrvfBe7xyS4GJJPk5+w+i+Khvw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICrqLlOvSkRF2Rc8pjoLREed3Prku+7Ckw2JLcY4PRD3AiATmJAKrNk6BJ0gMS0EtZIAmt4NKpqPTuHNae5ZE0g/cA=="}]},"maintainers":[{"name":"xecycle","email":"xecycle@gmail.com"}],"directories":{}},"0.1.0":{"name":"pg-template-tag","version":"0.1.0","description":"ECMAScript 6 (2015) template tag function to write queries for node-postgres.","repository":{"type":"git","url":"git+https://github.com/xecycle/pg-template-tag.git"},"scripts":{"prepublish":"node build.js","test":"mocha test.js"},"keywords":["pg","postgre","postgres"],"author":{"name":"Carl Lei"},"license":"SAX-PD","devDependencies":{"babel-core":"6.4.0","babel-preset-es2015":"6.3.13","mocha":"2.3.4"},"gitHead":"ac4d0361180debc13098b3c669602556bd6f3ae7","bugs":{"url":"https://github.com/xecycle/pg-template-tag/issues"},"homepage":"https://github.com/xecycle/pg-template-tag#readme","_id":"pg-template-tag@0.1.0","_shasum":"3c71c3678d72a9bf73d671fa1f4279d07c2fb3ef","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.14.4","_npmUser":{"name":"pauldraper","email":"paulddraper@gmail.com"},"dist":{"shasum":"3c71c3678d72a9bf73d671fa1f4279d07c2fb3ef","tarball":"https://registry.npmjs.org/pg-template-tag/-/pg-template-tag-0.1.0.tgz","integrity":"sha512-Oc+tNZzvFBUzi6/+52QOUbJXAV5lIcLPnzhK71lKTs705NBjTNj2mmk+8n58ro6mrjgB7/a0l7GmiDWEVAarJw==","fileCount":7,"unpackedSize":10274,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQ4q7CRA9TVsSAnZWagAA25IP/i+XZinh03ItCJObfejr\n4Sq+Hq80jaVNFpohZTYLMJdbugaZ4ueWMRi0UWE/s7AuUMc7nlEP9XazdB6k\nfFqwOVY+H746uLRpF5jiBZutLizuX70wqJHUQBZjxsHwCIDLcllQcbIKzQ5w\nNdhog+hQwBbU1CKe9UXZ1BJ4xYuDxMwEm/RXCBnZuqaF1u5fwwp9Gj/g6EzH\nmMB8Tz+c5tskMY1wrCCqAzno3ncIC/gop3WbQ4rNrpCIZdyZ3vfz4OQiF7R/\nLFVa1RSYbowezvPFISCBScxhFlPhWr5+AAjb0GbfUCGwBYZP1RwEyTb2Siep\nY1qFJnEZSh91LQh1Qr5auvDhI1ruLl6I3oXMX/SR+ewOAcXnRuMcboa4gZwN\nL2dPzKdxNrKQVJ3RHMK9nQhnwFvsNjGJXt5uH61jqtysta1cHpCviNrIzdpZ\nU2tXtSN973RIy+9wzLLXLxJdBbtSQur4p8fUDt2YaBg8lInbve54OaBsQFWK\n5hG4Xg9s5W8GhW4M/iI1HD4icQlFkQnrxvAKkcDS91I1brkxKRs9Z01XP0Nb\nNsVMxeJMmTZz7HoeBGUhgClPpHm1ykKydkwh8ZDXgdorSiBseGFqsa4/X7PJ\nZ47uHcCcl+Lucg0fw+l/c+4+X5C0FbssVhCBghvm2mDjYR+gWcIbyZBYzdwm\nQcQa\r\n=oiQk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/NNI35a7Zey/NIVNoDOypG3YmiaALtkWAbMTxAAbMRAiAcSkXF8GGyoLXCpvffwdSUb9V9A8mnfsdN1YfywzytuQ=="}]},"maintainers":[{"name":"xecycle","email":"xecycle@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-template-tag_0.1.0_1547930298694_0.17738745688799584"},"_hasShrinkwrap":false},"0.1.1":{"name":"pg-template-tag","version":"0.1.1","description":"ECMAScript 6 (2015) template tag function to write queries for node-postgres.","repository":{"type":"git","url":"git+https://github.com/xecycle/pg-template-tag.git"},"scripts":{"prepublish":"node build.js","test":"mocha test.js"},"keywords":["pg","postgre","postgres"],"author":{"name":"Carl Lei"},"license":"SAX-PD","devDependencies":{"babel-core":"6.4.0","babel-preset-es2015":"6.3.13","mocha":"2.3.4"},"gitHead":"3fe5556b838453231fe1ea6433c887beb9f4ba9b","bugs":{"url":"https://github.com/xecycle/pg-template-tag/issues"},"homepage":"https://github.com/xecycle/pg-template-tag#readme","_id":"pg-template-tag@0.1.1","_shasum":"307524d31327b1b46ce889e3c16faaef6538b1ef","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.14.4","_npmUser":{"name":"pauldraper","email":"paulddraper@gmail.com"},"dist":{"shasum":"307524d31327b1b46ce889e3c16faaef6538b1ef","tarball":"https://registry.npmjs.org/pg-template-tag/-/pg-template-tag-0.1.1.tgz","integrity":"sha512-oHREJyiwjUIVWXpTu1X8MkMRRFLnw8fKs0OJKIDxW+jyimoLB9ZXZ6JaO3oTw8iKa4tOewkSL7hvadBLW8701A==","fileCount":7,"unpackedSize":11700,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQ4wJCRA9TVsSAnZWagAAYiYP/2PXlW5VFl5Z+F2iXIVm\nAhNnukiQapHjeKJXeWEbpYR0OCZMU9gBq40GW9A+V6gF4ZHknF96sku9fN4g\npAh8IArrKdBgzyo3ujr7FrSHjr76MODzATObtcDjAMJ5Ze9dH3BAJ/W48G7J\n51JP9MSjPHIBEh4wN3xVQUaQQPfZFP77mwb9WoT13K81SP6k2fuHHXMaL/bY\nwGbcV9A8pkgde9O2uTXvp4IApQR6Jmb8ZPrKYjtHHMyytO8j1v3HvnTNlxwr\nUELzCvilJ7zIlHiNw7TrV9FL1PCg4YIwUuflvODZCY/7vrp4HjkGJpraZIYO\n9yPxJeXqZukgdYUJzlHGkv9i63AdBuWX2F+VvfjrML933OaKCdrbXzr84NY+\neA40JH5RMkKNFxXN0sP0E3v67hrZBdeyP0shHsWhGyl1Bsgs9+c26ZseN+T+\nk77ssijGri+GzypiHpc2sh+qa00kFnmJm0i0PgJZpdze26ny57uA8QWwwoVZ\n4M83959n3sK8WryALXZO/yp6Ij68ovmg5QLN+xNmjInbDSeJ/rMLcZqFOIEr\nQnLYylMr3A/XTcwbAgWIWqxpBjW70u78IFYCn3tUEl/oVnXcP5XbrPFkf5BM\nkjfr4o+fru5iB3fPuWeXh/40m5UxlcGkaP5t0TGl18ensrmNQWQ8GY1Y/gkf\nFQ3j\r\n=GLx0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDy/paKSDSUC/ZPRm6VNg5OgsDaJjc4FqWtbaonwYFWYgIhAJunWJgJT22A2hXMC6L9itLhpbPDZSEMIlYIoO/vpHmW"}]},"maintainers":[{"name":"xecycle","email":"xecycle@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-template-tag_0.1.1_1547930633243_0.04749326950131194"},"_hasShrinkwrap":false},"0.1.2":{"name":"pg-template-tag","version":"0.1.2","description":"ECMAScript 6 (2015) template tag function to write queries for node-postgres.","repository":{"type":"git","url":"git+https://github.com/xecycle/pg-template-tag.git"},"scripts":{"prepublish":"node build.js","test":"mocha test.js"},"keywords":["pg","postgre","postgres"],"author":{"name":"Carl Lei"},"license":"SAX-PD","devDependencies":{"babel-core":"6.4.0","babel-preset-es2015":"6.3.13","mocha":"2.3.4"},"gitHead":"cb961fc058095c2726f434df44a21212cf8b5bf7","bugs":{"url":"https://github.com/xecycle/pg-template-tag/issues"},"homepage":"https://github.com/xecycle/pg-template-tag#readme","_id":"pg-template-tag@0.1.2","_shasum":"35db981eecb5b1ca27029f482a694ae1d734d007","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.14.4","_npmUser":{"name":"pauldraper","email":"paulddraper@gmail.com"},"dist":{"shasum":"35db981eecb5b1ca27029f482a694ae1d734d007","tarball":"https://registry.npmjs.org/pg-template-tag/-/pg-template-tag-0.1.2.tgz","integrity":"sha512-YtnOv0WxKppY+T+wMgasMMvhpzTeNOLsuejESfn+Os0Jq0U4c5JyTmcZ7HTtdRJPB7Sl0/jvH7KhD15PyeiYBw==","fileCount":7,"unpackedSize":11931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQ5t1CRA9TVsSAnZWagAAA0oQAJ1FhP4m5/2nKthsR/53\nsRVmZMwE7xtg33QZnpuKu9lcyq0TH3DUOqthIuFTIw5jucqqb9//0FtmbMjy\nugGGIcuwBvDF8GsxVvMaIYRH8gBN036t/BnoxkR6rZjEC1x6sO7ntIT3WD/g\nnNvEvyR4zJrHP2n/wGOB/g8MyGykAaf4XgEK2PxH5IpsFCUH76x1fc0+tm/h\nRxH0nE4eTaqfy+xB2ejVaicQJVZz8SedXUwrJy1U5uL/uC6Ao3EqvjUV9fnL\nuwgvfO0yDbfhYn4vjBnqrsmM5HK2YWJCMUg9r3+XSDHaOt6M/imBKWdyyuGV\nZYPcuX8LbDHZINK9iRak5UHk/wyP/9A25RchcovoYWHESCBRr+pvFn/FjUS9\noRzEq7nkgwnm0cbIpnqQfypMP9y1JZ4mzu5zF8sQrpa+A0/9UNeptTLj/DFS\nTznoWgwY8oke1NYzVCQIEXtWFabt7V+se4aOFuAHBINP/9egfxeG6QeqCCYc\nvYxSQ7KY89bpXCMQCEkLAfr3U/Wcss9Hv5Q7SSI9p85h3sT2F4vClly2APYf\nvaOfz7Uy8VHRjfIjIKs0Xq3YkWAsphv6/RXKVdTPZbwIxBJddmP8z+byTB2K\npvueqlRxjUUlGixMXmGCuLKecPSuAJdKH9VdAte1XwWag2q0QznO0Z664S9f\n503u\r\n=A8Uk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGN+i/bRmA7CFRSABVCVfa+C6O1cRIFOFb1FIR/4tzUkAiAmRy0dpMG4rbZaMb8kwAmKY3Y4XjXLBe6LAGSqCnF+hA=="}]},"maintainers":[{"name":"xecycle","email":"xecycle@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-template-tag_0.1.2_1547934581386_0.40145795349433877"},"_hasShrinkwrap":false}},"readme":"#pg-template-tag\n[![Build Status](https://travis-ci.org/XeCycle/pg-template-tag.svg)](https://travis-ci.org/XeCycle/pg-template-tag)\n\nBuild a { text, values } object for use with\n[brianc/node-postgres](https://github.com/brianc/node-postgres/).\nSupports nesting.\n\n## Example\n\nWrite the query as-is inside template literals, use `${}` interpolation to\nsupply values.\n\n```javascript\nvar SQL = require(\"pg-template-tag\");\nconnection.query(SQL`select name from user where id=${id}`);\nconnection.query(SQL`select value from record where ${ lower===null ? SQL`true` : SQL`time > ${lower}`}`);\n```\n\nPieces are reusable, so you can:\n\n```javascript\nvar fields = SQL`name, time, score, history_avg(score) as \"scoreAvg\"`;\nconnection.query(SQL`select ${fields} from scores where time > current_date`);\nconnection.query(SQL`select ${fields} from scores where score > ${minScore}`);\n```\n\nValues are reused within the query if the piece is reused.\n\n```javascript\nvar ids = SQL`${[1, 2, 3]}`;\nvar query = SQL`\n  select name from a where id = any(${ids})\n  union all\n  select name from b where id = any(${ids})\n`;\nquery.text;   // 'select ... where id = any($1) union all select ... where id = any($1)'\nquery.values; // [[1, 2, 3]]\n```\n\nThere's a `.join` function analog to `Array.prototype.join` to join together literals.\n\n```javascript\nfunction filterUsers(filter) {\n  var conditions = [];\n  if (filter.email) conditions.push(SQL`email like ${filter.email}`);\n  if (filter.minAge) conditions.push(SQL`age > ${filter.minAge}`);\n  if (filter.maxAge) conditions.push(SQL`age < ${filter.maxAge}`);\n  return connection.query(SQL`select * from users where ${SQL.join(conditions, ' and ')}`);\n}\n```\n","maintainers":[{"name":"xecycle","email":"xecycle@gmail.com"}],"time":{"modified":"2022-06-23T19:55:37.595Z","created":"2015-07-23T06:57:35.612Z","0.0.1":"2015-07-23T06:57:35.612Z","0.0.2":"2015-07-27T08:55:47.589Z","0.0.3":"2015-08-13T11:26:15.789Z","0.1.0":"2019-01-19T20:38:18.799Z","0.1.1":"2019-01-19T20:43:53.331Z","0.1.2":"2019-01-19T21:49:41.511Z"},"homepage":"https://github.com/xecycle/pg-template-tag#readme","keywords":["pg","postgre","postgres"],"repository":{"type":"git","url":"git+https://github.com/xecycle/pg-template-tag.git"},"author":{"name":"Carl Lei"},"bugs":{"url":"https://github.com/xecycle/pg-template-tag/issues"},"license":"SAX-PD","readmeFilename":"README.md","users":{"ghkddbguse":true}}