{"_id":"@mtcute/postgres","_rev":"11-b35099ae8c401f3bea2182ff897d9218","name":"@mtcute/postgres","dist-tags":{"latest":"0.31.0"},"versions":{"0.29.1":{"name":"@mtcute/postgres","version":"0.29.1","author":{"name":"alina sireneva","email":"alina@tei.su"},"license":"MIT","_id":"@mtcute/postgres@0.29.1","maintainers":[{"name":"teidesu","email":"me@tei.su"}],"homepage":"https://mtcute.dev","bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"dist":{"shasum":"4f2fddd26e7096bbbc5cf8ccac0de079b1e71624","tarball":"https://registry.npmjs.org/@mtcute/postgres/-/postgres-0.29.1.tgz","fileCount":35,"integrity":"sha512-iyvNTzc5L2T5GN+a0+jo9NNVQe/lMKaeQ45pzQTRrIDkOgwsd//ieUgyxyPQa1kDO234RTpot9iYIAKOVAuftg==","signatures":[{"sig":"MEUCIBIFyohid+qC2CvKV3U1hPITdZalLmD1O0TTo3x6gr4OAiEA/QyTxmYt0Rpiw5sohf7SoiOQbXhhgKJVwUy2DOjVIoA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44840},"type":"module","types":"./index.d.ts","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}}},"gitHead":"34f1193f8db2e4335e4818004365a5f80f1cf717","scripts":{},"_npmUser":{"name":"teidesu","email":"me@tei.su"},"repository":{"url":"git+https://github.com/mtcute/mtcute.git","type":"git"},"_npmVersion":"10.9.2","description":"PostgreSQL storage for mtcute","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"@mtcute/core":"^0.29.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/postgres_0.29.1_1774053130969_0.7734711513787953","host":"s3://npm-registry-packages-npm-production"}},"0.29.2":{"name":"@mtcute/postgres","version":"0.29.2","author":{"name":"alina sireneva","email":"alina@tei.su"},"license":"MIT","_id":"@mtcute/postgres@0.29.2","maintainers":[{"name":"teidesu","email":"me@tei.su"}],"homepage":"https://mtcute.dev","bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"dist":{"shasum":"cfb6e6b6329124a5a5e971ffbe7a93a90560266a","tarball":"https://registry.npmjs.org/@mtcute/postgres/-/postgres-0.29.2.tgz","fileCount":35,"integrity":"sha512-xaphY/BErN2TqWFw02gF3atU8oXW1468bP/fb638QMcOx1E0wHAuG/KNZqeehXOSGpw8MhS0i7oBLzWOcRU8dw==","signatures":[{"sig":"MEUCIQD3ISmpWjWtUotJcvBUvMdga4rAMtYfhxVmp2gOCroj0wIgSb9PTkbKhoRwbgN4Ya/FOWj92DYas3FHUClOAh51/jI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52733},"type":"module","types":"./index.d.ts","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}}},"gitHead":"e86b510a480a1c1226b554bc0174d7f49a7324ad","scripts":{},"_npmUser":{"name":"teidesu","email":"me@tei.su"},"repository":{"url":"git+https://github.com/mtcute/mtcute.git","type":"git"},"_npmVersion":"10.9.2","description":"PostgreSQL storage for mtcute","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"@mtcute/core":"^0.29.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/postgres_0.29.2_1774123329117_0.06568234041134713","host":"s3://npm-registry-packages-npm-production"}},"0.29.4":{"name":"@mtcute/postgres","version":"0.29.4","author":{"name":"alina sireneva","email":"alina@tei.su"},"license":"MIT","_id":"@mtcute/postgres@0.29.4","maintainers":[{"name":"teidesu","email":"me@tei.su"}],"homepage":"https://mtcute.dev","bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"dist":{"shasum":"aff01be1828cbba74158624df7295c7ff650b421","tarball":"https://registry.npmjs.org/@mtcute/postgres/-/postgres-0.29.4.tgz","fileCount":35,"integrity":"sha512-IiPbjQqL3lbgpgvgn74bZ26I+LdoXy58cSvt4+MXI6VulvS+VWvtfw1+Cu0D2Zb1FJpcqZFhv1lS16WKk+KX4w==","signatures":[{"sig":"MEYCIQDXoHzJMeywl/nBsZLwbfPCqxqiZyv4QVdpbsWr9Su4XwIhAN2eV/ybccKAohvUgmXvv//YhmBLbBMaa8X272KkfInp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52733},"type":"module","types":"./index.d.ts","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}}},"gitHead":"33bde9c4c666bc3aca7b18a65094264057af94a0","scripts":{},"_npmUser":{"name":"teidesu","email":"me@tei.su"},"repository":{"url":"git+https://github.com/mtcute/mtcute.git","type":"git"},"_npmVersion":"10.9.2","description":"PostgreSQL storage for mtcute","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"@mtcute/core":"^0.29.4"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/postgres_0.29.4_1774259884243_0.5902547881520686","host":"s3://npm-registry-packages-npm-production"}},"0.29.5":{"name":"@mtcute/postgres","version":"0.29.5","author":{"name":"alina sireneva","email":"alina@tei.su"},"license":"MIT","_id":"@mtcute/postgres@0.29.5","maintainers":[{"name":"teidesu","email":"me@tei.su"}],"homepage":"https://mtcute.dev","bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"dist":{"shasum":"5a810fec439993d7a8f5ba5c6dbdf62b6efc6f46","tarball":"https://registry.npmjs.org/@mtcute/postgres/-/postgres-0.29.5.tgz","fileCount":35,"integrity":"sha512-KvgoY3W6/2jm1LJa3tjuCo8fvOy24NjhhgUy0p2Wz8rKrsnwy0P6EJMOl1IkbsSpZ9tawMXLtM5rGH1lunhzHQ==","signatures":[{"sig":"MEUCIQCsX+gYmJFebHysTaenmRwuGrSDFYoPwe5AZ7IzVNW32wIgSizfe5Xoo+Tl+UGwYu1sOGGAHRI+U2CqD08uoVLf6aU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52733},"type":"module","types":"./index.d.ts","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}}},"gitHead":"d3fb42c6ce22c682e71490072b1222a16afd9810","scripts":{},"_npmUser":{"name":"teidesu","email":"me@tei.su"},"repository":{"url":"git+https://github.com/mtcute/mtcute.git","type":"git"},"_npmVersion":"10.9.2","description":"PostgreSQL storage for mtcute","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"@mtcute/core":"^0.29.5"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/postgres_0.29.5_1775140456108_0.1728934586948212","host":"s3://npm-registry-packages-npm-production"}},"0.29.6":{"name":"@mtcute/postgres","version":"0.29.6","author":{"name":"alina sireneva","email":"alina@tei.su"},"license":"MIT","_id":"@mtcute/postgres@0.29.6","maintainers":[{"name":"teidesu","email":"me@tei.su"}],"homepage":"https://mtcute.dev","bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"dist":{"shasum":"f811a390176a3eaa0af77e4a2b76961f1398ebfc","tarball":"https://registry.npmjs.org/@mtcute/postgres/-/postgres-0.29.6.tgz","fileCount":35,"integrity":"sha512-PQloVu1u6RDtF4yNKUmuoP4UmrP6XgiTXfKw+GxjcINGOKjg2h5+Tma5aBrgpl0j5xPHeGzyE7/QfMZD9BwG5A==","signatures":[{"sig":"MEYCIQC7q4jx5nHQWCEp5m8BUzRL9PmodfNB1//vQWy24aK3ngIhAMmjE0RDU3wRItaNbjF8wKV6FNQiKzrn8O4qRVp6jrBG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52733},"type":"module","types":"./index.d.ts","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}}},"gitHead":"53e6bb137fe1d5ca037e26515a89d0b2e1b07813","scripts":{},"_npmUser":{"name":"teidesu","email":"me@tei.su"},"repository":{"url":"git+https://github.com/mtcute/mtcute.git","type":"git"},"_npmVersion":"10.9.2","description":"PostgreSQL storage for mtcute","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"@mtcute/core":"^0.29.6"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/postgres_0.29.6_1775662074873_0.9375967339583389","host":"s3://npm-registry-packages-npm-production"}},"0.29.7":{"name":"@mtcute/postgres","version":"0.29.7","author":{"name":"alina sireneva","email":"alina@tei.su"},"license":"MIT","_id":"@mtcute/postgres@0.29.7","maintainers":[{"name":"teidesu","email":"me@tei.su"}],"homepage":"https://mtcute.dev","bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"dist":{"shasum":"b584c45177668a9bedcaddc91229dc25ef7e9460","tarball":"https://registry.npmjs.org/@mtcute/postgres/-/postgres-0.29.7.tgz","fileCount":35,"integrity":"sha512-VTxcfhIMYx9y7uhvInwUFZaJRIEN2QSxrKHadNLGrcG/JbQ93nEqLaC/RMz6cDQrnXVZ1ieMhwrX1eZ/BbM3LA==","signatures":[{"sig":"MEYCIQCAbJxs0A44g6dPTAZZLFbi15ZgsZUwYgHK+2poOUXr1AIhAK5uIvVOTeXkFt2uw9VmHAO7hP0YOlnGUv6BZteGG7Hh","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52733},"type":"module","types":"./index.d.ts","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}}},"gitHead":"b8d51bd6ffe04dbf3dab95e2e95be9c193793a12","scripts":{},"_npmUser":{"name":"teidesu","email":"me@tei.su"},"repository":{"url":"git+https://github.com/mtcute/mtcute.git","type":"git"},"_npmVersion":"10.9.2","description":"PostgreSQL storage for mtcute","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"@mtcute/core":"^0.29.7"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/postgres_0.29.7_1778265469379_0.44152280250791653","host":"s3://npm-registry-packages-npm-production"}},"0.30.0":{"name":"@mtcute/postgres","version":"0.30.0","author":{"name":"alina sireneva","email":"alina@tei.su"},"license":"MIT","_id":"@mtcute/postgres@0.30.0","maintainers":[{"name":"teidesu","email":"me@tei.su"}],"homepage":"https://mtcute.dev","bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"dist":{"shasum":"f3d2def4f42f72189a0fb1821fc0af0a65b50446","tarball":"https://registry.npmjs.org/@mtcute/postgres/-/postgres-0.30.0.tgz","fileCount":35,"integrity":"sha512-JH7mfUd1NWx/hh265D01l5RHOsdE1QwJVpSxmAd70g83LwpO65LQrG+7NmhxkGndnYUuO7Lx//0/OPdAl+sv8Q==","signatures":[{"sig":"MEUCIFwgRcK+rLkhxUfonUEQrNmxMVgvGLvYE2loBjZsl2o8AiEAh1R5rUdXIbBu2eCY4B+WgVkqcRIs5q3zF9ZOTa052i4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52733},"type":"module","types":"./index.d.ts","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}}},"gitHead":"b4a22b0f565a874d40dc1e1768a408df696f013e","scripts":{},"_npmUser":{"name":"teidesu","email":"me@tei.su"},"repository":{"url":"git+https://github.com/mtcute/mtcute.git","type":"git"},"_npmVersion":"10.9.2","description":"PostgreSQL storage for mtcute","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"@mtcute/core":"^0.30.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/postgres_0.30.0_1781043333570_0.14042516086351653","host":"s3://npm-registry-packages-npm-production"}},"0.30.1":{"name":"@mtcute/postgres","version":"0.30.1","author":{"name":"alina sireneva","email":"alina@tei.su"},"license":"MIT","_id":"@mtcute/postgres@0.30.1","maintainers":[{"name":"teidesu","email":"me@tei.su"}],"homepage":"https://mtcute.dev","bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"dist":{"shasum":"4feb1eddfa381bd5e567c8a504f4ad58bc16014b","tarball":"https://registry.npmjs.org/@mtcute/postgres/-/postgres-0.30.1.tgz","fileCount":35,"integrity":"sha512-0WN3wutDeLkSZhobLHrgDGYIIl4eMiTcNkAl7TIojRcxYFry1E+otj5iO5Uj67+H4ZbdlGrJ52NsMWO/7R+h4Q==","signatures":[{"sig":"MEUCIDOWhMN08h3fksOYCMwzSV2pCMhRW1hKBGn8Rr4DakjeAiEA7grJKW6ALfcdxgALPlla8Kjegeu6cL/PdgDMvt0BvQM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52733},"type":"module","types":"./index.d.ts","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}}},"gitHead":"6eb0b66a8feb4ac2a2c6a5ff6e6358da2df868da","scripts":{},"_npmUser":{"name":"teidesu","email":"me@tei.su"},"repository":{"url":"git+https://github.com/mtcute/mtcute.git","type":"git"},"_npmVersion":"10.9.2","description":"PostgreSQL storage for mtcute","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"@mtcute/core":"^0.30.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/postgres_0.30.1_1781355410958_0.5543044142771882","host":"s3://npm-registry-packages-npm-production"}},"0.30.2":{"name":"@mtcute/postgres","version":"0.30.2","author":{"name":"alina sireneva","email":"alina@tei.su"},"license":"MIT","_id":"@mtcute/postgres@0.30.2","maintainers":[{"name":"teidesu","email":"me@tei.su"}],"homepage":"https://mtcute.dev","bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"dist":{"shasum":"fd768045ef166b5118e50af2b202ec8367599c02","tarball":"https://registry.npmjs.org/@mtcute/postgres/-/postgres-0.30.2.tgz","fileCount":35,"integrity":"sha512-eAjYKAzGVb76wXJJ55DOBOHE7M+SgQN5n0C0W3XufYMj1iT+bmR+hqv8pVmA46iCLGZ1MQTBxsrfUKH0qaJ/NA==","signatures":[{"sig":"MEQCIBzUohn/i5qyYavVY9JlaIxTBS+Iwhd5YMBHiur33e07AiAblU5PLuCm//Bo+uN7wM7rbPcITAPhF60wSI1zGzmEAQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@mtcute%2fpostgres@0.30.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":52733},"type":"module","types":"./index.d.ts","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}}},"gitHead":"9d6429dfd37103d89a1274e72a6bc400426434c1","scripts":{},"_npmUser":{"name":"teidesu","email":"me@tei.su"},"repository":{"url":"git+https://github.com/mtcute/mtcute.git","type":"git"},"_npmVersion":"10.9.8","description":"PostgreSQL storage for mtcute","directories":{},"sideEffects":false,"_nodeVersion":"22.23.0","dependencies":{"@mtcute/core":"^0.30.2"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/postgres_0.30.2_1783005065455_0.28117490877699924","host":"s3://npm-registry-packages-npm-production"}},"0.30.3":{"name":"@mtcute/postgres","version":"0.30.3","author":{"name":"alina sireneva","email":"alina@tei.su"},"license":"MIT","_id":"@mtcute/postgres@0.30.3","maintainers":[{"name":"teidesu","email":"me@tei.su"}],"homepage":"https://mtcute.dev","bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"dist":{"shasum":"bcde35c0668024bcdd4d8a0e03b01272b0e9f445","tarball":"https://registry.npmjs.org/@mtcute/postgres/-/postgres-0.30.3.tgz","fileCount":35,"integrity":"sha512-Zeg8PJ9B6Fcvr2z2gfDq31OlO0Es9/peKBEuz6Vr2Klxv8DfCDIJDCS9VfcHnNWvXAy9vchIBPyT5NoLELU68Q==","signatures":[{"sig":"MEUCIFxvi/Dw606lzlv8ZdNEtjlY+hFvkba+OMcatxD7wQ7jAiEAna5D/fQY6Goh3hmCKMoGoGYnhcLy2v1moshWpxEAGWY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@mtcute%2fpostgres@0.30.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":52733},"type":"module","types":"./index.d.ts","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}}},"gitHead":"21a9cee3de7e509e0bc0975e7908e49e4a6fc7d1","scripts":{},"_npmUser":{"name":"teidesu","email":"me@tei.su"},"repository":{"url":"git+https://github.com/mtcute/mtcute.git","type":"git"},"_npmVersion":"10.9.8","description":"PostgreSQL storage for mtcute","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","dependencies":{"@mtcute/core":"^0.30.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/postgres_0.30.3_1783085940509_0.0005799892631894732","host":"s3://npm-registry-packages-npm-production"}},"0.31.0":{"name":"@mtcute/postgres","type":"module","version":"0.31.0","description":"PostgreSQL storage for mtcute","license":"MIT","dependencies":{"@mtcute/core":"^0.31.0"},"exports":{".":{"import":{"types":"./index.d.ts","default":"./index.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}}},"author":{"name":"alina sireneva","email":"alina@tei.su"},"sideEffects":false,"homepage":"https://mtcute.dev","repository":{"type":"git","url":"git+https://github.com/mtcute/mtcute.git"},"scripts":{},"_id":"@mtcute/postgres@0.31.0","gitHead":"9d50882f603727c079c12362ce3dfa93cccc8c32","types":"./index.d.ts","bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-+yLAXEt5aEefHxVif5c6EYgG/aDuqx3Urw4rfjTl4zRBFWTYEJ7cdvXRFNuicatsjfhcUuAMuRz4Mt7bQGPOpQ==","shasum":"b0815fd56e16c922bb6e4aa86dc2c8c7a9dc3459","tarball":"https://registry.npmjs.org/@mtcute/postgres/-/postgres-0.31.0.tgz","fileCount":35,"unpackedSize":52733,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@mtcute%2fpostgres@0.31.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDhtybeYXpIm//nT4XoVGgIDIM81YBfCt6n4ERSyjTzEwIhAIp2uvSOex8qJimOLGWrE/On/ISz60Xl9sxrf2uh6fn1"}]},"_npmUser":{"name":"teidesu","email":"me@tei.su"},"directories":{},"maintainers":[{"name":"teidesu","email":"me@tei.su"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postgres_0.31.0_1784150172019_0.6005721337657468"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-21T00:32:10.871Z","modified":"2026-07-15T21:16:12.654Z","0.29.1":"2026-03-21T00:32:11.165Z","0.29.2":"2026-03-21T20:02:09.291Z","0.29.4":"2026-03-23T09:58:04.406Z","0.29.5":"2026-04-02T14:34:16.252Z","0.29.6":"2026-04-08T15:27:55.029Z","0.29.7":"2026-05-08T18:37:49.524Z","0.30.0":"2026-06-09T22:15:33.710Z","0.30.1":"2026-06-13T12:56:51.094Z","0.30.2":"2026-07-02T15:11:05.578Z","0.30.3":"2026-07-03T13:39:00.643Z","0.31.0":"2026-07-15T21:16:12.221Z"},"bugs":{"url":"https://github.com/mtcute/mtcute/issues"},"author":{"name":"alina sireneva","email":"alina@tei.su"},"license":"MIT","homepage":"https://mtcute.dev","repository":{"type":"git","url":"git+https://github.com/mtcute/mtcute.git"},"description":"PostgreSQL storage for mtcute","maintainers":[{"name":"teidesu","email":"me@tei.su"}],"readme":"# @mtcute/postgres\n\nPostgreSQL storage provider for mtcute. Uses any `pg`-compatible client (Pool, Client, or PoolClient).\n\nAll tables are created in a dedicated schema (`mtcute` by default), with automatic migrations.\n\n## Installation\n\n```bash\npnpm add @mtcute/postgres pg\n```\n\n## Usage\n\n```ts\nimport { TelegramClient } from '@mtcute/node'\nimport { PostgresStorage } from '@mtcute/postgres'\nimport pg from 'pg'\n\nconst pool = new pg.Pool({ connectionString: 'postgres://localhost/mydb' })\n\nconst tg = new TelegramClient({\n    apiId: 12345,\n    apiHash: 'abcdef',\n    storage: new PostgresStorage(pool),\n})\n\nconst self = await tg.start()\nconsole.log(`logged in as ${self.displayName}`)\n```\n\n## Options\n\n```ts\nnew PostgresStorage(pool, {\n    // PostgreSQL schema to use for all tables (default: 'mtcute')\n    schema: 'my_schema',\n    // Whether to automatically close the client when the storage is destroyed (default: false)\n    // Calls .end(), .release(), or .close() depending on what the client supports\n    autoClose: true,\n    // Account tag for multi-account isolation within the same schema (default: 'default')\n    account: 'bot-1',\n})\n```\n\n## Multi-account\n\nMultiple clients can share the same database and schema by using different `account` tags.\nEach account's data is fully isolated from others:\n\n```ts\nconst pool = new pg.Pool({ connectionString: 'postgres://localhost/mydb' })\n\nconst bot1 = new TelegramClient({\n    storage: new PostgresStorage(pool, { account: 'bot-1' }),\n    // ...\n})\n\nconst bot2 = new TelegramClient({\n    storage: new PostgresStorage(pool, { account: 'bot-2' }),\n    // ...\n})\n```\n\n## Using with PGlite\n\nYou can use [PGlite](https://github.com/electric-sql/pglite) for an embedded PostgreSQL instance that requires no external server:\n\n```ts\nimport { PGlite } from '@electric-sql/pglite'\nimport { PostgresStorage } from '@mtcute/postgres'\n\nconst pglite = await PGlite.create()\nconst storage = new PostgresStorage(pglite)\n```\n\nPGlite satisfies the `PgClient` interface out of the box, so no adapters are needed.\n\n## Using with an existing connection\n\nYou can pass any object that satisfies the `PgClient` interface (a `query` method matching `pg`'s signature):\n\n```ts\nimport { PostgresStorage } from '@mtcute/postgres'\n\n// with a single client\nconst client = new pg.Client({ connectionString: '...' })\nawait client.connect()\nconst storage = new PostgresStorage(client)\n\n// with a pool client\nconst poolClient = await pool.connect()\nconst storage = new PostgresStorage(poolClient)\n```\n\n> **Note:** By default, mtcute does **not** close the client when the storage is destroyed.\n> Set `autoClose: true` if you want the storage to call `.end()`, `.release()`, or `.close()` automatically.\n\n## Database schema\n\nAll tables are created under the configured schema (default `mtcute`). The following tables are used:\n\n| Table | Purpose |\n|-------|---------|\n| `migrations` | Tracks migration versions per repository |\n| `auth_keys` | Persistent authorization keys per DC |\n| `temp_auth_keys` | Temporary authorization keys with expiry |\n| `key_value` | General-purpose key-value store |\n| `peers` | Cached peer information (users, chats, channels) |\n| `message_refs` | Reference messages for peer access hash resolution |\n","readmeFilename":"README.md"}