@ductape/mcp 0.2.26 → 0.2.27
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/dist/index.js +37 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -780,11 +780,19 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
780
780
|
databases.migration.rollback [migrations, count?]
|
|
781
781
|
databases.migration.history []
|
|
782
782
|
databases.migration.status [migrations]
|
|
783
|
-
databases.action.create [{ product
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
783
|
+
databases.action.create [{ tag: "product:database:action", name, tableName, operation: "query"|"insert"|"update"|"delete"|"upsert"|"aggregate"|"rawSql", template: { where?, select?, limit?, offset?, orderBy?, records?, query?, params?, ... }, description?, filterTemplate? }]
|
|
784
|
+
← ADMINISTRATIVE (access key required). FORBIDDEN via ductape_execute (publishable key) —
|
|
785
|
+
use ductape_cli("db actions create -f action.json") instead. tag MUST be fully qualified
|
|
786
|
+
"product_tag:database_tag:action_tag" — a 2-part "database:action" shorthand only resolves
|
|
787
|
+
inside a long-lived process that already has that product's builder cached, never in a
|
|
788
|
+
fresh CLI/MCP call. This is pure metadata registration; it never connects to the live
|
|
789
|
+
database, so it does NOT require the database to be reachable at call time.
|
|
790
|
+
databases.action.update [{ tag, name?, description?, template?, filterTemplate? }]
|
|
791
|
+
← ADMINISTRATIVE. Use ductape_cli("db actions update --tag <tag> -f patch.json").
|
|
792
|
+
databases.action.fetch [action_tag] ← read-only, safe via ductape_execute
|
|
793
|
+
databases.action.fetchAll [database_tag] ← read-only, safe via ductape_execute.
|
|
794
|
+
NOTE: the method is fetchAll — "action.list" is not a callable method on this sub-object.
|
|
795
|
+
databases.action.delete [action_tag] ← ADMINISTRATIVE. Use ductape_cli("db actions delete <tag>").
|
|
788
796
|
databases.action.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch", targets={database: "db_tag", table: "table_name"}) — requires redisUrl in ductape initialization
|
|
789
797
|
databases.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch", targets={database: "db_tag", table: "table_name"}) — requires redisUrl in ductape initialization
|
|
790
798
|
databases.beginTransaction [{ product, env, database, isolationLevel?: "READ_COMMITTED"|"REPEATABLE_READ"|"SERIALIZABLE" }]
|
|
@@ -2399,10 +2407,30 @@ DUCTAPE DATABASE PERFORMANCE GUIDANCE
|
|
|
2399
2407
|
actions: `
|
|
2400
2408
|
DUCTAPE DATABASE ACTIONS
|
|
2401
2409
|
|
|
2402
|
-
A database action is a saved query or mutation (
|
|
2403
|
-
on
|
|
2404
|
-
|
|
2405
|
-
|
|
2410
|
+
A database action is a saved, parameterized query or mutation template (with {{placeholder}}
|
|
2411
|
+
fields) stored on a database component and executed by tag at runtime. This is what
|
|
2412
|
+
ctx.database.query/insert/update/delete inside a Feature step actually calls via its
|
|
2413
|
+
\`event\` field — Features do NOT accept the top-level {table, where} shape that
|
|
2414
|
+
sdk.databases.query/insert/update use outside of a Feature.
|
|
2415
|
+
|
|
2416
|
+
Create/update/delete are ADMINISTRATIVE (access key) — FORBIDDEN through ductape_execute
|
|
2417
|
+
(publishable key). Use ductape_cli, same as every other admin resource:
|
|
2418
|
+
ductape_cli("db actions create -f action.json")
|
|
2419
|
+
File: { tag: "product:database:action", name, tableName,
|
|
2420
|
+
operation: "query"|"insert"|"update"|"delete"|"upsert"|"aggregate"|"rawSql",
|
|
2421
|
+
template: { where?, select?, limit?, offset?, orderBy?, records?, query?, params? },
|
|
2422
|
+
description?, filterTemplate? }
|
|
2423
|
+
tag MUST be fully qualified "product_tag:database_tag:action_tag" — the SDK's 2-part
|
|
2424
|
+
"database:action" shorthand only works inside one already-warm process, never a fresh CLI call.
|
|
2425
|
+
This is pure metadata registration — it does not connect to the live database, so the
|
|
2426
|
+
database does not need to be reachable at creation time.
|
|
2427
|
+
ductape_cli("db actions update --tag <tag> -f patch.json")
|
|
2428
|
+
ductape_cli("db actions delete <tag>")
|
|
2429
|
+
|
|
2430
|
+
List/fetch are read-only and safe via ductape_execute:
|
|
2431
|
+
ductape_execute("databases.action.fetchAll", ["product_tag:database_tag"])
|
|
2432
|
+
NOTE: the method is fetchAll — "action.list" is not a callable method on this sub-object.
|
|
2433
|
+
ductape_execute("databases.action.fetch", ["product_tag:database_tag:action_tag"])
|
|
2406
2434
|
|
|
2407
2435
|
Dispatch an action at runtime:
|
|
2408
2436
|
→ CALL ductape_generate_payload FIRST to get the canonical input shape.
|
|
@@ -2414,13 +2442,6 @@ Dispatch an action at runtime:
|
|
|
2414
2442
|
input: { status: "active" },
|
|
2415
2443
|
}])
|
|
2416
2444
|
|
|
2417
|
-
List actions for a database:
|
|
2418
|
-
ductape_execute("databases.action.list", ["database_tag"])
|
|
2419
|
-
|
|
2420
|
-
Fetch:
|
|
2421
|
-
ductape_execute("databases.action.fetch", ["action_tag"])
|
|
2422
|
-
Update/delete are administrative and must be performed in Workbench.
|
|
2423
|
-
|
|
2424
2445
|
Actions are the preferred way to encapsulate complex or reused queries — they can be
|
|
2425
2446
|
scheduled, dispatched with retries, and audited via logs.
|
|
2426
2447
|
`.trim(),
|