TransactionBegin
Start a database transaction to manage data operations with atomicity and consistency in RushDB's graph database.
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 implements the TransactionBegin tool logic, initiating a database transaction with optional TTL.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:425-429 (schema)Input schema for the TransactionBegin tool defining the optional 'ttl' parameter of type number.inputSchema: { type: 'object', properties: { ttl: { type: 'number', description: 'TTL in milliseconds' } }, required: [] }
- tools.ts:422-430 (registration)Registration entry for TransactionBegin in the tools array used for MCP listTools response.{ 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)Dispatch case in MCP CallToolRequestSchema handler that invokes the TransactionBegin tool.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:48-48 (registration)Import statement for the TransactionBegin handler function.import { TransactionBegin } from './tools/TransactionBegin.js'