TransactionCommit
Commit database transactions in RushDB to finalize changes and ensure data persistence, using a transaction ID to identify specific operations.
Instructions
Commit a database transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| transactionId | Yes | Transaction ID |
Implementation Reference
- tools/TransactionCommit.ts:17-27 (handler)The core handler function that executes the TransactionCommit tool logic by committing the specified database transaction using the db.tx.commit method and returning a success response.export async function TransactionCommit(params: { transactionId: string }) { const { transactionId } = params const result = await db.tx.commit(transactionId) return { success: true, message: `Transaction '${transactionId}' committed successfully`, data: result.data } }
- tools.ts:431-439 (registration)Registration of the TransactionCommit tool in the tools array exported for MCP listTools, including name, description, and input schema validation.{ name: 'TransactionCommit', description: 'Commit a database transaction', inputSchema: { type: 'object', properties: { transactionId: { type: 'string', description: 'Transaction ID' } }, required: ['transactionId'] } },
- tools.ts:434-438 (schema)Input schema definition for the TransactionCommit tool, specifying the required transactionId parameter.inputSchema: { type: 'object', properties: { transactionId: { type: 'string', description: 'Transaction ID' } }, required: ['transactionId'] }
- index.ts:493-504 (registration)Dispatch and invocation of the TransactionCommit handler within the MCP CallToolRequest handler switch statement.case 'TransactionCommit': const commitResult = await TransactionCommit({ transactionId: args.transactionId as string }) return { content: [ { type: 'text', text: commitResult.message } ] }