From ef0123d8891aa89738d7f28a8443e4991cc5f452 Mon Sep 17 00:00:00 2001 From: Ben Borla Date: Mon, 9 Dec 2024 14:51:07 +0800 Subject: [PATCH] Corrected type and fixed build errors --- src/mysql/index.ts | 6 +++--- src/mysql/package.json | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mysql/index.ts b/src/mysql/index.ts index 7d14aa47..e15f2dae 100644 --- a/src/mysql/index.ts +++ b/src/mysql/index.ts @@ -44,7 +44,7 @@ const MYSQL_DB = process.env.MYSQL_DB || ""; const pool = mysql.createPool({ connectionLimit: 10, host: MYSQL_HOST, - port: MYSQL_PORT, + port: Number(MYSQL_PORT), user: MYSQL_USER, password: MYSQL_PASS, database: MYSQL_DB, @@ -54,7 +54,7 @@ const SCHEMA_PATH = "schema"; server.setRequestHandler(ListResourcesRequestSchema, async () => { return new Promise((resolve, reject) => { - pool.query( + pool.query( "SELECT table_name FROM information_schema.tables WHERE table_schema = DATABASE()", (error: MySQLErrorType, results: TableRow[]) => { if (error) reject(error); @@ -85,7 +85,7 @@ server.setRequestHandler(ReadResourceRequestSchema, async (request) => { } return new Promise((resolve, reject) => { - pool.query( + pool.query( "SELECT column_name, data_type FROM information_schema.columns WHERE table_name = ?", [tableName], (error: MySQLErrorType, results: ColumnRow[]) => { diff --git a/src/mysql/package.json b/src/mysql/package.json index d3c6dfe8..f5c72bdc 100644 --- a/src/mysql/package.json +++ b/src/mysql/package.json @@ -23,7 +23,8 @@ "mysql": "^2.18.1" }, "devDependencies": { - "@types/pg": "^8.11.10", + "@types/node": "^20.10.0", + "@types/mysql": "^2.15.26", "shx": "^0.3.4", "typescript": "^5.6.2" }