-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: handle the case when the Instance is in server param * chore: sonar
- Loading branch information
1 parent
78672e4
commit 1d4b9da
Showing
1 changed file
with
7 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,10 +42,15 @@ const parseSqlServerUrl = ({ url = '' }) => { | |
// example: Server=tcp:synapseworkspace.sql.azuresynapse.net,1433;Database=SampleDB;Authentication=Active Directory Password;User [email protected];Password=password;Encrypt=true;TrustServerCertificate=false;Connection Timeout=30; | ||
const parseBasicString = ({ string = '' }) => { | ||
const parsed = ConnectionPool.parseConnectionString(string); | ||
|
||
const serverRegex = /Server=(?:[a-z]+:)?([^,;]+)(?:,\d+)?/i; | ||
const match = serverRegex.exec(string); | ||
const host = match ? match[1] : parsed.server; | ||
|
||
return { | ||
databaseName: parsed.database, | ||
host: parsed.server, | ||
host: host, | ||
port: parsed.port, | ||
databaseName: parsed.database, | ||
userName: parsed.user, | ||
userPassword: parsed.password, | ||
}; | ||
|