lu-query-plan-data-changes
Skill2 starsChanged 29 days agoMITView on GitHub
Use lu-query to change Oracle rows safely - preview the blast radius with execute_dml_preview, rehearse with execute_dml_rollback_first, commit with execute_dml, and pick new keys with find_free_id or get_next_sequence_value. Use for INSERT/UPDATE/DELETE/MERGE where the user approved the change.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-and-interface-designSkill
- browser-testing-with-devtoolsSkill
- ci-cd-and-automationSkill
- code-review-and-qualitySkill
- code-reviewSkill
- code-simplificationSkill
- constraint-driven-developmentSkill
- debugging-and-error-recoverySkill
- deprecation-and-migrationSkill
- documentation-and-adrsSkill
- domain-modelingSkill
- doubt-driven-developmentSkill
- frontend-ui-engineeringSkill
- git-workflow-and-versioningSkill
- grill-meSkill
- grill-with-docsSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- incremental-implementationSkill
- observability-and-instrumentationSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- prSkill
- security-and-hardeningSkill
- setup-matt-pocock-skillsSkill
- shipping-and-launchSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- to-specSkill
- to-ticketsSkill
- using-agent-skillsSkill
- wayfinderSkill
- writing-for-agentsSkill
- lu-query-audit-data-qualitySkill
- lu-query-audit-reportSkill
- lu-query-benchmark-sqlSkill
- lu-query-explore-schemaSkill
- lu-query-manage-schemaSkill
- lu-query-query-dataSkill
- lu-query-triage-incidentSkill
- lu-query-tune-sqlSkill
- lu-query-use-plsqlSkill
The file
Files
Plan and apply data changes with lu-query
When to use
- The user has approved an INSERT, UPDATE, DELETE or MERGE on existing tables.
- You need a new primary key value from a sequence or the next free integer id.
When not to use
- The change alters structure (DDL) → lu-query-manage-schema.
- You are still deciding what to change → lu-query-audit-data-quality first.
The three modes (choose explicitly)
| Tool | Executes? | Commits? | Use for |
execute_dml_preview | no | no | always first: how many rows, which columns |
execute_dml_rollback_first | yes | no (rolled back) | rehearsing triggers, FKs and constraint violations |
execute_dml | yes | yes | the approved change, once |
Workflow
- Preview.
execute_dml_previewon the exact statement. It counts the affected rows with a mirror SELECT built from your own SQL, so an alias or a subquery in the predicate is honoured. It returnsdetectedKind,affectedRowCountand up to 10sampleRows. IfaffectedRowCountis not what you expect, stop and re-check the predicate. - Rehearse when risky.
execute_dml_rollback_firstproves the statement passes triggers/FKs/NOT NULL and showsrowsAffected, then rolls back. Use it before any bulk UPDATE. - Obtain keys deliberately.
find_free_idreturns the lowest unused integer in a range (default 1..1000, hard cap 10000) - it does not reserve it.get_next_sequence_valueconsumes the next value (gaps are normal). - Apply.
execute_dmlwith the same statement text you previewed. It commits through the chokepoint. - Verify. Re-run the read (
count_rows,run_query) and quote it. Do not report success fromrowsAffectedalone. - Record. The session audit Markdown contains the verbatim SQL,
WRITEtype and affected rows; quote that entry as evidence.
Reading results correctly
execute_dmlreturns{statementKind, rowsAffected}.execute_dml_previewreturnssampleRowsfrom the current table state, not from the statement's projection; it does not show the values the statement would write.- MERGE and exotic syntax may come back as an unknown kind from the parser; the statement still reaches Oracle unchanged. Trust Oracle's error, not the parser's guess.
Safety
execute_dmlis irreversible from the tool's point of view: no undo tool exists. Preview, then apply.- Sequences and
SYSDATEare not transactional: rollback does not return sequence numbers. - Identifiers and literals are validated/escaped by the server, but the statement is still your responsibility.
Tool reference
| Tool | Signature | Returns |
execute_dml_preview | sql* | {detectedKind, table, affectedRowCount, sampleColumns, sampleRows, sampleCount, note} |
execute_dml_rollback_first | sql* | {detectedKind, rowsAffected, rolledBack: true, note} |
execute_dml | sql* | {statementKind, rowsAffected} |
find_free_id | table*, column*, maxRange?, excludeTable?, schema? | {schema, table, column, maxRange, excludeTable, candidateId} |
get_next_sequence_value | sequence*, schema? | {schema, sequence, nextValue} |
Details: references/tools.md. Verified transcripts: references/examples.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

