moleculer-db-adapter-macrometa
Moleculer Data access service for MacroMeta.co.
Features
- auto creating collection
- raw C8QL queries
- save & execute named queries
- subscription to collection changes
Install
npm install moleculer-db-adapter-macrometa --save
Usage
"use strict"; const ServiceBroker = ;const DbService = ;const MacroMetaAdapter = ;const Sequelize = ; const broker = ; // Create a Sequelize service for `post` entitiesbroker; brokerstart// Create a new post // Get all posts;
Raw queries
You can reach the sequelize
instance via this.adapter.db
. To call Raw queries:
// posts.service.jsmoduleexports = name: "posts" adapter: actions: { return thisadapterdb ; }
Subscribe to changes
// posts.service.jsmoduleexports = name: "posts" adapter: methods: { thislogger; } async { await thisadapter; } async { await thisadapter; }
Named queries
await thisadapter;await thisadapter;
Test
$ npm test
In development with watching
$ npm run ci
Contribution
Please send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.
License
The project is available under the MIT license.
Contact
Copyright (c) 2019 MoleculerJS