Database plugin is used to get access to the CRM’s database. It exports a function called getDb. You can call the function to get a connection o database.
ID: cl_db
Exports
getDb(): () -> PrismaClient
Example Usage
Install the plugin
yarn add cl_cb
Or if you are using npm
npm install cl_cb
Import it wherever you need it:
var getDb = require("cl_db");
function getProducts() {
var db = getDb();
return db.products.findMany();
}