Non-blocking Vertica client for Node.js made with pure Javascript.
This monorepo contains the core vertica-nodejs module as well as a handful of related modules. Each individual package should have its own documentation with more specific information designed to help develop with the full capabilities of the driver.
- Pure JavaScript client
- Connection pooling
- Extensible JS ↔ Vertica data-type coercion
We will gladly accept external pull requests if they are well documented and contain tests. For more information on how to contribute, check out our contributing guidelines
To install vertica-nodejs with npm:
npm install vertica-nodejs
The current version of the driver is routinely tested against Node v14. It is recommended to install this version of node in your application environment.
Ensure that you have an active Vertica server.
Ensure that the applicable environment variables are configured for connecting to your Vertica server. These are the variables and the default values used if not set:
- V_HOST: 'localhost'
- V_PORT: 5433
- V_USER: process.env.USER/USERNAME
- V_PASSWORD: null
- V_DATABASE: ''
- V_BACKUP_SERVER_NODE: ''
Once these are done, you should be able to run the examples found in the examples directory noted in the next section. Simply download or copy the example javascript file(s) and execute them in a node environment.
For example, to execute the basic.js file all you need to do is run node basic.js
See the examples directory for sample applications showing how to use the vertica-nodejs client driver. Other usage examples can be found in the documentation of each individual package.
See DATATYPES.md to view the mappings from type IDs to Vertica data types.
The following instructions are for working with the driver source code. Follow this set up if you intend to contribute to the driver. These steps are similar to those for developing with the driver, but include steps for building and testing locally.
- Clone the repo
- If yarn is not already installed, install yarn
npm install -g yarn
- From your workspace root run
yarn
and thenyarn lerna bootstrap
- Ensure you have a Vertica instance running with
- Ensure you have the proper environment variables configured for connecting to the instance (
V_HOST
,V_PORT
,V_USER
,V_PASSWORD
,V_DATABASE
,V_BACKUP_SERVER_NODE
) - Run
yarn test
to run all the tests, or runyarn test
from within an individual package to only run that package's tests
If using VS Code, you can install the Remote - Containers
extension and it will use the configuration under the .devcontainer
folder to automatically create dev containers, including Vertica. See here for more information on developing in containers using VS Code. This process will complete steps 3 to 5 above.
vertica-nodejs is free software. If you encounter a bug with the library please open an issue on the GitHub repo. If you have questions unanswered by the documentation please open an issue pointing out how the documentation was unclear and we will address it as needed.
When you open an issue please provide:
- version of Node
- version of Vertica
- smallest possible snippet of code to reproduce the problem
The causes and solutions to common errors can be found among the Frequently Asked Questions (FAQ)
Apache 2.0 License, please see LICENSE for details.