← All procedures
db.execute
Execute a SQL statement (INSERT, UPDATE, DELETE)
MCPCLI- Package
- @procedures/sqlite · README
- Path
["db","execute"]- CLI
mark db execute --sql <string>- MCP tool
db.execute on the dev-tools server- As data
{"$proc":["db","execute"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/sqlite"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["db","execute"], { sql: "<sql>" });
console.log(JSON.stringify(result));From the command line
$ mark db execute --sql <string>
As data, in a program
{ "$proc": ["db", "execute"], "input": { "sql": "<sql>" } }Input
| Field | Type | Required | Default | Description |
|---|
sql | string | yes | | The SQL statement or script (INSERT, UPDATE, DELETE, CREATE TABLE, ...) |
params | any[] | no | | The values of the ? placeholders of the SQL, in order |
dbPath | string | no | | The SQLite database file (default: /home/runner/logs/cli/cli.db). A query does not make a missing file. |
Output
| Field | Type | Required | Default | Description |
|---|
changes | number | yes | | The number of rows that the statements changed |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"sql": {
"type": "string",
"description": "The SQL statement or script (INSERT, UPDATE, DELETE, CREATE TABLE, ...)"
},
"params": {
"description": "The values of the ? placeholders of the SQL, in order",
"type": "array",
"items": {}
},
"dbPath": {
"description": "The SQLite database file (default: /home/runner/logs/cli/cli.db). A query does not make a missing file.",
"type": "string"
}
},
"required": [
"sql"
]
},
"output": {
"type": "object",
"properties": {
"changes": {
"type": "number",
"description": "The number of rows that the statements changed"
}
},
"required": [
"changes"
],
"additionalProperties": {}
}
}