Dependency Manager
SQLTools can automatically install dependencies required by its drivers. We use node package managers like npm and yarn to get this done.
Below you can see configurations you can do to use your favorite package manager.
sqltools.dependencyManager options
autoAcceptboolean
Skip confirmation requests when installing or upgrading dependencies.
Skip confirmation requests when installing or upgrading dependencies.
Type | boolean |
Default Value | false |
installArgsany[]
Array of args passed when installing. If you use yarn
this shoud be set to ["add"]
.
Array of args passed when installing. If you use yarn
this shoud be set to ["add"]
.
Type | any[] |
Default Value | ["install"] |
packageManagerstring
Package manager name or path. For example yarn
, npm
or absolute paths like /usr/bin/npm
.
Package manager name or path. For example yarn
, npm
or absolute paths like /usr/bin/npm
.
Type | string |
Default Value | npm |
runScriptArgsany[]
Array of args passed when runnning npm scripts.
Array of args passed when runnning npm scripts.
Type | any[] |
Default Value | ["run"] |
NPM Example
By default SQLTools relies on npm
to install dependencies. Here is the an example of configuration to make SQLTools use npm
:
{
...
"sqltools.dependencyManager": {
"packageManager": "npm",
"installArgs": ["install"],
"runScriptArgs": ["run"],
"autoAccept": false
},
...
// advanced configuration
"sqltools.dependencyManager": {
"packageManager": "/usr/bin/npm",
"installArgs": ["--registry=https://registry.npmjs.org/", "install"], // this will be executed as `npm --registry=https://registry.npmjs.org/ install <package_name>
"runScriptArgs": ["run"],
"autoAccept": true
},
}
Yarn Example
You can easily setup SQLTools to use yarn
to install dependencies. Here is the an example of configuration:
{
...
"sqltools.dependencyManager": {
"packageManager": "yarn",
"installArgs": ["add"],
"runScriptArgs": ["run"],
"autoAccept": false
},
...
// advanced configuration
"sqltools.dependencyManager": {
"packageManager": "/usr/bin/yarn",
"installArgs": ["--registry", "https://registry.npmjs.org/", "add"], // this will be executed as `yarn --registry https://registry.npmjs.org/ add <package_name>
"runScriptArgs": ["run"],
"autoAccept": false
},
}
Other package managers
Out there we have plenty of package manager for NodeJS. You can setup any package manage you want using this settings.
Let’s say you want to use CNPM
as package manager for SQLTools, you can easily change settings to this:
{
...
"sqltools.dependencyManager": {
"packageManager": "/usr/bin/cnpm",
"installArgs": ["--registry=https://registry.npm.taobao.org", "install"],
"runScriptArgs": ["run"],
"autoAccept": false
},
...
// or with taobao mirror
"sqltools.dependencyManager": {
"packageManager": "/usr/bin/cnpm",
"installArgs": ["--registry=https://registry.npm.taobao.org", "install"],
"runScriptArgs": ["run"],
"autoAccept": false
},
}