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.

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
  },
}