@rolandohuber/mysql-mcp-server
Version:
A comprehensive MCP server for MySQL database operations with 16 tools, multi-transport support, and intelligent test data generation
32 lines • 1.01 kB
JavaScript
export const updateSchema = {
name: 'mysql_update',
description: 'Updates records in a table based on a WHERE clause',
inputSchema: {
type: 'object',
properties: {
table: {
type: 'string',
description: 'Name of the table to update',
},
data: {
type: 'object',
description: 'Object containing column-value pairs to update',
},
where: {
type: 'string',
description: 'WHERE clause condition (without the WHERE keyword)',
},
},
required: ['table', 'data', 'where'],
},
};
export async function updateHandler(mysqlService, args) {
try {
const result = await mysqlService.update(args.table, args.data, args.where);
return result;
}
catch (error) {
throw new Error(`Failed to update records in ${args.table}: ${error}`);
}
}
//# sourceMappingURL=update.js.map