{"_id":"@dahoom/cloudflare-d1-backups","_rev":"3-3ed4a6487f9f59ccd0859ee0f876a70b","time":{"created":"2023-08-08T08:29:13.256Z","0.0.1":"2023-08-08T08:11:48.960Z","modified":"2023-08-08T09:09:29.725Z","0.9.21":"2023-08-08T08:29:13.514Z","0.9.22":"2023-08-08T09:09:29.627Z"},"name":"@dahoom/cloudflare-d1-backups","dist-tags":{"latest":"0.9.22"},"versions":{"0.9.21":{"name":"@dahoom/cloudflare-d1-backups","main":"build/index.js","version":"0.9.21","scripts":{"build":"npx tsc"},"devDependencies":{"@cloudflare/workers-types":"^4.20230518.0","typescript":"^5.0.4"},"dependencies":{"@nora-soderlund/cloudflare-d1-backups":"^0.9.3"},"types":"./build/index.d.ts","description":"This is a package based heavily on [sqlite-dump for Python by simonw](https://github.com/simonw/sqlite-dump/blob/main/sqlite_dump/__init__.py) but modified to be suitable for the current state of the open alpha, experimental backend (beta), databases.","_id":"@dahoom/cloudflare-d1-backups@0.9.21","_nodeVersion":"19.9.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-rnWaBdr5vOVYvPNZn8bMS/mywnQ+p9Yes0gEeTSUF30tcBPRAsVZB5vButiY5hBKlXIFXlT8C/NAVXpuYX/4og==","shasum":"e5aea6af39d906daa87ce899f24add17605aab3e","tarball":"https://registry.npmjs.org/@dahoom/cloudflare-d1-backups/-/cloudflare-d1-backups-0.9.21.tgz","fileCount":41,"unpackedSize":139694,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICHmm8az2zUjVALVJ3RCJewwkEzUG3fEb1vKEVQja83YAiEAs9n2Ds+TURU+F07wDL3vGvVEe/ONnZsJArO8wVj7Zrw="}]},"_npmUser":{"name":"dahoom","email":"hi@bi.ls"},"directories":{},"maintainers":[{"name":"dahoom","email":"hi@bi.ls"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cloudflare-d1-backups_0.9.21_1691483353346_0.1143671334780465"},"_hasShrinkwrap":false},"0.9.22":{"name":"@dahoom/cloudflare-d1-backups","main":"build/index.js","version":"0.9.22","scripts":{"build":"npx tsc"},"devDependencies":{"@cloudflare/workers-types":"^4.20230518.0","typescript":"^5.0.4"},"dependencies":{"@nora-soderlund/cloudflare-d1-backups":"^0.9.3"},"types":"./build/index.d.ts","description":"This is a package based heavily on [sqlite-dump for Python by simonw](https://github.com/simonw/sqlite-dump/blob/main/sqlite_dump/__init__.py) but modified to be suitable for the current state of the open alpha, experimental backend (beta), databases.","_id":"@dahoom/cloudflare-d1-backups@0.9.22","_nodeVersion":"19.9.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-cJMGmRV8iD21lySA5mUKZeKNCOrSseOtbAi0iPlYNehyDMuzIvO7CuSlb4EEQT51UXuDHP7NqnnMHAyV2Xy0cA==","shasum":"7651f5fa5dc926fda83f7f94f44376fa8532b027","tarball":"https://registry.npmjs.org/@dahoom/cloudflare-d1-backups/-/cloudflare-d1-backups-0.9.22.tgz","fileCount":41,"unpackedSize":139677,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHnGD/+7U2bND2E0WLbycflOQrOlqIr/+N1Za8/zn2qhAiBi5J2cbH7zbXNE8FLdPQlzYi11TpbOTv86YqB97Qu10g=="}]},"_npmUser":{"name":"dahoom","email":"hi@bi.ls"},"directories":{},"maintainers":[{"name":"dahoom","email":"hi@bi.ls"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cloudflare-d1-backups_0.9.22_1691485769444_0.7598821363067765"},"_hasShrinkwrap":false}},"maintainers":[{"name":"dahoom","email":"hi@bi.ls"}],"description":"This is a package based heavily on [sqlite-dump for Python by simonw](https://github.com/simonw/sqlite-dump/blob/main/sqlite_dump/__init__.py) but modified to be suitable for the current state of the open alpha, experimental backend (beta), databases.","readme":"# cloudflare-d1-backups\nThis is a package based heavily on [sqlite-dump for Python by simonw](https://github.com/simonw/sqlite-dump/blob/main/sqlite_dump/__init__.py) but modified to be suitable for the current state of the open alpha, experimental backend (beta), databases.\n\nThis script has only been tested on a 660kb database, with 634 statements; from an experimental backend *to* an experimental backend.\n\n## Create a backup\nCreating a backup creates a SQL file in the destination R2 bucket.\n\n- Install the package: `npm install @nora-soderlund/cloudflare-d1-backups`.\n- Call `createBackup(D1Database, R2Bucket, CreateBackupOptions | undefined)` from an execution context.\n\n### CreateBackupOptions\n- `hourFormat`: either `(true): \"09:00:52PM\"|(false | undefined): \"20:00:52\"`, defaults to `(false | undefined): \"20:00:52\"`.\n- `fileName`: the file name for the SQL file in the R2 bucket, default is `backups/${(new Date()).toUTCString()}.sql`.\n- `cloudflarePlan`: any of `\"Free\" | \"Pro\" | \"Business\" | \"Enterprise\"`, this sets the respective `maxBodySize`, defaults to `\"Free\"` (100 MB).\n- `maxBodySize`: the maximum body size for R2 bucket uploads in MB, this depends on your plan, unless you're using Enterprise with a custom size, leave this unset.\n\n## Restoring a backup\nAssuming you've downloaded the backed up SQL file from your R2 bucket: `npx wrangler d1 execute <database> --file=<backup.sql>`\n\n## Example\nSee /example for an example worker.\n","readmeFilename":"README.md"}