Node.js
Introduction
sqlcommenter is a suite of plugins/middleware/wrappers to augment SQL statements from ORMs/Querybuilders with comments that can be used later to correlate user code with SQL statements.
Integrations
sqlcommenter-nodejs provides support for the following:
Installing it
sqlcommenter-nodejs can installed in a couple of ways:
From source
The first step is to clone the repository. This can be done with git by running:
git clone https://github.com/google/sqlcommenter.git
sqlcommenter/nodejs/sqlcommenter-nodejs
└── packages
├── knex
│ ├── index.js
│ ├── package.json
│ ├── test
│ └── ...
└── sequelize
├── index.js
├── package.json
├── test
└── ...
Each folder in the packages
directory can be installed by running
npm install <path/to/package>
for example to install @google-cloud/sqlcommenter-knex
in a given location, run npm install /path/to/sqlcommenter-nodejs/packages/knex
. Same for every package(folder) in the packages
directory.
# install
> npm install /path/to/sqlcommenter-nodejs/packages/knex
+ @google-cloud/sqlcommenter-knex@0.0.1
Verify Installation
If package is properly installed, running npm list <package-name>
will output details of the package. Let’s verify the installation of @google-cloud/sqlcommenter-knex
below:
# verify
> npm list @google-cloud/sqlcommenter-knex
project@0.0.0 path/to/project
└── @google-cloud/sqlcommenter-knex@0.0.1 -> /path/to/sqlcommenter-nodejs/packages/knex
Inspecting the package.json
file after installation should also show the installed pacakge.