MCPcopy Create free account
hub / github.com/bytebase/dbhub / getSchemas

Method getSchemas

src/connectors/sqlserver/index.ts:213–229  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

211 }
212
213 async getSchemas(): Promise<string[]> {
214 if (!this.connection) {
215 throw new Error("Not connected to SQL Server database");
216 }
217
218 try {
219 const result = await this.connection.request().query(`
220 SELECT SCHEMA_NAME
221 FROM INFORMATION_SCHEMA.SCHEMATA
222 ORDER BY SCHEMA_NAME
223 `);
224
225 return result.recordset.map((row: { SCHEMA_NAME: any }) => row.SCHEMA_NAME);
226 } catch (error) {
227 throw new Error(`Failed to get schemas: ${(error as Error).message}`);
228 }
229 }
230
231 async getTables(schema?: string): Promise<string[]> {
232 if (!this.connection) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected