{"id":17277668,"url":"https://github.com/vin65/npm-mssql","last_synced_at":"2025-04-14T09:14:38.212Z","repository":{"id":65465079,"uuid":"112260942","full_name":"Vin65/npm-mssql","owner":"Vin65","description":"NodeJS npm module to connect to MSSQL","archived":false,"fork":false,"pushed_at":"2023-04-19T14:17:15.000Z","size":152,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-14T09:14:30.630Z","etag":null,"topics":["mssql","npm","npm-package"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vin65.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-27T23:28:38.000Z","updated_at":"2022-11-03T06:16:39.000Z","dependencies_parsed_at":"2025-02-25T02:36:56.968Z","dependency_job_id":"148f295c-e9d9-49ef-b72b-107a35ae851a","html_url":"https://github.com/Vin65/npm-mssql","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vin65%2Fnpm-mssql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vin65%2Fnpm-mssql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vin65%2Fnpm-mssql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vin65%2Fnpm-mssql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vin65","download_url":"https://codeload.github.com/Vin65/npm-mssql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852183,"owners_count":21171842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mssql","npm","npm-package"],"created_at":"2024-10-15T09:09:39.777Z","updated_at":"2025-04-14T09:14:38.183Z","avatar_url":"https://github.com/Vin65.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Installation\n* `npm install --save npm-mssql`\n\n* Ensure the following environment variables are added to your secrets:\n  * `MSSQL_SERVER`\n    - IP Address of `vin65master` database\n  * `MSSQL_USERNAME`\n    - Username for accessing all databases\n  * `MSSQL_PASSWORD`\n    - Password for username for accessing all databases\n  \n# Usage\n\n### `MssqlClient`\n* Add `const MssqlClient = require('npm-mssql/objects/MssqlClient');` to make `MssqlClient` constructor available to your code.\n\n* To create a new `MssqlClient` instance, call `new MssqlClient(config)` where `config` is a required hash object that contains the following properties:\n  * `datasource`\n  * `server`\n  * `username`\n  * `password`\n\n* The initially provided config can also be updated via called `.setConfig(config)` where `config` is a required hash object containing the properties listed above.\n\n* To execute a query, call `.execute(query, params)`, where `query` is a required `string` that is a valid `SQL` statement, and `params` is optional hash object containing parameters for the `SQL` query.\n\n### `MssqlConfig`\n* Add `const MssqlConfig = require('npm-mssql/objects/MssqlConfig');` to make `MssqlConfig` constructor available to your code.\n\n* To get an instance of `MssqlConfig`, call `MssqlConfig.singleton(environment)`, where `environment` is an optional `string`, which can be specified to be `production` to fetch `Production` Datasources information from `vin65master` datasource. Otherwise, `staging` datasource information will be returned using the provided `MSSQL_SERVER` environment variable.\n  * **DO NOT** call `new MssqlConfig()` directly.\n  * _If you need to destroy the singleton instance, call `MssqlConfig.resetSingleton()`._\n\n* To fetch datasource config for a given datasource name, such as `pinewines`, call `singleton.for_(datasource)`, where `datasource` is a required `string` that is the name of datasource.\n\n* The name of the master datasource is available via `.masterDatasource()` method. Currently, it's set to `vin65master`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvin65%2Fnpm-mssql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvin65%2Fnpm-mssql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvin65%2Fnpm-mssql/lists"}