{"_id":"@superfunctions/db","_rev":"7-946034f37bc458da70e68615059cd177","name":"@superfunctions/db","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@superfunctions/db","version":"0.1.0","keywords":["database","adapter","orm","drizzle","prisma","kysely","mongodb","superfunctions"],"author":{"name":"21nCo"},"license":"MIT","_id":"@superfunctions/db@0.1.0","maintainers":[{"name":"21native","email":"npm@21n.org"}],"homepage":"https://github.com/21nCo/super-functions#readme","bugs":{"url":"https://github.com/21nCo/conduct/issues"},"dist":{"shasum":"b3084b630e8ebb44f499ba3dac7dcb77052a9f5e","tarball":"https://registry.npmjs.org/@superfunctions/db/-/db-0.1.0.tgz","fileCount":66,"integrity":"sha512-jYnWAmjXTIeDYiErK5I99sOcxkya51s9mnLFXZUACdZ7suLA7TV7WIvciV7LfZmy21JStqyTxE+lla76v1nqIQ==","signatures":[{"sig":"MEUCIQCOEza1XCC3g16knU4s/xxoe5JuFv2bHuwqDvNn8WfLxQIgXEqTnKG0PFzpV8tqFfT4MuGetw4gog9L69WB9RZOVpA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":243387},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./types":{"types":"./dist/adapter/types.d.ts"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./adapters":{"types":"./dist/adapters/index.d.ts","default":"./dist/adapters/index.js"}},"gitHead":"b1140ab1f60ad8bd57fe814cd244d543964ba55d","scripts":{"lint":"echo 'lint not configured'","test":"vitest","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --watch"},"_npmUser":{"name":"21native","email":"npm@21n.org"},"repository":{"url":"git+https://github.com/21nCo/super-functions.git","type":"git","directory":"packages/db"},"_npmVersion":"9.5.0","description":"Shared database adapter system for building useful backend libraries","directories":{},"_nodeVersion":"18.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0","drizzle-orm":"^0.35.0","better-sqlite3":"^12.5.0","@types/better-sqlite3":"^7.6.13"},"peerDependencies":{"kysely":">=0.28.0","mongodb":">=6.0.0","drizzle-orm":">=0.35.0","@prisma/client":">=6.0.0"},"peerDependenciesMeta":{"kysely":{"optional":true},"mongodb":{"optional":true},"drizzle-orm":{"optional":true},"@prisma/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/db_0.1.0_1765286053642_0.5864783256191091","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@superfunctions/db","version":"0.1.1","keywords":["database","adapter","orm","drizzle","prisma","kysely","mongodb","superfunctions"],"author":{"name":"21nCo"},"license":"MIT","_id":"@superfunctions/db@0.1.1","maintainers":[{"name":"21native","email":"npm@21n.org"}],"homepage":"https://github.com/21nCo/super-functions#readme","bugs":{"url":"https://github.com/21nCo/conduct/issues"},"dist":{"shasum":"b08cb675cd9149270c0eb6d175a969e7334c906e","tarball":"https://registry.npmjs.org/@superfunctions/db/-/db-0.1.1.tgz","fileCount":66,"integrity":"sha512-dH8AC4/klJKWN6gtW9WXKqc6NFuHNjrQm+dZTI5zOTshGOrkyVNNt5ffprmctlD1Ij1YHkAY16UuztLV4cfZwg==","signatures":[{"sig":"MEUCIAQIUFx3I1WWkdVTb8NCBasdeubuErwlEk/CzKTMQI8pAiEAyH25xo97Vl89+OuhB41qkUOByY9vVn5+v2Qhh6XWkrk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":241950},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./types":{"types":"./dist/adapter/types.d.ts"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./adapters":{"types":"./dist/adapters/index.d.ts","default":"./dist/adapters/index.js"}},"gitHead":"b1140ab1f60ad8bd57fe814cd244d543964ba55d","scripts":{"lint":"echo 'lint not configured'","test":"vitest","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --watch"},"_npmUser":{"name":"21native","email":"npm@21n.org"},"repository":{"url":"git+https://github.com/21nCo/super-functions.git","type":"git","directory":"packages/db"},"_npmVersion":"9.5.0","description":"Shared database adapter system for building useful backend libraries","directories":{},"_nodeVersion":"18.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0","drizzle-orm":"^0.35.0","better-sqlite3":"^12.5.0","@types/better-sqlite3":"^7.6.13"},"peerDependencies":{"kysely":">=0.28.0","mongodb":">=6.0.0","drizzle-orm":">=0.35.0","@prisma/client":">=6.0.0"},"peerDependenciesMeta":{"kysely":{"optional":true},"mongodb":{"optional":true},"drizzle-orm":{"optional":true},"@prisma/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/db_0.1.1_1765286428946_0.9649503408184903","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@superfunctions/db","version":"0.1.2","keywords":["database","adapter","orm","drizzle","prisma","kysely","mongodb","superfunctions"],"author":{"name":"21n"},"license":"MIT","_id":"@superfunctions/db@0.1.2","maintainers":[{"name":"21native","email":"npm@21n.org"}],"homepage":"https://github.com/21nCo/super-functions#readme","bugs":{"url":"https://github.com/21nCo/conduct/issues"},"dist":{"shasum":"64c82177572408b190e95eba44a9e1755a347d20","tarball":"https://registry.npmjs.org/@superfunctions/db/-/db-0.1.2.tgz","fileCount":66,"integrity":"sha512-MpdGNMNqfVR0qt7tn3wL68derzJiummy7jNjAWJ+a4BEos+LM1Ubj9kZfHZM4gJOHKJZWcvXzodjA1jN2WyXfQ==","signatures":[{"sig":"MEQCICebPmmB/K/IPCaW2F12lAlnrEczsaGaH3YQ8lhSm3VvAiAjcvNI5v7e/UaGtHgXE8KOrHTx4zMeOsvkxBShkt1fTg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242637},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./types":{"types":"./dist/adapter/types.d.ts"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./adapters":{"types":"./dist/adapters/index.d.ts","default":"./dist/adapters/index.js"}},"gitHead":"b1140ab1f60ad8bd57fe814cd244d543964ba55d","scripts":{"lint":"echo 'lint not configured'","test":"vitest","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --watch"},"_npmUser":{"name":"21native","email":"npm@21n.org"},"repository":{"url":"git+https://github.com/21nCo/super-functions.git","type":"git","directory":"packages/db"},"_npmVersion":"11.6.1","description":"Shared database adapter system for building useful backend libraries","directories":{},"_nodeVersion":"23.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0","drizzle-orm":"^0.35.0","better-sqlite3":"^12.5.0","@types/better-sqlite3":"^7.6.13"},"peerDependencies":{"kysely":">=0.28.0","mongodb":">=6.0.0","drizzle-orm":">=0.35.0","@prisma/client":">=6.0.0"},"peerDependenciesMeta":{"kysely":{"optional":true},"mongodb":{"optional":true},"drizzle-orm":{"optional":true},"@prisma/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/db_0.1.2_1767516849522_0.07803534773313214","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@superfunctions/db","version":"0.1.3","keywords":["database","adapter","orm","drizzle","prisma","kysely","mongodb","superfunctions"],"author":{"name":"21n"},"license":"MIT","_id":"@superfunctions/db@0.1.3","maintainers":[{"name":"21native","email":"npm@21n.org"}],"homepage":"https://github.com/21nCo/super-functions#readme","bugs":{"url":"https://github.com/21nCo/conduct/issues"},"dist":{"shasum":"f2fbad3f2d15701c3d0ac7d9fa0890fca564a4aa","tarball":"https://registry.npmjs.org/@superfunctions/db/-/db-0.1.3.tgz","fileCount":66,"integrity":"sha512-GfinBRUGY6wwOo5cZ3C5pdndECyDfUb3K3VE6egQeKbcWh7hMZIfyIUoGdvrTb2rqTQixcgr6GO1Hpv9BNfrNw==","signatures":[{"sig":"MEUCIQCoZUYFWeeWPOXlEneF8i2f1HNwHWRVNBgFC+hAlaoArwIgAtqmtpYOkMgmdrftMIGrIHOUCJf0qBIDwTHNQUuL/Vk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242637},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./types":{"types":"./dist/adapter/types.d.ts"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./adapters":{"types":"./dist/adapters/index.d.ts","default":"./dist/adapters/index.js"}},"gitHead":"b1140ab1f60ad8bd57fe814cd244d543964ba55d","scripts":{"lint":"echo 'lint not configured'","test":"vitest","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --watch"},"_npmUser":{"name":"21native","email":"npm@21n.org"},"repository":{"url":"git+https://github.com/21nCo/super-functions.git","type":"git","directory":"packages/db"},"_npmVersion":"11.6.1","description":"Shared database adapter system for building useful backend libraries","directories":{},"_nodeVersion":"23.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0","drizzle-orm":"^0.35.0","better-sqlite3":"^12.5.0","@types/better-sqlite3":"^7.6.13"},"peerDependencies":{"kysely":">=0.28.0","mongodb":">=6.0.0","drizzle-orm":">=0.35.0","@prisma/client":">=6.0.0"},"peerDependenciesMeta":{"kysely":{"optional":true},"mongodb":{"optional":true},"drizzle-orm":{"optional":true},"@prisma/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/db_0.1.3_1767624249871_0.6463028444499681","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@superfunctions/db","version":"0.1.4","keywords":["database","adapter","orm","drizzle","prisma","kysely","mongodb","superfunctions"],"author":{"name":"21n"},"license":"MIT","_id":"@superfunctions/db@0.1.4","maintainers":[{"name":"21native","email":"npm@21n.org"}],"homepage":"https://github.com/21nCo/super-functions#readme","bugs":{"url":"https://github.com/21nCo/super-functions/issues"},"dist":{"shasum":"d7c67af3c4a20a6b961a8cc1767b10602517e56a","tarball":"https://registry.npmjs.org/@superfunctions/db/-/db-0.1.4.tgz","fileCount":98,"integrity":"sha512-b/E1VZd2TMLjzn3yT3RfOnlTyNvi24Y8NYJjIeSqv/PivnTLxqfuXCf/L874Ez9lvSElpZhqabjrWVgJN9JSCg==","signatures":[{"sig":"MEYCIQCNFjoRgyXCWV0hNuAl9JJt3IdWMc7aQ05tsj+kyeHKiQIhANNIpDxs82TV6aCnNz0NlqdueVQbF6VgasWluAbOtwgm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":414658},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./types":{"types":"./dist/adapter/types.d.ts"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./adapters":{"types":"./dist/adapters/index.d.ts","default":"./dist/adapters/index.js"},"./adapters/memory":{"types":"./dist/adapters/memory/index.d.ts","default":"./dist/adapters/memory/index.js"},"./adapters/drizzle":{"types":"./dist/adapters/drizzle/index.d.ts","default":"./dist/adapters/drizzle/index.js"},"./adapters/cloudflare-kv":{"types":"./dist/adapters/cloudflare-kv/index.d.ts","default":"./dist/adapters/cloudflare-kv/index.js"}},"gitHead":"13d0068a71d6b6d560853e74e4ef7672eabd431f","scripts":{"lint":"echo 'lint not configured'","test":"vitest","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --watch"},"_npmUser":{"name":"21native","email":"npm@21n.org"},"repository":{"url":"git+https://github.com/21nCo/super-functions.git","type":"git","directory":"packages/db"},"_npmVersion":"10.8.2","description":"Shared database adapter system for building useful backend libraries","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"kysely":"^0.28.0","vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0","drizzle-orm":"^0.35.0","better-sqlite3":"^12.5.0","@types/better-sqlite3":"^7.6.13"},"peerDependencies":{"kysely":">=0.28.0","mongodb":">=6.0.0","drizzle-orm":">=0.35.0","@prisma/client":">=6.0.0"},"peerDependenciesMeta":{"kysely":{"optional":true},"mongodb":{"optional":true},"@prisma/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/db_0.1.4_1778737542966_0.25790959020859816","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@superfunctions/db","version":"0.2.0","keywords":["database","adapter","orm","drizzle","prisma","kysely","mongodb","superfunctions"],"author":{"name":"21n"},"license":"MIT","_id":"@superfunctions/db@0.2.0","maintainers":[{"name":"21native","email":"npm@21n.org"}],"homepage":"https://github.com/21nCo/super-functions#readme","bugs":{"url":"https://github.com/21nCo/super-functions/issues"},"dist":{"shasum":"9f685c1e4d776eaa0714dc717fbee004283e76c1","tarball":"https://registry.npmjs.org/@superfunctions/db/-/db-0.2.0.tgz","fileCount":118,"integrity":"sha512-PK+qwG1vFukIJcDZ0BtoE+xHfTaMwEJ3eVv0MULtSHasSpuX2COHUQOZGzXkGKwclXPzvcNWYcwv1J183uFQ+A==","signatures":[{"sig":"MEUCIQDKVvH7WeBPFX5SKhT++fyJ69jbicYdxsgUiLxHKdGOkgIgBV8SRIV2PK5adFcT+hV1Wwwg4gbBHsbBXYU1RhzmoiI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":540636},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./types":{"types":"./dist/adapter/types.d.ts"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./adapters":{"types":"./dist/adapters/index.d.ts","default":"./dist/adapters/index.js"},"./observability":{"types":"./dist/observability.d.ts","default":"./dist/observability.js"},"./adapters/redis":{"types":"./dist/adapters/redis/index.d.ts","default":"./dist/adapters/redis/index.js"},"./adapters/memory":{"types":"./dist/adapters/memory/index.d.ts","default":"./dist/adapters/memory/index.js"},"./adapters/drizzle":{"types":"./dist/adapters/drizzle/index.d.ts","default":"./dist/adapters/drizzle/index.js"},"./adapters/dynamodb":{"types":"./dist/adapters/dynamodb/index.d.ts","default":"./dist/adapters/dynamodb/index.js"},"./adapters/cloudflare-do":{"types":"./dist/adapters/cloudflare-do/index.d.ts","default":"./dist/adapters/cloudflare-do/index.js"},"./adapters/cloudflare-kv":{"types":"./dist/adapters/cloudflare-kv/index.d.ts","default":"./dist/adapters/cloudflare-kv/index.js"}},"gitHead":"e11bd81db6390dbc38303a5f3da6baadbaef0c8b","scripts":{"lint":"echo 'lint not configured'","test":"vitest","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --watch"},"_npmUser":{"name":"21native","email":"npm@21n.org"},"repository":{"url":"git+https://github.com/21nCo/super-functions.git","type":"git","directory":"packages/db"},"_npmVersion":"10.8.2","description":"Shared database adapter system for building useful backend libraries","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@aws-sdk/lib-dynamodb":"^3.800.0","@aws-sdk/client-dynamodb":"^3.800.0","@superfunctions/observability":"0.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"kysely":"^0.28.0","vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0","drizzle-orm":"^0.35.0","better-sqlite3":"^12.5.0","@types/better-sqlite3":"^7.6.13"},"peerDependencies":{"kysely":">=0.28.0","mongodb":">=6.0.0","drizzle-orm":">=0.35.0","@prisma/client":">=6.0.0"},"peerDependenciesMeta":{"kysely":{"optional":true},"mongodb":{"optional":true},"@prisma/client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/db_0.2.0_1787981021564_0.9030767755675333","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"_id":"@superfunctions/db@0.2.1","bugs":{"url":"https://github.com/21nCo/super-functions/issues"},"dist":{"shasum":"36f57eaef635e0a21fbebb4196926117dfa4ab1f","tarball":"https://registry.npmjs.org/@superfunctions/db/-/db-0.2.1.tgz","fileCount":118,"integrity":"sha512-1ZOzy437yoX/2mQTjN00B0nolHRDCCvoMFuuEzJXOG6+/ft2vFPk4aQexKcC/f2Cj/lxjp2kBr/wqSQfCwTBRw==","signatures":[{"sig":"MEUCIFVV5KExXiHiS+j99ZovTMMoMem7xhkZDWqCdKFBFpVOAiEAkKn7GRLraPGN0ki00M/4qB5OYH34C2aPUzG7lW6ntao=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBE28UsiPx22tZtLmWnCOOvI5hWruiK+gnzgnflFhsKIAiEAv5HoU/ISmxfTlVQKnQaly6UAZJ3pJOnQyykdGDWT2h0="}],"unpackedSize":541119},"main":"./dist/index.js","name":"@superfunctions/db","type":"module","types":"./dist/index.d.ts","author":{"name":"21n"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./types":{"types":"./dist/adapter/types.d.ts"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./adapters":{"types":"./dist/adapters/index.d.ts","default":"./dist/adapters/index.js"},"./observability":{"types":"./dist/observability.d.ts","default":"./dist/observability.js"},"./adapters/redis":{"types":"./dist/adapters/redis/index.d.ts","default":"./dist/adapters/redis/index.js"},"./adapters/memory":{"types":"./dist/adapters/memory/index.d.ts","default":"./dist/adapters/memory/index.js"},"./adapters/drizzle":{"types":"./dist/adapters/drizzle/index.d.ts","default":"./dist/adapters/drizzle/index.js"},"./adapters/dynamodb":{"types":"./dist/adapters/dynamodb/index.d.ts","default":"./dist/adapters/dynamodb/index.js"},"./adapters/cloudflare-do":{"types":"./dist/adapters/cloudflare-do/index.d.ts","default":"./dist/adapters/cloudflare-do/index.js"},"./adapters/cloudflare-kv":{"types":"./dist/adapters/cloudflare-kv/index.d.ts","default":"./dist/adapters/cloudflare-kv/index.js"}},"gitHead":"76ea582129eb3a3968844652a94eedcbe468fe2f","license":"MIT","scripts":{"lint":"echo 'lint not configured'","test":"vitest","build":"tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --watch"},"version":"0.2.1","_npmUser":{"name":"21native","email":"npm@21n.org"},"homepage":"https://github.com/21nCo/super-functions#readme","keywords":["database","adapter","orm","drizzle","prisma","kysely","mongodb","superfunctions"],"repository":{"url":"git+https://github.com/21nCo/super-functions.git","type":"git","directory":"packages/db"},"_npmVersion":"10.9.8","description":"Shared database adapter system for building useful backend libraries","directories":{},"maintainers":[{"name":"21native","email":"npm@21n.org"}],"_nodeVersion":"22.23.2","dependencies":{"@aws-sdk/lib-dynamodb":"^3.800.0","@aws-sdk/client-dynamodb":"^3.800.0","@superfunctions/observability":"0.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"kysely":"^0.28.0","vitest":"^3.2.4","typescript":"^5.6.0","@types/node":"^22.0.0","drizzle-orm":"^0.35.0","better-sqlite3":"^12.5.0","@types/better-sqlite3":"^7.6.13"},"peerDependencies":{"kysely":">=0.28.0","mongodb":">=6.0.0","drizzle-orm":">=0.35.0","@prisma/client":">=6.0.0"},"peerDependenciesMeta":{"kysely":{"optional":true},"mongodb":{"optional":true},"@prisma/client":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/db_0.2.1_1789490074413_0.9663974782172966"}}},"time":{"created":"2025-12-09T13:14:13.577Z","modified":"2026-09-15T16:34:34.680Z","0.1.0":"2025-12-09T13:14:13.808Z","0.1.1":"2025-12-09T13:20:29.089Z","0.1.2":"2026-01-04T08:54:09.679Z","0.1.3":"2026-01-05T14:44:10.040Z","0.1.4":"2026-05-14T05:45:43.137Z","0.2.0":"2026-08-29T05:23:41.760Z","0.2.1":"2026-09-15T16:34:34.503Z"},"bugs":{"url":"https://github.com/21nCo/super-functions/issues"},"author":{"name":"21n"},"license":"MIT","homepage":"https://github.com/21nCo/super-functions#readme","keywords":["database","adapter","orm","drizzle","prisma","kysely","mongodb","superfunctions"],"repository":{"url":"git+https://github.com/21nCo/super-functions.git","type":"git","directory":"packages/db"},"description":"Shared database adapter system for building useful backend libraries","maintainers":[{"name":"21native","email":"npm@21n.org"}],"readme":"# @superfunctions/db\n\nShared database adapter system for Superfunctions libraries. Provides a unified interface for interacting with databases across multiple ORMs (Drizzle, Prisma, Kysely).\n\n## Installation\n\n```bash\nnpm install @superfunctions/db\n\n# Plus your ORM of choice (optional peer dependencies)\nnpm install drizzle-orm         # For Drizzle\nnpm install @prisma/client      # For Prisma\nnpm install kysely              # For Kysely\n```\n\n## Quick Start\n\n### Using with a Library\n\n```typescript\nimport { AuthFn } from '@superfunctions/authFn';\nimport { memoryAdapter } from '@superfunctions/db/adapters';\n\n// Create adapter\nconst adapter = memoryAdapter({\n  namespace: { enabled: true }\n});\n\n// Initialize library with adapter\nconst authFn = AuthFn({ \n  database: adapter,\n  namespace: 'authFn'\n});\n\n// Use the library\nawait authFn.createUser({\n  email: 'user@example.com',\n  password: 'password',\n  name: 'John Doe',\n});\n```\n\n## Core Concepts\n\n### Adapter Interface\n\nAll adapters implement a unified interface:\n\n```typescript\ninterface Adapter {\n  // CRUD operations\n  create(params: CreateParams): Promise<T>;\n  findOne(params: FindOneParams): Promise<T | null>;\n  findMany(params: FindManyParams): Promise<T[]>;\n  update(params: UpdateParams): Promise<T>;\n  delete(params: DeleteParams): Promise<void>;\n  \n  // Batch operations\n  createMany(params: CreateManyParams): Promise<T[]>;\n  updateMany(params: UpdateManyParams): Promise<number>;\n  deleteMany(params: DeleteManyParams): Promise<number>;\n  \n  // Advanced\n  upsert(params: UpsertParams): Promise<T>;\n  count(params: CountParams): Promise<number>;\n  transaction<R>(callback: (trx: TransactionAdapter) => Promise<R>): Promise<R>;\n  \n  // Lifecycle\n  initialize(): Promise<void>;\n  isHealthy(): Promise<HealthStatus>;\n  close(): Promise<void>;\n  \n  // Schema management\n  getSchemaVersion(namespace: string): Promise<number>;\n  setSchemaVersion(namespace: string, version: number): Promise<void>;\n}\n```\n\n### Capabilities System\n\nAdapters declare their capabilities, and libraries adapt accordingly:\n\n```typescript\nconst adapter = memoryAdapter();\n\nif (adapter.capabilities.operations.batch) {\n  // Use batch operations\n  await adapter.createMany({ model: 'users', data: users });\n} else {\n  // Fallback to sequential\n  for (const user of users) {\n    await adapter.create({ model: 'users', data: user });\n  }\n}\n```\n\n### Namespace Isolation\n\nPrevent table name conflicts when multiple libraries use the same database:\n\n```typescript\nconst adapter = memoryAdapter({\n  namespace: { \n    enabled: true,\n    separator: '_'\n  }\n});\n\n// Library A\nconst authFn = AuthFn({ database: adapter, namespace: 'authFn' });\n// Tables: authFn_users, authFn_sessions, authFn_tokens\n\n// Library B\nconst fileFn = FileFn({ database: adapter, namespace: 'fileFn' });\n// Tables: fileFn_files, fileFn_folders\n\n// No conflicts!\n```\n\n## Built-in Adapters\n\n### Memory Adapter\n\nIn-memory adapter for testing and development:\n\n```typescript\nimport { memoryAdapter } from '@superfunctions/db/adapters';\n\nconst adapter = memoryAdapter({\n  namespace: { enabled: true },\n  debug: true\n});\n```\n\n### Drizzle Adapter\n\nFor Drizzle ORM (PostgreSQL, MySQL, SQLite):\n\n```typescript\nimport { drizzle } from 'drizzle-orm/node-postgres';\nimport { users, posts } from './schema';\nimport { drizzleAdapter } from '@superfunctions/db/adapters';\n\nconst db = drizzle(pool);\nconst adapter = drizzleAdapter({\n  db,\n  dialect: 'postgres', // 'postgres' | 'mysql' | 'sqlite'\n  schema: { users, posts }, // model name → drizzle table\n  upsertKeys: { users: 'email' }, // conflict targets\n  schemaVersionsTable, // optional\n  debug: false\n});\n```\n\n**Features:**\n- Full CRUD with where/orderBy/select\n- Batch operations\n- Transactions (async for Postgres/MySQL)\n- Upsert with conflict resolution\n- All where operators: eq, ne, gt, gte, lt, lte, in, not_in, contains, starts_with, ends_with\n\n### Prisma Adapter\n\nFor Prisma ORM:\n\n```typescript\nimport { PrismaClient } from '@prisma/client';\nimport { prismaAdapter } from '@superfunctions/db/adapters';\n\nconst prisma = new PrismaClient();\nconst adapter = prismaAdapter({\n  prisma,\n  modelMap: { users: 'user', posts: 'post' }, // model → Prisma model name\n  schemaVersionsTable: 'schemaVersions', // optional\n  debug: false\n});\n```\n\n**Features:**\n- Full where clause translation with AND/OR\n- Select projection and orderBy\n- Batch operations\n- Transaction support via `$transaction`\n- Upsert with unique constraints\n\n### Kysely Adapter\n\nFor Kysely query builder:\n\n```typescript\nimport { Kysely, PostgresDialect } from 'kysely';\nimport { kyselyAdapter } from '@superfunctions/db/adapters';\n\nconst db = new Kysely<Database>({\n  dialect: new PostgresDialect({ pool })\n});\n\nconst adapter = kyselyAdapter({\n  db,\n  dialect: 'postgres', // 'postgres' | 'mysql' | 'sqlite'\n  schema: { users: 'users', posts: 'posts' }, // model → table name\n  schemaVersionsTable: '__schema_versions', // optional\n  debug: false\n});\n```\n\n**Features:**\n- Type-safe query building\n- Full CRUD with all operators\n- Transactions\n- Upsert (INSERT...ON CONFLICT)\n- Multi-dialect support\n\n\n## Testing\n\nUse the built-in memory adapter for testing:\n\n```typescript\nimport { memoryAdapter } from '@superfunctions/db/testing';\nimport { describe, it, expect } from 'vitest';\n\ndescribe('My Library', () => {\n  it('should create records', async () => {\n    const adapter = memoryAdapter();\n    \n    const result = await adapter.create({\n      model: 'users',\n      data: { name: 'John' }\n    });\n    \n    expect(result).toHaveProperty('id');\n    expect(result.name).toBe('John');\n  });\n});\n```\n\n## TypeScript\n\nFull TypeScript support with strict types:\n\n```typescript\nimport type {\n  Adapter,\n  CreateParams,\n  WhereClause,\n  TableSchema\n} from '@superfunctions/db';\n\nconst adapter: Adapter = memoryAdapter();\n\nconst params: CreateParams = {\n  model: 'users',\n  data: { name: 'John' }\n};\n\nconst user = await adapter.create(params);\n```\n\n## Error Handling\n\nStandardized error classes across all adapters:\n\n```typescript\nimport { \n  AdapterError, \n  NotFoundError, \n  ConnectionError \n} from '@superfunctions/db';\n\ntry {\n  await adapter.findOne({ model: 'users', where: [{ field: 'id', operator: 'eq', value: '123' }] });\n} catch (error) {\n  if (error instanceof NotFoundError) {\n    console.log('User not found');\n  } else if (error instanceof ConnectionError) {\n    console.log('Database connection failed');\n  } else if (error instanceof AdapterError) {\n    console.log('Adapter error:', error.code);\n  }\n}\n```\n\n## License\n\nApache-2.0\n\n## Contributing\n\nContributions welcome! See [Contributing Guide](../../CONTRIBUTING.md) for details.\n\n## Related Packages\n\n- `@superfunctions/cli` - Schema management and migrations\n","readmeFilename":"README.md"}