{"_id":"@deox/drizzle-d1-utils","_rev":"7-d629ebccd9b15fe54a1bda0baf11dc73","name":"@deox/drizzle-d1-utils","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"@deox/drizzle-d1-utils","version":"0.0.1","keywords":["drizzle-d1","cloudflare-d1"],"author":{"url":"https://github.com/kumardeo","name":"Deo Kumar"},"license":"MIT","_id":"@deox/drizzle-d1-utils@0.0.1","maintainers":[{"name":"kumardeo","email":"kumardeo080@gmail.com"}],"homepage":"https://github.com/kumardeo/deox/tree/main/packages/drizzle-d1-utils#readme","bugs":{"url":"https://github.com/kumardeo/deox/issues"},"dist":{"shasum":"84e50e045f80a11c5196dc075f6402ed89054a53","tarball":"https://registry.npmjs.org/@deox/drizzle-d1-utils/-/drizzle-d1-utils-0.0.1.tgz","fileCount":8,"integrity":"sha512-co+9bBichF8i6f11h4Lk7zjq5mC6W9xQTelSSalJ7QzQaNN7bGP21Jyv/DkgrmD40ktC2QHIqzT1QP5ylLoiJQ==","signatures":[{"sig":"MEUCIQDmc0ff7xi0h1clB2xHXa9gvDPir7q/DeGOYBKT4r/htwIgSeeOOnYhfkFrt5CBXYFm3Buz0Db3aW0oJVkZ4igOFDU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@deox%2fdrizzle-d1-utils@0.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":36476},"main":"./dist/index.cjs","type":"module","_from":"file:deox-drizzle-d1-utils-0.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"private":false,"scripts":{"build":"tsup","clean":"rimraf dist","check:types":"tsc --noEmit"},"_npmUser":{"name":"kumardeo","email":"kumardeo080@gmail.com"},"_resolved":"/tmp/25c1d824996ed840f4f82d383a941621/deox-drizzle-d1-utils-0.0.1.tgz","_integrity":"sha512-co+9bBichF8i6f11h4Lk7zjq5mC6W9xQTelSSalJ7QzQaNN7bGP21Jyv/DkgrmD40ktC2QHIqzT1QP5ylLoiJQ==","repository":{"url":"git+https://github.com/kumardeo/deox.git","type":"git","directory":"packages/drizzle-d1-utils"},"_npmVersion":"10.9.4","description":"Drizzle D1 utils","directories":{},"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","wrangler":"^4.39.0","drizzle-kit":"^0.31.7"},"peerDependencies":{"wrangler":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/drizzle-d1-utils_0.0.1_1764493728124_0.38557843022332605","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@deox/drizzle-d1-utils","version":"0.0.2","keywords":["drizzle-d1","cloudflare-d1"],"author":{"url":"https://github.com/kumardeo","name":"Deo Kumar"},"license":"MIT","_id":"@deox/drizzle-d1-utils@0.0.2","maintainers":[{"name":"kumardeo","email":"kumardeo080@gmail.com"}],"homepage":"https://github.com/kumardeo/deox/tree/main/packages/drizzle-d1-utils#readme","bugs":{"url":"https://github.com/kumardeo/deox/issues"},"dist":{"shasum":"ee1fb82951781144053f279e6cac4925fbe6061c","tarball":"https://registry.npmjs.org/@deox/drizzle-d1-utils/-/drizzle-d1-utils-0.0.2.tgz","fileCount":8,"integrity":"sha512-fAAZaxWoEU3dMrPMuVpN3mOLWljhLWExQzddg+beRbqrGkH59fu8H30eaBtQBNTwAX7PfhDjut3m10/xLureng==","signatures":[{"sig":"MEUCIH/nbszwsjZhQyl+KXq698bzDItIzyLTSayTRwquxYL0AiEA9TQZavK0bGFZgP4G/fefQQYo8SKciIiUg6BXdD4hrc0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@deox%2fdrizzle-d1-utils@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":41073},"main":"./dist/index.cjs","type":"module","_from":"file:deox-drizzle-d1-utils-0.0.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"private":false,"scripts":{"dev":"NODE_ENV=development tsup --watch","lint":"biome lint ./src","build":"NODE_ENV=production tsup","check":"biome check ./src","check:types":"tsc --noEmit"},"_npmUser":{"name":"kumardeo","email":"kumardeo080@gmail.com"},"_resolved":"/tmp/96c1a6e292402cd7377d062aa001f9f4/deox-drizzle-d1-utils-0.0.2.tgz","_integrity":"sha512-fAAZaxWoEU3dMrPMuVpN3mOLWljhLWExQzddg+beRbqrGkH59fu8H30eaBtQBNTwAX7PfhDjut3m10/xLureng==","repository":{"url":"git+https://github.com/kumardeo/deox.git","type":"git","directory":"packages/drizzle-d1-utils"},"_npmVersion":"10.9.4","description":"Drizzle D1 utils","directories":{},"_nodeVersion":"22.22.1","dependencies":{"prompt-sync":"^4.2.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","wrangler":"^4.76.0","drizzle-kit":"^0.21.3","@types/prompt-sync":"^4.2.3"},"peerDependencies":{"wrangler":"^4.0.0","drizzle-kit":">=0.21.3"},"_npmOperationalInternal":{"tmp":"tmp/drizzle-d1-utils_0.0.2_1774225098524_0.20831271651388117","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@deox/drizzle-d1-utils","version":"0.0.3","keywords":["drizzle-d1","cloudflare-d1"],"author":{"url":"https://github.com/kumardeo","name":"Deo Kumar"},"license":"MIT","_id":"@deox/drizzle-d1-utils@0.0.3","maintainers":[{"name":"kumardeo","email":"kumardeo080@gmail.com"}],"homepage":"https://github.com/kumardeo/deox/tree/main/packages/drizzle-d1-utils#readme","bugs":{"url":"https://github.com/kumardeo/deox/issues"},"dist":{"shasum":"ead474360335ab95f6838cf0481c180b4a05142e","tarball":"https://registry.npmjs.org/@deox/drizzle-d1-utils/-/drizzle-d1-utils-0.0.3.tgz","fileCount":30,"integrity":"sha512-STpT/vuOLpOrMIBfD+ySrkFtXK2ZH8YOM+5lpWohUIuhxRgVwJ9YwUEvQ4Q+5p9MPrktQdjr3f9MGRR/2QhZVg==","signatures":[{"sig":"MEUCIQDCSC322DHcn3qsnB46SKNLnqwVe7Sabx7tgUYNwx3c6QIgKhhIYDoeZAyugD8R1W5px6JlSgiJ1hY+yF7T+J76/B0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@deox%2fdrizzle-d1-utils@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":76400},"main":"./dist/index.cjs","type":"module","_from":"file:deox-drizzle-d1-utils-0.0.3.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"private":false,"scripts":{"dev":"NODE_ENV=development tsdown --watch","lint":"biome lint ./src","build":"NODE_ENV=production tsdown","check":"biome check ./src","check:types":"tsc --noEmit"},"_npmUser":{"name":"kumardeo","email":"kumardeo080@gmail.com"},"_resolved":"/tmp/1817357f9fbc3714161866d15bab51e7/deox-drizzle-d1-utils-0.0.3.tgz","_integrity":"sha512-STpT/vuOLpOrMIBfD+ySrkFtXK2ZH8YOM+5lpWohUIuhxRgVwJ9YwUEvQ4Q+5p9MPrktQdjr3f9MGRR/2QhZVg==","repository":{"url":"git+https://github.com/kumardeo/deox.git","type":"git","directory":"packages/drizzle-d1-utils"},"_npmVersion":"10.9.4","description":"Drizzle D1 utils","directories":{},"_nodeVersion":"22.22.1","dependencies":{"prompt-sync":"^4.2.0"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.21.4","wrangler":"^4.76.0","drizzle-kit":"^0.21.3","@types/prompt-sync":"^4.2.3"},"peerDependencies":{"wrangler":"^4.0.0","drizzle-kit":">=0.21.3"},"_npmOperationalInternal":{"tmp":"tmp/drizzle-d1-utils_0.0.3_1774357745615_0.9470193689516762","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@deox/drizzle-d1-utils","version":"0.0.4","keywords":["drizzle-d1","cloudflare-d1"],"author":{"url":"https://github.com/kumardeo","name":"Deo Kumar"},"license":"MIT","_id":"@deox/drizzle-d1-utils@0.0.4","maintainers":[{"name":"kumardeo","email":"kumardeo080@gmail.com"}],"homepage":"https://github.com/kumardeo/deox/tree/main/packages/drizzle-d1-utils#readme","bugs":{"url":"https://github.com/kumardeo/deox/issues"},"dist":{"shasum":"3bdd121aa65c52ad6787a3498ab7e0efa8ced2d2","tarball":"https://registry.npmjs.org/@deox/drizzle-d1-utils/-/drizzle-d1-utils-0.0.4.tgz","fileCount":30,"integrity":"sha512-Fv59RsZNTlDOkEuCkwzdlnjrEmv/5ijzxhmrnLLNKLFI4pjX6d8mj1ADzY9XFhLGOExLi/sLXOcibcrgLmsm9Q==","signatures":[{"sig":"MEUCIEWf4e2Z11b3FqFIq7z5pNKJ5fR2DiI0OTDV1HQGlAx7AiEA6ZUHWXkqAnGUMHeYtL/epx2NsDRWMW+PPoti35UbiBE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@deox%2fdrizzle-d1-utils@0.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":76775},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"scripts":{"dev":"NODE_ENV=development tsdown --watch","lint":"biome lint ./src","build":"NODE_ENV=production tsdown","check":"biome check ./src","check:types":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:eeb63ffc-4209-4b92-8520-9b793f63469f"}},"repository":{"url":"https://github.com/kumardeo/deox","type":"git","directory":"packages/drizzle-d1-utils"},"description":"Drizzle D1 utils","directories":{},"_nodeVersion":"22.23.0","dependencies":{"prompt-sync":"^4.2.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.0","wrangler":"^4.94.0","@types/node":"^25.9.0","drizzle-kit":"^0.31.10","@types/prompt-sync":"^4.2.3"},"peerDependencies":{"wrangler":"^4.0.0","drizzle-kit":">=0.21.3"},"_npmOperationalInternal":{"tmp":"tmp/drizzle-d1-utils_0.0.4_1782391889961_0.04193053061381535","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@deox/drizzle-d1-utils","version":"0.0.5","keywords":["drizzle-d1","cloudflare-d1"],"author":{"url":"https://github.com/kumardeo","name":"Deo Kumar"},"license":"MIT","_id":"@deox/drizzle-d1-utils@0.0.5","maintainers":[{"name":"kumardeo","email":"kumardeo080@gmail.com"}],"homepage":"https://github.com/kumardeo/deox/tree/main/packages/drizzle-d1-utils#readme","bugs":{"url":"https://github.com/kumardeo/deox/issues"},"dist":{"shasum":"456ffd456473747e28f5a4abd417250b8796e75a","tarball":"https://registry.npmjs.org/@deox/drizzle-d1-utils/-/drizzle-d1-utils-0.0.5.tgz","fileCount":30,"integrity":"sha512-Dq3TsOJFzLFovrHfGKB0mxcN8lcwDf/UM16YtiWaXzB2DaM577VHt5aUStXhQ+upaB1GodhX8PkxK0cgcfLxyA==","signatures":[{"sig":"MEQCIAl2VGihV1adoFE8DOFJwv2ZRfNcxHaiuRD7VM9lOgtVAiBzU3o0SPuHN8MHy8Mlw5VUIO9o9Flnv/aGgyoZ3hWvsQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@deox%2fdrizzle-d1-utils@0.0.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":77903},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"scripts":{"dev":"NODE_ENV=development tsdown --watch","lint":"biome lint ./src","build":"NODE_ENV=production tsdown","check":"biome check ./src","check:types":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:eeb63ffc-4209-4b92-8520-9b793f63469f"}},"repository":{"url":"https://github.com/kumardeo/deox","type":"git","directory":"packages/drizzle-d1-utils"},"description":"Drizzle D1 utils","directories":{},"_nodeVersion":"22.23.1","dependencies":{"prompt-sync":"^4.2.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.0","wrangler":"^4.94.0","@types/node":"^25.9.0","drizzle-kit":"^0.31.10","@types/prompt-sync":"^4.2.3","@cloudflare/workers-utils":"^0.26.0"},"peerDependencies":{"wrangler":"^4.0.0","drizzle-kit":">=0.21.3"},"_npmOperationalInternal":{"tmp":"tmp/drizzle-d1-utils_0.0.5_1783714727673_0.49810191423638983","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@deox/drizzle-d1-utils","version":"0.0.6","keywords":["drizzle-d1","cloudflare-d1"],"author":{"url":"https://github.com/kumardeo","name":"Deo Kumar"},"license":"MIT","_id":"@deox/drizzle-d1-utils@0.0.6","maintainers":[{"name":"kumardeo","email":"kumardeo080@gmail.com"}],"homepage":"https://github.com/kumardeo/deox/tree/main/packages/drizzle-d1-utils#readme","bugs":{"url":"https://github.com/kumardeo/deox/issues"},"dist":{"shasum":"26b9cc74c915f6a226d1334e692511512d56cced","tarball":"https://registry.npmjs.org/@deox/drizzle-d1-utils/-/drizzle-d1-utils-0.0.6.tgz","fileCount":30,"integrity":"sha512-bC4AlQoNNrTH2FZxqQZwpwKt3D/MYuoRkx5/PBxtkbycxEHV52ReewTQ5dFqx1KASHjbtaLVQGkj8S2sseEnSg==","signatures":[{"sig":"MEUCIQDdCHvO6032MREB7Rj9t9xu0q5i7UZzygw+0JVDDNJIDgIgJhRiMvF0WL8BgmqU/kfKTPFZGvAlN5Uh02M7QMDJNzs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@deox%2fdrizzle-d1-utils@0.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":79387},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"scripts":{"dev":"NODE_ENV=development tsdown --watch","lint":"biome lint ./src","build":"NODE_ENV=production tsdown","check":"biome check ./src","check:types":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:eeb63ffc-4209-4b92-8520-9b793f63469f"}},"repository":{"url":"https://github.com/kumardeo/deox","type":"git","directory":"packages/drizzle-d1-utils"},"description":"Drizzle D1 utils","directories":{},"_nodeVersion":"22.23.2","dependencies":{"prompt-sync":"^4.2.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.0","wrangler":"^4.94.0","@types/node":"^25.9.0","drizzle-kit":"^0.31.10","@types/prompt-sync":"^4.2.3","@cloudflare/workers-utils":"^0.26.0"},"peerDependencies":{"wrangler":"^4.0.0","drizzle-kit":">=0.21.3"},"_npmOperationalInternal":{"tmp":"tmp/drizzle-d1-utils_0.0.6_1787259442437_0.2774141611660217","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@deox/drizzle-d1-utils","version":"0.1.0","description":"Drizzle D1 utils","keywords":["drizzle-d1","cloudflare-d1"],"license":"MIT","author":{"name":"Deo Kumar","url":"https://github.com/kumardeo"},"homepage":"https://github.com/kumardeo/deox/tree/main/packages/drizzle-d1-utils#readme","repository":{"type":"git","url":"https://github.com/kumardeo/deox","directory":"packages/drizzle-d1-utils"},"bugs":{"url":"https://github.com/kumardeo/deox/issues"},"publishConfig":{"access":"public","provenance":true},"type":"module","main":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.mts","exports":{"./package.json":"./package.json",".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"peerDependencies":{"drizzle-kit":">=0.21.3","wrangler":"^4.0.0"},"dependencies":{"prompt-sync":"^4.2.0"},"devDependencies":{"@cloudflare/workers-utils":"^0.34.0","@types/node":"^26.2.0","@types/prompt-sync":"^4.2.3","drizzle-kit":"^0.31.10","tsdown":"^0.22.14","wrangler":"^4.125.0"},"scripts":{"lint":"biome lint ./src","check":"biome check ./src","check:types":"tsc --noEmit","build":"NODE_ENV=production tsdown","dev":"NODE_ENV=development tsdown --watch"},"_nodeVersion":"22.23.2","_id":"@deox/drizzle-d1-utils@0.1.0","dist":{"integrity":"sha512-IzCnMpWvz/8oP562RMZyY12jASXn2HU0fxupwM6TEX3Wwc42VBHsll1L28aU8ueMVjuozShPQwvthZxs9IAwwQ==","shasum":"a3c6bf080ba0158c4363d3c329eabe6c5175ef1e","tarball":"https://registry.npmjs.org/@deox/drizzle-d1-utils/-/drizzle-d1-utils-0.1.0.tgz","fileCount":16,"unpackedSize":42792,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@deox%2fdrizzle-d1-utils@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDRXwldi9N0XxqWHaRpi98JYLYxqGydHKXkun+si4xYsQIhAMzdB+HbonFYDR2U8K3s/LjWDQENgB9RVQEknob6DAHs"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:eeb63ffc-4209-4b92-8520-9b793f63469f"}},"directories":{},"maintainers":[{"name":"kumardeo","email":"kumardeo080@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/drizzle-d1-utils_0.1.0_1787435154286_0.7653047183330264"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-30T09:08:47.998Z","modified":"2026-08-22T21:45:54.759Z","0.0.1":"2025-11-30T09:08:48.351Z","0.0.2":"2026-03-23T00:18:18.672Z","0.0.3":"2026-03-24T13:09:05.760Z","0.0.4":"2026-06-25T12:51:30.100Z","0.0.5":"2026-07-10T20:18:47.830Z","0.0.6":"2026-08-20T20:57:22.581Z","0.1.0":"2026-08-22T21:45:54.432Z"},"bugs":{"url":"https://github.com/kumardeo/deox/issues"},"author":{"name":"Deo Kumar","url":"https://github.com/kumardeo"},"license":"MIT","homepage":"https://github.com/kumardeo/deox/tree/main/packages/drizzle-d1-utils#readme","keywords":["drizzle-d1","cloudflare-d1"],"repository":{"type":"git","url":"https://github.com/kumardeo/deox","directory":"packages/drizzle-d1-utils"},"description":"Drizzle D1 utils","maintainers":[{"name":"kumardeo","email":"kumardeo080@gmail.com"}],"readme":"# @deox/drizzle-d1-utils\n\nA helper that builds a complete [Drizzle Kit](https://orm.drizzle.team/kit-docs/overview) `Config` object pre-configured for a [Cloudflare D1](https://developers.cloudflare.com/d1/) database. It reads your Wrangler configuration to resolve the correct binding, handles local SQLite file creation automatically, and switches between local, remote, and preview modes with a single option.\n\n## Installation\n\n```bash\nnpm install -D @deox/drizzle-d1-utils\n```\n\n`drizzle-kit` and `wrangler` are peer dependencies and must also be present in your project:\n\n```bash\nnpm install -D drizzle-kit wrangler\n```\n\nWhen using a **local database**, Drizzle Kit also requires a SQLite driver. Install one of:\n\n```bash\nnpm install -D better-sqlite3\n# or\nnpm install -D @libsql/client\n```\n\n## Quick Start\n\n```ts\n// drizzle.config.ts\nimport { drizzleD1Config } from \"@deox/drizzle-d1-utils\";\n\nexport default drizzleD1Config(\n  { schema: \"./src/schema.ts\", out: \"./drizzle\" },\n  { binding: \"DB\" },\n);\n```\n\nRun Drizzle Kit as normal:\n\n```bash\nnpx drizzle-kit generate\nnpx drizzle-kit migrate\n```\n\n## Modes\n\n### Local (default)\n\nReads the SQLite file path from your Wrangler config and passes it to Drizzle Kit as `dbCredentials.url`. This is the default for local development.\n\n> **Requires a SQLite driver:** install either `better-sqlite3` or `@libsql/client` — see [Installation](#installation).\n\n```ts\nexport default drizzleD1Config(\n  { schema: \"./src/schema.ts\", out: \"./drizzle\" },\n  { binding: \"DB\" },\n);\n```\n\nIf the SQLite file does not exist yet, the helper detects this and offers to run `wrangler d1 execute --local` interactively to create it. You will see a prompt like:\n\n```\n[!] SQLite file for D1 binding 'DB' does not exist.\n[!] The file can be created by executing the following command:\n    wrangler d1 execute MyDatabase --command='SELECT 1' --local\n[!] Run this command to create it? (y/N)\n```\n\nAnswering `y` creates the file and continues. Answering `n` throws an error and exits.\n\n### Remote\n\nTargets the live Cloudflare D1 database via the HTTP API (`d1-http` driver). Requires `accountId` and `apiToken`.\n\n```ts\nexport default drizzleD1Config(\n  { schema: \"./src/schema.ts\", out: \"./drizzle\" },\n  {\n    binding: \"DB\",\n    remote: true,\n    accountId: process.env.CF_ACCOUNT_ID,\n    apiToken: process.env.CF_API_TOKEN,\n  },\n);\n```\n\n> **Tip:** Store credentials in environment variables and never commit them to source control.\n\nThe `remote` option also inherits its default from the binding's own `remote` flag in the Wrangler config (if set), so you can configure it once in `wrangler.toml` rather than repeating it here.\n\n### Preview\n\nTargets the `preview_database_id` declared in the Wrangler config instead of the production `database_id`. Can be combined with either local or remote mode.\n\n```ts\nexport default drizzleD1Config(\n  { schema: \"./src/schema.ts\", out: \"./drizzle\" },\n  { binding: \"DB\", preview: true },\n);\n```\n\n---\n\n## API\n\n### `drizzleD1Config(config, options?)`\n\nBuilds and returns a complete Drizzle Kit `Config`.\n\n| Parameter | Type | Description |\n| --------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `config` | `DrizzleKitConfig` | Base Drizzle Kit config — `schema`, `out`, `migrations`, etc. The `dialect`, `driver`, and `dbCredentials` fields are injected automatically and must not be set here. |\n| `options` | `DrizzleD1Options` | D1-specific options (see below). All fields are optional. |\n\n**Returns** a complete `Config` object ready to be the default export of `drizzle.config.ts`.\n\n---\n\n### `DrizzleD1Options`\n\n| Option | Type | Default | Description |\n| ------------- | --------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------- |\n| `binding` | `string` | First D1 binding found | Name of the D1 binding as declared in the Wrangler config. |\n| `environment` | `string` | — | Wrangler environment name (e.g. `\"staging\"`, `\"production\"`). |\n| `configPath` | `string` | — | Path to the Wrangler config file (`wrangler.toml` or `wrangler.json`). |\n| `persistTo` | `string` | — | Directory where the local D1 SQLite file is persisted. |\n| `remote` | `boolean` | Binding's `remote` flag, or `false` | When `true`, connects to the remote Cloudflare D1 database via the HTTP API. Requires `accountId` and `apiToken`. |\n| `preview` | `boolean` | `false` | When `true`, targets the `preview_database_id` instead of `database_id`. |\n| `accountId` | `string` | — | Cloudflare account ID. Required when `remote` is `true`. |\n| `apiToken` | `string` | — | Cloudflare API token with D1 read/write permissions. Required when `remote` is `true`. |\n\n---\n\n### `DrizzleKitConfig`\n\nA re-export of Drizzle Kit's `Config` type with `dialect`, `driver`, and `dbCredentials` omitted. Use this type when building the first argument to `drizzleD1Config` programmatically.\n\n```ts\nimport type { DrizzleKitConfig } from \"@deox/drizzle-d1-utils\";\n\nconst base: DrizzleKitConfig = {\n  schema: \"./src/schema.ts\",\n  out: \"./drizzle\",\n};\n```\n\n---\n\n## Error Reference\n\n| Error | Cause |\n| ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| `Options accountId, apiToken are required when using remote database. Missing: ...` | `remote: true` was set but one or both credentials were not provided. |\n| `database_id is not set for D1 binding '...'` | The resolved binding has no `database_id` in the Wrangler config. |\n| `preview_database_id is not set for D1 binding '...'` | `preview: true` was set but the binding has no `preview_database_id`. |\n| `Could not find SQLite file for D1 binding '...'` | Local mode: the SQLite file does not exist and could not be created (either `wrangler` was not found, or the user declined the prompt). |\n| `Aborted by user.` | The interactive prompt to create the SQLite file was declined. |\n\n---\n\n## Console Output\n\nEvery run prints a summary of the resolved database before Drizzle Kit executes:\n\n```\n----------------------------------------------------------\n  Using following D1 Database:\n----------------------------------------------------------\n  Binding        : DB\n  Database name  : MyDatabase\n  Database Id    : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n  Mode           : LOCAL\n                   (using local SQLite database)\n  SQLite file    : .wrangler/state/v3/d1/miniflare-D1DatabaseObject/abc123.sqlite\n----------------------------------------------------------\n```\n\nIn remote mode, `Mode` shows `REMOTE` and the SQLite file line is omitted.\n\n---\n\n## Examples\n\n### Multiple environments\n\n```ts\n// drizzle.config.ts\nimport { drizzleD1Config } from \"@deox/drizzle-d1-utils\";\n\nconst env = process.env.ENV ?? \"development\";\n\nexport default drizzleD1Config(\n  { schema: \"./src/schema.ts\", out: \"./drizzle\" },\n  { binding: \"DB\", environment: env },\n);\n```\n\n### Remote with preview database\n\n```ts\nexport default drizzleD1Config(\n  { schema: \"./src/schema.ts\", out: \"./drizzle\" },\n  {\n    binding: \"DB\",\n    remote: true,\n    preview: true,\n    accountId: process.env.CF_ACCOUNT_ID,\n    apiToken: process.env.CF_API_TOKEN,\n  },\n);\n```\n\n### Custom Wrangler config path\n\n```ts\nexport default drizzleD1Config(\n  { schema: \"./src/schema.ts\", out: \"./drizzle\" },\n  {\n    binding: \"DB\",\n    configPath: \"./config/wrangler.toml\",\n    persistTo: \"./.wrangler/state\",\n  },\n);\n```\n","readmeFilename":""}