@farhan0431/db-snap 0.3.10 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,6 +10,8 @@ Supports **SQLite**, **PostgreSQL**, and **MySQL/MariaDB**. The npm package
10
10
  bundles prebuilt binaries for Windows x64, macOS Intel and Apple Silicon, and
11
11
  Linux x64 (glibc and musl) and ARM64 (glibc).
12
12
 
13
+ **MySQL/MariaDB restore is available for the original database.** Stop writers and scheduled events first. Restore is not atomic and requires a pinned safety snapshot. Interrupted restores must recover that snapshot before another restore.
14
+
13
15
  ## Install
14
16
 
15
17
  Requires Node.js 16 or later.
@@ -69,6 +71,10 @@ before making changes. The server also exposes tools to create, list, restore,
69
71
  and prune snapshots. It resolves the project from its working directory, so
70
72
  start it in the project you want to protect.
71
73
 
74
+ Restore and prune are disabled by default in MCP. To enable them for a server
75
+ session, start it with `dbsnap mcp --allow-destructive`. Each operation requires
76
+ approval through an MCP client supporting elicitation; otherwise use the CLI.
77
+
72
78
  `dbsnap init` also writes `.agents/skills/dbsnap/SKILL.md` in the project.
73
79
  Whether that skill is loaded automatically depends on the AI client; the skill
74
80
  file and the MCP server are separate integrations.
@@ -85,10 +91,12 @@ file and the MCP server are separate integrations.
85
91
  | `dbsnap rollback` | Restore the latest snapshot. |
86
92
  | `dbsnap prune --keep 5` | Remove older snapshots and retain the newest five. |
87
93
  | `dbsnap diff before after` | Compare SQLite snapshot schemas and table row counts. |
94
+ | `dbsnap pin <tag-or-id>` | Protect a snapshot from pruning; use `unpin` to remove protection. |
88
95
 
89
96
  `dbsnap list --json` and `dbsnap status --json` provide machine-readable
90
97
  output. SQLite `diff` does not compare individual row contents; PostgreSQL and
91
98
  MySQL/MariaDB snapshot diffs are not currently supported.
99
+ Pinned snapshots survive `prune`, including `--all`.
92
100
 
93
101
  ## Database requirements
94
102
 
@@ -100,15 +108,24 @@ MySQL/MariaDB snapshot diffs are not currently supported.
100
108
 
101
109
  PostgreSQL server-side clones are stored on the database server. Use dump mode
102
110
  when the snapshot needs to survive removal of that server's data volume.
111
+ For dump save and restore, install `pg_dump` and `pg_restore` matching the
112
+ PostgreSQL server's major version. Mismatched tools are rejected before restore.
103
113
 
104
114
  ## Safety
105
115
 
106
- - The default host guard restricts operation to local and private-network
107
- targets. MCP always uses that guard.
116
+ - MCP permits SQLite and loopback database hosts only. The CLI also permits
117
+ private-network targets by default. A local target is not necessarily safe.
108
118
  - Project binding checks that the current target matches the recorded database.
109
- - Restore verifies the selected snapshot before applying it and, by default,
119
+ - Restore checks SQLite chunks and dump artifacts before applying them and, by default,
110
120
  creates a safety snapshot first. If that snapshot cannot be created, restore
111
121
  stops; the CLI has an explicit option to skip it.
122
+ - A PostgreSQL server-side clone has a metadata fingerprint, not a content
123
+ checksum. dbsnap checks that the clone exists before restore.
124
+ - PostgreSQL restore is not atomic; an interruption can require manual
125
+ recovery. Clone and staged dump restores journal their cutover.
126
+ - PostgreSQL network connections require verified TLS. Set `DBSNAP_PG_CA_CERT`
127
+ to a trusted CA PEM file if needed; use `DBSNAP_PG_TLS=verify-full` to require
128
+ TLS on loopback connections as well.
112
129
 
113
130
  dbsnap is intended for development workflows. Keep independent backups for
114
131
  data you cannot afford to lose.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farhan0431/db-snap",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
4
4
  "description": "Instant physical database time-machine and MCP server for AI coding agents — git commit/checkout for your local database, powered by Rust.",
5
5
  "license": "MIT",
6
6
  "bin": {