Command Palette

Search for a command to run...

Back to skills
skill № 76878

write-rows

Changing rows through the sql-server write tool with a counted expectedRows and a person's approval. Use when inserting, updating, deleting or merging rows on…

FreeNo executable scripts
melodic-softwareby melodic-software★ 34 GitHub stars

Install write-rows in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Write rows

Preconditions

  • write runs only on a registration started with --write, against an environment whose write block names a write login and whose write mode is on. describe_environments shows the write mode and the most rows one write may expect. When writes are off there, tell the person: opening them is their change to the registration or the config.
  • Use the environment and database settled with the choose-environment skill. A write must name its database when the environment allows more than one, and a pattern counts as more than one.
  • A change of several statements that must land together goes to the run-scripts skill, never to a run of write calls: each write call commits on its own.

Workflow

  • Write one INSERT, UPDATE, DELETE or MERGE, optionally led by WITH. The write tool's own description lists what it refuses.
  • Count the rows first with query, using the exact filter the write will use. That count is expectedRows: the write commits only when the statement affects exactly that many rows of the target table, and rolls back otherwise. Never choose the number to fit whatever the statement happens to do.
  • Run preview_write on the target table. It lists the triggers on the table and the foreign keys whose delete or update action cascades from it. The row check counts only the target table, so rows a trigger or cascade changes are not counted and only this preview shows them.
  • Before the call, show the person the environment, the database, the statement, expectedRows with the query that counted it, and what preview_write listed. A person approves every write call, and this is what they need to judge it.
  • When the count is above the most the environment lets one write expect, split the write by key into calls that each stay within it.

Outcomes

  • Committed: report committed and rowCount.
  • A row-count mismatch rolls back and returns an error naming both counts, so nothing changed. Find out why the counts differ (the filter, a concurrent change, a trigger) and show the person before any new attempt.
  • After a timeout, or when a trigger returns more rows than the row cap, whether the write committed is not known. Read the table to learn its state and tell the person before anything else; never resend the write blind.
  • On a refusal, read the message and do its next step. On any other error, report the message to the person.

Next

  • The write committed and the person wants the result checked: the query-safely skill.
  • The change needs several statements to land together: the run-scripts skill.

Related

  • No sql-server registration is available, or a call reports that the config is invalid: the setup skill.

Gotchas

  • A sequence of write calls is not one transaction. When a later call fails, the earlier ones have already committed; a change that must land whole belongs in a script.
  • Leaving out database on an environment with several databases or a pattern is refused for a write, even where a read without it would run in the default database.
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the write-rows skill do?

Changing rows through the sql-server write tool with a counted expectedRows and a person's approval. Use when inserting, updating, deleting or merging rows on a sql-server registration, or a write rolled back or its outcome is unknown. Not for reads: the query-safely skill.

How do I install the write-rows skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the write-rows skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare write-rows with