TransactionBegin
Start a new database transaction to group multiple operations, ensuring data consistency and atomic execution within RushDB's graph database system.
Instructions
Begin a new database transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ttl | No | TTL in milliseconds |
Implementation Reference
- tools/TransactionBegin.ts:17-28 (handler)The core handler function that begins a new database transaction using the db.tx.begin method, optionally with a TTL configuration, and returns the transaction ID.export async function TransactionBegin(params: { ttl?: number }) { const { ttl } = params const config = ttl ? { ttl } : undefined const transaction = await db.tx.begin(config) return { success: true, transactionId: transaction.id, message: `Transaction started with ID: ${transaction.id}` } }
- tools.ts:422-430 (schema)The schema definition for the TransactionBegin tool, including input schema for optional ttl parameter, description, and name. Part of the tools array used for tool discovery.{ name: 'TransactionBegin', description: 'Begin a new database transaction', inputSchema: { type: 'object', properties: { ttl: { type: 'number', description: 'TTL in milliseconds' } }, required: [] } },
- index.ts:480-491 (registration)Registration in the MCP tool call handler switch statement, dispatching calls to the TransactionBegin function with parsed arguments.case 'TransactionBegin': const beginResult = await TransactionBegin({ ttl: args.ttl as number | undefined }) return { content: [ { type: 'text', text: `${beginResult.message}\nTransaction ID: ${beginResult.transactionId}` } ] }
- index.ts:72-76 (registration)Registration of the tools list handler, which exposes the TransactionBegin tool schema via MCP ListTools endpoint.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools } })