{"id":43230,"library":"mssql-connection-string","title":"mssql-connection-string","description":"A small TypeScript library for parsing MS SQL Server connection strings into configuration objects compatible with knex. At version 0.3.2, it extracts host, port, database, user, and password from standard connection strings. Differentiators: built-in support for handling email-like User IDs (extracts login), optional protocol and port in Data Source, and ESM + CJS exports. The library is stable but has low activity and no recent updates. Works in Node.js environments.","status":"active","version":"0.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/nsc-c-park/mssql-connection-string","tags":["javascript","mssql","knex","bookshelf","connection","string","typescript"],"install":[{"cmd":"npm install mssql-connection-string","lang":"bash","label":"npm"},{"cmd":"yarn add mssql-connection-string","lang":"bash","label":"yarn"},{"cmd":"pnpm add mssql-connection-string","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The default export is the parse function. In TypeScript, use default import.","wrong":"const parse = require('mssql-connection-string').default","symbol":"default","correct":"import parse from 'mssql-connection-string'"},{"note":"CommonJS users should assign the whole module to a variable; there is no named export.","wrong":"const { parse } = require('mssql-connection-string')","symbol":"default","correct":"const parse = require('mssql-connection-string')"},{"note":"Only available in TypeScript with ESM-like imports; types are exported from the package.","symbol":"type","correct":"import type { ConnectionConfig, KnexConfig } from 'mssql-connection-string'"}],"quickstart":{"code":"import parse from 'mssql-connection-string';\n\nconst connStr = 'Data Source=tcp:example.com,1433;Initial Catalog=mydb;User Id=user@domain.com;Password=secret;';\nconst config = parse(connStr);\nconsole.log(config);\n// {\n//   host: 'example.com',\n//   options: { database: 'mydb', encrypt: true, port: '1433' },\n//   password: 'secret',\n//   user: 'user'\n// }","lang":"typescript","description":"Parses a typical MS SQL Server connection string and outputs configuration for knex."},"warnings":[{"fix":"Ensure the connection string follows standard MS SQL format before parsing.","message":"The package does not validate connection string syntax; invalid strings may cause unexpected results.","severity":"gotcha","affected_versions":"*"},{"fix":"If encryption is not desired, override the 'options.encrypt' field after parsing.","message":"'encrypt' is hardcoded to true in the output; there is no option to change it.","severity":"gotcha","affected_versions":"*"},{"fix":"Provide a non-email User Id or modify the library source if full email is required.","message":"If 'User Id' contains an email address, only the part before '@' is used as the user. This may break authentication if the actual expected user is the full email.","severity":"gotcha","affected_versions":"*"},{"fix":"Consider alternatives like tedious or mssql for active support.","message":"The package is not actively maintained; last release was in 2019.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.3.2':24 'activ':69 'bookshelf':81 'built':39 'built-in':38 'cjs':60 'compat':19 'configur':17 'connect':3,14,35,82 'data':56 'databas':29 'differenti':37 'email':45 'email-lik':44 'environ':77 'esm':59 'export':61 'extract':26,49 'handl':43 'host':27 'id':48 'javascript':78 'knex':21,80 'librari':8,63 'like':46 'login':50 'low':68 'ms':11 'mssql':2,79 'mssql-connection-str':1 'node.js':76 'object':18 'option':51 'pars':10 'password':32 'port':28,54 'protocol':52 'recent':72 'server':13 'small':6 'sourc':57 'sql':12 'stabl':65 'standard':34 'string':4,15,36,83 'support':41 'typescript':7,84 'updat':73 'user':30,47 'version':23 'work':74","created_at":"2026-06-05T16:58:48.394796+00:00","updated_at":"2026-06-05T16:58:48.394796+00:00","problems":[{"fix":"const parse = require('mssql-connection-string');","cause":"Incorrect import in CommonJS: using destructuring instead of assigning the default export.","error":"TypeError: parse is not a function"},{"fix":"npm install mssql-connection-string and ensure tsconfig includes node_modules.","cause":"Missing npm install or type definitions not recognized.","error":"Cannot find module 'mssql-connection-string' or its corresponding type declarations."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/nsc-c-park/mssql-connection-string#readme","github":"https://github.com/nsc-c-park/mssql-connection-string","docs":null,"changelog":null,"pypi":null,"npm":"mssql-connection-string","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}