{"_id":"@slonik/typegen","_rev":"46-034e9b516d5b461bca8b21291560d250","name":"@slonik/typegen","dist-tags":{"latest":"0.15.0","transform-properties":"0.3.2-transform-properties.4","next":"0.9.0-next.1","featureinterpret-coalesce":"0.11.4-featureinterpret-coalesce-2022-03-22-16-48-05.6","feature-improve-log-output":"0.11.4-feature-improve-log-output-2022-03-31-07-11-56.6"},"versions":{"0.0.1":{"name":"@slonik/typegen","version":"0.0.1","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","bin":{"slonik-typegen":"cli.js"},"types":"dist/index.d.ts","author":{"name":"mmkal"},"repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 17"},"bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"homepage":"https://github.com/mmkal/slonik-tools#readme","_id":"@slonik/typegen@0.0.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-TxK6W+YM9qZ52iBMTOiDdoEARzcs/Elzqlq6fAbULAp3gy/nvOblcf1R/hX+BtdMh90EZwGga0qnva7Di9zR+g==","shasum":"5c6ca014adff482fd4d7c1839544c13d1c9f6a35","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.0.1.tgz","fileCount":11,"unpackedSize":57408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBGoVCRA9TVsSAnZWagAAwHYQAJqUQBDcqrI+RGjN2siB\n1S9eR1ee6yYHRT3qFwiHZAa5wgoY4JWl2gzdIenv+KRItFuJmHTp9ZsK9Uph\nB9aLBpZQDeXVrgPB8wvFirR+Iw2/Xa0y8Z3tiJvRaanWl1COOLXW5H07TlWW\n/EEI03pxp0rzaum4VgAjDtOy+f4tQa3XR40LIpECvJT22R8UUi7j2GHQfxWr\nQKm2n5gaD6O2boF7/PsKKQ6cf62GyOTWmfVRuOtM7RzZ04PKNvUNmIklCsHv\n8hHDOyMiV/ee7Th+8AhfMjA2Hp5o3D9DHN14zWHxtVFXPufp3GEDCjMvCb2J\nn7DKcTChHcF3fximrDk8pv89+a85UE4V/VEYUgIJX9lbmkhcSPkgX/l1kNqX\nKW0pqlZSeGIBDDx3PWHTMcc5EY+egIe9merF7WFDSEwNX3jsF2QxBZfeQL3E\nWTcwV41mG4B0OOH7Xk4ydeAR4wcdfKoqeqX6oE6kqv9E2bcGlmIOMhI0zF5u\nt9JpUMrm/yVLLrqRBHiLFq36JbRHStB8Bt24776EwrJwtdhdro5jbSinLhZl\nNHT4PmG4MXluNykHLxUPvgqAAmjI86ViqvFgxI/dRhdz0fsb4L81LOqfQqBA\nm5vTAg6Nui0L4FuzBGd2vhKjBspeMj/H6GEnQ8R55npa8KxJ3gXWl1Wea1hr\nEF8K\r\n=aah6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBn7IWtcQbE+/Kahh39RFdnYc/CpAaOItjzu4WjhRzJyAiBX1bfJf6j6ZHa4rdDvhbEokaD3YgKHMqATWH9E1+PpqA=="}]},"maintainers":[{"name":"mmkal","email":"mmkal1@outlook.com"},{"name":"gajus","email":"gajus@gajus.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.0.1_1560570388551_0.17849604814297693"},"_hasShrinkwrap":false},"0.0.2":{"name":"@slonik/typegen","version":"0.0.2","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 17"},"bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"homepage":"https://github.com/mmkal/slonik-tools#readme","_id":"@slonik/typegen@0.0.2","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-JONtZZ3spUKTW2I5V0vXMi516RHwcLb/U96Ng/8nhan1hzkpXt9bYI3BFIAb0DA+xEtQexYlegiLtGeHw+Yb3w==","shasum":"aa8366497a3c3933aa0e0698a858a569cec1e227","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.0.2.tgz","fileCount":11,"unpackedSize":57290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCFqmCRA9TVsSAnZWagAAxpkP/3BItXaq50qXGzS6H3T4\nTEvcaCTH23kE/AzLamCO3kIb/UpsfsF9b2aazXxku2Dd21n3J0wdtuklLqF4\n3UtJztUz+007/bWCsvDGa5/jilT+X3anfvtrEKIuwWMFDzIbUdeQReCaQ5ZF\nkv24HPR/7e75Y7QZMBLGDboSKTCL/AfLpU0XOkgzuRaeLvhwpJrfSN2MF5th\n4x+MDvdsf4+OwUIYt2VxWTzkmYJuITTQXYLqqCamk9GksBL+ZNalPd9wECdG\nna/JbPsViMKEFjyVslD7V/eNSMKr5gsjJ+C08aj3xah/i94jkkt+sh7licpp\nrVcXwT+nLXfGQRYbmdqe/mcELpXPa2wJtqqFLyZ8V7IpidPU9uM+0Zmv2pH0\ng+D70Q3wfJzpxFuCnrXgeXzIzWXG8DxgpREL+sq8uAp6Dv7Sn8l81X+7ia2w\nW8GxNRgiwuc03/uQcXyd28G+wm6ghKtIru/cdZferBxQRIoT3uqYSLSJSSDf\nixOaXAhRI0nqZNzJs3HPHFPO90ve3hLHXdVMnvhGH3trHiPLQSUdWHNCDQoi\nK9hQFm2vEQLIjKSangbxRIuV5cItIDKeA6ml11ZMNLRu+ZaciwkNggBVL5Q5\n4Smnca7IVLtfoiAKvDFiENURKOTWloLGZZh391KvT938ddVXPTqqEfQ9Ha3b\nZjoY\r\n=bvlR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAmt03gVJ5m6KVeNvVcAYbDA/eB2ZVeh+dSeCy2xTEfWAiBShgiC9oXRBZN/eHRB3aqK3qVupyVn233hsxaC+ah3xw=="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.0.2_1560828581460_0.18785388253268143"},"_hasShrinkwrap":false},"0.1.0":{"name":"@slonik/typegen","version":"0.1.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 17"},"bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"homepage":"https://github.com/mmkal/slonik-tools#readme","_id":"@slonik/typegen@0.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ZRGYe/mnrfqGoTGhiXXUXHi1RGWR1rDZw0RE3+aZW5IMsQdl/VVwndgSdZtgXOCXG1W0IjUj/hHPU4qgmi5KSQ==","shasum":"86d08bab77524ba1b06f4c32f386446014b89996","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.1.0.tgz","fileCount":7,"unpackedSize":28908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdDEyzCRA9TVsSAnZWagAAcWMQAIQZYSgXT7hzad4cZGfm\nAx7p5U82Qnk64dBUfM6O6BGDBINNZIQJf5sQwXAmwJppgHrUFrNFz0zzP2EY\nopaK5GPOzB1F3mWZr79CGZAO+tUtQtNsP1w9pMBbjS2tMbRe1V7+r0Au6tBC\nTR/EDktMlQOsCO4cxrUUSqc7/v0lZGhjSTyZrgkdZ7uYJeyk8/uivnR7gzDM\ndhy+FtcnvulrELW8uVxnAv1g8NIeEG7rGYGjPN5mnGfcUYI917hltQ6Q09OC\nsncStgHAc5grSkB68mjKh/9UDN1D84ZyAKB9ra7Q+kDAv0h2DWL/Vd5yFCGf\neNTtwR64c3ZpHwDvrd5Zz+KiFjmuIBgCHkiC7KEHpENbswctgUREEzVjL+vH\ntJU+ycKG3W6fU0QzrGGzHhZmtRMdbm3wcABeVEwdCLOzvzvJsYOS3lPbFUXy\n1fMnBcM8S1c0jUfbaDRb+/VffIE5J20GgBawQ8X+7K43HqAd6qky1SLAZUKv\nt7KBCMNwHOZ8IbiIRts4pIgA3opgMhymZqOJe16Fu5AdQKDEtNeTMNye9vLB\n4Yo4yb3g+noW5XZFUlLblqZCobEkHqmw9AWz8o6dohuQtSUH+k5sp3dhZ/E9\nqfbvy3GBF5YOVtaYcfxIk3ZQJqrYy9QvPQBbF8yh17TViUEyRkiSxTPXL2rb\n1d6M\r\n=ZTCK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAFWV6iOjUzuMphFnyM1UIfDdqcvYJK4ZZeUYXgZ2kegIhAPDwkFmc2i0/Qns1sJkM4MvoYtrRP3lNmO69VjBpdODM"}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.1.0_1561087154939_0.331435885678276"},"_hasShrinkwrap":false},"0.1.1":{"name":"@slonik/typegen","version":"0.1.1","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 17"},"bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"homepage":"https://github.com/mmkal/slonik-tools#readme","_id":"@slonik/typegen@0.1.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-pCT5aw/uU8a4lKWl1TdCOIhkZSwUuykZ1nyxw6veZQ6mBJgiIGII3cmgB/hFZaqVxXJzy/O4Y4Tdav1Xhc7XrA==","shasum":"d6b9f86a17147de2c678a49aa825807ed8ca7072","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.1.1.tgz","fileCount":7,"unpackedSize":28698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdDmWACRA9TVsSAnZWagAAWPwP/0EOunTTf9ZPLBdtS4gf\n83O3eg8mexd2Jz8XOJin0V/GfHPGUpPIZ8J8L7V+XyyMgYwDXYuk6bAAB33S\nQCoQVPS8HtlPmFQLOiSIBqnJrdiSQsZzNWbV4IIbmwDCCJFXKumIudSwkm81\nABi7MK6xUMU5zzLDFqp5appApk2TnL0B9aPnFLbpR0BF8T0tTHFPuuDkdhh5\nVoXYV7iG8cXvdI6g5mL80JXqvhQBibrnqpDwCahUlVc0vBY3lpC/acpQIl1/\n1/zVNyFOvwCCYO7834TYeLOXEq1xvpepdR+yH85H8N9Q+RMH6upeA8DYH1i8\npysfaUxVDotUoxj3Vu6ecU2OnHbBeumCMKggL7s1/dhDwzjvqn3vu+oBUaW1\nx7dviKZIv9yZmxBq3g+OCwHUHsHSrtdp3Hb0hYfi6ONA0dRB85mVzSS4/Vj6\nI89Y8wy4eyVeld/XpjyyUStSgaDTmu50YqyLe7qyVBPAd4sT1Gb4cwOflSJk\nDjyYrWXo/NdGYgoX4qhdQrWDCGwfpBJCmXq7kV9BIGADSZrzTFKPtToj/wPx\nlbFUb/maOElfZQWRhjF9MP0mCxVTBIdlOaYLrKJhEpxS0EDs9cgiweyRGP5S\nbCmMXOlUQCDGqBfIQf+iwOetsRh1GEI2vFj0NZtDJT2Yq/XQvBT/WBxro9XQ\n4xDW\r\n=9wX4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxN/zLpdDc9qN2kDlrbN3dyT37kGCqE7HhC49P1Cv9YAIgIkI1401VEPKKPdA0coLGqkxTIp7TjrQE8EanqKlxsjY="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.1.1_1561224575953_0.5934342472953531"},"_hasShrinkwrap":false},"0.1.2":{"name":"@slonik/typegen","version":"0.1.2","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 17"},"bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"homepage":"https://github.com/mmkal/slonik-tools#readme","_id":"@slonik/typegen@0.1.2","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-J5S0m/xKuIYD7G7VbcZiiQdPGthJSAbUkWGX4is8rf86jfaPYkOMYhtkBdWQSimC8wquc+kI/opJPlt0NtgKzg==","shasum":"1c786415e3272f85d67013abc2fbd03803fd61b7","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.1.2.tgz","fileCount":7,"unpackedSize":28698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdF+cmCRA9TVsSAnZWagAArOQP+wSvoNx9kq7UqpIFWKIc\nVjSqevXskzdmsx3TBqhMfftH13TJKQh5FlT+HLwC19zOsJPxNFKdx5STwGsZ\nWwoGQeRmVA5Wn8AKw1JvSUJXnIeBznD4we+HRSQBRE3M9bEYDyH8xzuI3GGV\nOEKWMtxyDkmmayGJurcLad5f2W7Jwvjt/910Fq8iSCZtWGbj6N95oWOpudhJ\n4ivRtIBFUJL5H7XZYxSmkzllXTZRDOVNp54tFAsGRSDoKKZt3GnT6PXBlfiB\n92ZVvSH3AxpzKW+f4WqKXfWTe7aHnodtnRSzrkKkLC4C9iD3IBiJOKETjcQx\nu3n7kXz/bQrJcuq6YpZk2iuMHfiDcA6P3eNIKd9WrG3Y1b/JXWIwg8gpVnMd\nH/HKRPw0ceARdtLz6HrxV0RJF3kMakVLgdbNYDNlfRrWBC8Ru44W6evDibdp\ntiTsldeVXCUYJvmXWedB7A1t/pUavXfNEHYhKBfOmlTx+r5T1GS1m0eNyxX+\nZqCOgkdDXpf5MV84nSQJwavKK4sJwOE/U07gzydHMPFgKjNZoWKnJR8/Do8y\ngQ1Jj5SBW7GqiRZypRzljGxsa0Ev7DxOlo25xoLbCSGATp8dE6ySqpziDyw8\nAphGpdXvttE+z4alQQ7lGXaKm9OTItMBhIJdFlz56yfmcnIn8bLKGOZO6oyr\nM73/\r\n=0AQC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF7TPaN6k48DYYHMBmC3XcN2jf/zSUmNdNPrrPeun+L3AiBSKQ9dXGFrNDV04N+k9EzWCqCgjmEiT/smkKa3RA16Zw=="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.1.2_1561847589446_0.6897385763065955"},"_hasShrinkwrap":false},"0.1.3":{"name":"@slonik/typegen","version":"0.1.3","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 17"},"bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"homepage":"https://github.com/mmkal/slonik-tools#readme","_id":"@slonik/typegen@0.1.3","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-uobEJy2d25RWpzo8ulaIDNZxqJcfUjx5VSzWyLwasvftncI6Zro3QPXBtaytExnIMl4JwxC55LD48lmJTBGNKg==","shasum":"56b0560a072720778701c962d8e970386582de46","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.1.3.tgz","fileCount":7,"unpackedSize":28882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdGUNiCRA9TVsSAnZWagAAB+UP/iMf4DmZwES+g/3J2qEI\n10J9OKUvoev8jnxFy95GK//lWeaxO65Nf3ILfAfOnB1UWhg9/WCdKwfYD0Bq\nKmiVaO9T41Oup3VNE3ac7qEfGd1VjQteWzO4sEcDRTUqvSTWIooAxAa9CoDW\nWcht1rpPD9eQ2w/C2ZeMHya5c0k0+WsawMWmWXtfSDWE6pTkKDF8m49QMGxt\n2GX2CXnbl2m0TrBdV4LvSLyMLGE8SAgS+F7LHEVHLyAhtVM/SA5qI8QzemV8\nbOcAQ5pitvKGk/W+icJs0JuiU8n2AVcu0S6AYKoE8Ij5MrSLPqOMYYgOYFZN\npvcz4FQx/DIm81gw4/E/T2pjToNrPl1R0OcJw0lQn2rzQTLY/OCw0dedcPbp\nnLtfVQdGpVY7aRdRSQnTjKAOEItlP+Xw+JMZNNyeUkVtWU8F9DaodFZYEe0v\nw3IYqPPtsadK631+t6MRZOVNh0tZ0QshrI78860Qr6FbCCE/UcCADg3nmeWr\nvjPu0nlBgtIbk8bCxFK9levZmbRB6oIyJWowTuBC07Uj86pmj6cc3tgYiQa2\nVXgID1ESbs9l3/U85Yyqkzh6yLck2E91UA3sOlizdJtch5uESZYrFpVPTlRI\n8WRfdiA1U81nknyH6lAao999mbuN6AH2AbUJKiox052pai4YwzvaZ5NmJLFP\nM/eU\r\n=ApHc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrE/eNwgF6w4HN4J70HNBvhdR/pgTB1iVwJ2YDW06WkwIhAMpemAVA42b94fqUUxUGq70xEevjT9YZEjKDAaJwclKW"}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.1.3_1561936737200_0.40126851580537015"},"_hasShrinkwrap":false},"0.1.4":{"name":"@slonik/typegen","version":"0.1.4","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 17"},"gitHead":"4229fab373578ff10284e426e19025053916b3fe","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"homepage":"https://github.com/mmkal/slonik-tools#readme","_id":"@slonik/typegen@0.1.4","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.15.0/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-ZtbKjg7OmZOUypG1GuUWPNldOxfTbduDktBhywXt2EEStZufA8TO/aPFE7Bq6Kh40YkAgmOvQvF1DbUHCu3+cA==","shasum":"143822b99bcc69a38842df5b35e75fd5ed3ca3dd","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.1.4.tgz","fileCount":9,"unpackedSize":30256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdMkqnCRA9TVsSAnZWagAASygP+gOZ33tpXhbP9ZMtirM2\n5z1/YX6Cr9U7ePB6ehsG4eZ4knw1D9oMfGHVpsNOYjx1Bm+9XOIO6qfBhi7+\nBO/ppxbFajf6PnD5RoNp8A9eUYsJkko+ATaYNhw7MmgM1acRwKpq4Bu7/Kft\niSVjLaAr19lLRpcnEiGpjAXvDSk+AMafC2EtaRwuHKG6fsIon26sPzHkProi\nYheBctDzCD9UxjvJbhbu6VG2qdVbra7Sd87dLXQ38e5F2JQxFu0BubMrn9ZK\nLpQNBAIAZLmAezpdk8Ao113MS+dAx5sPf21yoGtl5x5nLbw+iscX9FkFPIRP\nWRPxjv4FifW9uvRX0EmnQD2PCyjRPTSMOiG0T9Tx4kkGL+ZOwgXdNfMbJUuX\nmQQ4HHwat8LWDn9dH/iyHfveOsoSqrOgiTZz6+a5/JQSL1db1wAhgg46DCPY\nYExNoyTPyI0z5My2UHpTY4QSXhkcOrEvKuFRecNymkaYY5Mplh/PHtN02Ix/\ntjzufNTYeI6MQPeEG5oTGmweAJYllp+dQwD6TSpaC47HQ835OqYZwxqt/BHC\nLsaBLw9dyII3mlHM7Fo6zFqSeErnSjNjHfVuSbWZiAEQNesmZWrFd5XuAsHP\nL70S+c0WA68ojlM3DJA8rySrL98FsS2PbFHauqCTNAaBkhlVyRubmuXqshSD\ni9/y\r\n=iKka\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGJ+/vTVgugJPOyU6ZU3asyBTKMM0JDTqOav4/Kc7v5gAiBmemxDU1vXmBtVC1yZAr8yv1RcPrZMNCTRvw17SSk+wQ=="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.1.4_1563576998521_0.6127098101566972"},"_hasShrinkwrap":false},"0.1.5":{"name":"@slonik/typegen","version":"0.1.5","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 19"},"gitHead":"744e6e88e3f1c34e02c86b19bad2bfdf36206300","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"homepage":"https://github.com/mmkal/slonik-tools#readme","_id":"@slonik/typegen@0.1.5","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.1/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-c/pAXwVru7WKw1rNxtequ3wFQVBpynrnPvFRmeaSkiE6BAHG3/thQtmKMBgQBJXTgkyTkI+7xjtDTDQmlkWX0A==","shasum":"7f1a8da30504b417ee6c21f310cc1e7a0849a0b9","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.1.5.tgz","fileCount":9,"unpackedSize":30665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdM2rvCRA9TVsSAnZWagAA2sEP/2kVXJwQeAQHR5Ia6NPf\nBxEWS9upZ8RFWhMWAy5Tll5kBC+JNxD2WfNTOJb6E8aiIsGahxBNbn4AWUvh\nEyGLM1Rd1xXt+fubK4AJCTlMT6mtQzzBpQ3oSmygDWeGF2AmPHm5DqZv6zBw\nJPRjT7GVOH6RK3QZV55dWH8auo+d69b4+QfAtPZaAp9AWKV+fYL4Zol62vCF\n47BecBqV/jmaRMHfUvaUV6AYV9xF92HceyCL7SJVncUmDCbCt+0Bj3UWn/Hw\nGb7SVlfdkx5ko33uWlAXmftFP6LZxLEgSyi5D4KMKf8Q7MiqVdgHgswMV74q\nlo6DAFe/QMZdSH25VQPogtk8igDVNs8nWyRf808ZrGnwBRkOSze21OBes2uB\niZzA93bkap+6fDNzMwSi8jR0icg9Zi1IFDn+K2ecFHsFD8GAz6qRmfB8nA+J\nO8gvrI37uCIEH6JHIFsRaZmmOiyYJd7G5QuienDOCvKGN2dkmkb4JTaIOPVG\nf0Ym8VNZX/RF1v+f8mYaU/TlhSgMJCD7d8zCIVNbeSBJSgJFZsE7EGvfSZsG\nDaE9ApL5ZCgXXHTTqx7lkpZsxjhgHSMFclGF5zrJrZ7/GIxzLMeRvR2Hsnpk\nN3+0DfySmP6A2ZQkHBmbPvhPgRFQaKRQIVbZUEX8qNXAM9ifz1AY1yKHsIu/\nJpeV\r\n=AjJ3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiBj+FPS7OpxaPciP+AfuE+0oKxLR1Z5cargHwaTIcCAiEA/G/96i3jrdMOaf43WaSd1h2MtgGL6qpWjqSFynBR2SY="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.1.5_1563650798845_0.37426783049115064"},"_hasShrinkwrap":false},"0.1.6":{"name":"@slonik/typegen","version":"0.1.6","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 19"},"gitHead":"732f671b4d72c3ac2e678ddc60ae67564aceb339","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"homepage":"https://github.com/mmkal/slonik-tools#readme","_id":"@slonik/typegen@0.1.6","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.1/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-znQqayrFdpPYM6iWTSYUbFRcGG8ttgzh9u291GtmWY/4dMGe1VA2ob+OiMxS2E0HWPHPtgUSIgyXEyUVI/0MWw==","shasum":"0ea018e23484a91c6d2409647ac1eb1efd4def13","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.1.6.tgz","fileCount":9,"unpackedSize":30844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdM3AhCRA9TVsSAnZWagAA4H4P/3c5Jugpxpa8GZ6thxDY\ndep6uOen4KeqzH+5i3CMFIiXmjB+cWsQcp7jmLWzLMKLEPdDI8C2CYHMju/E\n5KzVnafXxywabkk3lVhw0L1Q0werpVBIjBgcmmTyrQjFHGLICgTyZ8jmJiSI\nTeXW+DBs7sjqOuT3tADrapZhui8uQ2yFSaag5vneIodxC9GiYetsTFecytTb\nViT4lVVKJqHjYv3TDaX4ezbjjESkkx4mluDy7J9OjMaRETJXRw0FYY6DFNr4\nBaiMOhGfhcxu1wuwi+b/LZuObBAFzLp9GytPTcQiRbvx9pBA5HsTeFW0lkq9\nnsQAKIKFBQ4S90m50Kc+jHeU+aVZsE7dEMZaNbALeW2plWMp/tFjzgCL6clF\nsz4zh5SwK4aXXH3q6p3yNd/DODyDkbpP9lveY/VDCrMJUonN5o2dRxyh4+Vy\nHIs16Tz1+w94CuvnlWst3a/g4NfTBMfpn5NZ2051UUp1Nw104M6h96BCZsTs\n15WpZUjTKpjOUbnXPDHAEnBE9X51TOfkgHymcPaHCi+wTsmLWYXRh1PFHV+h\n9oZGlqvIsRXflOAaaTJg2oLLxM8LC+VnTow98GKYVhAqn7mVi7SxPOrJODEL\n/FXH3sq+Q5Pz3pL/lCuwZaXknjl2CkigifZ+4OYd9LXVjfOgUgjEqvRtASI9\nrTrU\r\n=UhMR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeG746WNdREj8xrVQUuopQaHBB/saZ4A38QPEY+CmxIQIgcpln4XHn+p+20Q1LuHVxOKmX9QagTz/WdYLSN1ga0oM="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.1.6_1563652128401_0.376614015515389"},"_hasShrinkwrap":false},"0.1.7":{"name":"@slonik/typegen","version":"0.1.7","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 19"},"gitHead":"fc51e7f00f6c57ad62a8223cda1ded72d46e23a9","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"homepage":"https://github.com/mmkal/slonik-tools#readme","_id":"@slonik/typegen@0.1.7","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.1/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-XScXYNa2UOfVTxSZbvYzLCmAG4LFFogprSeup5xrNGMjBn43wjb3HP0Glw81JJyLY+5+GWv05uDO33/HjDhrSA==","shasum":"d89bddb5cc9dda571fae70b8de54cdb7b01bcb9d","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.1.7.tgz","fileCount":9,"unpackedSize":31023,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdM4KlCRA9TVsSAnZWagAAF18QAJ1CIAXws58VfJtK3K5D\nic3smrLZlREJ8cRjACXKdBx1m48FlNKHFhzV84lAAh6r7dlV1W+5b27QhUpu\nV5fFtvvEz8zsXjMTUWrqF6VyYEytbUIzZIS0HQ0DWQ99YO5HmUdAWL4Qdd4R\nWNoo9GIqyMO5C9CxTn4iSEs9/grnXLLON8JASSukalk7l6q/bWPjKe4ViXSL\ncPWtsQXw1OvIiMo1wc8aN6qfPBPfgoKoua1rC2srJq2k5HGwRSxNscfmGmQf\nMwoK26dKNQgrBm3jS+xdTa1egDoy9oyRpjgAf5R/0FW6/2eBgzlyFwyazGDy\n1htOuYEg9R9n/MUV7vwTpG4Mat3XpfXQ1Rr6kP5UlNKHgArqvzI7TlZ0msAW\nsxCMNJVlYoO9/yHgSOEYgFhEq1Am4bgDVeBq74rsuRRXq6qsjlo7cipfUnvX\ng1HcuAGyvfKhL1fxbBw4PgYD9XuSvU1cqTYrS+JYZO3sTaYcRTxZ5uHeT1+B\n9lleV6udRrxR8pvv3hnYpIhFyovFKkO8NQZpx9z8QQWFQUTAQUrUwRwF4ds2\nts7G7ycR6RlRfbhAwyJYWQ2XCR4M9IcR7vSzfhZEHywYrqLYM7K/pn2QTKVP\n8fuW342kFIh/VOSAvat4gOu9t3+hPRt6ZxpJFPQxiOeFiLxw2qOF6+2Un2Kq\nf94A\r\n=1g6g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDV/vjQmDN2qmn3J7lYMthJi7J8fznsUJyFdwnlM62A3AiEAmBY1lgvnqcTB1K00Ccd9ZWBfd6VNu1fkuGyNdim6zmI="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.1.7_1563656869006_0.10166409236419538"},"_hasShrinkwrap":false},"0.2.0":{"name":"@slonik/typegen","version":"0.2.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 19"},"gitHead":"507eb7398deb2007f37a93e5fdb18534ae67bd40","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"homepage":"https://github.com/mmkal/slonik-tools#readme","_id":"@slonik/typegen@0.2.0","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.1/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-CUbJGURQgMj7pC1NFPOel3skDxhL7+HrTIqZl2WcTykJGf4eKZjLKO5EjZX64liLl5KaOorSht8OmBYlYRKhRQ==","shasum":"f003908c58e317955ef56e50a355d73dc1ac0350","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.2.0.tgz","fileCount":9,"unpackedSize":31518,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNHl8CRA9TVsSAnZWagAADXMP/3YmMjpfHRLuszw/Yw36\n0EvRCMEv1HoUo5hVeYEiHKbvMK0NFEjd9wbdqhydI/1J2A4sg2vRTC72vKPH\nU0JY3//z5sRDz9kY7uq6GVj0xN8QiA/kD0HKkGZiO9b+bTVwG4/5ev8NZ+z3\negIPduatIc3fy2I+7O+fENJy/Eg5ybN+h4aJubg+ZL6oBIUp1p0mwtX3dm0m\nGvGDW6yur+dW8p1SZpk/ZeN5Z+XrowCunohhhVblUdW5D2bZ++ZXXNZCl/pl\nnoV5GHbj54vVlIUB7GV96wTtP2/Euu4pIzBOY295nShyNx2n4R9YNWHrY7QN\nnA/ddv+gVevpVBVIhEI2tIXDcdITCje7d962wsPufAG9wE6ZoAE8ixDTTKHg\ncZnhDX7Db/NcAWKhrZbmyRJDQZl2+9knnxYGtPiX8+u2rstrIMreuaZMtYCr\nffkE880QReN0KyXG1bGnXKyT3ZpIwYtokj6+IHLUicEPIpfTljuGsdzwZBq0\n1EJT8SevMTLgjJVirtvcW3Ul6T71Geiv9ZX68BVdXrUA8s57Q3abdqn8acp3\nuM6MA5JOom+r1A65PV7Drkkxq82yQ0n+z3higXUdqBs0EWAX/NfA28xrsBg5\nLT7esRepsMNN7wrnsPHoA6bJASfFwZuejCGdJvVupfq9XarskNBix9sZmp1I\nNGkB\r\n=G8WW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCerhWUpRDt+D1dabozdK8+FRR64KdI6h1K89YwOUsM+QIgfdN4LbIhHJOpMHdfjfHKkEoFMbkKxahXKbuFMRc31jY="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.2.0_1563720059862_0.46599217008873794"},"_hasShrinkwrap":false},"0.2.1":{"name":"@slonik/typegen","version":"0.2.1","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 16.0.0 < 19"},"gitHead":"54e6412b16037034437a4ba4f4f459c9029a7091","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.2.1","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.16.1/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-F4XJIoRVi19qz0hCQELfhlfRy5rfOQYUq8M1F2PqHIyk1aZLNEUQUHHy1jZy9q/jWSBOfT8bOqb045xiprpfYA==","shasum":"0568caa5ee6dda5eac9012b7e9dee46f32c0a79d","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.2.1.tgz","fileCount":9,"unpackedSize":31825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNJjFCRA9TVsSAnZWagAAPcgP/ilAN/qETiD4clVyfDQX\n1Cz4KDSesBNNMQOSVjd5kchuyqQ00FCUTb4Px1ceQSREB0KNJlptDBwWIFb/\ndVfb7inGwxcDuMVEyA6RPPKomvXz9vrpyjgyP0/XOruv0frDnXBaZk6pmFM5\npMGdS6Qz2kYc22cvCU2rM4AGu9+Q1xxRUFH2lqSt6+uhcK7UT0N7QxGbZeSN\n8mvZnk6aP0E3xKDFGM4eykNsak/YxRq60uxaBc+G92sZlSsCtEl0DyKuXELp\nNFwyBaOSezxcD1qBF+rS8RIB0YhzgDoHtPeGewyFi3Z++0oh0luYXgdsIsq5\nYkHUgQRB2Rr6NaW7Tnnm3S1qpgGIlXyBeggjCjQdiFjAWaktfb063YmDJtRq\n2QWzHN9OclIq8tOlNoD2fULqx7dHMQJndqNvluy/vs792FtzzBZZ7QLsi2iO\nLXHEJ30TZ1sXBlXCK9HiUBee5djYx+fmoaibDJyTKESZE5rocfooOCPOYYjX\nv7IXYp8Y0dhNyAxn3aI/4qjYB+piGJFJWZHbGZGuZZIrzI66ldWP4Dr+me/B\n72QQjjlnEOC7qgLgQTCYzkUe19FdSq5a+WQjx5Vgtnx22pLUwZGXtWQalD5G\nIx1xKHUSlGSXi/IcAVakz99iCwA7FO52QtGQeNOLdp2SujXPA6AuLSovelCS\niTjT\r\n=Du7E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4TrC6G9hK83qfHuulZaUGw0Skt6bGtZL9WfU2aWwu4QIgHwG9pFRgGmptW06GqXhd7oSsrE81re5Sw5a4q30sZ/g="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.2.1_1563728068404_0.9615424343887937"},"_hasShrinkwrap":false},"0.3.0":{"name":"@slonik/typegen","version":"0.3.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 21.0.0 < 22"},"gitHead":"4c75541d9ded954369ae8578a1c540c09f64fb7a","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.3.0","_nodeVersion":"12.12.0","_npmVersion":"lerna/3.16.4/node@v12.12.0+x64 (darwin)","dist":{"integrity":"sha512-S+cKKs54AlbH/2/8I5n7E/r1WR5IJL/nEgIrmmJVHjvxjXvpx6SGP9MTHWlmpwGEETFRbFzGHBwOdARoCl/IYg==","shasum":"4ddf71176c180682102646fd54cdb453c043c213","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.3.0.tgz","fileCount":9,"unpackedSize":32491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeAgksCRA9TVsSAnZWagAAjUEP/2kz+ttsjzdl9rKer+mg\nmNRlXE5KLNDsIV0hLKaoHZMWg3mxSR6np8OEICxGGXBRGJRa5nfU8qrGMXd+\nJX1S9NxXwkI7e4/ltLYMjUZLtzp1+hkR49f2V3UGUut89YMBoC46qBMTxyj4\nrgpGQmoU/ZbsnGcKregyq4C51XDR4hna7f7NqY99QrDPenGYGQrSa/ZnbgNl\nXY9aoftRXbbPhKslfFWOpx3qQkc+jKQE4WXk+9g3Feu0ymqOm6DRZTOXNGe1\nRwBuBBHCMJZj2L13P6aR66uFxVKsAMOjnRa9DcTCYStsj//zprxJZlcBu8mN\ngfBPH5fJBkm48tDaoN4UOI40fE0N+x8kLDBDhYIlHycPdd55TmY0VYungeCS\nfdLUp/PXzZLJHP5hQ2Q/NzLCszBJmwU3VGPSSMoKiLanx6VKDiZILewJEFJV\nG6XQafjjT5hx4XUcahJFC0H4s9IOhgfVOB1N4TrZ4+KO+ZbOx/wqJComGBqL\nN+M+cvTcNIqVb3oLhadOpnDAPpuap9puotC9IoM09bPwQEGGgjYjGduu6mLx\n1Tevj5+9esAt94Ym1GsmM8p33mPCHPSSeaFz/PmwuDk3fxf1sLWRzYZTcuXT\nbXuvPSFktAnhzJK9SWIaaTG4RSBG1DY9mEz6+TssURHXizFvAS5MdzkGeTTe\n4VAm\r\n=BeX/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHS7VJ+JSPxz0vL+JTozgoDZ8bvSgkGVYS7UyeynISCKAiEAlkm6EhTHvGOTiWCoR8or0+Mw5npYgGLaoeRdSzEeX14="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.3.0_1577191723316_0.3300832617033411"},"_hasShrinkwrap":false},"0.3.1":{"name":"@slonik/typegen","version":"0.3.1","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 21.0.0 < 22"},"gitHead":"896a5a7a6765fbf2dbbd370c43bf43f4ddec46f0","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.3.1","_nodeVersion":"12.12.0","_npmVersion":"lerna/3.20.2/node@v12.12.0+x64 (win32)","dist":{"integrity":"sha512-UNKT/fz9vg+aZEYG/Jha6QzSNUcFTXaSZ2rXTHZOX43JD+DOtyGLmLOTC/qKKILjaSTuy8C+76I3DO2RzGdX9g==","shasum":"db11affb443a0d3fd0984c8aee94c3463a5a6889","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.3.1.tgz","fileCount":9,"unpackedSize":33498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLSIGCRA9TVsSAnZWagAAvDQP/R4d5Y3w5pGF6sATiaKe\ng8YkjWjcBi3nWULPEr9zphV59GawjfVTx276c4dkDp5oNKhHi+5ff2U7eckN\nzz36wg7GnEofvj7JbFX3JfyQH/vwSds8CSzDjStcf/tUXWWjjRvFI1r5aXyS\nP28JOMpB0x4ncwfbOXX3TXPAVaOPKUfdYKI4flXZVGi5ZPc3ddDpw3wXEN0s\nRW1EK5/DH/GLiIaBz6TfMn+7Xgg9olT0G3vLGo45P9PSvpNh8OmH+vrwwsGb\noflHS5PhMX01ciRVXp4t9Lr49RKHeyMiOdfM0YJ+3PiqRTBOUCTJ8uZKjXXj\nK8eMulS1UqVpwwbEkvqv0HE8HH0Da/61B7HjsQOeqoP8KuJuq4KBUp1mIJAx\ngf6q/I40ROYp/wJAf5bjMZ/wrBDSJrQW+F8ZlFdBeUNiSX0HiZ/evG+A7GwX\n2oTW5nbaf2PycU1yyuMWciGwQ1QGI/p4uhV10clhjLBCi+4WdjZm2XJDew9t\ne9c5k7U2ClQTKHvTEqqCH2RqBSGk4QqLdIC9EWNuGci6vmPFPJ8xQMlRnJUs\nrKAJ/Q4+n6Z1FPS1ZuaLThlErJZlzEeck4+siXO4ob9oVReBQhzQICdwp6HU\n7cLozY6CqAcJLE/ArIFZDOBB5yWI7KZdWQvDqR7Sk6rirpqlSsLls5hgyXed\nQNoz\r\n=HS/2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFus4APRhH+D2py6xuFTmW9Ug5CtY5+SyBRu461xKo4VAiB4kfJlhKkAIei7J0CkInhl74+5Ey40jtYWdQ3rGjzaFw=="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.3.1_1580016133443_0.14778295727437984"},"_hasShrinkwrap":false},"0.4.0":{"name":"@slonik/typegen","version":"0.4.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 21.0.0 < 23"},"gitHead":"8f6f68c1325934d6f935e7bd8f39abee9cc40723","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.4.0","_nodeVersion":"12.12.0","_npmVersion":"lerna/3.20.2/node@v12.12.0+x64 (win32)","dist":{"integrity":"sha512-29CeJExMUQ9EvzQmB7ijjlG+A7bUHEhkdk3G2bgdqPLfpolvMGIFVLuMx6Rn+nGXzesY6WAI0zqd8HmblqfV+g==","shasum":"5ea146dd62456fd9f8bd42cea0664102633f4112","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.4.0.tgz","fileCount":9,"unpackedSize":34005,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeT54CRA9TVsSAnZWagAAxdcQAITOX9gzXF9KQvdqoVTZ\nrtEg/C4mKgl1oTeIIWrLS4kks4aISBIm3qnGfOZOG+ht8uoFNyoGKF4gZ3PQ\n5ED8crBZsxcPZioRViH5omNVeizNEzLihE1QvhO+nIl8baFHRspqHobXNZ1w\ngIBy8bT4F5yc/i/+kLLv3YYCQv6hJKJ3PnFnm4fa7T/XMBdrNrCeYTpVerGp\nP0fa5gBZFULadrskSGrIB2IescenjqJm9ASXD/V4XJXUYXw1cXShVcNYbMaJ\n5DEO6sdVGjBk41MCHq52ngQsmIsW/N1FmXrovG5GA7CbN0OaXQqY2r3RRSJl\nsivmjqlEaT1k7R9+RtrYaOSTY1uPrpUhYAtUvVEZuWuH+KOM5/FxbOxMu8Ty\n3jg/N11xEQCI6HRAOyuk4AeUh9PIHpR730n8xlHiX1L1qidofClNjdfG/+hm\nVoCysIdybNjMKhGQ95IdAsnzR2NuJEEPZQt9K5y1yZGvFIs98V9Eun+DSJpL\nF4y6LT6xRdxl58QFgmcCuABdS4nVD2ryiSEYxyni43M6jwsjTgxJRnRQWPdh\n5sIAnJM7FsW2RsvEUSDQ7bQ9WyLqVVDIGHqFX6BLvEwzORG98/1BdarLgYEY\n30NbmviedMWNkrTZp6xoSapq5/vbJLZmrv+CpLrLEaPQqTvaHUybUh7C7Bi8\nZ1PN\r\n=yHDU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFp6Drr9vU7lmwir6RNrFk3gUpx1pLPe9UTmHwP8A1NKAiEAlYJDnSvnse0ASoSyNtDnZQiWY3oKryiHzysOUtlRFq0="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.4.0_1585004151816_0.9609314881658724"},"_hasShrinkwrap":false},"0.5.0":{"name":"@slonik/typegen","version":"0.5.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 21.0.0 < 23"},"gitHead":"87ffb2246050bf4ffe527e9df8d307c04b851fac","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.5.0","_nodeVersion":"12.12.0","_npmVersion":"lerna/3.20.2/node@v12.12.0+x64 (win32)","dist":{"integrity":"sha512-d66m6CYsdwsPbcskvLtv5IOpqESiUJzz9mamjuR66SRFaRHWkLYocWhduwwkbqpwafgZrmFhyW/pW0KEJ+gLNg==","shasum":"5c721cc25ccfbf886ab9c4efe57a2d2f20cef108","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.5.0.tgz","fileCount":9,"unpackedSize":36292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeT+cCRA9TVsSAnZWagAAfYoP/jrbolJ1XxUqMwuISBHq\nob/F8iz6OarxIpbpueZ3FxW2U9JVbREWxUE+7MLEPLaqk37Ckh3MjZVRx7P5\n63YSAReGR5dajSvxlGmicz3U9/Hgc/m/tQ26GcMVph7tedW5tEgRZj1ijByA\nta+DWEoL1rRr9Hpmsq1cUny3l3w25p7b7Bc9ralfAZbD3k1YfTdLwfGBNOSI\nL2IP/WvYnLrWF/z3IjnxVf4JkAF/ms9pYU2KSXjqbmPWUHyTFw7Is/KFSObO\n5u+plIF5wfylZczsuKqirDHlIpa7qr1iJ+n5mr0xikbabYMQkrshEY8XrxuK\nwtjOPRC7uqXzpckhRHXGgU1lGcg6c4MuuoHjSmwmi+U7gtkt3kUoVlrxsreA\nmWGbvUqXDRz+5wgFyECGfmKstnCRxVfSgVL4gyChzR/WSHm3AaZQuUpgWl8H\nC1wvZuvw1yh29ljVexEDiZQ6u84u5fhwL8uDjo8yv21IJP7grSrbC2FuoqS7\nr86iGYAd2xH9l1Vqlaj9fEP7h755ynbWHlwHmXyuN8XrBOA6NCUq4iLbhInB\nAkuD+KfQ/vH+3MtuJJPZnYCUF6OYsicYROpTeX0O0T8JZkk2bCvWRIbf8YPW\nvQYG1fz4WEmuTgGMIpLtNqpSOfRC9OtgCKppjseZaG6iwZCz9PCfEf0+pZLP\nmX4t\r\n=o20P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAxidKrbXZCSnS+epKvkMcSp28YAshLUYg6dN9Abp+lwAiAL61EzMWLS1SzbGVnKwQZ7qUZuIdQIJlLFnfslp6RhmQ=="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.5.0_1585004444456_0.46228165378265706"},"_hasShrinkwrap":false},"0.3.2-transform-properties.4":{"name":"@slonik/typegen","version":"0.3.2-transform-properties.4","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 21.0.0 < 23"},"gitHead":"91282e04261bd27bf22c93ce80a2d6d46f18e23b","readme":"# @slonik/typegen\r\n\r\n[![Build Status](https://travis-ci.org/mmkal/slonik-tools.svg?branch=master)](https://travis-ci.org/mmkal/slonik-tools)\r\n[![Coverage Status](https://coveralls.io/repos/github/mmkal/slonik-tools/badge.svg?branch=master)](https://coveralls.io/github/mmkal/slonik-tools?branch=master)\r\n\r\nA library that uses [slonik](https://npmjs.com/package/slonik) to generate typescript interfaces based on your sql queries.\r\n\r\n## The idea\r\n\r\nThis library gives you type-safety of an ORM, and the flexibility of sql. Read [@gajus](https://github.com/gajus)'s excellent blog post on why it's a good idea to use sql rather than ORMs or query-builders: [Stop using Knex.js](https://medium.com/@gajus/bf410349856c)\r\n\r\nThe library will make sure that return values from all your SQL queries have strict, accurate TypeScript interfaces.\r\n\r\nIt provides gradual ramp to type safety, so you don't have to spend any time manually syncing interfaces. Before the types have been generated, results will be typed as a generic dictionary - meaning you can write your queries and business logic as quickly and easily as before, but the compiler will tell you if you got something wrong once you try it out.\r\n\r\nThis method gives you strong typing, like in an ORM, but avoids the [inner-platform effect](https://en.wikipedia.org/wiki/Inner-platform_effect) that tends to come with them. You can rename columns, do any kinds of join you want, and the types generated will be based on the _query_, not the _table_, so you won't be limited by ORM feature-sets.\r\n\r\nSimple select statements, joins, and updates/inserts using `returning` are all supported - any sql query that returns a tabular value will have an interface generated for the row type. The interface will be automatically applied to the appropriate query result.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @slonik/typegen\r\nnpx slonik-typegen src/generated/db # initialises a placeholder directory for generated types\r\n```\r\n\r\n## Usage\r\n\r\nSetup slonik in with type generation in typescript (e.g. in a `src/db.ts` file):\r\n\r\n```typescript\r\nimport {setupTypeGen} from '@slonik/typegen'\r\nimport {createPool} from 'slonik'\r\nimport {knownTypes} from './generated/db'\r\n\r\nexport const {sql, poolConfig} = setupTypeGen({\r\n  knownTypes,\r\n  writeTypes: process.env.NODE_ENV !== 'production' && process.cwd() + '/src/generated/db',\r\n})\r\n\r\nexport const slonik = createPool(process.env.POSTGRES_URI, poolConfig)\r\nexport const getPeople = () => slonik.query(sql.Person`select * from person limit 2`)\r\n```\r\n\r\nWhen you first write this code, `getPeople` will have return type `Promise<QueryResultType<any>>`.\r\nBut once you run `getPeople()` (say, by normal usage of your application, or in an integration test), `@slonik/typegen` will inspect the field types of the query result, and generate a typescript interface for it.\r\n\r\nAfterwards, without having to modify any code, `getPeople` will have return type `Promise<QueryResult<Person>>`, where `Person` is defined based on the query. In this case is the schema of the `person` table. This allows you to get started fast - just write a query, and you will be able to use the results.\r\n\r\nThe code generation is opt-in. If you don't provide a path for the generated code to be written, you'll get a normal slonik client with no code generation hooks. It is strongly recommended you don't generate code in production (the example above relies on a simple check of the `NODE_ENV` environment variable). When a falsy value is supplied to `writeTypes`, `sql.Person` becomes slonik's `sql` template function.\r\n\r\n## Configuration\r\n\r\n| property | description | default value |\r\n|--------|------------|-------------|\r\n| `writeTypes` | location to write generated typescript. if this is undefined (or falsy) no types will be written. | `false` |\r\n| `knownTypes` | object produced by the library's codegen. By referencing the export produced in the location set by `writeTypes`, types will gradually improve without adding any code per query. | `undefined` |\r\n| `knownTypes.defaultType` | by setting this, you can force any unknown/new queries to be given a particular type. For example, in development, you may want a new query to be typed as `any` while you're writing code. | `undefined` |\r\n| `typeMapper` | custom mapper from postgres type name to typescript type as a string, as well as a corresponding function mapping the runtime values - see examples using `Date` and a custom enum in [the tests](https://github.com/mmkal/slonik-tools/blob/master/packages/typegen/test/index.test.ts). | `undefined` |\r\n| `reset` | if true, generated code directory will be wiped and reinitialised on startup. | `false` |\r\n\r\n## Examples\r\n\r\n[The tests](https://github.com/mmkal/slonik-tools/blob/master/packages/typegen/test/index.test.ts) are a good starting point to see a few different configurations.\r\n\r\n## How it works\r\n\r\nThe function `setupTypeGen` returns a special `sql` proxy object, which allows accessing any string key. When you access a key, it's considered as a query identifier. You'll get a wrapped version of slonik's `sql` tagged template variable. When you use it with a tagged template, @slonik/typegen will remember your query and store the identifier against it. `setupTypeGen` also returns a slonik interceptor, defining a hook to be run after every query is executed. The hook looks up the query identifier from the query taht was run, and generates a typescript interface from the field metadata provided by postgres. The interface is written to disk, and added to the `KnownTypes` definition. The typescript compiler will then automatically gain type information corresponding to that query.\r\n\r\n## Recommendations\r\n\r\n1. You can re-use the same type name for many queries. But you should only do this if the types represented by any single name are the same, since the resultant type will be a union of all of the outputs (meaning `A | B` - i.e. only fields common to both will be accessible).\r\n1. Check in the types to source control. They're generated code, but it makes it much easier to track what was happened when a query was update, and see those changes over time.\r\n1. After running CI, it's worth making sure that there are no working copy changes. For git, you can use [check-clean](https://npmjs.com/package/check-clean):\r\n\r\n```sh\r\nyarn test:integration\r\nnpx check-clean\r\n```\r\n","readmeFilename":"readme.md","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.3.2-transform-properties.4","_nodeVersion":"12.12.0","_npmVersion":"lerna/3.20.2/node@v12.12.0+x64 (win32)","dist":{"integrity":"sha512-IQg5Tm1s7xBm4Z4gDD4j2Ah5OJkCd0doARz5fS4NyY6upaULgbBlpYVkqwu12U/mD9rHi90575NPN6NOoPHP0g==","shasum":"ea78325ea284a1c9c6350495bc3a918a238b608c","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.3.2-transform-properties.4.tgz","fileCount":9,"unpackedSize":36941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJef5S8CRA9TVsSAnZWagAACfkP/19AAksOBZWZzKAzQozE\nAvOUKbGpaW+Mi2NMwoWtK+Y2zubmsiWl7gOxDpiiXDL2AiNGNx0azznFAoHe\nSPLAeLIABYy9AqbrcnfmgcVqyE1pg01hQ1gRMRJQGQR7Ld+epb829buB7mpd\n5wjUAY3lhvDEBd/OTdRFwgoXevTpFO7Q6koonWi7/kyaG/ppeZ/f31ATr7ny\nBzAV4uaqtmXMfFjC3qafbWYiP8wr1rWbzrxBy2xfVYqdVhQvdUDBCS6lZv9h\nudzqr5CnjV5eNBtGBqN4pTE5qXODqfbgsz543Lly70dfVXg7tSIqtN5Bbc1j\nWxscf1j2TBS96iRJFbIhvenxA2Id3HldLXeGMutNYAoBXRoMt0A8nz38Drxs\nlp4u2faG6WRQsk1kMm2wKV+gUwqmt6c8FmCgmasRrnGBe3pQAbj7OIJvDqn7\n60IWLtNuihmodogqm1wCU6O04Ph9LIMFbYhFwdbq3s91i76Mn1qw2dDFNlnH\n9SrLpAoNPaJcOOOUKrBQPPwozJo3TjpeMuQJgyVkkpPl+U2E6cOaxaV7o3Zj\n9BBdhlq4F35i6QR6Iy/AchfVciqHxLL9HDxKgZLSI7ZcLKY1FSQgYmrX/+18\ndD5+Vse5v3ZNMMljK2swvrWbN9rHDn3OHB7/HXZwiO9T407KmP6wFpYCfse3\nj9/n\r\n=VGcY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFR/p1NKGZa3ndFlrU1A3qxEPaHs5Q9jLGUS5rkWgUx9AiEA9QjhfNr1K61dn5x7Vc3+PsfPDe/YeC5+lrUSxSzMx3I="}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.3.2-transform-properties.4_1585419452214_0.7258733582431904"},"_hasShrinkwrap":false},"0.6.0":{"name":"@slonik/typegen","version":"0.6.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 21.0.0 < 23"},"gitHead":"5e6bf21af98834a7f49c11ff920581ab95faa944","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.6.0","_nodeVersion":"12.12.0","_npmVersion":"lerna/3.20.2/node@v12.12.0+x64 (win32)","dist":{"integrity":"sha512-zJSpO0Ll2qu6IJfRxJG/YU0ws2Lo176vDPI+/th0NC/VPPcJsiJsrJeAyBVcBmo1LttX7gTayKNKuKEcO6Ab0g==","shasum":"48392fd2a399e5b6ea952b6ce8db9a82ffd8fd49","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.6.0.tgz","fileCount":9,"unpackedSize":39008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeipFVCRA9TVsSAnZWagAAoBYP/0Bpl0t4KdA9q6IEx7/h\nw/J54nGCvdcN4tdpM8CzYih3Q2pm1tVFnqhA7PBkmzM74sh3nuZcEUYfTQsa\nl3RLmq/vQxyR9zp49uGiMrXEyNFtNoswxQgMbfQy9uX8QUJpEwJLCRPASHe+\n1oUBB+V8a3OLP/lbDclnKcmnWBgeGYBssac9HWPUgQFmVYmiWfJpLkRM6WC4\nTWEqXt2GO/BF7+mTeppfAl6rZAKcqwVkDD5ivvU7nf4JK14wqCQkzzRtun9T\nScmt/bdq+50I2lAKgJaevtWr6fi2qGfJA4hPO4t0XsmIDL6ZqXr07mIQEU8G\nlP3I3NRu6Lk0AgKctCCs/82aJ1t/I8a9OZWMuetbn6jYG4tuAckUwm9k/OaT\nQ369I3rPgxAqEreshXeaT59jg98qz9kEAf8lWk2Fu/M/iGGMCV5a0K+hspKM\n5FOsjatZsnSUIjHd09+ZQCoVW2qLhPFcuCj7G9tGBkG6FJQoQJlNZRhbk869\nStRgmPBaadLdOsxn2nzdKp3iCdigm8l44OqQ7J0r10oehljAUfC+n1EPXcdA\n/hbspK4LA4TT5CI5avC068a6wzDwiHEZZsNBEMaGZjngeVZKCfuDgltdyia/\nrYb7iLZy2wBUhOBQ57XJ1+P+uw8Ib7WZbjRUJh/g9itF9Op0x0oJ7JJqLCib\naLxz\r\n=b5Bw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBlejWDkka+QovKLY9AY0oYLCaa+IROxue8ZU5m5IVJQIhAJ9Ht0ZFOyNNw4WvyGmd0HhOMF5dK35sXkLqOu4UEt6w"}]},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkal","email":"mmkal1@outlook.com"}],"_npmUser":{"name":"mmkal","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.6.0_1586139477067_0.08776573855153447"},"_hasShrinkwrap":false},"0.6.1":{"name":"@slonik/typegen","version":"0.6.1","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 21.0.0 < 23"},"gitHead":"19f801c2a31c41e16f4bef66eeab7ee6df4546bc","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.6.1","_nodeVersion":"12.18.0","_npmVersion":"lerna/3.22.1/node@v12.18.0+x64 (win32)","dist":{"integrity":"sha512-Bm4VtXKZPTy6o/Gl3PLH9OQ0AfQpSJOMzpHHAqnSiTgwnj8I1RpcwuPcbdpnXjgMpdaiivsYBFMOaq698VS/jg==","shasum":"c9c5d8811c72c0a6d0767e23e82b7feada8cc22e","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.6.1.tgz","fileCount":9,"unpackedSize":39105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhHvqCRA9TVsSAnZWagAA/C8P/Auco8o+DLk4zgi7VgCn\np3XB4e61cWVZVdM0Gfcm1J9XU+PjrY4+jHh02nb+eta9oPVa+HPB5zdQRQX8\nze1+4+jsNanGad41tgs+m//IKc6CsufqdTGtWBr3VzUriMXu0zQ+zJUQjYYd\nSRaLHhSTY+75zPsWJhndIsLPtHxHJ9GVb6FG/EedcZMOzTZo+cJa41jbiaKR\nsQPcqbr9DJT1xJ12LHQU29N5nLnzCTKfX/GNhKKGJ6zhGi1CSfiljUz+Tfww\npirwgk6rVMUvY5IMXNZRkNLw4Unhyou2ZtwKXZUZu9pEd6G6VvtOJNXYVSgT\nOwaxUKMen7wdW5XUN2JOMbK6eQj8BTMvy/QQ3NeKL3fqIux4HpzKFbp2y+Zu\n2kHoSFaH6Ll9nT1yiWXxZNXQjw53zwye2RRAxBy50Pi3rnzKMag9R7T/fJVQ\n0eiC5i4JQowZV28/hdQfWlRhhAuUhE1pg4DuNaFDOaUEviOdoom4R2SVj2xv\nlqSPn2celSefTsrDHSrCAWX0n/7jEyFUyU8wTZ4MQjKCR0qMx0ud/08gPwex\nEBhSn/3FEDnNgzblcy9IdR0rvhfALp7CSTs5szdoJy+H+EBIhSHFUan0LCYE\nwuBYeaU9gG1GEFPgOK/gqdHk1QC7rI8xzPQLS0j8lrUO6MHazXYqxoZlsKUU\n76Zx\r\n=vRwx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFBWG+AczdKDHva38z4sjyL3ES2hyi/6lACFn+bFYz6gIhANyJ64fsqzSt/uiWbokeoAQl8bGxYBIA67CRa8TBX1zJ"}]},"maintainers":[{"name":"mmkale","email":"mmkal1@outlook.com"},{"name":"gajus","email":"gajus@gajus.com"}],"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.6.1_1602517993741_0.5989415676191121"},"_hasShrinkwrap":false},"0.6.2":{"name":"@slonik/typegen","version":"0.6.2","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 21.0.0 < 23"},"gitHead":"b811f24c1c5cb1e31532cf9635adf4c92a1264fc","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.6.2","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-uWV1DqczXmwq2Ge6AD7zIXm7Kzoyl8+gMhrsmHnPxrSZ2I1joJGQjX6p+xMDET3f6cWJUl3+vcduZBZkBjerow==","shasum":"0164947e4e76b9e656ff6ab4c261bd733a77dc21","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.6.2.tgz","fileCount":9,"unpackedSize":38965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhH6cCRA9TVsSAnZWagAABLUP/1ajTOCZFd3Jzr/2ZiNP\naXszFSjm5uMQyy4ubzuU6QBNYArVBX6pJsDVj76wKPd3JmAIX/c93jv5W6Ag\nPSWFtyPm3UmWWPojzwXCDop+5cKLAJQYl/IYUQ+LiM8WZ5vMKtZUj4+Xau3q\nDibWOh0r/8FlqqxBx4YBjMYx2Zs07VXdshknlJ9eeJvab37W0vVy+bnkikmY\naF5CGxfZkxnPLhAx8+eIOhOJRtkcC7I7FAhUWP/sQ7nUnfeoErn8p21wX4NU\niZ4qLeiYkAbJtzdaYkXclpQEPwUz6GTVdMbwXTQwcRd0uU85OYwVFpcVb0f2\n5kGhTPPHjBKqD+m7zIo6PU6wEXGvWp+cks/mcxuY8kG4K2Jear6tyx0l3qHU\nTNUlbwuQFBQ3ZRpw0xSTeE9KJwBRMAXc0UWPwDtM8/J57jB+y0CV1Vqhapkv\naqHYUAucy6xpYz9Qjt27Aj1A4tCUkwdAWgmgbjA029/Mv3m6OhVH8RkrCpZp\n0IMi2VHpHGvkj/KdcfwIbVgWFum9DdEvZbfzadnbuns4O8m1b0b6GhVD9zGT\nstfisyipFRRvOBdk9JCyXjGi5pIw4ulMmvITEP9cFIUTOcgzVyA10ymuB9va\nNirEa9N/q/G3tzah4Ysk3SO8OqfxcPGLigSpnz3B4WvVQ8hcXZPOlyK868jB\nwUgF\r\n=b+bz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUP6bpMYsTRLitSHVul6gRKMtW028dXuModsb0cA70hgIhAKKSQDQNlbY0BJraASmaKtQ5Q+Hj6ruKKzd2Iw+RnW/1"}]},"maintainers":[{"name":"mmkale","email":"mmkal1@outlook.com"},{"name":"gajus","email":"gajus@gajus.com"}],"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.6.2_1602518684368_0.6192424113999866"},"_hasShrinkwrap":false},"0.7.0":{"name":"@slonik/typegen","version":"0.7.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 21.0.0 < 23"},"gitHead":"ee9ab33f8d885af4feb64d0ee3fed9feebb992df","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.7.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-Kw+29gkBSDQWDh1zJL28TyYqmr9PiwDDwPAs7y6xDijGwuSHumwOpsMTI4QGc9U9yBxM5qKGlaO5VSr+/0hImg==","shasum":"43668c4d7711677f6c8c6d69ad07fa34f1f04e39","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.7.0.tgz","fileCount":9,"unpackedSize":39206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhOmZCRA9TVsSAnZWagAAcQYP/A37unEkxQVsR9ElrS8H\neQmxdKPguAlU2lQBisyAMDIAT7zEY/f9cmnm6VnUoQxNSnOSM2hayKM6JMKu\nXXRgKUvkDJleKfsLAHkss/5B90ws9TYGeQnhtXUjfnX9xYI/W5LMlPwcXpIZ\ntIJPXPTtfBC+OPeGr4M/7pGffhX1dIUaqZqo+BEAOyhNOEMnJ+swi80eDZkp\n8VOe2qJp7IWTNXWsokjo7ZMgBjjOTeruB5LGsw0pY8WfUghySIkJ1pjMQYEp\nF8cIa9sJUyZ/LZtvRJMxLgKpj8jZ19I9YyNyrlCLh0Bl8QwriZckg35uqxlQ\nQhLQqc3CqFgZ5919nW9anPpIvc1i0oW7gPDuyur9Kug9xwVzX6eunyYOEGyi\n/B/VnaiSTR5qFj3kJ48VKW0E7yX9lrgfjfBGv1WBU4Dkna7e0ofM9Qwrk0V3\n+I1CMBkIAdZjQc/3O4g5fr8czg74Won2nimr/cS8JYkuCF25G0cISrrZ8iQN\nfav915YU2eQ1KWAnHjJQKbYe9Xvacs8GXky5xvwxMmQSDzSv4oJW488WVtKA\nYmrecuwNAjnjBc0J80PfQfdG1MCrBAIpBquCQuXKo+GHx3XMVg8nUJe7AUlU\na7esKmnJv5ai7Rw9hu9Xd/FbU8ajvoi5a1JMhLs2FrDhgvcl6ABY4Z8PPGLa\ndz0E\r\n=0qg1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEsgia/deZrcpAGDz1rGMTYGl3FfsfsP0D6S+aCnvRb0AiEAmMOXXwk0YUE40YKain0UDz+EJRFZy0GNjdSgJ29eBZ8="}]},"maintainers":[{"name":"mmkale","email":"mmkal1@outlook.com"},{"name":"gajus","email":"gajus@gajus.com"}],"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.7.0_1602546072897_0.06907462853047641"},"_hasShrinkwrap":false},"0.8.0":{"name":"@slonik/typegen","version":"0.8.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 21.0.0 < 24"},"gitHead":"4a6ff0caa0d1816942777db4b313f96484eb674a","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.8.0","_nodeVersion":"12.19.0","_npmVersion":"lerna/3.22.1/node@v12.19.0+x64 (linux)","dist":{"integrity":"sha512-InrhuXEJb8jVegCAqwUSKFmoUOafj0NdjRNmQ/GOsRIqwtKTa8AvVcZcyvnGlkLMvjXpDOX2uJIBDy9Uc88pIQ==","shasum":"d3e204a8fcde9d933b22f9c38d2c32db03588a42","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.8.0.tgz","fileCount":9,"unpackedSize":39555,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnErSCRA9TVsSAnZWagAA83gP/138uGEGSpDtGpxTDaWI\nnA+99JAvYCvD7B0uIUmMg9LA6cr+fda7clXHC26+ZnOi17d9487QudMxjSCY\nct9grMQa6b/Ze/2OmowM5WopZc1UW8QtMFcpL941FWFix1XrWoEqVZyZKw0k\nazI+gnLfK5GrfHpbJztYJO5Us6efuhGxnfbSbxDfK24Ex5YG5J44ZryFssrD\nVMlGCZDpVVRLPlW76LtK4Y0h5Rab1qEiFCR7JI/5MB+WAp8WAqfEA4rGRkAP\nDAoaMcg6K6mZb0VcZatG0pdX31aRxbj+SxnqWz9reBEskZyqmKEB70RsPFUK\n+q2xE1fGa2Gh2pa+LLM+MHgIWEYhMvbiao3Qir+/nE4nR6JD13+VjLPuSGjz\n0K7QjJZ1BNunmmT/xgkEV5r1kTUeJI09d/sKVL0efbiPUFw8nmV1h+d/uyDv\nwNiqNie8Vz29Is6gfvsDiOf9PZEUGhL4DBoh3uHB3TxYIOg0ywQiiPItbk+D\n1Oi7sQ83QQnJnBYlPQpFA8FWODEWwNw5ZOSeVeftKRuBL9/MHN/aTPrGm2U3\nq3Epm8m79XYIsN9yThVNzBzLq7irsauh/MsGEGdzGawtqaJ9R98aluDJtlmI\ncG+eEUCvJ3LqlGl+JVGjaMZt2++e2iD4V1wsZ8nmP35VG/nK3Ob4l5qxiIqQ\nS5+A\r\n=LoNO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEk04yIT/lDtYTOpbEIpXQ7RLTgO2KsN8Cgyk9xB+AsiAiAbPIWqOZaFml3mxr356O5vugTA+/k7/mPDbBYdiompmQ=="}]},"maintainers":[{"name":"mmkale","email":"mmkal1@outlook.com"},{"name":"gajus","email":"gajus@gajus.com"}],"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.8.0_1604078289590_0.7711154758511152"},"_hasShrinkwrap":false},"0.9.0-next.1":{"name":"@slonik/typegen","version":"0.9.0-next.1","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">=23.4.0","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","execa":"^5.0.0","find-up":"^5.0.0","io-ts-extra":"^0.11.4","pgsql-ast-parser":"^3.1.0","pluralize":"^8.0.0"},"devDependencies":{"@types/pluralize":"^0.0.29","fs-syncer":"^0.3.4-next.2"},"readme":"# @slonik/typegen\r\n\r\n[![Node CI](https://github.com/mmkal/slonik-tools/workflows/CI/badge.svg)](https://github.com/mmkal/slonik-tools/actions?query=workflow%3ACI)\r\n[![codecov](https://codecov.io/gh/mmkal/slonik-tools/branch/master/graph/badge.svg)](https://codecov.io/gh/mmkal/slonik-tools)\r\n\r\nA library that uses [slonik](https://npmjs.com/package/slonik) to generate typescript interfaces based on your sql queries.\r\n\r\n## The idea\r\n\r\nThis library gives you the type-safety of an ORM (in some cases, even more), while maintaining the flexibility of sql. Read [@gajus](https://github.com/gajus)'s excellent blog post on why it's a good idea to use sql rather than ORMs or query-builders: [Stop using Knex.js](https://medium.com/@gajus/bf410349856c).\r\n\r\nThe library will make sure that return values from all your SQL queries have strict, accurate TypeScript interfaces.\r\n\r\nIt works by scanning your source code, so you don't have to spend any time manually syncing interfaces. Write queries using the `sql` tag as normal, then run the CLI to apply strong types to them automatically. The compiler will then tell you if you got something wrong.\r\n\r\nThis method avoids the [inner-platform effect](https://en.wikipedia.org/wiki/Inner-platform_effect) that tends to come with ORMs. You can rename columns, call functions, use sub-select statements, do any kinds of join you want, and the types generated will be based on the _query_, not the _table_, so you won't be limited by ORM feature-sets.\r\n\r\nSelect statements, joins, and updates/inserts using `returning` are all supported - any sql query that returns a tabular value will have an interface generated for the row type. The interface will be automatically applied to the appropriate query result.\r\n\r\n## Contents\r\n\r\n<!-- codegen:start {preset: markdownTOC, sort: package.name, minDepth: 2} -->\r\n- [The idea](#the-idea)\r\n- [Contents](#contents)\r\n- [Installation](#installation)\r\n- [Usage](#usage)\r\n- [Configuration](#configuration)\r\n   - [Example config](#example-config)\r\n   - [CLI options](#cli-options)\r\n   - [writeTypes](#writetypes)\r\n      - [Controlling write destination](#controlling-write-destination)\r\n      - [Modifying types](#modifying-types)\r\n      - [Modifying source files](#modifying-source-files)\r\n- [Examples](#examples)\r\n- [Migration from v0.8.0](#migration-from-v080)\r\n- [SQL files](#sql-files)\r\n- [Limitations](#limitations)\r\n- [How it works](#how-it-works)\r\n- [Recommendations](#recommendations)\r\n<!-- codegen:end -->\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @slonik/typegen --save-dev\r\n```\r\n\r\n## Usage\r\n\r\n```bash\r\nnpx slonik-typegen generate\r\n```\r\n\r\nThe above command will generate types using sensible default values. It will look for code in a `src` directory, and create interfaces for all `sql`-tagged queries it finds - e.g.\r\n\r\n<!-- codegen:start {preset: custom, source: ./docgen.js, export: basicExample} -->\r\nFor a table defined with:\r\n\r\n```sql\r\ncreate table test_table(foo int not null, bar text);\r\n\r\ncomment on column test_table.bar is 'Look, ma! A comment from postgres!'\r\n```\r\n\r\nSource code before:\r\n\r\n```ts\r\nimport {sql, createPool} from 'slonik'\r\n\r\nexport default async () => {\r\n  const pool = createPool('...connection string...')\r\n\r\n  const results = await pool.query(sql`select foo, bar from test_table`)\r\n\r\n  results.rows.forEach(r => {\r\n    console.log(r.foo)\r\n    console.log(r.bar)\r\n  })\r\n}\r\n```\r\n\r\nSource code after:\r\n\r\n```ts\r\nimport {sql, createPool} from 'slonik'\r\n\r\nexport default async () => {\r\n  const pool = createPool('...connection string...')\r\n\r\n  const results = await pool.query(sql<queries.TestTable>`select foo, bar from test_table`)\r\n\r\n  results.rows.forEach(r => {\r\n    console.log(r.foo) // foo has type 'number'\r\n    console.log(r.bar) // bar has type 'string | null'\r\n  })\r\n}\r\n\r\nexport module queries {\r\n  /** - query: `select foo, bar from test_table` */\r\n  export interface TestTable {\r\n    /** column: `example_test.test_table.foo`, not null: `true`, regtype: `integer` */\r\n    foo: number\r\n\r\n    /**\r\n     * Look, ma! A comment from postgres!\r\n     *\r\n     * column: `example_test.test_table.bar`, regtype: `text`\r\n     */\r\n    bar: string | null\r\n  }\r\n}\r\n```\r\n<!-- codegen:end -->\r\n\r\n## Configuration\r\n\r\nThe CLI can run with zero config, but there will usually be customisations needed depending on your project's setup. By default, the CLI will look for `typegen.config.js` file in the working directory. The config file can contain the following options (all are optional):\r\n\r\n- `rootDir` - Source root that the tool will search for files in. Defaults to `src`. Can be overridden with the `--root-dir` CLI argument.\r\n- `glob` - Glob pattern of files to search for. Defaults to searching for `.ts` and `.sql` files, ignore `node_modules`. Can be overridden with the `--glob` CLI argument.\r\n- `pool` - Slonik database pool instance. Will be used to issue queries to the database as the tool is running, and will have its type parsers inspected to ensure the generated types are correct. It's important to pass in a pool instance that's configured the same way as the one used in your application.\r\n- `psqlCommand` - the CLI command for running the official postgres `psql` CLI client. Defaults to `psql -h localhost -U postgres postgres`. You can test it's working with `echo 'select 123 as abc' | psql -h localhost -U postgres postgres -f -`. Note that right now this can't contain single quotes. This should also be configured to talk to the same database as the `pool` variable (and it should be a development database - don't run this tool in production!)\r\n- `logger` - Logger object with `debug`, `info`, `warn` and `error` methods. Defaults to `console`.\r\n- `writeTypes` (advanced/experimental) - Control how files are written to disk. See the [writeTypes](#writetypes) section.\r\n\r\n### Example config\r\n\r\nHere's a valid example config file.\r\n\r\n```js\r\nconst yourAppDB = require('./lib/db')\r\n\r\n/** @type {import('@slonik/typegen').Options} */\r\nmodule.exports = {\r\n  rootDir: 'source', // maybe you don't like using `src`\r\n  glob: ['{queries/**.ts,sql/**.sql}', {ignore: 'legacy-queries/**.sql'}],\r\n  pool: yourAppDB.getPool(),\r\n}\r\n```\r\n\r\nNote that the `/** @type {import('@slonik/typegen').Options} */` comment is optional, but will ensure your IDE gives you type hints.\r\n\r\n### CLI options\r\n\r\nSome of the options above can be overriden by the CLI:\r\n\r\n<!-- codegen:start {preset: custom, source: ./docgen.js, export: cliHelpText} -->\r\n```\r\nusage: slonik-typegen generate [-h] [--config PATH] [--root-dir PATH]\r\n                               [--connection-uri URI] [--psql COMMAND]\r\n                               [--default-type TYPESCRIPT] [--glob PATTERN]\r\n                               [--migrate {<=0.8.0}] [--skip-check-clean]\r\n                               \r\n\r\nGenerates a directory containing with a 'sql' tag wrapper based on found \r\nqueries found in source files. By default, searches 'src' for source files.\r\n\r\nOptional arguments:\r\n\r\n  -h, --help            Show this help message and exit.\r\n\r\n  --config PATH         Path to a module containing parameters to be passed \r\n                        to 'generate'. If specified, it will be required and \r\n                        the export will be used as parameters. If not \r\n                        specified, defaults will be used. Note: other CLI \r\n                        arguments will override values set in this module\r\n\r\n  --root-dir PATH       Path to the source directory containing SQL queries. \r\n                        Defaults to \"src\" if no value is provided\r\n\r\n  --connection-uri URI  URI for connecting to postgres. Defaults to \r\n                        URI for connecting to postgres. Defaults to \r\n\r\n  --psql COMMAND        psql command used to query postgres via CLI client. e.\r\n                        g. 'psql -h localhost -U postgres postgres' if \r\n                        running postgres locally, or 'docker-compose exec -T \r\n                        postgres psql -h localhost -U postgres postgres' if \r\n                        running with docker-compose. You can test this by \r\n                        running \"<<your_psql_command>> -c 'select 1 as a, 2 \r\n                        as b'\". Note that this command will be executed \r\n                        dynamically, so avoid using any escape characters in \r\n                        here.\r\n\r\n  --default-type TYPESCRIPT\r\n                        TypeScript fallback type for when no type is found. \r\n                        Most simple types (text, int etc.) are mapped to \r\n                        their TypeScript equivalent automatically. This \r\n                        should usually be 'unknown', or 'any' if you like to \r\n                        live dangerously.\r\n\r\n  --glob PATTERN        Glob pattern of source files to search for SQL \r\n                        queries in. By default searches for all ts, js, sql, \r\n                        cjs and mjs files under 'rootDir'\r\n\r\n  --migrate {<=0.8.0}   Before generating types, attempt to migrate a \r\n                        codebase which has used a prior version of this tool\r\n\r\n  --skip-check-clean    If enabled, the tool will not check the git status to \r\n                        ensure changes are checked in.\r\n```\r\n<!-- codegen:end -->\r\n\r\nThere are some more configuration options [documented in code](./src/types.ts) but these should be considered experimental, and might change without warning. You can try them out as documented below, but please start a [discussion](https://github.com/mmkal/slonik-tools/discussions) on this library's project page with some info about your use case so the API can be stabilised in a sensible way.\r\n\r\n### writeTypes\r\n\r\nThe `writeTypes` option allows you to tweak what's written to disk. Note that the usage style isn't finalised and might change slightly in future. If you use it, please create a discussion about it in https://github.com/mmkal/slonik-tools/discussions.\r\n\r\n#### Controlling write destination\r\n\r\nBy default, interfaces for SQL queries are added to a module at the end of the typescript file they're found in. You can tell the CLI to write the interfaces to a separate file instead using `writeTypes`:\r\n\r\n```js\r\nconst path = require('path')\r\nconst typegen = require('@slonik/typegen')\r\n\r\n/** @type {import('@slonik/typegen').Options} */\r\nmodule.exports = {\r\n  writeTypes: typegen.defaultWriteTypes({\r\n    getTSModuleFromSource: filepath => path.join(path.dirname(filepath), '__sql__', path.basename(filepath)),\r\n  }),\r\n}\r\n```\r\n\r\nThe itnerfaces will be written to a separate file under a `__sql__` folder next to the source, and will be imported via `import * as queries from './__sql__/file-name'`.\r\n\r\n#### Modifying types\r\n\r\nYou can modify the types generated before they are written to disk by defining a custom `writeTypes` implementation.\r\n\r\nFor example, you can create [branded types](https://michalzalecki.com/nominal-typing-in-typescript):\r\n\r\n```js\r\nconst typegen = require('@slonik/typegen')\r\n\r\n/** @type {import('@slonik/typegen').Options} */\r\nmodule.exports = {\r\n  writeTypes: queries => {\r\n    queries.forEach(query => {\r\n      query.fields.forEach(field => {\r\n        // add a `_brand` to all string id fields:\r\n        if (field.typescript === 'string' && field.column && field.column.name === '.id') {\r\n          field.typescript = `(${field.typescript} & { _brand: ${JSON.stringify(field.column)} })`\r\n        }\r\n      })\r\n    })\r\n\r\n    return typegen.defaultWriteTypes()(queries)\r\n  }\r\n}\r\n```\r\n\r\nOr you could mark all fields as non-null (but probably shouldn't!):\r\n\r\n```js\r\nconst typegen = require('@slonik/typegen')\r\n\r\n/** @type {import('@slonik/typegen').Options} */\r\nmodule.exports = {\r\n  writeTypes: queries => {\r\n    queries.forEach(query => {\r\n      query.fields.forEach(field => {\r\n        field.notNull = true\r\n      })\r\n    })\r\n\r\n    return typegen.defaultWriteTypes()(queries)\r\n  }\r\n}\r\n```\r\n\r\nOr you could use a custom type for json fields:\r\n\r\n```js\r\nconst typegen = require('@slonik/typegen')\r\n\r\n/** @type {import('@slonik/typegen').Options} */\r\nmodule.exports = {\r\n  writeTypes: queries => {\r\n    queries.forEach(query => {\r\n      query.fields.forEach(field => {\r\n        if (field.regtype === 'json' || field.regtype === 'jsonb') {\r\n          field.typescript = `import('@your-project/custom-types').YourCustomType`\r\n          // For more customisation, you could look up which type to use based on `field.column`.\r\n        }\r\n      })\r\n    })\r\n\r\n    return typegen.defaultWriteTypes()(queries)\r\n  }\r\n}\r\n```\r\n\r\n#### Modifying source files\r\n\r\nYou can also use `writeTypes` to define a hook that runs before writing to disk:\r\n\r\n```js\r\nconst typegen = require('@slonik/typegen')\r\n\r\n/** @type {import('@slonik/typegen').Options} */\r\nmodule.exports = {\r\n  writeTypes: typegen.defaultWriteTypes({\r\n    writeFile: async (filepath, content) => {\r\n      content = content.replace(/queries/g, 'querieeeez')\r\n      await typegen.write.writeFile(filepath, content)\r\n    },\r\n  })\r\n}\r\n```\r\n\r\nOr you could override the default formatter (which uses prettier, if found):\r\n\r\n```js\r\nconst typegen = require('@slonik/typegen')\r\nconst yourCustomLinter = require('@your-project/custom-linter')\r\nconst fs = require('fs')\r\nconst path = require('path')\r\n\r\n/** @type {import('@slonik/typegen').Options} */\r\nmodule.exports = {\r\n  writeTypes: typegen.defaultWriteTypes({\r\n    writeFile: async (filepath, content) => {\r\n      content = await yourCustomLinter.fix(filepath, content)\r\n      await fs.promises.mkdir(path.dirname(filepath), {recursive: true}) // since you're not using the built-in `writeFile` you should explicitly call mkdir with {recursive: true}\r\n      await fs.promises.writeFile(filepath, content)\r\n    },\r\n  })\r\n}\r\n```\r\n\r\n## Examples\r\n\r\n[The tests](./test) and [corresponding fixtures](./test/fixtures) are a good starting point to see what the code-generator will do.\r\n\r\n## Migration from v0.8.0\r\n\r\nVersion 0.8.0 and below of this library used a different style of code-generation. It had several drawbacks - it was a runtime dependency, and required queries to be actually run before types could be inferred. It also created a global repository of types, meaning two queries in separate locations which shared a name could clash with each other. It also required changing the way your code was written.\r\n\r\nConceptually, this library now does more work so you don't have to worry about it so much. Just write slonik code/queries as normal, and then run the CLI to add types to them. If you add a new column to any query, run it again to update the interfaces.\r\n\r\nIf you previously used the old version of the tool, you can run it once with the  `--migrate v0.8.0` CLI argument to automatically attempt to codemod your project. Note that this will, by default, check that your git status is clean before running since it modifies code in place. The codemod isn't advanced enough to find all usages of the old API, so have a look through what it does after running it to make sure the changes look OK. If they aren't, reset the git changes and either apply them manually and/or pass in a different `glob` value to avoid files that were incorrectly modified.\r\n\r\n## SQL files\r\n\r\nThe tool will also search for `.sql` files, and generate some typescript helpers for running the queries contained in them. Any parameters (`$1`, `$2` etc.) will also be strongly typed, and become required inputs for running the query. See the [SQL file fixtures](./test/fixtures/sql.test.ts) for some examples.\r\n\r\n## Limitations\r\n\r\nSome dynamically-generated queries will not receive a type. One example is any query where the template express parameters are identifiers rather than values, e.g.\r\n\r\n```ts\r\nimport {sql} from 'slonik'\r\n\r\nconst tableName = Math.random() < 0.5 ? 'foo' : 'bar'\r\n\r\nexport default sql`select * from ${sql.identifier([tableName])}`\r\n```\r\n\r\nIn the above example, no type can be inferred because it's impossible to know whether the query will return values from table `foo` or `bar`.\r\n\r\n___\r\n\r\nQueries with multiple statements will also not receive a type:\r\n\r\n```ts\r\nimport {sql} from 'slonik'\r\n\r\nsql`\r\n  insert into foo(a, b) values (1, 2);\r\n  insert into foo(a, b) values (3, 4);\r\n`\r\n```\r\n\r\nThis kind of query does not return a value when executed anyway.\r\n\r\n___\r\n\r\nQueries using the `pg_temp` schema will usually not be typeable since the schema is ephemeral and only can be queried within a single session that `psql` doesn't have access to.\r\n\r\n```ts\r\nimport {sql} from 'slonik'\r\n\r\nsql`select * from pg_temp.my_temp_table`\r\n```\r\n\r\n___\r\n\r\nInvalid SQL syntax will also be left untouched (they will result in an error being logged when running the CLI):\r\n\r\n```ts\r\nimport {sql} from 'slonik'\r\n\r\nsql`this is not even valid SQL!`\r\n```\r\n\r\nIf you see errors being logged for SQL that you think is valid, feel free to [raise an issue](https://github.com/mmkal/slonik-tools/issues/new). In the meantime, you can create a variable `const _sql = sql` and use the `_sql` tag in the same way as `sql`. `_sql` will not be detected by the tool and can be used as normal.\r\n\r\n___\r\n\r\nCustom interceptors. Some interceptors, such as [slonik-interceptor-field-name-transformation](https://npmjs.com/package/slonik-interceptor-field-name-transformation) change the runtime shape of query results. You could try to match its behaviour with a custom `writeTypes` implementation, but I'd suggest just not using the interceptor in the first place. All it does is transform from snake-case to camel-case.\r\n\r\n___\r\n\r\nFinally, for some complex queries, static parsing might fail, making it not possible to determine statically if a column is nullable. If this happens, it will still receive a valid type, but the type will be `string | null` rather than `string`.\r\n\r\nIf you find such a case, please [raise an issue](https://github.com/mmkal/slonik-tools/issues/new) to see if it's possible to handle - under the hood this library uses [pgsql-ast-parser](https://npmjs.com/package/pgsql-ast-parser) and you might have found an edge case which that library doesn't handle yet.\r\n\r\n## How it works\r\n\r\nWhen you run `slonik-typegen generate`, the tool will scan your source files, and traverse their ASTs using the TypeScript compiler API. Note that typescript is a peer dependency for this reason.\r\n\r\nOn finding [a](https://oracle-base.com/blog/2015/01/02/a-sql-or-an-sql/#:~:text=According%20to%20the%20Oracle%20docs,%2Dlevel%20declarative%20computer%20language%E2%80%A6%E2%80%9D) sql query, it will issue a `psql` command using the [flag `\\gdesc`](https://www.postgresql.org/docs/11/app-psql.html), which responds with a table of the columns and their corresponding types contained in the query. The query itself is never actually run.\r\n\r\nThe postgres type is then converted into typescript using an in-built mapping. Any slonik `typeParsers` configured (see [slonik docs](https://github.com/gajus/slonik/#api) for more info) are inspected to infer the type of the value that will be returned by the query.\r\n\r\nTo determine whether query columns are nullable, the query is parsed using [pgsql-ast-parser](https://npmjs.com/package/pgsql-ast-parser). Some more queries are sent to postgres to figure out whether query column can be null - in general, postgres is only able to guarantee if a query column is null if it comes directly from a table which declares that column non-null too.\r\n\r\n## Recommendations\r\n\r\n1. Check in the types to source control. They're generated code, but it makes it much easier to track what was happened when a query was update, and see those changes over time.\r\n1. After running CI, it's worth making sure that there are no working copy changes. For git, you can use [check-clean](https://npmjs.com/package/check-clean):\r\n\r\n```sh\r\nnpx slonik-typegen generate\r\nnpx check-clean\r\n```\r\n","readmeFilename":"readme.md","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.9.0-next.1","_nodeVersion":"12.18.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-XAgR/iH3ELZANYXmCiAdS8mwKBYCSQiCmbLihVZNz35e477yOlKqkNs1W59zSVKtHxRkmrYY6y/VNI6qfHLeTQ==","shasum":"a528782f79946515f610b30c254d1f2d92526870","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.9.0-next.1.tgz","fileCount":112,"unpackedSize":193765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+8UoCRA9TVsSAnZWagAAVMsP/RR3VdZ7oh+JoRWzuKqN\nZyft8UCYK53Sei4YPHBrHbMX6tSoo2G45igeDe0tOLxBQ0+pEVQCDv2XWJZ7\nyanuzYbG6gdXarsPwvxuMKIvSuEChc6NcQvRNasAdmK/2av0LarJjAgzawMa\nsg9Qz98Sn0lqdv5qRMTwV/ZNTqB9VHLihKP2z8gyvnvz5XfI3ZH9rjgKFwAe\nlDD/8c0LtS/dg5dKTOCCqwUDCjiVybfRNYkDkcHbTpAkxy2ECxbA84+d498O\n5FQcDcB0xf6jvcxzamc6XFQYunH4JSmkMKv7jjyzY8SyVAeaJsSj1hYHdduZ\nCL9G1bfS3RtsI8rMei3UlgOTbHGrdRm092tfmQuWmcD8H3Gx36CLzy4G0WXW\n0J6DPnOoLgur8ze3DDqZkjsQJ9IPlzBYH7m/hyole5LYWy6youpUiryMYUGN\n/8mjBKtqZ5YZylO9wi4i8/BF4KxDmCMc4hT5nHZ6kdO9y+52xvkwViTZg1lB\ni6uc2+nL27J5djbidgr/JB8FVDLxN8CMM6KkbWqbD6Iiq3tckjEGth6lOj9A\ndocy9mdCN4GYE3Fu25T26ANBcUHXKb8pojcSrx0IsgjBcMbkp31o8W2P6ivc\nU9S1A+pII+YvucUvUi7P0/+OAZILSx4I1k3h1D474Q+gLmIGHddgc3s0ycx6\ntlNb\r\n=GwMG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1ZrtAq9DhmZdLWuGDKMUGIzn6DovgHsKzPHaTTmp7CwIhAM120xsMxUxhtSz0Wd7MgXbGSCc1wn6xMe/j1yHn+jEv"}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.9.0-next.1_1610335527837_0.37070007529441584"},"_hasShrinkwrap":false},"0.8.1":{"name":"@slonik/typegen","version":"0.8.1","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 23.0.0 < 24"},"gitHead":"71cb2c77d14f2f5559b6035dccdf5a153460d097","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.8.1","_nodeVersion":"12.22.1","_npmVersion":"lerna/3.22.1/node@v12.22.1+x64 (linux)","dist":{"integrity":"sha512-rLbTxoGCSl8zq+fE5w66UwJwKHNq5kM0KQfyGgnY96ePP0LHHaMRYD/YVP8jVojXm6eXylZKLDaQP19FdSnGeA==","shasum":"5416fc3fc4e099d68c1b650d104361d2367e52f2","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.8.1.tgz","fileCount":9,"unpackedSize":39265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1cYICRA9TVsSAnZWagAAN1QP/2NWJub7COBVa7RMqp0X\n1YFopJVhTKcvJxM+EBZ3ikjPKgCCvhrap9DwjbpewSJnO9mDOA+WwGN359pb\nsQEJk3/CRO5bHkuA9il5yhssDiVGvGc8eCdaVkMPtdL8PtvkfWBY3TSmh2XP\n63RlAebRslxAEBykKj2kDKAHnWIWelz9cTax8lCSjOYIoUe72lOuXRJ/EywE\nGlmtzD1m1WrFXr/PW/lxs1wCrZ+ipwfGhbWCfHfBWKsjGmFQ8coYCpykIVYz\nnE4pArXDXKwfyDxbgdfxriGddveGV5erzfiQ68f6xNADz9bFRcNApzQVexU5\nHw4vlJEY1G27yxYlTWUkEylrLY9WNBslRg+d+rjJ2p58tDvSteucnHd9I8yn\nSWmXWBDMTEkOlEsrn6wCPTdPVc4H7MlWGDB4Et0G/yrEtoGCHCVRrlowOKyz\nvMQRFU9GoDAaNwM8prFhfzSJQfpUhlmxM01wa14A5L6p0XzVZbri/Iwhe/CY\nnRi4H6fCCt48YwzZrTP+o+2uZdnA57mVcG5t58HhYYdEl6WE+PGGSz7GZ0mx\nFHz17LS8mYmCRTCl4WZCmQsuZDwSQ/xuVdU1nOo7w1bbo0DEiVRw91GNmRES\nExsv1dxtJQReV1yWNeBAuAQm5WjmY0aniFQyvGcZ19SbgadTQh4XcbVALYrX\nG+3m\r\n=vFLY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDA+oa+B9j5p2ddr7tK+DpOACOXOAQ6DMe0LU1ta94rlAIhAMJYvmeUE2g8VULC7aqKpr1YUzGGO6o4KQTi4giz7X4N"}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.8.1_1624622599839_0.423268308160057"},"_hasShrinkwrap":false},"0.9.0":{"name":"@slonik/typegen","version":"0.9.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">=23.4.0","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","execa":"^5.0.0","find-up":"^5.0.0","io-ts-extra":"^0.11.4","pgsql-ast-parser":"^3.1.0","pluralize":"^8.0.0"},"devDependencies":{"@types/pluralize":"^0.0.29","fs-syncer":"^0.3.4-next.2"},"gitHead":"646240e56ee6a3da78196894e3a03d61ab0d9c0b","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.9.0","_nodeVersion":"12.22.1","_npmVersion":"lerna/3.22.1/node@v12.22.1+x64 (linux)","dist":{"integrity":"sha512-kvDP07mXRLuSXlQqHeY5CHBdgBHhCFBWG/Yd9VSc1HNfPaqfkSxTK5mR6dRP+vXWVae0Y2Rt20LW2E/lRoyD5Q==","shasum":"91252d8bdaec259ffbe209a1146281af6fcb1abf","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.9.0.tgz","fileCount":105,"unpackedSize":210323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1e5NCRA9TVsSAnZWagAAwWYP/0fdXb8OhEzmgxj7tLYE\nSWR97VLLZuauzQa8Dz3LTeu67DVwkhZicCD9bGEhHTbqzCKKB3bV/lBhKcpi\nIYKNfcWlGIdULgtE3okh4cqlX2wnOi+QuGU9/eBk3UpyQInV0I7zRy5SejYV\nNJpvzQn82HCRfE7d0F0ICkOOcG7Tw5xxyByKMDCYxxXH3/Pu+HSZLtRdePy9\n0iIzNCRu7rxlbsi5Ja16nbXdRIGMZ0vj664ESrZ5lmKfpf7NzsjHX8DzaZLv\nADwyVgyMsYo8lJDFW1dgIUnNn9NBrPtCwzUhdrP0EzCmifs7y2SOOW5Caesl\nk0kPRcNo03rRJ/Inx/2ZtPkwhVEAs8E+LPx57gE3C6hdoy8jVlESG0rAoYP0\nlw/BywSVFmdoU4JVfyNXXbSHwxaAd89f8bNTKYe1gyRS2JISbi/fLEMqOOn0\nGLj8O1qU5K3zSVsjhoq8KOrMNSvo2UfEBJiBjpbhE5HcegX1h1fJvqlytUbC\n6lLT5l0L/WHX6VPPr5tKR8zigj3WReiBDD5Ik1+rkm5oy5q8jyLqh9qAmwHk\nbwd3/2czyHMC6YpjnkV2QxW8EPMdvi07Ayx5u7xA4M4pYuSYcjm3857IIV0I\nzgVb8eDLf83ME4liJkfgHaowEHwDep94kjsmZt8l7YykQ3HNa/4tREjm4q5g\nvjWi\r\n=wKW8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDliwcIk8DMq++u5MuLFMqbFICtMqOZmU6UCYY/VRy6AIgcqIjUJG09R9LQJ0q9iPKD6VKC/mxsN/4F5m1NKfQpSY="}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.9.0_1624632908949_0.911256260872471"},"_hasShrinkwrap":false},"0.9.1":{"name":"@slonik/typegen","version":"0.9.1","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">=23.4.0","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","execa":"^5.0.0","find-up":"^5.0.0","io-ts-extra":"^0.11.4","pgsql-ast-parser":"^3.1.0","pluralize":"^8.0.0"},"devDependencies":{"@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2"},"gitHead":"8d7c4a2110db0caed64ebe2d19d95d9918ded1c8","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.9.1","_nodeVersion":"12.22.1","_npmVersion":"lerna/3.22.1/node@v12.22.1+x64 (linux)","dist":{"integrity":"sha512-GIBDvjRLqb4tiXIoliOoznD3Iut3K77EVOSIcwKhEABI/FmOTHdU1opDnx/6BjOqshPfkPjigpDMMZn44LC8yg==","shasum":"2aa848faec052985e1956ead6784fc55f70fb55b","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.9.1.tgz","fileCount":105,"unpackedSize":210500,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1pl8CRA9TVsSAnZWagAAgaUP/2QnsRRSrJ38kGMzUz38\nBQvHi86V2rn+i9J4nENnUofvUdqXXdLYx4lADLU5QDUSO8fkm3cMZBq4Y8pP\ncZ76POe3F0cx5Ik2Ex3H4CB12jceF/DyhkcTcCO2AInXn72azQauaOLeztMb\nfojp+cj8D7EYR5Qw6e5GWsP1eYCPoapkfxL1X/rJkb9FB2IjLdKrOy3lAzJ3\nDrmhcT6Q7DhigAlSNUnONetAYPr6PkGsoZ+ox4SoYXuL2JIIS9F3bycy5hnz\nJ7TYln/lTa58Kb0n8cNtuDD79A5ayczhCRAXV1Jin0plsjlyF7hVvq6yv9Py\nUlEPB9c6DNyF9fF094dqXJ/BGk39g30r11qX80orwPeG2OX2B/0oM1IbKdNh\noCq0ntqGryvzuU3j+Xdahy1SVXwL2ITzxgh11CPS3zP64IyDuJs0iS+vRrYE\nXGPy97TfcNho9VMRqf3tH7WRhbTEINoHoQ4pppNwWve1rYx5fVV//Xy4dmpz\nf5M4ywrZn+pJ7SNTuZWhxAxAYeEURE2IzhZY93ExMIEr/mFj4FR6aMzBz8NN\n9i4KthjMfaj8i+UzvEvmO2eJfiJfKO6raC1JT19OmFin1lm7OgekLlI8KdcW\nyiOKaET4tu/GjzDfzriZsoCv+pxthBYki09YI/mwDYsDNvSm86Lt8zo9hAvE\nIrJ7\r\n=lfRa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA9gI04MwnkO04Z7gQWaX8D+26zPEnsBrky8Dx67/PjMAiAdruRcbn5/fCaMsaWBjoQ/bSf9M4SoBxE5RqCj/wm8jw=="}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.9.1_1624676732210_0.47031400852730365"},"_hasShrinkwrap":false},"0.9.2":{"name":"@slonik/typegen","version":"0.9.2","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">=23.4.0","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","pgsql-ast-parser":"^3.1.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.3","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2"},"gitHead":"b1a73e092cb751cbe53941360727e49bb5ec6537","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.9.2","_nodeVersion":"12.22.1","_npmVersion":"lerna/3.22.1/node@v12.22.1+x64 (linux)","dist":{"integrity":"sha512-Xh+vcIolW8uZ0w24XXeL6LpMrWlRUaKDnMvxkU8sIEzUGs2Dtb8CSMLGDhrV/5QQkxwB+GJhTEcWtSxweCOI/g==","shasum":"f04fb59fd2e083091badcf61cccea97d474ef63c","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.9.2.tgz","fileCount":105,"unpackedSize":210949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg15fVCRA9TVsSAnZWagAACkoQAIsTVoOq5FAZuvgHInG6\naPghFlME6/6azaFBAA7UsaLeYbHDOPah0d+prJerohQj4q0dbpm0QFKahJwd\n7gXmqFkIu8ye9/6YOqkrekH0FVB1vrKBkad9ykUr/MnVzYeNwSG160uzG+Ta\nOGFKAo/N8VNHp70txB8F0iyOzFMzzbO5pRBnlEJkqPveuRefjRiTN99pM6YL\nNAhSrv3RVtwVDBcbesuueDMl4vuc0/Z87z2BcQcv8JEGFNamyjNBjd3wM0a+\n6y5reJv81tYXE9TZuZxHVrJVQEsvHZ9tXOGpJC0F80VuEKs9q4Mv9Q5at0+O\n8dEgIaEVueI10TGMs1cycWiVHb/ms325kUbQTvMplbrAGqsPWl5eK6RKfAe7\nsaaBrzgr0YBcrRDKiowI4ANTt390HotRIiZN0zigau3ROrWEH94lUC+MRqKr\njUl6UCJQL2OcJ014qCy0c9YGdS9/GVzzpdQr1rNMQg0I0fN/jgW7r+zxwV//\nEo2rO5P/Y7OxtzmUC9I1UVDi6O6hOps1vvt4OOBwGYijyxOutBI2O+sGl/uJ\nioGIheP/n0uk2Li9Iw8Qx2pgyhRfAAQoyCRReO/nsdgP6E5fHUxY9msi+jdQ\nhZLd33W8eaQq/FgJx7Xpb7TTqgTd8xIEKo+ayOLUJ/K3XgRMzsWD2G69pCRX\nDGUQ\r\n=5/IQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENwIa01nVlru4VpJWhlKhMYS0L/Atd7T29wlKyrlBAiAiBTB2MsWxRDxfu1bxYUUBw/5gzYkQJMMQSXn+yUxSpecA=="}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.9.2_1624741844927_0.2861443955224121"},"_hasShrinkwrap":false},"0.9.3":{"name":"@slonik/typegen","version":"0.9.3","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">=23.4.0","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","pgsql-ast-parser":"^3.1.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.3","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2"},"gitHead":"66ee473fc6ef3a3d8d2b58ba894542ce7a10a421","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.9.3","_nodeVersion":"12.22.1","_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","dist":{"integrity":"sha512-PMELwczJ0/M/dYuiAeWrDCPYhPmJRvmKcEzI9hL33z3W30cXy5KVDn6ugRgWEQ1IdzCJ0jIl45W63UJTIy1bOw==","shasum":"a4a6b87dc2b7ebfeb27b3d78193f5d3960f136bf","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.9.3.tgz","fileCount":104,"unpackedSize":206538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2vDvCRA9TVsSAnZWagAAYYMP/20uyqCjMGZfLedhahMZ\nchsIMgZeWAGOMXAA1Hmoqyvi9LrDswkE5Tzo4pV7Orw3qmrIL8N9kffJYkI1\nbFDPZoR9L1zCV9mpi35O3qbqtJB+qMAZc3Rw42se1FS/fbU2gUFKxXA3yE9K\n/w0Zu8r6oUHWSPwAYONSVqYknou+h2HaYjHodoqsKpQPsHsdteaIhaLqxXdN\nqfErHaebqfl34NenxV1tyUmWq5QUDreX71L+WgskZiJCj8QFOOkq8Phr1HJU\nwb+Ph6TXxmDB1sOBx4eq++aOdHkKzh29GQ9eZszgXQuX25bXvkEtET16LQCR\n5CsCZ/VSif3xUhZ+lq5BV01eW5lj9zhPIH5kODd+sE/7GFZtZg9lSUdUk3mY\na+VdslduRdBfSqHYX4+z/QtFy1VtOfETY6POq7V2OzkvrZD10kNLJyVPGtBj\ntBgmvaytmaJYBQ/prfrDqjn2Ujdu4ulqRtQsuKAavEeD1DfHbcFKrhB9BkdN\nfwZxAuqItHOW74g/t2D8R7Md/tVtDQKoFQpQ38OadrDJ6uKNNcFutZXxAhbx\n1DtTzWvkDV3vPFvnwyEvLHhOaxa1J8AtrlQvGq1XxDFMgyodTRL9trLQmJ/i\n42rN6Y0hqo4hrPolmxLAPO9eGaMISk8KGDxgqK+8WkPYMpA8Sd8fPy7DGjvD\nRIq5\r\n=waM4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG1F/1n0tdsHglKlSB19IfzUHOHGQedGSbC1aWi0KYh/AiAykYzdTYIjAxX5OtTPmfSWL5zavwj1fzC/bavPXnhwpg=="}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.9.3_1624961262938_0.8460675641158999"},"_hasShrinkwrap":false},"0.9.4":{"name":"@slonik/typegen","version":"0.9.4","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">=23.4.0","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","pgsql-ast-parser":"^3.1.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.3","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2"},"gitHead":"36bdb331ad698bac68b186a66dc7f620e2999990","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.9.4","_nodeVersion":"12.22.1","_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","dist":{"integrity":"sha512-DlKgfFQVnhlS88j5mRtMJneThTc3tOQdfSC+0F4PyR5JHl+ScVkd5XcRsMsg+D9vsGq6FurNHCsIJ1me8GryZA==","shasum":"bbf3b765113b262313e0a6ab52b84f5b15bfc544","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.9.4.tgz","fileCount":104,"unpackedSize":209145,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg22DvCRA9TVsSAnZWagAAKdsQAIyfiz7KxF20Nk7YzojJ\nUlgPW/xuNvCuChNKGBuG0tx+jOQEun66TY1qt+JscNIA9FQF8Al8x/9H1cq/\n5Vvgjc8Zras/AEe/Jx/dvp9aEcQ0Usvy84inQQDYsB3Sg8a5lqMJFhqOztt/\n67Fz8Tkr7jl/n0mTbAvCpn/HquvNKHwOq1C8Su20avWTzny9Rjd9akIYkkhD\nd7HqJ+4oAu65b4TVEYDuEBpm6DWBNq/I30AUj/+CwhBnZBi0+pBKEHNs9Uaf\nateFQElX4mhRwjejSSNFGL9xSplMmxB5xNTNaDnO9nXvDnDjGwblLmY3Aojb\n2wCuOceYdfMy+NTrafSZWv4WJ8PV69s358Gja71qBgsQFMM/scEdooVM0BkY\nFgHjWI3cI2svYRP+cgqXqQCTEBJEa0KhyhlfGCoym23l7r6+T8m0oy+OawrC\n2jhHFCEHEnD8h5shUZZPzv3IwF+R0VWQbrF8VltEX4k3Ypu0jQhpZgqMQO+O\nvZG4yGXPNidkNi9txUKLMOYJULjm6TdTLzvY4v3yfmI8TG6sIyglynypedAy\nPAmnD/k5LOnM2H31dBbk8Epgett89NYBRvbcji3rRjloFcJSzwSRcLt1QJ07\nNXFISHmCU7kynz6QQchis9dUmxbwO9/c7MtQwIegvgOB5UuRqZjI7nL6M4ly\nmD7L\r\n=rmIf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtrxh7vhCb7lAPCdy2xIpevnfZtuKnHlBAFCa6a28xqAIhAP5UMwO94IbX+Bo9I2iEn6+ywr9FRDBvupKcySNqxane"}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.9.4_1624989935196_0.6521561955290771"},"_hasShrinkwrap":false},"0.9.5":{"name":"@slonik/typegen","version":"0.9.5","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">=23.4.0","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","pgsql-ast-parser":"^3.1.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.3","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2"},"gitHead":"8c522840fcbafbda80b83e817ee51c957b474d02","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.9.5","_nodeVersion":"12.22.1","_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","dist":{"integrity":"sha512-S8XCCOck6YxRT8S+03iMVz/Bdc6Iit0nKPdyl4mbjb7xrvxYps2wbzkFE74+brjJitFQ+AR+Emxrt/bh8XOiCw==","shasum":"76f74d444c6eca322d43180e2d4c8a56fd9076af","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.9.5.tgz","fileCount":104,"unpackedSize":209590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg23ftCRA9TVsSAnZWagAAkNsQAI1D1of6R9S3PFvGShjj\nAXFS+vLlOLZw1t4kVQwAxGqCXejNXuKmP7OOTcSkhB52Tzp9zY03Ksluz3Ts\nfmoM1P85WLjGVrq7PuXv+pTpM9gWmsuTHYdGNustJP1GefoM1to8x3jlfFca\nW01mQ8Ffx4FMxV0QdseeWp3AiEe+T/4tg/S57F4j9aOykM835iq98c7uQtlC\nsgdVYVZ4VdFWKerbQicCT5RiGdTAIfVkRksiG9TiajpNhVTNh/zcSQMwmHJ8\nv2srm6HESGxv7rSH63uPEAqtWS5oA6wNEzhL5CKca2vzfVu+jWAABTg5cP+2\nYYolxF7qqS9OVCWDxkjuuW3dFZVnUmvX8Ug2AC9GXrwVWcaG+XslmLXrFMTG\nc/PwvNDZu5e5/NDDnnwyNLDjwhd98S+9ZIyIYjEp9jKU5SUkvhKO+K7929RW\noWHMytzOXs6Mlutkc2YoRnXIkNqaR1jL2NTP6a1ZvWN0+9o7taVDWwuFKfoS\nQC2CLOwx3YC3/RtzBLtuFjrwt1a1tmscgIAp38xt238ccwYwBacHokPCmGbO\nF1zaJSDiYb12+v6Yzei6ditc8+5MqHo2WGD9lwoQtBJZLBNJzMxZMW96Wtiu\nqV/Kj3gaHuVhPzGhUmslyuNgwtEPIUu3UDD7wygWFNk9cAJ8KC7vyjgLaxlD\nH9As\r\n=hdWQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICLLtIpmMBAsp94sb4biQheF7vsJH+Zt3JoSoEsXognyAiAH1TdHooi8fKrBl02ARoGHnj32s9ZA6GCqh98F3ItAZw=="}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.9.5_1624995820470_0.485412793668456"},"_hasShrinkwrap":false},"0.10.0":{"name":"@slonik/typegen","version":"0.10.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">=23.4.0","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","chokidar":"^3.5.2","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^8.0.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.3","@types/memoizee":"0.4.5","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2"},"gitHead":"d24a1d6d844a93793298ce7e311f36e85fed5482","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.10.0","_nodeVersion":"12.22.1","_npmVersion":"lerna/4.0.0/node@v12.22.1+x64 (linux)","dist":{"integrity":"sha512-XQ/FD6WisH4LBD+e8YNRsMJaSKeDBNyM0Imp4yi4riF4v8Fa/ysHxsj4DnZFC3/xvkMpia9J79iwgyRxfXY3sA==","shasum":"c2eb95bace8ebb7b961fd21e01b12c77948341af","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.10.0.tgz","fileCount":104,"unpackedSize":217661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4kMzCRA9TVsSAnZWagAAbXAQAJwqhtC1gLgnVIvIeKyG\n8HDEJbMlHv5UJHSIZXuhRlDAVms7JjQeg4jwrtTeoYw0mvgKN6TMamILgCFG\ni7uEm8MloiaJWbftpB7EUx+GqXVlJqMRKOzCKqwP3QxscupHOFNg9YEUeuzH\nfBBixn0WPf0Az4Na31LQyJfTaZE8EA9SkrsJ5W05pY6+4vwdG8LfZSFP7G4H\nKqH3XNM+y+XpTSDPSrGBgRn5dyFNbKoFwZMm0jDsSzoRzV+RaOPkb4er8E5Y\nuhk3thz3FyF7FP/8WgF+Tia4Qji9Kr4ZVMaYXBPP0DtUlL0sgnyHGLmKj5Cd\naoBT45kEzXXAFMKX82QN/DXTI4SXGu53oMq8bNsCm65K+7lglbbbkIBJo7QR\nLdUlsHTH1sQlHYMoQWT3hnv7W7a4bU7+DdQw0o6Zqj1FcLh7lDNGURDk9I4r\nWibsPTWZL83YEbAOzxI2neRqMlkTrXxKcfTPMIWzpeBsofuUizfYbtMCsNnM\nQ6OP2V05Q4OSZdiUg2y7zcwDq2ooFN7B1a5rmlbSUmbOrJ3+JH+offtwbwzm\nVgilfxPs4rH/tWVcq/4GcW7LYOLQ8gU89my3MaPF6POFCbym1MEXYlTzVlxN\ncNCXlvxw+gMor+opPgcHV+LnSmugwnknSE8xjGMb7D3ZmyjMSWNOagw+XqD/\nWdWG\r\n=8zKq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1rC9vUrP1MfBD7YaMinBSveuBkxEf46PkQQOmkxl2uwIgCrOMG074LB1vbDaZAo5QAEiCsIprYfhPO+tjrOBKWFE="}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.10.0_1625441075331_0.7365656830076122"},"_hasShrinkwrap":false},"0.11.0":{"name":"@slonik/typegen","version":"0.11.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">=23.4.0","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","chokidar":"^3.5.2","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^8.0.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.4","@types/memoizee":"0.4.6","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2","pg-native":"3.0.0"},"gitHead":"b9d5f9e762d82e79f3b139fefe92c847fb971d03","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.11.0","_nodeVersion":"12.22.3","_npmVersion":"lerna/4.0.0/node@v12.22.3+x64 (linux)","dist":{"integrity":"sha512-ap7CRVF65PLXwhd67EOp/ZlZyar2uATH2JhQp/38gEam3x7KnCbroTwJ/cHj9jAKsQzWVRF8UYp9JZADFaMspg==","shasum":"0881bc62d2209297c0bece757a23b3bc6277753a","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.11.0.tgz","fileCount":104,"unpackedSize":218298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8DLmCRA9TVsSAnZWagAAJm4P/iOYtli13E2pAeBuQuqs\nAMqpgfrxoOz1E3AB6roOe9CcnDSfkn8/dtapKDA0N9VVpRZVCZPvJ1qkayOb\nTDYOId3zAB5FuYaxwd8pt/m6FAw9zyl2Nq3WA7o49vli/VB3iQHS2AUWzq3X\nBLROwOK+7t+1DE/AimTy1JQvC61uGcujLU4GxMVswDBqwJAk6IwlPBXu5792\nI/0anXPXqlXLmoAaoamwiUfPILkd7nWegGwPzWAj9CALFHLTWE5V8UkDKsuE\nbkC4rbMYn8vDy+Zeq/7+L7kzBxapuAV9coimFFGHQ8jaZWgTdqr3Jih4Zhvf\nU4hKAQSDQ1jBGWVgxWwTJK07QMWfu2ja8hZh3PjVgyVxr6+qoV8d47e98C14\n3fT0sLf3XsXoFadS+oOu+rEaEgL3WOAgvxLLWqaaeBGh/o1IOmLE8gxLhxLw\ng31UGlpTQ0hRuSJ06ygg92kJJkHc1a5OIB50NIH7yxpwISSxWx06Ir5yxQ3T\nByK36O9McOt5ZEukMd9tbqGxof+rN1kTV2zxrX+jSZetwkkamWhhAM08dSZP\nrbddJs6Gs0m7QMYBMMyjJjhPup2scUIrASZl946kqloMGXl4t3w6Ual8YuYq\nOd5mqnPVrql7pgYhEqE6EGA+YUGhK6jpHbuL9Z5XJkKDwVTIKy+ctAVysDzB\n0FgJ\r\n=JEhI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkeW/6ZW+Z8C2dPmUpkLd2ne/WWTi6hPYxm1fehzp9lgIhAL9Hz1LgpaJoqyTnbnFKiItdaTsxoOZtLhEWOSJXp+1O"}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.11.0_1626354406400_0.5488049225842009"},"_hasShrinkwrap":false},"0.11.1":{"name":"@slonik/typegen","version":"0.11.1","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">=23.4.0","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","chokidar":"^3.5.2","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^8.0.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.4","@types/memoizee":"0.4.6","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2","pg-native":"3.0.0"},"gitHead":"52882939a29e9a175682f2426a9699c009f3c39f","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.11.1","_nodeVersion":"12.22.7","_npmVersion":"lerna/4.0.0/node@v12.22.7+x64 (linux)","dist":{"integrity":"sha512-At6DUZjWl5qpg+63GV0GS0LWyv7/77tvUth2xKSsLpE4xMmQQ7uKeGMCpCZgwU7wPD20TniX1LgRgJT6Mbok2w==","shasum":"e028f92cc016ec747000ac68f1d4ffda6c01e8f6","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.11.1.tgz","fileCount":104,"unpackedSize":218169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsPPyCRA9TVsSAnZWagAAxWMP/2AdgP4rngtD7lzxIY0e\n9lW8eFI7X8ns7OaL76IWJiXnxxr4Nm5XM3oDyrPQ55ODIwdiBa2c37o4Vo/S\nZQU7D8f5ZQgGI4TiCCqGcgjyeI0iL341qcVfap69FMK4paI8TjHQkUyp61rV\nxod0rn4ojyPyIeaG1knNrMfN3BKgfKIWM8r5qdHrwe9UK0lndaT8XZALFkUo\n6/Ccp8+EV90ZKV5jibyG83nt7GsMUO5W76eL3UcujFy2pKHeKsN8q7LZkCX4\nvluUZYVVzuturHgYqAVt9jfRpeOmNdH7Zzz/hlg9SOWiBD5cPaIq5ZlYM9iP\n6JE/MedCqosIlm0h1yAvfBmJfGrvTn28O2btrLKK5JglcQuRryI4V9Dttynr\ng9S8JcSSv2fZB8lpsHccBVM/ohzmXMhDVfl4/czcqM2XxoN6LcxR8hho/gOM\nF60uyXtE+QTqVEZmAzQtV2zPIgZS4xhXeGbDw+2n6mFH1Thrn6mLlscnaUBD\n7TjuJyat86KTttj5vQQaAjCS9dBtxYBlDxgO591L1eCKJdgoKmL25n6lrrxK\nBgwBC8KXFB20ohYxX7nxATXWzDdly9PAfBn3gDOVC9dWPoHELkVcNmn1+rP1\n+Lg3CSXeuCGmfM0/S4K/DCE8P+8B+2OshXCzst5m4QsIrWiHMX/f25V00L5n\nS36y\r\n=WaeQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE+YanvvyHX1pPRD7sX7GBfa+/jtda44+AUgaikbVhkQAiBvRUdqFHyaHlG2oEY++ouhmBysOG0QfLe342LDVHTjbA=="}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.11.1_1638986738338_0.8019288373802249"},"_hasShrinkwrap":false},"0.11.2":{"name":"@slonik/typegen","version":"0.11.2","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">=23.4.0","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","chokidar":"^3.5.2","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^8.0.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.4","@types/memoizee":"0.4.6","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2"},"gitHead":"4cfc2083b862f95c1855dd7208fbdc27f51d7cc4","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.11.2","_nodeVersion":"12.22.9","_npmVersion":"lerna/4.0.0/node@v12.22.9+x64 (linux)","dist":{"integrity":"sha512-eSIpbAs3eI+A4WJijacQ35W7YMKP07UjtD0T4E8kTsZvE1Vv6IyY0exgTMIPOqA55RA4fQcOUZAjI7PQC7qi8A==","shasum":"8cfb2a425ee3a8dfefcc7affa5963f26364ab542","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.11.2.tgz","fileCount":104,"unpackedSize":218053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/lbqCRA9TVsSAnZWagAA4kEP/je+b8XIWcwEjB8NvMXa\nNLaWsYyWR8mrHKDtVe9Wj+ABnIXKI+DUZ6G87fRVvsIHXmqehjLv4SeZhTtY\nBsCueI2fcAIjzW1JyPaUzXj28CvnEC3LRsTatCrcm0x37eJffKBllAWNGN+d\nL9nNdlUqN37Twb7fxUO4Pab5QWSvgClZoQ1z8d7DHB8GXHWnbPJDRrKTffOi\n21w+EmlVeu/W3vJm3TLb1OCi0N/EFZJwDG7usjp99cWdIcz2q5JbmUeCAFHc\nFiGEuSjhh5xcHL+yj9jWRHBTZhA76KslKovA5MNrdhtb2JGiprr80/ph10HW\nvNqfkDEXBiG9x5OtAxAUf8TJN+ths/LMLwp5V7aJzOx672l80ghrFJNjcVhF\nHtWrjcemO/wws9OgzlR1NoR2s3nrIngoVM7b1KsmdMs6j0n/sa8hXt7nEDO8\nfQ79k/qbCjz8AfHkIYgvs2CM1x5CYD13N25uHVvGqaFHZKQAJgvaZIRNgGR7\n6dwHceSCa5jxAJLK8EebhiusvW4ru70mUSGWZ7c8vn1/vrsM6HF30iXn8ep8\nnL4kGy1Jdr6e4f1NL0EeT3xgXDyzYPax9osPId/3zIFl5D6D4lcULmWi0Dp3\nY6iheIfzKLEoQHlyYoo8uJH4xHralxn7zHAC+rI5RYzGwZZvv+OhOrsomqLx\nQJIB\r\n=NvIM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCspUbpmG+n9k0k8ke1nkrgSP+/EpKWHtRpJ4mFP70pogIhANaPCSHflJT7JacGqG6eaxbV2euXWryNwo4+tQm/IfrT"}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.11.2_1644058345947_0.8978291330367798"},"_hasShrinkwrap":false},"0.11.3":{"name":"@slonik/typegen","version":"0.11.3","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 27.0.0 < 28","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","chokidar":"^3.5.2","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^8.0.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.4","@types/memoizee":"0.4.6","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2"},"gitHead":"f39b3c931cd6cd837bae230224f67820c092289c","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.11.3","_nodeVersion":"12.22.10","_npmVersion":"lerna/4.0.0/node@v12.22.10+x64 (linux)","dist":{"integrity":"sha512-c9Nc93qsEnR+SOHILLpKX0nEazKuc/Ad2zdrLHZTZ/1dwygOoldHy9FcQgX1FanqrJMcdwhGcEUeHqrY48qKTQ==","shasum":"e17cd1557391745910ae0000444e67af46f275a5","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.11.3.tgz","fileCount":104,"unpackedSize":217965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFAhiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpbsg/6A8XJNjs2fcWGXPEt0F6CHZ65Jcyvt8InofAwyTgBDFpfMY4c\r\nUY9v1i/YBIOypn/wFkWBM0NrRRfuZEl8jjOtiEETbyus4+2Ms07TzvaCqn8r\r\nYE9EA59jZgquZRiUmyAHRXnI4L7RTm5Gxf79Rj+yLeJZXabqTGC8xRyZoVb8\r\nYgatB0T1DaiaV7g60wWodUrKjVy3SS64RuR1Qn3tUUPg5Qc6AmFLDe2PVHpy\r\nBhapArNM1UAWOUf0WuEYKrW3M8O8182LiOzf3mE7NojRu2VcfLDFj0VO/y5E\r\nz1pvK6DvqbK3l5Ymcfnup9miSfKoKZW5GQ/+aXzMKnfDL/e5c+1ax5M6Pwz6\r\nx6s81F4DAerb8aYOcUWT3FV/Zm5h6coPUbnXPpAW9X9utEU4Hs0YAAr+vBQk\r\nZQTpUh+ieuO0CDeHXz6B2cS8Z8DJAEVHj8C36nJlRhQmvHY2liEoYYCslzX6\r\nydTZvAVjhDfH6RiUBpRUqlCHkrG3xw18oBZtCvDDkJ325ATfmXZKwl8jkBTp\r\nxUqrD9vccQN5PDiVdcMGZ9LZQGm+5FRmbguQsSZOtNIm8udEFeZ4t9y4MZSC\r\nNJJlWB21MEyHhEjKGy8pBw0WTUVuUEPn+AxR6QXCISVF0JKvKx4fetdI9d1w\r\nDu/cYIUI53HHvg/vnCJD2032LenPJkbfIQA=\r\n=0VqK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClNPVeM5F0c+RF9B7nRGiWn4jY7U5UrNjz/0ESCkaFLgIgdvPxJb5VonRhEmN6LBtVf+q7oFyI4iza6WfxzGih+Yc="}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.11.3_1645480033896_0.8220385210637646"},"_hasShrinkwrap":false},"0.11.4-featureinterpret-coalesce-2022-03-22-16-48-05.6":{"name":"@slonik/typegen","version":"0.11.4-featureinterpret-coalesce-2022-03-22-16-48-05.6","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 27.0.0 < 28","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","chokidar":"^3.5.2","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^8.0.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.4","@types/memoizee":"0.4.6","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2"},"gitHead":"aeb99aea5632604f33cd132f1fd8bdcd330557e4","readme":"# @slonik/typegen\n\n[![Node CI](https://github.com/mmkal/slonik-tools/workflows/CI/badge.svg)](https://github.com/mmkal/slonik-tools/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/mmkal/slonik-tools/branch/master/graph/badge.svg)](https://codecov.io/gh/mmkal/slonik-tools)\n\nA library that uses [slonik](https://npmjs.com/package/slonik) to generate typescript interfaces based on your sql queries.\n\n## The idea\n\nThis library gives you the type-safety of an ORM (in some cases, even more), while maintaining the flexibility of sql. Read [@gajus](https://github.com/gajus)'s excellent blog post on why it's a good idea to use sql rather than ORMs or query-builders: [Stop using Knex.js](https://medium.com/@gajus/bf410349856c).\n\nIt will make sure that return values from all your SQL queries have strict, accurate TypeScript interfaces.\n\nIt works by scanning your source code, so you don't have to spend any time manually syncing interfaces. Write queries using the `sql` tag as normal, then run the CLI to apply strong types to them automatically. The compiler will then tell you if you got something wrong.\n\nThis method avoids the [inner-platform effect](https://en.wikipedia.org/wiki/Inner-platform_effect) that tends to come with ORMs. You can rename columns, call functions, use sub-select statements, do any kinds of join you want, and the types generated will be based on the _query_, not the _table_, so you won't be limited by ORM feature-sets.\n\nSelect statements, joins, and updates/inserts/deletes using `returning` are all supported - any sql query that returns a tabular value will have an interface generated for the row type. The interface will be automatically applied to the appropriate query result.\n\n## Contents\n\n<!-- codegen:start {preset: markdownTOC, sort: package.name, minDepth: 2} -->\n- [The idea](#the-idea)\n- [Contents](#contents)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Configuration](#configuration)\n   - [Example config](#example-config)\n   - [CLI options](#cli-options)\n   - [writeTypes](#writetypes)\n      - [Controlling write destination](#controlling-write-destination)\n      - [Modifying types](#modifying-types)\n      - [Modifying source files](#modifying-source-files)\n- [Examples](#examples)\n- [Migration from v0.8.0](#migration-from-v080)\n- [SQL files](#sql-files)\n- [Usage with `@typescript-eslint`](#usage-with-typescript-eslint)\n- [Limitations](#limitations)\n- [How it works](#how-it-works)\n- [Recommendations](#recommendations)\n<!-- codegen:end -->\n\n## Installation\n\n```bash\nnpm install @slonik/typegen --save-dev\n```\n\n## Usage\n\n```bash\nnpx slonik-typegen generate\n```\n\nThe above command will generate types using sensible default values. It will look for code in a `src` directory, and create interfaces for all `sql`-tagged queries it finds - e.g.\n\n<!-- codegen:start {preset: custom, source: ./docgen.js, export: basicExample} -->\nFor a table defined with:\n\n```sql\ncreate table test_table(foo int not null, bar text);\n\ncomment on column test_table.bar is 'Look, ma! A comment from postgres!'\n```\n\nSource code before:\n\n```ts\nimport {sql, createPool} from 'slonik'\n\nexport default async () => {\n  const pool = createPool('...connection string...')\n\n  const results = await pool.query(sql`select foo, bar from test_table`)\n\n  results.rows.forEach(r => {\n    console.log(r.foo)\n    console.log(r.bar)\n  })\n}\n```\n\nSource code after:\n\n```ts\nimport {sql, createPool} from 'slonik'\n\nexport default async () => {\n  const pool = createPool('...connection string...')\n\n  const results = await pool.query(sql<queries.TestTable>`select foo, bar from test_table`)\n\n  results.rows.forEach(r => {\n    console.log(r.foo) // foo has type 'number'\n    console.log(r.bar) // bar has type 'string | null'\n  })\n}\n\nexport declare namespace queries {\n  // Generated by @slonik/typegen\n\n  /** - query: `select foo, bar from test_table` */\n  export interface TestTable {\n    /** column: `example_test.test_table.foo`, not null: `true`, regtype: `integer` */\n    foo: number\n\n    /**\n     * Look, ma! A comment from postgres!\n     *\n     * column: `example_test.test_table.bar`, regtype: `text`\n     */\n    bar: string | null\n  }\n}\n```\n<!-- codegen:end -->\n\n## Configuration\n\nThe CLI can run with zero config, but there will usually be customisations needed depending on your project's setup. By default, the CLI will look for `typegen.config.js` file in the working directory. The config file can contain the following options (all are optional):\n\n- `rootDir` - Source root that the tool will search for files in. Defaults to `src`. Can be overridden with the `--root-dir` CLI argument.\n- `glob` - Glob pattern of files to search for. Defaults to searching for `.ts` and `.sql` files, ignore `node_modules`. Can be overridden with the `--glob` CLI argument.\n- `connectionURI` - URI for connecting to psql. Defaults to `postgresql://postgres:postgres@localhost:5432/postgres`. Note that if you are using `psql` inside docker, you should make sure that the container and host port match, since this will be used both by `psql` and slonik to connect to the database.\n- `poolConfig` - Slonik database pool configuration. Will be used to create a pool which issues queries to the database as the tool is running, and will have its type parsers inspected to ensure the generated types are correct. It's important to pass in a pool confguration which is the same as the one used in your application.\n- `psqlCommand` - the CLI command for running the official postgres `psql` CLI client. Defaults to `psql`. You can test it's working, and that your postgres version supports `\\gdesc` with your connection string using: `echo 'select 123 as abc \\gdesc' | psql \"postgresql://postgres:postgres@localhost:5432/postgres\" -f -`. Note that right now this can't contain single quotes. This should also be configured to talk to the same database as the `pool` variable (and it should be a development database - don't run this tool in production!). If you are using docker compose, you can use a command like `docker-compose exec -T postgres psql`\n- `logger` - Logger object with `debug`, `info`, `warn` and `error` methods. Defaults to `console`.\n- `writeTypes` (advanced/experimental) - Control how files are written to disk. See the [writeTypes](#writetypes) section.\n\n### Example config\n\nHere's a valid example config file.\n\n```js\nconst yourAppDB = require('./lib/db')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  rootDir: 'source', // maybe you don't like using `src`\n  glob: ['{queries/**.ts,sql/**.sql}', {ignore: 'legacy-queries/**.sql'}],\n  connectionURI: 'postgresql://postgres:postgres@localhost:5432/postgres',\n  poolConfig: yourAppDB.getPool().configuration,\n}\n```\n\nNote that the `/** @type {import('@slonik/typegen').Options} */` comment is optional, but will ensure your IDE gives you type hints.\n\n### CLI options\n\nSome of the options above can be overriden by the CLI:\n\n<!-- codegen:start {preset: custom, source: ./docgen.js, export: cliHelpText} -->\n```\nusage: slonik-typegen generate [-h] [--config PATH] [--root-dir PATH]\n                               [--connection-uri URI] [--psql COMMAND]\n                               [--default-type TYPESCRIPT] [--glob PATTERN]\n                               [--since REF] [--migrate {<=0.8.0}]\n                               [--skip-check-clean] [--watch] [--lazy]\n                               \n\nGenerates a directory containing with a 'sql' tag wrapper based on found \nqueries found in source files. By default, searches 'src' for source files.\n\nOptional arguments:\n\n  -h, --help            Show this help message and exit.\n\n  --config PATH         Path to a module containing parameters to be passed \n                        to 'generate'. If specified, it will be required and \n                        the export will be used as parameters. If not \n                        specified, defaults will be used. Note: other CLI \n                        arguments will override values set in this module\n\n  --root-dir PATH       Path to the source directory containing SQL queries. \n                        Defaults to \"src\" if no value is provided\n\n  --connection-uri URI  URI for connecting to postgres. Defaults to \n                        URI for connecting to postgres. Defaults to \n\n  --psql COMMAND        psql command used to query postgres via CLI client. e.\n                        g. 'psql -h localhost -U postgres postgres' if \n                        running postgres locally, or 'docker-compose exec -T \n                        postgres psql -h localhost -U postgres postgres' if \n                        running with docker-compose. You can test this by \n                        running \"<<your_psql_command>> -c 'select 1 as a, 2 \n                        as b'\". Note that this command will be executed \n                        dynamically, so avoid using any escape characters in \n                        here.\n\n  --default-type TYPESCRIPT\n                        TypeScript fallback type for when no type is found. \n                        Most simple types (text, int etc.) are mapped to \n                        their TypeScript equivalent automatically. This \n                        should usually be 'unknown', or 'any' if you like to \n                        live dangerously.\n\n  --glob PATTERN        Glob pattern of source files to search for SQL \n                        queries in. By default searches for all ts and sql \n                        files under 'rootDir'\n\n  --since REF           Limit affected files to those which have been changed \n                        since the given git ref. Use \"--since HEAD\" for files \n                        changed since the last commit, \"--since main\" for \n                        files changed in a branch, etc.\n\n  --migrate {<=0.8.0}   Before generating types, attempt to migrate a \n                        codebase which has used a prior version of this tool\n\n  --skip-check-clean    If enabled, the tool will not check the git status to \n                        ensure changes are checked in.\n\n  --watch               Run the type checker in watch mode. Files will be run \n                        through the code generator when changed or added.\n\n  --lazy                Skip initial processing of input files. Only useful \n                        with '--watch'.\n```\n<!-- codegen:end -->\n\nThere are some more configuration options [documented in code](./src/types.ts), but these should be considered experimental, and might change without warning. You can try them out as documented below, but please start a [discussion](https://github.com/mmkal/slonik-tools/discussions) on this library's project page with some info about your use case so the API can be stabilised in a sensible way.\n\n### writeTypes\n\nThe `writeTypes` option allows you to tweak what's written to disk. Note that the usage style isn't finalised and might change in future. If you use it, please create a discussion about it in https://github.com/mmkal/slonik-tools/discussions so that your use-case doesn't get taken away unexpectedly.\n\n#### Controlling write destination\n\nBy default, interfaces for SQL queries are added to a module at the end of the typescript file they're found in. You can tell the CLI to write the interfaces to a separate file instead using `writeTypes`:\n\n```js\nconst path = require('path')\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: typegen.defaultWriteTypes({\n    queriesPathFromTS: filepath => path.join(path.dirname(filepath), '__sql__', path.basename(filepath)),\n  }),\n}\n```\n\nThe interfaces will be written to a separate file under a `__sql__` folder next to the source, and will be imported via `import * as queries from './__sql__/file-name'`.\n\n#### Modifying types\n\nYou can modify the types generated before they are written to disk by defining a custom `writeTypes` implementation.\n\nFor example, you can create [branded types](https://michalzalecki.com/nominal-typing-in-typescript) (see what this outputs in [tests](./test/branding.test.ts)):\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      query.fields.forEach(field => {\n        // add a `_brand` to all string id fields:\n        if (field.typescript === 'string' && field.column && field.column.name === '.id') {\n          field.typescript = `(${field.typescript} & { _brand: ${JSON.stringify(field.column)} })`\n        }\n      })\n    })\n\n    return typegen.defaultWriteTypes()(queries)\n  }\n}\n```\n\nOr you could mark all fields as non-null (but probably shouldn't!):\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      query.fields.forEach(field => {\n        field.nullability = 'assumed_not_null'\n      })\n    })\n\n    return typegen.defaults.defaultWriteTypes()(queries)\n  }\n}\n```\n\nOr you could be more granular. If, for example, there's a particular file with a lot of nullable types that you can't (yet) add full strict typing to:\n\n```js\nconst typegen = require('@slonik/typegen')\nconst path = require('path')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      const filesWithLegacyNullableFields = [\n        path.resolve(__dirname, 'path/to/file1.ts'),\n        path.resolve(__dirname, 'path/to/file2.ts'),\n      ]\n      if (filesWithLegacyNullableFields.includes(query.file)) {\n        query.fields.forEach(field => {\n          if (field.nullability === 'unknown') {\n            field.nullability = 'assumed_not_null'\n          }\n        })\n      }\n    })\n\n    return typegen.defaults.defaultWriteTypes()(queries)\n  }\n}\n```\n\nOr you could use a custom type for json fields:\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      query.fields.forEach(field => {\n        if (field.regtype === 'json' || field.regtype === 'jsonb') {\n          field.typescript = `import('@your-project/custom-types').YourCustomType`\n          // For more customisation, you could look up which type to use based on `field.column`.\n        }\n      })\n    })\n\n    return typegen.defaults.defaultWriteTypes()(queries)\n  }\n}\n```\n\n#### Modifying source files\n\nYou can also use `writeTypes` to define a hook that runs before writing to disk:\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: typegen.defaultWriteTypes({\n    writeFile: async (filepath, content) => {\n      content = content\n        .replace(/declare module queries/g, 'declare module some_other_naming_convention')\n        .replace(/queries\\./g, 'some_other_naming_convention.')\n      await typegen.defaults.defaultWriteFile(filepath, content)\n    },\n  })\n}\n```\n\nOr you could override the default formatter (which uses prettier, if found):\n\n```js\nconst typegen = require('@slonik/typegen')\nconst yourCustomLinter = require('@your-project/custom-linter')\nconst fs = require('fs')\nconst path = require('path')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: typegen.defaults.defaultWriteTypes({\n    writeFile: async (filepath, content) => {\n      content = await yourCustomLinter.fix(filepath, content)\n      await fs.promises.mkdir(path.dirname(filepath), {recursive: true}) // since you're not using the built-in `writeFile` you should explicitly call mkdir with {recursive: true}\n      await fs.promises.writeFile(filepath, content)\n    },\n  })\n}\n```\n\n## Examples\n\n[The tests](./test) and [corresponding fixtures](./test/fixtures) are a good starting point to see what the code-generator will do.\n\n## Migration from v0.8.0\n\nVersion 0.8.0 and below of this library used a different style of code-generation. It had several drawbacks - it was a runtime dependency, and required queries to be actually run before types could be inferred. It also created a global repository of types, meaning two queries in separate locations which shared a name could clash with each other. It also required changing the way your code was written.\n\nConceptually, this library now does more work so you don't have to worry about it so much. Just write slonik code/queries as normal, and then run the CLI to add types to them. If you add a new column to any query, run it again to update the interfaces.\n\nIf you previously used the old version of the tool, you can run it once with the  `--migrate v0.8.0` CLI argument to automatically attempt to codemod your project. Note that this will, by default, check that your git status is clean before running since it modifies code in place. The codemod isn't advanced enough to find all usages of the old API, so have a look through what it does after running it to make sure the changes look OK. If they aren't, reset the git changes and either apply them manually and/or pass in a different `glob` value to avoid files that were incorrectly modified.\n\n## SQL files\n\nThe tool will also search for `.sql` files, and generate some typescript helpers for running the queries contained in them. Any parameters (`$1`, `$2` etc.) will also be strongly typed, and become required inputs for running the query. See the [SQL file fixtures](./test/sql.test.ts) for some examples, and [the generated SQL usage test to see how it can be used](./test/sql-usage.test.ts).\n\n## Usage with `@typescript-eslint`\n\nThe default ruleset for [`@typescript-eslint/eslint-plugin`](https://npmjs.com/package/@typescript-eslint/eslint-plugin) prevents usage of [typescript namespaces](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/docs/rules/no-namespace.md). To avoid lint errors for inline type declarations (which are perfectly valid!), add this to your eslint config:\n\n```\n\"@typescript-eslint/no-namespace\": [\"warn\", {\"allowDeclarations\": true}],\n```\n\n## Limitations\n\nSome dynamically-generated queries will not receive a type. One example is any query where the template express parameters are identifiers rather than values, e.g.\n\n```ts\nimport {sql} from 'slonik'\n\nconst tableName = Math.random() < 0.5 ? 'foo' : 'bar'\n\nexport default sql`select * from ${sql.identifier([tableName])}`\n```\n\nIn the above example, no type can be inferred because it's impossible to know whether the query will return values from table `foo` or `bar`.\n\n___\n\nQueries with multiple statements will also not receive a type:\n\n```ts\nimport {sql} from 'slonik'\n\nsql`\n  insert into foo(a, b) values (1, 2);\n  insert into foo(a, b) values (3, 4);\n`\n```\n\nThis kind of query does not return a value when executed anyway.\n\n___\n\nQueries using the `pg_temp` schema will usually not be typeable since the schema is ephemeral and only can be queried within a single session that `psql` doesn't have access to.\n\n```ts\nimport {sql} from 'slonik'\n\nsql`select * from pg_temp.my_temp_table`\n```\n\n___\n\nInvalid SQL syntax will also be left untouched (they will result in an error being logged when running the CLI):\n\n```ts\nimport {sql} from 'slonik'\n\nsql`this is not even valid SQL!`\n```\n\nIf you see errors being logged for SQL that you think is valid, feel free to [raise an issue](https://github.com/mmkal/slonik-tools/issues/new). In the meantime, you can create a variable `const _sql = sql` and use the `_sql` tag in the same way as `sql`. `_sql` will not be detected by the tool and can be used as normal.\n\n___\n\nCustom interceptors. Some interceptors, such as [slonik-interceptor-field-name-transformation](https://npmjs.com/package/slonik-interceptor-field-name-transformation) change the runtime shape of query results. You could try to match its behaviour with a custom `writeTypes` implementation, but it's recommended to just not using the interceptor in the first place. All it does is transform from snake-case to camel-case.\n\n___\n\nFinally, for some complex queries, static parsing might fail, making it not possible to determine statically if a column is nullable. If this happens, it will still receive a valid type, but the type will be `string | null` rather than `string`.\n\nIf you find such a case, please [raise an issue](https://github.com/mmkal/slonik-tools/issues/new) to see if it's possible to handle - under the hood this library uses [pgsql-ast-parser](https://npmjs.com/package/pgsql-ast-parser) and you might have found an edge case which that library doesn't handle yet.\n\n## How it works\n\nWhen you run `slonik-typegen generate`, the tool will scan your source files, and traverse their ASTs using the TypeScript compiler API. Note that typescript is a peer dependency for this reason.\n\nOn finding [a](https://oracle-base.com/blog/2015/01/02/a-sql-or-an-sql/#:~:text=According%20to%20the%20Oracle%20docs,%2Dlevel%20declarative%20computer%20language%E2%80%A6%E2%80%9D) sql query, it will issue a `psql` command using the [flag `\\gdesc`](https://www.postgresql.org/docs/11/app-psql.html), which responds with a table of the columns and their corresponding types contained in the query. The query itself is never actually run.\n\nThe postgres type is then converted into typescript using an in-built mapping. Any slonik `typeParsers` configured (see [slonik docs](https://github.com/gajus/slonik/#api) for more info) are inspected to infer the type of the value that will be returned by the query.\n\nTo determine whether query columns are nullable, the query is parsed using [pgsql-ast-parser](https://npmjs.com/package/pgsql-ast-parser). Some more queries are sent to postgres to figure out whether query column can be null - in general, postgres is only able to guarantee if a query column is null if it comes directly from a table which declares that column non-null too.\n\n## Recommendations\n\n1. Check in the types to source control. They're generated code, but it makes it much easier to track what was happened when a query was update, and see those changes over time.\n1. After running CI, it's worth making sure that there are no working copy changes. For git, you can use `git diff --exit-code`:\n\n```sh\nnpx slonik-typegen generate\ngit diff --exit-code\n```\n","readmeFilename":"readme.md","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.11.4-featureinterpret-coalesce-2022-03-22-16-48-05.6","_nodeVersion":"14.17.0","_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (darwin)","dist":{"integrity":"sha512-03uyIKWjeYffcqHZ1OxTpUd/27ROFAie3hHsz61Gt4zGktEy8cnxgGHr1d8c2WqKbOVeG1aHjqNn3+84jhJdRw==","shasum":"9b24f6c48828e37617840a91a39f32e860c849fb","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.11.4-featureinterpret-coalesce-2022-03-22-16-48-05.6.tgz","fileCount":104,"unpackedSize":219409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOf3RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQjxAAjO2k9dZjP+XO4goWLPjxwpB8jtul7Q0M5YponWpZwg3aL+l9\r\nQzGt3Aie4uS/AXKuq6Oi1SvkreNFOxcsqJUfDO4rrjaSimrKSTJRD6COKo7I\r\nSTTWsu344STeO+Ff6nXdc6/QCzPkb3rF6vg7HuaJi/aRBUDilB2/Fx29mzai\r\nQ9V4m7wHJubfJYtLGCi5BPRPLjjMc9qd740ids+9J4oWkXXIduugyLoizhSI\r\nPZGFabsoZNFcMk5yks80glNH3snhjq9z81aniAWgwHj0NKy/eAa/xPpa9y2d\r\nZSmGAu41grLu0qH2Jq9HtIS2EGI86tKQ1QgXZGPHmveI3Yd6k44c51XHE4Ch\r\n0i8GrW1L6yzM+EPuEoKHCbyJ6jI1Nfx19lIEUXrd5bKEXSk8oSt9I2b0fzLF\r\n1yEm+yRlitNYuUM39woa0Lltex+07nm8hR1lFJEAclIf8iXdujJ4a6sidGB3\r\nB+6Gwss2Ye9/1jnezS0oxyBSyfep3CTRbNNRb4wYYzkp23ox6PDTrNWLRqw3\r\nG5K0sS43JWUSn76sUou0i7IuFz+NyqnO8Z6xRkT05kOm0E3SDbOigQhJIrd0\r\n4pfYQVjH/8noIt/50+mamE3KgLvgUdRnrjQYXtroYJvI539FK7vJcUo2A9F0\r\nT8XMj5yUvusZufwz0vtRvL1VWRKgCtybIBc=\r\n=jpiZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD70xIk6Ap5DfTytF38rQQ2GDpiIC+kso/xAW3a1fMODgIgDBF/NTGuKxYOMoJGtNpC6eYfnCccdU/S1P+3L6ix5tM="}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.11.4-featureinterpret-coalesce-2022-03-22-16-48-05.6_1647967697480_0.7720133259180921"},"_hasShrinkwrap":false},"0.11.4-feature-improve-log-output-2022-03-31-07-11-56.6":{"name":"@slonik/typegen","version":"0.11.4-feature-improve-log-output-2022-03-31-07-11-56.6","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 27.0.0 < 28","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","chokidar":"^3.5.2","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^8.0.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.4","@types/memoizee":"0.4.6","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2"},"gitHead":"25085f2edfcd1f0c4101f8cd1e7ce48ce3f731f0","readme":"# @slonik/typegen\n\n[![Node CI](https://github.com/mmkal/slonik-tools/workflows/CI/badge.svg)](https://github.com/mmkal/slonik-tools/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/mmkal/slonik-tools/branch/master/graph/badge.svg)](https://codecov.io/gh/mmkal/slonik-tools)\n\nA library that uses [slonik](https://npmjs.com/package/slonik) to generate typescript interfaces based on your sql queries.\n\n## The idea\n\nThis library gives you the type-safety of an ORM (in some cases, even more), while maintaining the flexibility of sql. Read [@gajus](https://github.com/gajus)'s excellent blog post on why it's a good idea to use sql rather than ORMs or query-builders: [Stop using Knex.js](https://medium.com/@gajus/bf410349856c).\n\nIt will make sure that return values from all your SQL queries have strict, accurate TypeScript interfaces.\n\nIt works by scanning your source code, so you don't have to spend any time manually syncing interfaces. Write queries using the `sql` tag as normal, then run the CLI to apply strong types to them automatically. The compiler will then tell you if you got something wrong.\n\nThis method avoids the [inner-platform effect](https://en.wikipedia.org/wiki/Inner-platform_effect) that tends to come with ORMs. You can rename columns, call functions, use sub-select statements, do any kinds of join you want, and the types generated will be based on the _query_, not the _table_, so you won't be limited by ORM feature-sets.\n\nSelect statements, joins, and updates/inserts/deletes using `returning` are all supported - any sql query that returns a tabular value will have an interface generated for the row type. The interface will be automatically applied to the appropriate query result.\n\n## Contents\n\n<!-- codegen:start {preset: markdownTOC, sort: package.name, minDepth: 2} -->\n- [The idea](#the-idea)\n- [Contents](#contents)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Configuration](#configuration)\n   - [Example config](#example-config)\n   - [CLI options](#cli-options)\n   - [writeTypes](#writetypes)\n      - [Controlling write destination](#controlling-write-destination)\n      - [Modifying types](#modifying-types)\n      - [Modifying source files](#modifying-source-files)\n- [Examples](#examples)\n- [Migration from v0.8.0](#migration-from-v080)\n- [SQL files](#sql-files)\n- [Usage with `@typescript-eslint`](#usage-with-typescript-eslint)\n- [Limitations](#limitations)\n- [How it works](#how-it-works)\n- [Recommendations](#recommendations)\n<!-- codegen:end -->\n\n## Installation\n\n```bash\nnpm install @slonik/typegen --save-dev\n```\n\n## Usage\n\n```bash\nnpx slonik-typegen generate\n```\n\nThe above command will generate types using sensible default values. It will look for code in a `src` directory, and create interfaces for all `sql`-tagged queries it finds - e.g.\n\n<!-- codegen:start {preset: custom, source: ./docgen.js, export: basicExample} -->\nFor a table defined with:\n\n```sql\ncreate table test_table(foo int not null, bar text);\n\ncomment on column test_table.bar is 'Look, ma! A comment from postgres!'\n```\n\nSource code before:\n\n```ts\nimport {sql, createPool} from 'slonik'\n\nexport default async () => {\n  const pool = createPool('...connection string...')\n\n  const results = await pool.query(sql`select foo, bar from test_table`)\n\n  results.rows.forEach(r => {\n    console.log(r.foo)\n    console.log(r.bar)\n  })\n}\n```\n\nSource code after:\n\n```ts\nimport {sql, createPool} from 'slonik'\n\nexport default async () => {\n  const pool = createPool('...connection string...')\n\n  const results = await pool.query(sql<queries.TestTable>`select foo, bar from test_table`)\n\n  results.rows.forEach(r => {\n    console.log(r.foo) // foo has type 'number'\n    console.log(r.bar) // bar has type 'string | null'\n  })\n}\n\nexport declare namespace queries {\n  // Generated by @slonik/typegen\n\n  /** - query: `select foo, bar from test_table` */\n  export interface TestTable {\n    /** column: `example_test.test_table.foo`, not null: `true`, regtype: `integer` */\n    foo: number\n\n    /**\n     * Look, ma! A comment from postgres!\n     *\n     * column: `example_test.test_table.bar`, regtype: `text`\n     */\n    bar: string | null\n  }\n}\n```\n<!-- codegen:end -->\n\n## Configuration\n\nThe CLI can run with zero config, but there will usually be customisations needed depending on your project's setup. By default, the CLI will look for `typegen.config.js` file in the working directory. The config file can contain the following options (all are optional):\n\n- `rootDir` - Source root that the tool will search for files in. Defaults to `src`. Can be overridden with the `--root-dir` CLI argument.\n- `glob` - Glob pattern of files to search for. Defaults to searching for `.ts` and `.sql` files, ignore `node_modules`. Can be overridden with the `--glob` CLI argument.\n- `connectionURI` - URI for connecting to psql. Defaults to `postgresql://postgres:postgres@localhost:5432/postgres`. Note that if you are using `psql` inside docker, you should make sure that the container and host port match, since this will be used both by `psql` and slonik to connect to the database.\n- `poolConfig` - Slonik database pool configuration. Will be used to create a pool which issues queries to the database as the tool is running, and will have its type parsers inspected to ensure the generated types are correct. It's important to pass in a pool confguration which is the same as the one used in your application.\n- `psqlCommand` - the CLI command for running the official postgres `psql` CLI client. Defaults to `psql`. You can test it's working, and that your postgres version supports `\\gdesc` with your connection string using: `echo 'select 123 as abc \\gdesc' | psql \"postgresql://postgres:postgres@localhost:5432/postgres\" -f -`. Note that right now this can't contain single quotes. This should also be configured to talk to the same database as the `pool` variable (and it should be a development database - don't run this tool in production!). If you are using docker compose, you can use a command like `docker-compose exec -T postgres psql`\n- `logger` - Logger object with `debug`, `info`, `warn` and `error` methods. Defaults to `console`.\n- `writeTypes` (advanced/experimental) - Control how files are written to disk. See the [writeTypes](#writetypes) section.\n\n### Example config\n\nHere's a valid example config file.\n\n```js\nconst yourAppDB = require('./lib/db')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  rootDir: 'source', // maybe you don't like using `src`\n  glob: ['{queries/**.ts,sql/**.sql}', {ignore: 'legacy-queries/**.sql'}],\n  connectionURI: 'postgresql://postgres:postgres@localhost:5432/postgres',\n  poolConfig: yourAppDB.getPool().configuration,\n}\n```\n\nNote that the `/** @type {import('@slonik/typegen').Options} */` comment is optional, but will ensure your IDE gives you type hints.\n\n### CLI options\n\nSome of the options above can be overriden by the CLI:\n\n<!-- codegen:start {preset: custom, source: ./docgen.js, export: cliHelpText} -->\n```\nusage: slonik-typegen generate [-h] [--config PATH] [--root-dir PATH]\n                               [--connection-uri URI] [--psql COMMAND]\n                               [--default-type TYPESCRIPT] [--glob PATTERN]\n                               [--since REF] [--migrate {<=0.8.0}]\n                               [--skip-check-clean] [--watch] [--lazy]\n                               \n\nGenerates a directory containing with a 'sql' tag wrapper based on found \nqueries found in source files. By default, searches 'src' for source files.\n\nOptional arguments:\n\n  -h, --help            Show this help message and exit.\n\n  --config PATH         Path to a module containing parameters to be passed \n                        to 'generate'. If specified, it will be required and \n                        the export will be used as parameters. If not \n                        specified, defaults will be used. Note: other CLI \n                        arguments will override values set in this module\n\n  --root-dir PATH       Path to the source directory containing SQL queries. \n                        Defaults to \"src\" if no value is provided\n\n  --connection-uri URI  URI for connecting to postgres. Defaults to \n                        URI for connecting to postgres. Defaults to \n\n  --psql COMMAND        psql command used to query postgres via CLI client. e.\n                        g. 'psql -h localhost -U postgres postgres' if \n                        running postgres locally, or 'docker-compose exec -T \n                        postgres psql -h localhost -U postgres postgres' if \n                        running with docker-compose. You can test this by \n                        running \"<<your_psql_command>> -c 'select 1 as a, 2 \n                        as b'\". Note that this command will be executed \n                        dynamically, so avoid using any escape characters in \n                        here.\n\n  --default-type TYPESCRIPT\n                        TypeScript fallback type for when no type is found. \n                        Most simple types (text, int etc.) are mapped to \n                        their TypeScript equivalent automatically. This \n                        should usually be 'unknown', or 'any' if you like to \n                        live dangerously.\n\n  --glob PATTERN        Glob pattern of source files to search for SQL \n                        queries in. By default searches for all ts and sql \n                        files under 'rootDir'\n\n  --since REF           Limit affected files to those which have been changed \n                        since the given git ref. Use \"--since HEAD\" for files \n                        changed since the last commit, \"--since main\" for \n                        files changed in a branch, etc.\n\n  --migrate {<=0.8.0}   Before generating types, attempt to migrate a \n                        codebase which has used a prior version of this tool\n\n  --skip-check-clean    If enabled, the tool will not check the git status to \n                        ensure changes are checked in.\n\n  --watch               Run the type checker in watch mode. Files will be run \n                        through the code generator when changed or added.\n\n  --lazy                Skip initial processing of input files. Only useful \n                        with '--watch'.\n```\n<!-- codegen:end -->\n\nThere are some more configuration options [documented in code](./src/types.ts), but these should be considered experimental, and might change without warning. You can try them out as documented below, but please start a [discussion](https://github.com/mmkal/slonik-tools/discussions) on this library's project page with some info about your use case so the API can be stabilised in a sensible way.\n\n### writeTypes\n\nThe `writeTypes` option allows you to tweak what's written to disk. Note that the usage style isn't finalised and might change in future. If you use it, please create a discussion about it in https://github.com/mmkal/slonik-tools/discussions so that your use-case doesn't get taken away unexpectedly.\n\n#### Controlling write destination\n\nBy default, interfaces for SQL queries are added to a module at the end of the typescript file they're found in. You can tell the CLI to write the interfaces to a separate file instead using `writeTypes`:\n\n```js\nconst path = require('path')\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: typegen.defaultWriteTypes({\n    queriesPathFromTS: filepath => path.join(path.dirname(filepath), '__sql__', path.basename(filepath)),\n  }),\n}\n```\n\nThe interfaces will be written to a separate file under a `__sql__` folder next to the source, and will be imported via `import * as queries from './__sql__/file-name'`.\n\n#### Modifying types\n\nYou can modify the types generated before they are written to disk by defining a custom `writeTypes` implementation.\n\nFor example, you can create [branded types](https://michalzalecki.com/nominal-typing-in-typescript) (see what this outputs in [tests](./test/branding.test.ts)):\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      query.fields.forEach(field => {\n        // add a `_brand` to all string id fields:\n        if (field.typescript === 'string' && field.column && field.column.name === '.id') {\n          field.typescript = `(${field.typescript} & { _brand: ${JSON.stringify(field.column)} })`\n        }\n      })\n    })\n\n    return typegen.defaultWriteTypes()(queries)\n  }\n}\n```\n\nOr you could mark all fields as non-null (but probably shouldn't!):\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      query.fields.forEach(field => {\n        field.nullability = 'assumed_not_null'\n      })\n    })\n\n    return typegen.defaults.defaultWriteTypes()(queries)\n  }\n}\n```\n\nOr you could be more granular. If, for example, there's a particular file with a lot of nullable types that you can't (yet) add full strict typing to:\n\n```js\nconst typegen = require('@slonik/typegen')\nconst path = require('path')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      const filesWithLegacyNullableFields = [\n        path.resolve(__dirname, 'path/to/file1.ts'),\n        path.resolve(__dirname, 'path/to/file2.ts'),\n      ]\n      if (filesWithLegacyNullableFields.includes(query.file)) {\n        query.fields.forEach(field => {\n          if (field.nullability === 'unknown') {\n            field.nullability = 'assumed_not_null'\n          }\n        })\n      }\n    })\n\n    return typegen.defaults.defaultWriteTypes()(queries)\n  }\n}\n```\n\nOr you could use a custom type for json fields:\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      query.fields.forEach(field => {\n        if (field.regtype === 'json' || field.regtype === 'jsonb') {\n          field.typescript = `import('@your-project/custom-types').YourCustomType`\n          // For more customisation, you could look up which type to use based on `field.column`.\n        }\n      })\n    })\n\n    return typegen.defaults.defaultWriteTypes()(queries)\n  }\n}\n```\n\n#### Modifying source files\n\nYou can also use `writeTypes` to define a hook that runs before writing to disk:\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: typegen.defaultWriteTypes({\n    writeFile: async (filepath, content) => {\n      content = content\n        .replace(/declare module queries/g, 'declare module some_other_naming_convention')\n        .replace(/queries\\./g, 'some_other_naming_convention.')\n      await typegen.defaults.defaultWriteFile(filepath, content)\n    },\n  })\n}\n```\n\nOr you could override the default formatter (which uses prettier, if found):\n\n```js\nconst typegen = require('@slonik/typegen')\nconst yourCustomLinter = require('@your-project/custom-linter')\nconst fs = require('fs')\nconst path = require('path')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: typegen.defaults.defaultWriteTypes({\n    writeFile: async (filepath, content) => {\n      content = await yourCustomLinter.fix(filepath, content)\n      await fs.promises.mkdir(path.dirname(filepath), {recursive: true}) // since you're not using the built-in `writeFile` you should explicitly call mkdir with {recursive: true}\n      await fs.promises.writeFile(filepath, content)\n    },\n  })\n}\n```\n\n## Examples\n\n[The tests](./test) and [corresponding fixtures](./test/fixtures) are a good starting point to see what the code-generator will do.\n\n## Migration from v0.8.0\n\nVersion 0.8.0 and below of this library used a different style of code-generation. It had several drawbacks - it was a runtime dependency, and required queries to be actually run before types could be inferred. It also created a global repository of types, meaning two queries in separate locations which shared a name could clash with each other. It also required changing the way your code was written.\n\nConceptually, this library now does more work so you don't have to worry about it so much. Just write slonik code/queries as normal, and then run the CLI to add types to them. If you add a new column to any query, run it again to update the interfaces.\n\nIf you previously used the old version of the tool, you can run it once with the  `--migrate v0.8.0` CLI argument to automatically attempt to codemod your project. Note that this will, by default, check that your git status is clean before running since it modifies code in place. The codemod isn't advanced enough to find all usages of the old API, so have a look through what it does after running it to make sure the changes look OK. If they aren't, reset the git changes and either apply them manually and/or pass in a different `glob` value to avoid files that were incorrectly modified.\n\n## SQL files\n\nThe tool will also search for `.sql` files, and generate some typescript helpers for running the queries contained in them. Any parameters (`$1`, `$2` etc.) will also be strongly typed, and become required inputs for running the query. See the [SQL file fixtures](./test/sql.test.ts) for some examples, and [the generated SQL usage test to see how it can be used](./test/sql-usage.test.ts).\n\n## Usage with `@typescript-eslint`\n\nThe default ruleset for [`@typescript-eslint/eslint-plugin`](https://npmjs.com/package/@typescript-eslint/eslint-plugin) prevents usage of [typescript namespaces](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/docs/rules/no-namespace.md). To avoid lint errors for inline type declarations (which are perfectly valid!), add this to your eslint config:\n\n```\n\"@typescript-eslint/no-namespace\": [\"warn\", {\"allowDeclarations\": true}],\n```\n\n## Limitations\n\nSome dynamically-generated queries will not receive a type. One example is any query where the template express parameters are identifiers rather than values, e.g.\n\n```ts\nimport {sql} from 'slonik'\n\nconst tableName = Math.random() < 0.5 ? 'foo' : 'bar'\n\nexport default sql`select * from ${sql.identifier([tableName])}`\n```\n\nIn the above example, no type can be inferred because it's impossible to know whether the query will return values from table `foo` or `bar`.\n\n___\n\nQueries with multiple statements will also not receive a type:\n\n```ts\nimport {sql} from 'slonik'\n\nsql`\n  insert into foo(a, b) values (1, 2);\n  insert into foo(a, b) values (3, 4);\n`\n```\n\nThis kind of query does not return a value when executed anyway.\n\n___\n\nQueries using the `pg_temp` schema will usually not be typeable since the schema is ephemeral and only can be queried within a single session that `psql` doesn't have access to.\n\n```ts\nimport {sql} from 'slonik'\n\nsql`select * from pg_temp.my_temp_table`\n```\n\n___\n\nInvalid SQL syntax will also be left untouched (they will result in an error being logged when running the CLI):\n\n```ts\nimport {sql} from 'slonik'\n\nsql`this is not even valid SQL!`\n```\n\nIf you see errors being logged for SQL that you think is valid, feel free to [raise an issue](https://github.com/mmkal/slonik-tools/issues/new). In the meantime, you can create a variable `const _sql = sql` and use the `_sql` tag in the same way as `sql`. `_sql` will not be detected by the tool and can be used as normal.\n\n___\n\nCustom interceptors. Some interceptors, such as [slonik-interceptor-field-name-transformation](https://npmjs.com/package/slonik-interceptor-field-name-transformation) change the runtime shape of query results. You could try to match its behaviour with a custom `writeTypes` implementation, but it's recommended to just not using the interceptor in the first place. All it does is transform from snake-case to camel-case.\n\n___\n\nFinally, for some complex queries, static parsing might fail, making it not possible to determine statically if a column is nullable. If this happens, it will still receive a valid type, but the type will be `string | null` rather than `string`.\n\nIf you find such a case, please [raise an issue](https://github.com/mmkal/slonik-tools/issues/new) to see if it's possible to handle - under the hood this library uses [pgsql-ast-parser](https://npmjs.com/package/pgsql-ast-parser) and you might have found an edge case which that library doesn't handle yet.\n\n## How it works\n\nWhen you run `slonik-typegen generate`, the tool will scan your source files, and traverse their ASTs using the TypeScript compiler API. Note that typescript is a peer dependency for this reason.\n\nOn finding [a](https://oracle-base.com/blog/2015/01/02/a-sql-or-an-sql/#:~:text=According%20to%20the%20Oracle%20docs,%2Dlevel%20declarative%20computer%20language%E2%80%A6%E2%80%9D) sql query, it will issue a `psql` command using the [flag `\\gdesc`](https://www.postgresql.org/docs/11/app-psql.html), which responds with a table of the columns and their corresponding types contained in the query. The query itself is never actually run.\n\nThe postgres type is then converted into typescript using an in-built mapping. Any slonik `typeParsers` configured (see [slonik docs](https://github.com/gajus/slonik/#api) for more info) are inspected to infer the type of the value that will be returned by the query.\n\nTo determine whether query columns are nullable, the query is parsed using [pgsql-ast-parser](https://npmjs.com/package/pgsql-ast-parser). Some more queries are sent to postgres to figure out whether query column can be null - in general, postgres is only able to guarantee if a query column is null if it comes directly from a table which declares that column non-null too.\n\n## Recommendations\n\n1. Check in the types to source control. They're generated code, but it makes it much easier to track what was happened when a query was update, and see those changes over time.\n1. After running CI, it's worth making sure that there are no working copy changes. For git, you can use `git diff --exit-code`:\n\n```sh\nnpx slonik-typegen generate\ngit diff --exit-code\n```\n","readmeFilename":"readme.md","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.11.4-feature-improve-log-output-2022-03-31-07-11-56.6","_nodeVersion":"14.17.0","_npmVersion":"lerna/4.0.0/node@v14.17.0+x64 (darwin)","dist":{"integrity":"sha512-zCLqDgNG9JwsoHrxVT+Pp3ZmT5ifpn1WE+7Wmd05QNdUAnOybqLDOVZMov5dUf/W4CIBY0KsXSKparH46vyS2w==","shasum":"db1c6d54e582a930cc1f9b7eddd61caf4f259d63","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.11.4-feature-improve-log-output-2022-03-31-07-11-56.6.tgz","fileCount":104,"unpackedSize":219410,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGnEKJGwYitC1nYgp0Di9fG15s2X2eOFOxkgB8ZpxOFVAiEAhQwnXQC2PLM/1eT6c9cb/KpRRnCLS/ic0+/HtfErnf0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRYygACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNSg//T05yAtarHHid9Gz0NpnX3W2u5pcG/VdvWji8mzbMH+nPtAYG\r\nUETglIwupH107uwOVc5HB9g28ZFxbzf5kuZKbZkJX196dLR93+Mn+u+Iu5Q/\r\nN9+PzKgKQK7hQcOFDOnrUMw3oKIXAOi/k30BFiUcoI9/06kgu8qWNjfQYOpL\r\nY+y7snbXjKH4g3kpWH+9at6PQIIFvxMCZLncg5ojShQR5dqasA5fNP7le6xZ\r\nLmnGS5B9wFw1PGVfX3cWq4fgnodyUBDk7vpbU5ZBUb9kDlmgfz4oKt9VX37u\r\nA/tdvm3AzJ+XR0w3tmAuVTIfkgKlYf/7P+06twmd6Imze0l+4z2wHQWR1pXt\r\n5cLHGFePXBmvsv7AlvdAM1dymRv0p5VFX1+qQoe7Bq9HJFe5clMp0qcDVIil\r\nJFqhjgkZb/w7q5WbIgi41L7iIFNamsGxlwGG6BT3SzclRIpJD7Jz99BrNu2u\r\nqM31LE2yXZc8G7UnXpkwv6ufeGJQ1KqNHSw6grATiZozlDvy9nrKwg8kR9oW\r\nVxsJI8P5Zen9jX/1pwDzH7C7/EE1YXmUpGhwYhqJCx7X4bJctE7S/HPA7D7p\r\nsrAugqBFX+08grgK7cwH24HWEMkrhhXR08+IkPDOcOEN2/NCOvNTpZ76M1ua\r\npg3ESAXHHsbfu0MMB/8Dyqhjm8mkJEF+XtM=\r\n=r7Xw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.11.4-feature-improve-log-output-2022-03-31-07-11-56.6_1648725152360_0.08593404155823015"},"_hasShrinkwrap":false},"0.12.0":{"name":"@slonik/typegen","version":"0.12.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 27.0.0 < 28","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.7.8","chokidar":"^3.5.2","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.1.7","io-ts-extra":"^0.11.4","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^8.0.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.1.4","@types/memoizee":"0.4.6","@types/pluralize":"0.0.29","fs-syncer":"0.3.4-next.2"},"gitHead":"5ef04824e7d169bf58b9d714f5c69dd94df6cbe8","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.12.0","_nodeVersion":"12.22.11","_npmVersion":"lerna/4.0.0/node@v12.22.11+x64 (linux)","dist":{"integrity":"sha512-oRnbpPJhLpY/9dWDiyfORkjTr5M0c26o5O05EBw+M9VhCMmjP4SjBjbe3ueviE/eINhY2cPwXIiXOoXEehaSuw==","shasum":"124e3ad6719c4e2f366836b643b93a0e93f486fa","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.12.0.tgz","fileCount":104,"unpackedSize":223815,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDetKkJ/CCTX/RvCjoRsfUxrU786Lf+d3osPOGe73WpFwIhAPKC3AVDbiCeXaOCuqDvgtypTpzn/qNAwnkiAwiiLGQ7"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTtzrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoVLg/9E41uwX6dA3Z64BvXubBu7j2PzP6zBdLc7F5Z03EOdfgl3kbD\r\nGuQgGcjbSjj99Bo3XhBHkM+//NwdG5CtYkXdDDzdrCtU2M+VJpc2ukYGNUrz\r\nxovCM2CtWhSfIj/XaYQPdcz1mnqr7xQMM8YJghoN3m8dxAe+xH9VcDrL8vJk\r\nmaiUcziyo2o1Ytqv7iQ1Cu31IjEJh3i+00Gt52mU0OZDSVbukW7jHH98byE9\r\nMaCaLqNnwCGh/Gcj8vxZZgcg/uPcMbKg4UNxDa01QUe/ng1sKpjFTTET4s8Q\r\nODnzMu2x1bfvHI3zqp5bfKcSvZ7UbIcNvDR620apyHP/Dr4KPg6yWFtkvE9e\r\ndDjP5yKIMavG+zklLtGpioRUV7fB++ooFZwaUTjwIgkb75dcm6hHXz7o3ciJ\r\n2iefJPD7GNW+7zaR6WoWjwC6L1X6VL9XAjR/UsUzzVtgrGJ7xWRDT9mhdmJr\r\n+QPGtaCUjwQq/tLdCR/lo4gCAfQEfDY8pAOW58s2F3Jm07xd3PHIwmjNh0pO\r\n2BKOfP/CYA5lW8GVM2SMgKjG8CrOVpwBCXtr1Ko1jlGZ2lPZJPE7fTJW2lJA\r\n+EQk7FDDpenKjcc6eudCBBEF2i5bSB7AMNWpYbqs/6Y50MGpwT9GXLqe/LPY\r\nGJxhVSTMK2dtwxV8Sc/FLLrW0ruTRQLg7n8=\r\n=Dq+Y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.12.0_1649335530832_0.1268953432789186"},"_hasShrinkwrap":false},"0.12.1":{"name":"@slonik/typegen","version":"0.12.1","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 27.0.0 < 28","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.10.8","chokidar":"^3.5.3","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.2.0","io-ts-extra":"^0.11.6","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^10.0.2","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.2.0","@types/memoizee":"0.4.7","@types/pluralize":"0.0.29","fs-syncer":"0.4.0"},"gitHead":"33fefd4fe8a445d6511460075a0583638c89b331","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.12.1","_nodeVersion":"12.22.11","_npmVersion":"lerna/4.0.0/node@v12.22.11+x64 (linux)","dist":{"integrity":"sha512-0HAqmHgf0c2gWpzlCGNCbWUJtz3F1ivz01Egw0AP7XLeou373NYco/2GY00qjKBIjJhBCF92ekZrm6nAtoPFNw==","shasum":"86a6eb51e372171de8aea8881d0d2e6250ca4855","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.12.1.tgz","fileCount":104,"unpackedSize":224078,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv5lBZZcjoRIAhX5tnr+irDK1DbnGwoLIT0aDnmgKOuwIgXsSIPyIY1XIsINmoSo9Lf8T9U+s0J5OGunHME2dN5C8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVAnaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZBhAAhOFXtYHYHWrReeMIcWkW+/ZOQcrC/ZuTBNXDY485POahDsdM\r\nRAz0/Hw403oMxGH7g7sBEQUhJRMRcQcjuuZEYb2dPPK9t4TvpzikPu1yctwN\r\nXB2QXfZJIWV6wh5iDPKzfSEOTbyZIXzGVraar1MXKur1olvyqrfNLhS893Gf\r\nN/NZHKMUwW57ufTebqg4A36znlaeKPNAUkPMWqYdFo1WDhYLvM0bCtKi80gS\r\nAFhD1TsaX4VYyncn2ZRj/4x5ivjQjKyzbptAeMXaCwW3A2WK0WA9wVlgP9Xm\r\nt7RHt+FbfJ0n5f54TNA8pW74Q+0LfVvOJpaLRFyQmvv1ZWc4cxuP1xShDEnN\r\n5grih6ZdbdBF76e9iM8DpgScsGIMtS4KG32s8o0+d4uijc5vKXx5RnDtQemz\r\nCJ2/wMMPdw+B52ci+5D3vSbtTfPpJOWEUMfFtnFZGuVofbq86m4/JmblNQh6\r\ncMCFFSfjAmRnbdRl/95Obb+CKcdxqeJUNRaQsfHkmxWQVFk8iwxriX+/ls12\r\n3Ce3wt+EWSgpE5JXN7x5oynaC7JvL8uDIDnCDLTkaVtTolz4N2BuyiTudKQe\r\n/B5YLFL8440qhpQVvhhWLyb+Tm8ejlPDG7AI0DB4iAkjEYXzjV6hRvdOMDG1\r\nash5GrHwkrLAYPdiWUzLYsFwuNpliW+L6NE=\r\n=HZqH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.12.1_1649674714080_0.700587221713143"},"_hasShrinkwrap":false},"0.12.2":{"name":"@slonik/typegen","version":"0.12.2","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 27.0.0 < 29","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.10.8","chokidar":"^3.5.3","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.2.0","io-ts-extra":"^0.11.6","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^10.0.2","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.2.0","@types/memoizee":"0.4.7","@types/pluralize":"0.0.29","fs-syncer":"0.4.0"},"gitHead":"86feef742e7a4926d1986a3b5df0f2acc8402e28","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.12.2","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-1i1Juuzz8T8o7iltuWruDzRo0BparlBmt1M0rWVb0PPSci3xp8iNVvgV+5y+WW5badChZU7PDK9fG3GvEWQKNg==","shasum":"c219ce2526f50deff2a2b084085c59e27adb1932","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.12.2.tgz","fileCount":104,"unpackedSize":227664,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAyNAFfJLmMinODgRkXsJCwpEXWEfR8uOW6LYAoHqeX9AiBZwL6W3akCaaaHzmD0LsElbXMAtiR229w0F4Jt4PS1CA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWBSpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrS6A//ZKNJ5wtCdysqi/bWJ0RWrj+TtCzTNo7D7RkuVOEufZS9gMWW\r\nzhxqx6kpKnBG4RouJ+i0toEQHn3i4BJVNm6S5FddRmZRTnNCKTwtN3e0y94o\r\nA6GWsplZ5VzLjrqLJxrh4QR7GieTPnndn3CPMQw5sqIPP3Y6Ghr/OF/2utpG\r\nTeMUes4OFqd6mfr4uuhXlCEJBg9nA+T6u0YqYdxClvcyYSDNBD0AmdSE6I6o\r\nydRVyKDDhOWSjto0tNcmC+RYOdlseKteN6Sctx02FPL/cIyyOTol90fvp0Xx\r\npZRbY+rt4Tz0K6hKzrR4wydvyJ/Sdh6J+bH5EZ3ODh9l362/pXgF8OCFPSly\r\nuT6h0H+pxaSGq7MOerW+euNWr/teCxd2KM2BlEu2pdbfCEb91kLhgyo27DPd\r\nxwLby0hO9uTXW1jdpsS3klgq5bRJkVfojl8jC8vicqopuy1iXReDGy+nqxSC\r\nEnnnnKOUF57jBNbOmMrZbOc/9y6IHAc/46n6tcs5Yys00CE4So7kOdBSIUZo\r\nT41QGigk5Ard5ZTqpUG5XEOWdRrc6rjb+Eo7E7UTpLAxba4pQDhznIwjpc2u\r\n2Vot+9neTjX93IVKKGExxdQpjesG2ruqIqW2192g0pK0EcJo4J962Ti8X1eX\r\nAM940Me7uOQ3W4f+Wm0Dos+Pg3Qsx6g07iM=\r\n=6cJ2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.12.2_1649939625268_0.038217358373749954"},"_hasShrinkwrap":false},"0.13.0":{"name":"@slonik/typegen","version":"0.13.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 27.0.0 < 29","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.10.8","chokidar":"^3.5.3","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.2.0","io-ts-extra":"^0.11.6","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^10.0.2","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.2.0","@types/memoizee":"0.4.7","@types/pluralize":"0.0.29","fs-syncer":"0.4.0"},"gitHead":"ecd6f486d645b662f403315b458b5e419f60ac38","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.13.0","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-TgqteXUeFLW2voWEyVEGwYWv86ibI3KTpgrrlzWtoPeTWjbnvmPZ+V9osFHfhUf+3qhL1mGwDWbQ51qXibo44g==","shasum":"c81ae1c0b6e21ae3ee97cef189ed62fdbee196de","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.13.0.tgz","fileCount":104,"unpackedSize":229912,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAq1IBZmxwhKtEaltt6/n/2y2LdMdr61hjME1rE/O9OVAiEAqGddrZA2BltQ2699O/2DRYEd9Fk6T24KLCm1oE+dOj8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWtQmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMDQ//UndDCg0tW0VxMS31JR0oCF62YuO05SSbuVqP3xNXOJGMaqip\r\nTZLyCSNnzAHEMWaILUq6jfPnLtSAUkQrxddwZ1ssLNC1EJzb+uoRka4yfsud\r\nqgtC5FY3FSoMJ67tPgco81HxQfSEEJPPOCiwqA0i72b/L6/KX1zr3hh1o5hp\r\nBLp4bfN58Qw2FPsTZn6h41PIdzKNJm+eBJotFD8Phsxh0U9os2iI6+cI/wg+\r\noCH67GapN0lmOLRXzR2odqvRaBbGYJ1DU/hLogtIylLWb3phlJI4d2KFMXYc\r\n+u39uLk2BQ3//iksi1kkaASO02/8OGz8FP+n/7Di7yImiYEB+kUCUsG+JcSh\r\nLznhKI7EiiosiMHVPR1E6nyx3I0IqQAeQA8qmIrux+L4nJrt7A4yJPMke1Ux\r\nVUps48uQC6xi9/5q0L6R52H09FBt8tYZjWY6dYxSO2QrGhc2PxLKAAySaN4K\r\ndGFkZWCXgTnLe3m0gzgMJCM/6kT4rzPveMDcvCggujI0V9JiFk83xL5GjVSE\r\nYZr4N6RmdszHAsBR/uj10DKsg29tBfJmd3JijiwqXd0y1J1jHVseRZgVqrwi\r\nmf5dkR6MAk0ZmmunfMvx/vqxX5OB1/ghsIPuOXaO10a9uqgc9nwkQE6485NG\r\ni34Q+gszsIQPNQmHmY2FGYmmNJoyJ9+OifQ=\r\n=1s9w\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.13.0_1650119718389_0.6903149549033505"},"_hasShrinkwrap":false},"0.14.0":{"name":"@slonik/typegen","version":"0.14.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 27.0.0 < 29","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.10.8","chokidar":"^3.5.3","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.2.0","io-ts-extra":"^0.11.6","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^10.0.2","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.2.0","@types/memoizee":"0.4.7","@types/pluralize":"0.0.29","fs-syncer":"0.4.0"},"gitHead":"f761e933bb35a68ead9bf97714b4ae95bf7965db","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.14.0","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-y02SaEJ13lkPHCpl9KXq5gMWMOxtq5aSPBq+g274O+gCj1/O8RPRTYjrsAqlf8nHBGBmPGkqIMWbP6tVM1I6hQ==","shasum":"9d2eadd72e200273be1de8324823564050f644a6","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.14.0.tgz","fileCount":104,"unpackedSize":233580,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHsN0PU4vNF+mbQdw32yDXY0LM+YDNsHzr2LBroDnk0qAiEA0Fr4oMDRUD8iRGyl1gTdQn/ptjuUPJEPhORASSRP7o4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJif7cGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrjtg//Z6mnKmhA7h1pafW4Atal4Xcqc9EXHsqAVWcwoylps+PANOAu\r\n4ChKoXX+ND/vLGvQnKoW0B+Z+tkCiiMzJ3x6Lr/WiIFVZb+LYmG4mxveAqhZ\r\nlQHwIprHsAQtv2yrVX/Rqgm9SExLCNZyioxWhgrl83cgVobpdzz31mui60bI\r\nFoHFOCUv8yB8Zhw/0wFjqr2g3qN69Eh65LgKXMtI786hGtP6DZBh1GoUQ0//\r\nsxQDsl2j/6Q/mg8Eh1pZlDalG6Bo+MKtJUTKu0Yb4fmqSOWHNSpkrjhbhu6x\r\n5BY/Aa/DNEAxyF5Z76C6fChjxNOMPfzikedJrfEPBvP1E1SpHDvGCtI4g+Hl\r\n4E0xAXYTTmA6DZI8KF9kl3daI3ONO4vp61jQm1GvG/GWyvu9bBBTjE0+FRLa\r\nOVFYDjAxfcBKNCiGdhmmJyIRiEQf7jjjSMA3qoxabquQJQlx223kodib1yi6\r\nZeYbJ7xH1pkRHIE3zNLqc7lO50lcxKXt6exGZTc8OyrtYqiDVlk9BquTqPb9\r\n2PPZvQ27SqWxO9aYTrZhEBoMnMl/hdOh36QW1xBBk5OknVk8p6K5DVKj0iAw\r\nUZyOXeofJWdfkHLhtITb/Y5IXW0I1UNLQF3HeYKK7QPgiz7XTi78JPjuAJ+G\r\ndIeKW+vYprcOefNeQoveJ50C1j0FP03lo/k=\r\n=vJjL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.14.0_1652537094383_0.20884640838256452"},"_hasShrinkwrap":false},"0.14.1":{"name":"@slonik/typegen","version":"0.14.1","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":">= 27.0.0 < 29","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.10.8","chokidar":"^3.5.3","execa":"^5.0.0","find-up":"^5.0.0","glob":"^7.2.0","io-ts-extra":"^0.11.6","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^10.0.2","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.2.0","@types/memoizee":"0.4.7","@types/pluralize":"0.0.29","fs-syncer":"0.4.0"},"gitHead":"b192f97fcf2cedd6b6c871e2d8135c356ec2c607","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.14.1","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-NBoHF70hvlos5WbTsGwXm5CW9o90L7thFcmInh8e+z33MdAhlExvdAMDu/Egu3b9LUO0rcALPNfoRlSELRvBIw==","shasum":"3c89f09b55a83dfb228681bbb4698181182ab280","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.14.1.tgz","fileCount":104,"unpackedSize":233765,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJTnlWjfRswuVg+ms2I9a9SRuBgusV0GYwyEiwiJeeZAiBSmH/cxI8Xz3RWG6J5x+O58+RFqK1h+3uAHP5iV+WGTQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijE26ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr85w//a90zjgojv7t2Gh5T9hRiZAdTndJvRRgkV2S84dwuPwM+Imf8\r\n64hW7UYuHhUxd2d7gnLaBZCOGS3zXjh/SOTLyfZSOu+KmmxBz6i1PCZhREX1\r\n9//IZBwNPmXhBNWQ/i1x2+259ZsXUPVTxc05x8ao1nxPZeT6036AFSTj0PhH\r\nrjJ7I425BMTFOkZ2K3Pf+3qWTD8hzpeBNaoRXnC6pRvCHeJS3rKhDWsoLvBP\r\nHYoBuuLuo81hJ/3g72VUtGfYlYY25OVlPpfSPc8SlWEPqEk0/CyIx5w7E0As\r\ne6Q3i+emiuMjIk1onmaj/UAljQEs1fbJvw0ioKKjSmfkbNahancTsjQVPTaC\r\nzwKq2ghbqcXKrxp+pJSnoDo4WRTUeqAN2rL58ZOlcKB9v7XH57I47URX84X1\r\nHxiZGxEEvrpUsCRqAf2UfvqE0keXaHA3LOAV1owaZSCQYKM6xgMxD94JwjTE\r\nZXONL0BzTu2FDc9lY5WoMtrw0zE+Rk2sK4l6lt4zRpxyokZ7PjhuR6hAQjcr\r\nEX7c/kLoKKxdZegucCukWlMDo7vA5F8er9vQLlUhU8MWTrz0eyt05igbdOVt\r\n5XSbO1Fly44R+qFavv23VLOUoE71UZTv82CKZd60z5dlaJBQRV3Ddy5MV1Bj\r\nIlgCsQDxMu0KlqQ/bEKzYqkJb/TPronr08I=\r\n=Tc6c\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.14.1_1653362106256_0.6603086929533828"},"_hasShrinkwrap":false},"0.14.2":{"name":"@slonik/typegen","version":"0.14.2","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":"27 - 29","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.11.0","chokidar":"^3.5.3","execa":"^5.0.0","find-up":"^5.0.0","glob":"^8.0.3","io-ts-extra":"^0.11.6","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^10.3.1","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.2.0","@types/memoizee":"0.4.8","@types/pluralize":"0.0.29","fs-syncer":"0.4.0"},"gitHead":"dfc033ec64a28add38db82c499f8b42de682aded","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.14.2","_nodeVersion":"12.22.12","_npmVersion":"lerna/4.0.0/node@v12.22.12+x64 (linux)","dist":{"integrity":"sha512-IQL7r+d/A22ntGW37X1O36nHOo8kT55vNlJtIxOB0UETcn29hBsN6I9/VbLp97SM3SXNj03EHVPlTi9wr3qQuQ==","shasum":"5b0fe4cefee3bee751b0d9f63a0fc290b7cada99","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.14.2.tgz","fileCount":104,"unpackedSize":235344,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxMc2Du9FxbYo6O2uIkNojHHKPoKqPj7/YQpwXCaR0BQIgPkaS/0AIKouVrDeOu8gvW1G5nIGpj1hrPctJsMVOpE0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8fuUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6Lg//XmSTo8vsaOEjnDbZvN0c3ZAzkBMWjQoDh/ILlvftOaaGjP1w\r\njGll5lcZ1SzvFgJCucXyAY+NYc22cv6dJzkuj0229m55kTKJgTB7+pucmYBL\r\nuMCKCIGNr8Ixpx3GRLwaU9KF7HSLQjv2m9QNNwM3bmcIad+72FcB1YI79ixY\r\nPjsiA9yujznbwvxDLCLeND1LiFCpn9jPn2fm1r2cXXXDvfue55Bb+VUr4E2T\r\n8Zc1iK7skqTimF3ZAmHIXxetispMQ+C9EEEzvqBAm2xY3Dj+vtYgczDrwB7m\r\na4adX7hcD/qIHvC8+moPeUbarDKfYg7ZaX7nBjrp0dWbpXIuGWrh1wDbJdOO\r\nWLzWEdynuZtFtJ7P/CQLYSkNPTLu7TOPWTMz2mqo53YLg9VHqSA539y4gQcy\r\nZ/L10il+QFwXaBcaGSJCi20QGc1NgIOUTnoKlYXeQWpxYemkXIrHaAmRkgYH\r\noq3gVDc1VpT1SaNDXbryNcup2vYvd9OYvkVgSlyGrl0ko3+jreE4TxiNylv2\r\nYNCDzeLHg/SzfSNO5b3a8ilHz74rtdXJ4j2DRdGJt9dbiU2Yvf7b6hyMOev9\r\nafYiSsBIcVKFE5QGIRt2Uw0EbWeRSg2/QxRPkB1M6eSzO0NGV0F8SY0Df+sE\r\n/xEKV/SZTiAqcjhIryJIvrl0Ux/Ce8NvPTc=\r\n=jHkL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.14.2_1660025748088_0.05212886311229625"},"_hasShrinkwrap":false},"0.15.0":{"name":"@slonik/typegen","version":"0.15.0","description":"Automatically generates typescript types from slonik queries","main":"dist/index.js","types":"dist/index.d.ts","bin":{"slonik-typegen":"cli.js"},"scripts":{"build":"tsc -p .","dogfood":"node dist/cli generate --psql \"docker-compose exec -T postgres psql\" --connection-uri \"postgresql://postgres:postgres@localhost:5433/postgres\""},"author":{"name":"mmkal"},"homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"license":"ISC","peerDependencies":{"slonik":"27 - 29","typescript":"*"},"dependencies":{"@rushstack/ts-command-line":"^4.11.0","chokidar":"^3.5.3","execa":"^5.0.0","find-up":"^5.0.0","glob":"^8.0.3","io-ts-extra":"^0.11.6","lodash":"^4.17.21","memoizee":"^0.4.15","pgsql-ast-parser":"^11.1.0","pluralize":"^8.0.0"},"devDependencies":{"@types/glob":"7.2.0","@types/memoizee":"0.4.8","@types/pluralize":"0.0.29","fs-syncer":"0.4.0"},"gitHead":"1541e7585185e96e4ee99c0ebea195a208b73f96","bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"_id":"@slonik/typegen@0.15.0","_nodeVersion":"18.15.0","_npmVersion":"lerna/7.1.1/node@v18.15.0+arm64 (darwin)","dist":{"integrity":"sha512-caRjpQVl9dQNywUDHsf6VcjBKCQ77ysLg75iDMnBsj7b51Gj2tjGxIAB4lBAFlUFtuxw/X9jAgYbtnzQLUeezQ==","shasum":"687e0238b5538c0a35a50d9de770581a5bf73196","tarball":"https://registry.npmjs.org/@slonik/typegen/-/typegen-0.15.0.tgz","fileCount":108,"unpackedSize":237549,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXW4ZpGRWRXE8CShG0g2+67fwOaJCNM+5oJla0yowXrAIhAMteHZCWCjSDhnBddFaN6mb+XnXn2XKAMJ3YYzRjrHm+"}]},"_npmUser":{"name":"mmkale","email":"mmkal1@outlook.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"},{"name":"mmkale","email":"mmkal1@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typegen_0.15.0_1688590522333_0.7883140930866785"},"_hasShrinkwrap":false}},"time":{"created":"2019-06-15T03:46:28.351Z","0.0.1":"2019-06-15T03:46:28.671Z","modified":"2024-05-07T00:31:06.199Z","0.0.2":"2019-06-18T03:29:41.562Z","0.1.0":"2019-06-21T03:19:15.099Z","0.1.1":"2019-06-22T17:29:36.131Z","0.1.2":"2019-06-29T22:33:09.616Z","0.1.3":"2019-06-30T23:18:57.437Z","0.1.4":"2019-07-19T22:56:38.702Z","0.1.5":"2019-07-20T19:26:39.018Z","0.1.6":"2019-07-20T19:48:48.733Z","0.1.7":"2019-07-20T21:07:49.171Z","0.2.0":"2019-07-21T14:41:00.066Z","0.2.1":"2019-07-21T16:54:28.572Z","0.3.0":"2019-12-24T12:48:43.509Z","0.3.1":"2020-01-26T05:22:13.640Z","0.4.0":"2020-03-23T22:55:52.166Z","0.5.0":"2020-03-23T23:00:44.562Z","0.3.2-transform-properties.4":"2020-03-28T18:17:32.354Z","0.6.0":"2020-04-06T02:17:57.199Z","0.6.1":"2020-10-12T15:53:13.902Z","0.6.2":"2020-10-12T16:04:44.526Z","0.7.0":"2020-10-12T23:41:13.106Z","0.8.0":"2020-10-30T17:18:09.743Z","0.9.0-next.1":"2021-01-11T03:25:27.983Z","0.8.1":"2021-06-25T12:03:19.973Z","0.9.0":"2021-06-25T14:55:09.215Z","0.9.1":"2021-06-26T03:05:32.404Z","0.9.2":"2021-06-26T21:10:45.072Z","0.9.3":"2021-06-29T10:07:43.134Z","0.9.4":"2021-06-29T18:05:35.332Z","0.9.5":"2021-06-29T19:43:40.623Z","0.10.0":"2021-07-04T23:24:35.451Z","0.11.0":"2021-07-15T13:06:46.525Z","0.11.1":"2021-12-08T18:05:38.502Z","0.11.2":"2022-02-05T10:52:26.089Z","0.11.3":"2022-02-21T21:47:14.047Z","0.11.4-featureinterpret-coalesce-2022-03-22-16-48-05.6":"2022-03-22T16:48:17.651Z","0.11.4-feature-improve-log-output-2022-03-31-07-11-56.6":"2022-03-31T11:12:32.520Z","0.12.0":"2022-04-07T12:45:30.989Z","0.12.1":"2022-04-11T10:58:34.239Z","0.12.2":"2022-04-14T12:33:45.422Z","0.13.0":"2022-04-16T14:35:18.601Z","0.14.0":"2022-05-14T14:04:54.590Z","0.14.1":"2022-05-24T03:15:06.447Z","0.14.2":"2022-08-09T06:15:48.262Z","0.15.0":"2023-07-05T20:55:22.540Z"},"maintainers":[{"email":"gajus@gajus.com","name":"gajus"}],"description":"Automatically generates typescript types from slonik queries","homepage":"https://github.com/mmkal/slonik-tools/tree/master/packages/typegen#readme","repository":{"type":"git","url":"git+https://github.com/mmkal/slonik-tools.git"},"author":{"name":"mmkal"},"bugs":{"url":"https://github.com/mmkal/slonik-tools/issues"},"license":"ISC","readme":"# @slonik/typegen\n\n[![Node CI](https://github.com/mmkal/slonik-tools/workflows/CI/badge.svg)](https://github.com/mmkal/slonik-tools/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/mmkal/slonik-tools/branch/master/graph/badge.svg)](https://codecov.io/gh/mmkal/slonik-tools)\n\nA library that uses [slonik](https://npmjs.com/package/slonik) to generate typescript interfaces based on your sql queries.\n\n## The idea\n\nThis library gives you the type-safety of an ORM (in some cases, even more), while maintaining the flexibility of sql. Read [@gajus](https://github.com/gajus)'s excellent blog post on why it's a good idea to use sql rather than ORMs or query-builders: [Stop using Knex.js](https://medium.com/@gajus/bf410349856c).\n\nIt will make sure that return values from all your SQL queries have strict, accurate TypeScript interfaces.\n\nIt works by scanning your source code, so you don't have to spend any time manually syncing interfaces. Write queries using the `sql` tag as normal, then run the CLI to apply strong types to them automatically. The compiler will then tell you if you got something wrong.\n\nThis method avoids the [inner-platform effect](https://en.wikipedia.org/wiki/Inner-platform_effect) that tends to come with ORMs. You can rename columns, call functions, use sub-select statements, do any kinds of join you want, and the types generated will be based on the _query_, not the _table_, so you won't be limited by ORM feature-sets.\n\nSelect statements, joins, and updates/inserts/deletes using `returning` are all supported - any sql query that returns a tabular value will have an interface generated for the row type. The interface will be automatically applied to the appropriate query result.\n\n## Contents\n\n<!-- codegen:start {preset: markdownTOC, sort: package.name, minDepth: 2} -->\n- [The idea](#the-idea)\n- [Contents](#contents)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Configuration](#configuration)\n      - [Complex config types](#complex-config-types)\n      - [Testing `psqlCommand`](#testing-psqlcommand)\n   - [Example config](#example-config)\n   - [Advanced Configuration](#advanced-configuration)\n      - [Controlling write destination](#controlling-write-destination)\n      - [Modifying types](#modifying-types)\n      - [Modifying source files](#modifying-source-files)\n- [Enhancing Return Types](#enhancing-return-types)\n- [Ignoring Queries](#ignoring-queries)\n- [Examples](#examples)\n- [Migration from v0.8.0](#migration-from-v080)\n- [SQL files](#sql-files)\n- [Usage with `@typescript-eslint`](#usage-with-typescript-eslint)\n- [Limitations](#limitations)\n- [How it works](#how-it-works)\n- [Recommendations](#recommendations)\n<!-- codegen:end -->\n\n## Installation\n\n```bash\nnpm install @slonik/typegen --save-dev\n```\n\n## Usage\n\n```bash\nnpx slonik-typegen generate\n```\n\nThe above command will generate types using sensible default values. It will look for code in a `src` directory, and create interfaces for all `sql`-tagged queries it finds - e.g.\n\n<!-- codegen:start {preset: custom, source: ./docgen.js, export: basicExample} -->\nFor a table defined with:\n\n```sql\ncreate table test_table(foo int not null, bar text);\n\ncomment on column test_table.bar is 'Look, ma! A comment from postgres!'\n```\n\nSource code before:\n\n```ts\nimport {sql, createPool} from 'slonik'\n\nexport default async () => {\n  const pool = createPool('...connection string...')\n\n  const results = await pool.query(sql`select foo, bar from test_table`)\n\n  results.rows.forEach(r => {\n    console.log(r.foo)\n    console.log(r.bar)\n  })\n}\n```\n\nSource code after:\n\n```ts\nimport {sql, createPool} from 'slonik'\n\nexport default async () => {\n  const pool = createPool('...connection string...')\n\n  const results = await pool.query(sql<queries.TestTable>`select foo, bar from test_table`)\n\n  results.rows.forEach(r => {\n    console.log(r.foo) // foo has type 'number'\n    console.log(r.bar) // bar has type 'string | null'\n  })\n}\n\nexport declare namespace queries {\n  // Generated by @slonik/typegen\n\n  /** - query: `select foo, bar from test_table` */\n  export interface TestTable {\n    /** column: `example_test.test_table.foo`, not null: `true`, regtype: `integer` */\n    foo: number\n\n    /**\n     * Look, ma! A comment from postgres!\n     *\n     * column: `example_test.test_table.bar`, regtype: `text`\n     */\n    bar: string | null\n  }\n}\n```\n<!-- codegen:end -->\n\n## Configuration\n\nThe CLI can run with zero config, but there will usually be customisations needed depending on your project's setup.  \nBy default, the CLI will look for `typegen.config.js` file in the working directory, exporting an object containing the properties below.\n\nSome options are only available via CLI, some are only available in the config.  \nCLI arguments will always have precedence over config options.\n\n|Option|CLI&nbsp;Argument&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|Type|Default|Description|\n|-|-|-|-|-|\n|`rootDir`|`--root-dir`|`string`|`'src'`|Source root that the tool will search for files in.|\n|`include`|`--include`|`string[]`|`['**/*.{ts,sql}']`|Glob patterns for files to include in processing. Repeatable in CLI.|\n|`exclude`|`--exclude`|`string[]`|`['**/node_modules/**']`|Glob patterns for files to exclude from processing. Repeatable in CLI.|\n|`since`|`--since`|`string \\| undefined`|`undefined`|Limit matched files to those which have been changed since the given git ref. Use `\"HEAD\"` for files changed since the last commit, `\"main\"` for files changed in a branch, etc.|\n|`connectionURI`|`--connection-uri`|`string`|`'postgresql://`&thinsp;`postgres:postgres`&thinsp;`@localhost:5432/`&thinsp;`postgres'`|URI for connecting to psql. Note that if you are using `psql` inside docker, you should make sure that the container and host port match, since this will be used both by `psql` and slonik to connect to the database.|\n|`psqlCommand`|`--psql`|`string`|`'psql'`|The CLI command for running the official postgres `psql` CLI client.<br/>Note that right now this can't contain single quotes. This should also be configured to talk to the same database as the `pool` variable (and it should be a development database - don't run this tool in production!). If you are using docker compose, you can use a command like `docker-compose exec -T postgres psql`|\n|`defaultType`|`--default-type`|`string`|`'unknown'`|TypeScript type when no mapping is found. This should usually be `unknown` (or `any` if you like to live dangerously).|\n|`poolConfig`||`PoolConfig \\| undefined`<br/>(see [below](#complex-config-types))|`undefined`|Slonik database pool configuration. Will be used to create a pool which issues queries to the database as the tool is running, and will have its type parsers inspected to ensure the generated types are correct. It's important to pass in a pool confguration which is the same as the one used in your application.|\n|`logger`||`Logger`<br/>(see [below](#complex-config-types))|`console`|Logger object with `debug`, `info`, `warn` and `error` methods. Defaults to `console`.|\n|`writeTypes`<br/>(experimental)||`WriteTypes`<br/>(see [below](#complex-config-types))|`typegen.`&thinsp;`defaultWriteTypes`|Control how files are written to disk. See the [Advanced Configuration](#advanced-configuration) section.|\n||`--config`|`string`|`'typegen.config.js'`|Path to configuration file.|\n||`--migrate`|`'<=0.8.0'`|disabled|Before generating types, attempt to migrate a codebase which has used a prior version of this tool.|\n||`--watch`|CLI argument|disabled|Run in watch mode.|\n||`--lazy`|CLI argument|disabled|Skip initial processing of input files. Only useful with `'--watch'`.|\n||`--skip-check-clean`|CLI argument|disabled|If enabled, the tool will not check the git status to ensure changes are checked in.|\n\nDocumentation for CLI arguments can be printed to your terminal with `npx slonik-typegen generate --help`.\n#### Complex config types\n```typescript\ntype Logger = Record<'error' | 'warn' | 'info' | 'debug', (msg: unknown) => void>;\ntype WriteTypes = (queries: AnalysedQuery[]) => Promise<void>;\ntype PoolConfig = slonik.ClientConfigurationInput; // imported from slonik lib\n```\n\n#### Testing `psqlCommand`\nYou can check if your `psql` is working, and that your postgres version supports `\\gdesc` with your connection string using this shell command:\n```bash\necho 'select 123 as abc \\gdesc' \\| psql \"postgresql://postgres:postgres@localhost:5432/postgres\" -f -\n```\n\nThere are some more configuration options [documented in code](./src/types.ts), but these should be considered experimental, and might change without warning. You can try them out as documented [below](#advanced-configuration), but please start a [discussion](https://github.com/mmkal/slonik-tools/discussions) on this library's project page with some info about your use case so the API can be stabilised in a sensible way.\n\n### Example config\n\nHere's a valid example config file.\n\n```js\nconst yourAppDB = require('./lib/db')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  rootDir: 'source', // maybe you don't like using `src`\n  include: ['{queries/**.ts,sql/**.sql}'],\n  exclude: ['legacy-queries/**.sql'],\n  connectionURI: 'postgresql://postgres:postgres@localhost:5432/postgres',\n  poolConfig: yourAppDB.getPool().configuration,\n}\n```\n\nNote that the `/** @type {import('@slonik/typegen').Options} */` comment is optional, but will ensure your IDE gives you type hints.\n\n### Advanced Configuration\n\nThe `writeTypes` option allows you to tweak what's written to disk. Note that the usage style isn't finalised and might change in future. If you use it, please create a discussion about it in https://github.com/mmkal/slonik-tools/discussions so your use-case doesn't get taken away unexpectedly.\n\n#### Controlling write destination\n\nBy default, interfaces for SQL queries are added to a module at the end of the typescript file they're found in. You can tell the CLI to write the interfaces to a separate file instead using `writeTypes`:\n\n```js\nconst path = require('path')\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: typegen.defaultWriteTypes({\n    queriesPathFromTS: filepath => path.join(path.dirname(filepath), '__sql__', path.basename(filepath)),\n  }),\n}\n```\n\nThe interfaces will be written to a separate file under a `__sql__` folder next to the source, and will be imported via `import * as queries from './__sql__/file-name'`.\n\n#### Modifying types\n\nYou can modify the types generated before they are written to disk by defining a custom `writeTypes` implementation.\n\nFor example, you can create [branded types](https://michalzalecki.com/nominal-typing-in-typescript) (see what this outputs in [tests](./test/branding.test.ts)):\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      query.fields.forEach(field => {\n        // add a `_brand` to all string id fields:\n        if (field.typescript === 'string' && field.column && field.column.name === '.id') {\n          field.typescript = `(${field.typescript} & { _brand: ${JSON.stringify(field.column)} })`\n        }\n      })\n    })\n\n    return typegen.defaultWriteTypes()(queries)\n  }\n}\n```\n\nOr you could mark all fields as non-null (but probably shouldn't!):\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      query.fields.forEach(field => {\n        field.nullability = 'assumed_not_null'\n      })\n    })\n\n    return typegen.defaults.defaultWriteTypes()(queries)\n  }\n}\n```\n\nOr you could be more granular. If, for example, there's a particular file with a lot of nullable types that you can't (yet) add full strict typing to:\n\n```js\nconst typegen = require('@slonik/typegen')\nconst path = require('path')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      const filesWithLegacyNullableFields = [\n        path.resolve(__dirname, 'path/to/file1.ts'),\n        path.resolve(__dirname, 'path/to/file2.ts'),\n      ]\n      if (filesWithLegacyNullableFields.includes(query.file)) {\n        query.fields.forEach(field => {\n          if (field.nullability === 'unknown') {\n            field.nullability = 'assumed_not_null'\n          }\n        })\n      }\n    })\n\n    return typegen.defaults.defaultWriteTypes()(queries)\n  }\n}\n```\n\nOr you could use a custom type for json fields:\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: queries => {\n    queries.forEach(query => {\n      query.fields.forEach(field => {\n        if (field.regtype === 'json' || field.regtype === 'jsonb') {\n          field.typescript = `import('@your-project/custom-types').YourCustomType`\n          // For more customisation, you could look up which type to use based on `field.column`.\n        }\n      })\n    })\n\n    return typegen.defaults.defaultWriteTypes()(queries)\n  }\n}\n```\n\n#### Modifying source files\n\nYou can also use `writeTypes` to define a hook that runs before writing to disk:\n\n```js\nconst typegen = require('@slonik/typegen')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: typegen.defaultWriteTypes({\n    writeFile: async (filepath, content) => {\n      content = content\n        .replace(/declare module queries/g, 'declare module some_other_naming_convention')\n        .replace(/queries\\./g, 'some_other_naming_convention.')\n      await typegen.defaults.defaultWriteFile(filepath, content)\n    },\n  })\n}\n```\n\nOr you could override the default formatter (which uses prettier, if found):\n\n```js\nconst typegen = require('@slonik/typegen')\nconst yourCustomLinter = require('@your-project/custom-linter')\nconst fs = require('fs')\nconst path = require('path')\n\n/** @type {import('@slonik/typegen').Options} */\nmodule.exports.default = {\n  writeTypes: typegen.defaults.defaultWriteTypes({\n    writeFile: async (filepath, content) => {\n      content = await yourCustomLinter.fix(filepath, content)\n      await fs.promises.mkdir(path.dirname(filepath), {recursive: true}) // since you're not using the built-in `writeFile` you should explicitly call mkdir with {recursive: true}\n      await fs.promises.writeFile(filepath, content)\n    },\n  })\n}\n```\n\n## Enhancing Return Types\n\nTypegen is designed to output types only to the degree it's certain they are correct.  \n\nLet's say in a complex query it can determine that a specific column will return a `string`, but isn't sure if it is also nullable, it will extract the type as `{ column: string | null }`, just to be on the safe side. When it encounters columns where it is unable to even determine the basic type, i.e. `json` columns, it will return :shrug: (Ok, actually the typescript equivalent, which is `unknown`).\n\nIn these cases you likely know more about the actual return type than typegen and you might feel the urge to overwrite the types.  \nYet you shouldn't touch generated code, as your changes will be removed again on the next run.\n\nInstead what you should do is add (one or more) intersection types to the sql literal, specifying the columns where you want to help typegen out by increasing specificity. The resulting type will be a combination of the extracted types and your enhancements.  \nCheck out the [typescript docs on intersection types](https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types) to learn more.\n\nImagine this is your code after running typegen.\n```typescript\nsql<queries.ExtractedResult>`select string_col, json_col from table`\n\nexport declare namespace queries {\n  // Generated by @slonik/typegen\n\n  /** - query: `select string_col, json_col from table` */\n  export interface TestTable {\n    /** column: `example_test.table.string_col`, regtype: `character_varying` */\n    string_col: string | null,\n    /** column: `example_test.table.json_col`, regtype: `jsonb` */\n    json_col: unkown\n  }\n}\n```\n\nYou can enhance the return type like this:\n\n```typescript\nsql<queries.ExtractedResult & { json_col: string[] }>`[query]`\n```\n\\- or, if you prefer -\n```typescript\ninterface EnhancedResult {\n  json_col: string[]\n}\nsql<queries.ExtractedResult & EnhancedResult>`[query]`\n```\n\nEither way the resulting type will be this:\n\n```typescript\ntype ResultingType = {\n  string_col: string | null,\n  json_col: string[]\n}\n```\n\n**On subsequent runs typegen will only update the first intersection type and leave all following intersections untouched**.\n\nThis also means you can make the column `string_col` non-nullable by intersecting it with `{ string_col: string }`.\n\nNote that you can't completely change a property type (say from `string` to `number`) this way.  \nThis is by design, because if you could, a change in the underlying table might cause typegen to detect a new type, which would be ignored, had you overwritten it. This would cause type changes to go unnoticed and we can't have that.  \nWith intersections, the resulting property will be of type `never`, when an underlying column type changes. This will alert you to the change, so you can update your manual enhancements.\n\n## Ignoring Queries\n\nFor file-based ignores, you can use the [exclude option](#configuration) to set a pattern or specific file(s) to be ignored via the config file or using the CLI option.\n\nTypegen also automatically ignores all queries with zero chance of returning a result (i.e. sql fragments).\n\nIf you want to exclude a specific query from processing, you can add a `--typegen-ignore` or `/* typegen-ignore */` comment anywhere in the query.\n\n## Examples\n\n[The tests](./test) and [corresponding fixtures](./test/fixtures) are a good starting point to see what the code-generator will do.\n\n## Migration from v0.8.0\n\nVersion 0.8.0 and below of this library used a different style of code-generation. It had several drawbacks - it was a runtime dependency, and required queries to be actually run before types could be inferred. It also created a global repository of types, meaning two queries in separate locations which shared a name could clash with each other. It also required changing the way your code was written.\n\nConceptually, this library now does more work so you don't have to worry about it so much. Just write slonik code/queries as normal, and then run the CLI to add types to them. If you add a new column to any query, run it again to update the interfaces.\n\nIf you previously used the old version of the tool, you can run it once with the  `--migrate v0.8.0` CLI argument to automatically attempt to codemod your project. Note that this will, by default, check that your git status is clean before running since it modifies code in place. The codemod isn't advanced enough to find all usages of the old API, so have a look through what it does after running it to make sure the changes look OK. If they aren't, reset the git changes and either apply them manually and/or pass in a different `include` value to avoid files that were incorrectly modified.\n\n## SQL files\n\nThe tool will also search for `.sql` files, and generate some typescript helpers for running the queries contained in them. Any parameters (`$1`, `$2` etc.) will also be strongly typed, and become required inputs for running the query. See the [SQL file fixtures](./test/sql.test.ts) for some examples, and [the generated SQL usage test to see how it can be used](./test/sql-usage.test.ts).\n\n## Usage with `@typescript-eslint`\n\nThe default ruleset for [`@typescript-eslint/eslint-plugin`](https://npmjs.com/package/@typescript-eslint/eslint-plugin) prevents usage of [typescript namespaces](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/docs/rules/no-namespace.md). To avoid lint errors for inline type declarations (which are perfectly valid!), add this to your eslint config:\n\n```\n\"@typescript-eslint/no-namespace\": [\"warn\", {\"allowDeclarations\": true}],\n```\n\n## Limitations\n\nSome dynamically-generated queries will not receive a type. One example is any query where the template express parameters are identifiers rather than values, e.g.\n\n```ts\nimport {sql} from 'slonik'\n\nconst tableName = Math.random() < 0.5 ? 'foo' : 'bar'\n\nexport default sql`select * from ${sql.identifier([tableName])}`\n```\n\nIn the above example, no type can be inferred because it's impossible to know whether the query will return values from table `foo` or `bar`.\n\n___\n\nQueries with multiple statements will result in an error:\n\n```ts\nimport {sql} from 'slonik'\n\nsql`\n  update table set col=1 where id=1 returning 1;\n  update table set col=2 where id=2 returning 2;\n`\n```\n\nThe return type is not clearly assigned here. Every literal should only contain one query statement.\n\n___\n\nQueries using the `pg_temp` schema will usually not be typeable since the schema is ephemeral and only can be queried within a single session that `psql` doesn't have access to.\n\n```ts\nimport {sql} from 'slonik'\n\nsql`select * from pg_temp.my_temp_table`\n```\n\n___\n\nInvalid SQL syntax will also be left untouched (they will result in an error being logged when running the CLI):\n\n```ts\nimport {sql} from 'slonik'\n\nsql`this is not even valid SQL!`\n```\n\nIf you see errors being logged for SQL that you think is valid, feel free to [raise an issue](https://github.com/mmkal/slonik-tools/issues/new).  \nIn the meantime, you can use of of the [ignore options](#ignoring-queries) to skip processing the concerned queries.\n\n___\n\nCustom interceptors. Some interceptors, such as [slonik-interceptor-field-name-transformation](https://npmjs.com/package/slonik-interceptor-field-name-transformation) change the runtime shape of query results. You could try to match its behaviour with a custom `writeTypes` implementation, but it's recommended to just not using the interceptor in the first place. All it does is transform from snake-case to camel-case.\n\n___\n\nFinally, for some complex queries, static parsing might fail, making it not possible to determine statically if a column is nullable. If this happens, it will still receive a valid type, but the type will be `string | null` rather than `string`.\n\nIf you find such a case, please [raise an issue](https://github.com/mmkal/slonik-tools/issues/new) to see if it's possible to handle - under the hood this library uses [pgsql-ast-parser](https://npmjs.com/package/pgsql-ast-parser) and you might have found an edge case which that library doesn't handle yet.\n\n## How it works\n\nWhen you run `slonik-typegen generate`, the tool will scan your source files, and traverse their ASTs using the TypeScript compiler API. Note that typescript is a peer dependency for this reason.\n\nOn finding [a](https://oracle-base.com/blog/2015/01/02/a-sql-or-an-sql/#:~:text=According%20to%20the%20Oracle%20docs,%2Dlevel%20declarative%20computer%20language%E2%80%A6%E2%80%9D) sql query, it will issue a `psql` command using the [flag `\\gdesc`](https://www.postgresql.org/docs/11/app-psql.html), which responds with a table of the columns and their corresponding types contained in the query. The query itself is never actually run.\n\nThe postgres type is then converted into typescript using an in-built mapping. Any slonik `typeParsers` configured (see [slonik docs](https://github.com/gajus/slonik/#api) for more info) are inspected to infer the type of the value that will be returned by the query.\n\nTo determine whether query columns are nullable, the query is parsed using [pgsql-ast-parser](https://npmjs.com/package/pgsql-ast-parser). Some more queries are sent to postgres to figure out whether query column can be null - in general, postgres is only able to guarantee if a query column is null if it comes directly from a table which declares that column non-null too.\n\n## Recommendations\n\n1. Check in the types to source control. They're generated code, but it makes it much easier to track what was happened when a query was update, and see those changes over time.\n1. After running CI, it's worth making sure that there are no working copy changes. For git, you can use `git diff --exit-code`:\n\n```sh\nnpx slonik-typegen generate\ngit diff --exit-code\n```\n","readmeFilename":"readme.md"}