You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nothing outside the supported vocabulary is ever guessed at: `revertFor` emits a `-- revert not derivable: <reason>` comment plus a warning; `verifyFor` emits nothing plus a warning. The list is exported as `SUPPORTED_STATEMENTS` (and `SUPPORTED_NODE_TAGS`).
32
32
33
+
## Node-level API
34
+
35
+
For consumers that compose inverses at the AST level (semantic diffing, migration generation) without round-tripping through deparsed text:
const inverse =invertStatement(facts[0]); // AST statement nodes, [] = nothing to revert, null = not derivable
41
+
const checks =existenceCheck(facts[0]); // SelectStmt check nodes, [] = nothing to check, null = not derivable
42
+
```
43
+
44
+
`invertStatement` returns the per-statement inverse as wrapped AST nodes (e.g. `{ DropStmt: {...} }`); `existenceCheck` returns the raise-on-failure checks as `SelectStmt` nodes. Both return `null` instead of guessing when derivation is not possible — including partially underivable multi-command statements.
45
+
33
46
## Supported statements
34
47
35
48
| Statement | Revert | Verify |
@@ -52,5 +65,32 @@ Nothing outside the supported vocabulary is ever guessed at: `revertFor` emits a
0 commit comments