mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-18 08:03:26 +02:00
Corrected type and fixed build errors
This commit is contained in:
@@ -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<TableRow[]>(
|
||||
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<ColumnRow[]>(
|
||||
pool.query(
|
||||
"SELECT column_name, data_type FROM information_schema.columns WHERE table_name = ?",
|
||||
[tableName],
|
||||
(error: MySQLErrorType, results: ColumnRow[]) => {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user