@@ -410,11 +410,11 @@ async function getTableInfo(db: DatabaseConnection, tableName: string, schema: s
410410}
411411
412412// Enum functions (adapted from enums.ts)
413- async function executeGetEnumsInSchema (
414- connectionString : string ,
415- schema = 'public' ,
416- enumName ?: string ,
417- getConnectionString ?: GetConnectionStringFn
413+ async function executeGetEnumsInSchema (
414+ connectionString : string | undefined ,
415+ schema = 'public' ,
416+ enumName ?: string ,
417+ getConnectionString ?: GetConnectionStringFn
418418) : Promise < EnumInfo [ ] > {
419419 const resolvedConnectionString = getConnectionString ? getConnectionString ( connectionString ) : connectionString ;
420420 const db = DatabaseConnection . getInstance ( ) ;
@@ -450,9 +450,9 @@ async function executeGetEnumsInSchema(
450450}
451451
452452async function executeCreateEnumInSchema (
453- connectionString : string ,
454- enumName : string ,
455- values : string [ ] ,
453+ connectionString : string | undefined ,
454+ enumName : string ,
455+ values : string [ ] ,
456456 schema = 'public' ,
457457 ifNotExists = false ,
458458 getConnectionString ?: GetConnectionStringFn
@@ -562,12 +562,12 @@ export const manageSchemaTools: PostgresTool = {
562562 return { content : [ { type : 'text' , text : `Table ${ result . tableName } altered successfully.` } , { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ] } ;
563563 }
564564
565- case 'get_enums' : {
566- const result = await executeGetEnumsInSchema (
567- connStringArg || '' ,
568- schema || 'public' ,
569- enumName ,
570- getConnectionStringVal
565+ case 'get_enums' : {
566+ const result = await executeGetEnumsInSchema (
567+ connStringArg ,
568+ schema || 'public' ,
569+ enumName ,
570+ getConnectionStringVal
571571 ) ;
572572 return { content : [ { type : 'text' , text : `Fetched ${ result . length } ENUM(s).` } , { type : 'text' , text : JSON . stringify ( result , null , 2 ) } ] } ;
573573 }
@@ -578,12 +578,12 @@ export const manageSchemaTools: PostgresTool = {
578578 content : [ { type : 'text' , text : 'Error: enumName and values are required for create_enum operation' } ] ,
579579 isError : true
580580 } ;
581- }
582- const result = await executeCreateEnumInSchema (
583- connStringArg || '' ,
584- enumName ,
585- values ,
586- schema || 'public' ,
581+ }
582+ const result = await executeCreateEnumInSchema (
583+ connStringArg ,
584+ enumName ,
585+ values ,
586+ schema || 'public' ,
587587 ifNotExists || false ,
588588 getConnectionStringVal
589589 ) ;
0 commit comments