Fastify CockroachDB Plugin using Sequelize ORM
Installation
npm i fastify-cockroachdb -s
Usage
// ...Other Pluginsfastify; fastify;
Options
Option | Description |
---|---|
database |
Required, the name of the database to connect to within CockroachDB. |
user |
Required, the name of the user to log in as within the database. |
password |
Optional, the password of the user to log in as. Should be empty if SSL is used. |
settings |
Optional, the settings to be passed in to the Sequelize ORM. Should include dialectOptions if a secure CockroachDB instance is used. Consult this tutorial. |
port |
Optional, used in place of default port 26257 if no settings parameter is found. |
models |
Optional, any models to be declared and injected under fastify.cockroachdb.models . |
Any models declared should follow the following format:
name: "profiles" // Required, should match name of model in database alias: "Profile" // Optional, an alias to inject the model as schema: schemaDefinition // Required, should match schema of model in database
The schemaDefinition
variable should be created according to the Sequelize Model Specification.
Author
License
Licensed under GPLv3.