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

Method connect

src/connectors/sqlserver/index.ts:192–204  ·  view source on GitHub ↗
(dsn: string, initScript?: string, config?: ConnectorConfig)

Source from the content-addressed store, hash-verified

190 }
191
192 async connect(dsn: string, initScript?: string, config?: ConnectorConfig): Promise<void> {
193 try {
194 this.config = await this.dsnParser.parse(dsn, config);
195
196 if (!this.config.options) {
197 this.config.options = {};
198 }
199
200 this.connection = await new sql.ConnectionPool(this.config).connect();
201 } catch (error) {
202 throw error;
203 }
204 }
205
206 async disconnect(): Promise<void> {
207 if (this.connection) {

Callers

nothing calls this directly

Calls 2

parseMethod · 0.65
connectMethod · 0.65

Tested by

no test coverage detected