{"_id":"@bounkhong/idempotency-adapter-sql","name":"@bounkhong/idempotency-adapter-sql","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bounkhong/idempotency-adapter-sql","version":"0.1.0","description":"SQL idempotency store adapter for AIF core","license":"MIT","author":{"name":"Bounkhong","url":"AIF"},"repository":{"type":"git","url":"git+https://github.com/aif/idempotency-package.git"},"bugs":{"url":"https://github.com/aif/idempotency-package/issues"},"homepage":"https://github.com/aif/idempotency-package#readme","keywords":["idempotency","adapter","sql","nodejs"],"type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"dependencies":{"@bounkhong/idempotency-core":"0.1.0"},"scripts":{"build":"tsc -p tsconfig.json","test":"vitest run --passWithNoTests","lint":"tsc -p tsconfig.json --noEmit","typecheck":"tsc -p tsconfig.json --noEmit"},"_id":"@bounkhong/idempotency-adapter-sql@0.1.0","_integrity":"sha512-QE6YNapesv8mDel9GD+01+5VEmehlslvnkzt0iln+5KmtUGpuoTV/YqMY2Lbk4qudK0P5oFPcrdiSIcUU1tVOA==","_resolved":"/tmp/5278ef60edbebaa118323b6e71cb7e14/bounkhong-idempotency-adapter-sql-0.1.0.tgz","_from":"file:bounkhong-idempotency-adapter-sql-0.1.0.tgz","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-QE6YNapesv8mDel9GD+01+5VEmehlslvnkzt0iln+5KmtUGpuoTV/YqMY2Lbk4qudK0P5oFPcrdiSIcUU1tVOA==","shasum":"4f10675a1ee205ad27f48d32c5661b790983f133","tarball":"https://registry.npmjs.org/@bounkhong/idempotency-adapter-sql/-/idempotency-adapter-sql-0.1.0.tgz","fileCount":6,"unpackedSize":8296,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICoGUxTBuHQY4V93QTs5MiwUqSbPcH7jKCFrRn9tMg5VAiEAtKJS5A8at/FrnFeFQGD1K5t5+p+p/r/GjW1K4rwb3lQ="}]},"_npmUser":{"name":"bounkhong","email":"bounkhong6655@gmail.com"},"directories":{},"maintainers":[{"name":"bounkhong","email":"bounkhong6655@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/idempotency-adapter-sql_0.1.0_1779338607215_0.6795467560698343"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-21T04:43:27.093Z","0.1.0":"2026-05-21T04:43:27.355Z","modified":"2026-05-21T04:43:27.533Z"},"maintainers":[{"name":"bounkhong","email":"bounkhong6655@gmail.com"}],"description":"SQL idempotency store adapter for AIF core","homepage":"https://github.com/aif/idempotency-package#readme","keywords":["idempotency","adapter","sql","nodejs"],"repository":{"type":"git","url":"git+https://github.com/aif/idempotency-package.git"},"author":{"name":"Bounkhong","url":"AIF"},"bugs":{"url":"https://github.com/aif/idempotency-package/issues"},"license":"MIT","readme":"# @bounkhong/idempotency-adapter-sql\n\nSQL-backed idempotency store with ORM-agnostic driver interface.\n\n## Install\n\n```bash\npnpm add @bounkhong/idempotency-adapter-sql @bounkhong/idempotency-core\n```\n\n## Driver contract\n\nProvide a driver implementing:\n\n```ts\ninterface SqlDriver {\n  query<T = unknown>(sql: string, params?: unknown[]): Promise<{ rows: T[] }>;\n}\n```\n\n## Usage\n\n```ts\nimport { SqlIdempotencyStore, createSqlSchema, cleanupExpiredSql } from \"@bounkhong/idempotency-adapter-sql\";\n\nconst store = new SqlIdempotencyStore(driver, \"idempotency_records\");\n```\n\n## Schema and TTL cleanup\n\n- Create table/index using `createSqlSchema()`\n- Run periodic cleanup job with `cleanupExpiredSql()`\n\nExample cleanup cron idea:\n- every 1-5 minutes: `DELETE FROM idempotency_records WHERE expires_at < NOW()`\n","readmeFilename":"README.md","_rev":"1-795c931d7a1700531c878ab95e222e8b"}