|
1 | | -# Bool.js - Sequelize Driver |
| 1 | +<p align="center"><img src="https://cdn.rawgit.com/BoolJS/booljs/master/logo.svg" width="50%"></p> |
2 | 2 |
|
3 | | -[](https://travis-ci.org/BoolJS/booljs-sequelize) [](https://david-dm.org/booljs/booljs-sequelize) [](https://david-dm.org/booljs/booljs-sequelize#info=devDependencies) [](https://codeclimate.com/github/BoolJS/booljs-sequelize) [](http://inch-ci.org/github/booljs/booljs-sequelize) |
| 3 | +<p align="center"> |
| 4 | + <a href="https://travis-ci.org/BoolJS/booljs-sequelize"><img src="https://img.shields.io/travis/BoolJS/booljs-sequelize.svg?style=flat-square" alt="Build Status"></a> |
| 5 | + <a href="LICENSE.md"><img src="https://img.shields.io/badge/License-GPL%20v3-green.svg?style=flat-square" alt="License"></a> |
| 6 | + <a href="https://github.com/BoolJS/booljs-sequelize/releases"><img src="https://img.shields.io/github/release/BoolJS/booljs-sequelize.svg?style=flat-square" alt="Latest Stable Version"></a> |
| 7 | + <a href="https://david-dm.org/booljs/booljs-sequelize"><img src="https://img.shields.io/david/booljs/booljs-sequelize.svg?style=flat-square" alt="Dependency status"></a> |
| 8 | + <a href="https://david-dm.org/booljs/booljs-sequelize?type=dev"><img src="https://img.shields.io/david/dev/booljs/booljs-sequelize.svg?style=flat-square" alt="devDependency status"></a> |
| 9 | + <a href="https://david-dm.org/booljs/booljs-sequelize?type=peer"><img src="https://img.shields.io/david/peer/booljs/booljs-sequelize.svg?style=flat-square" alt="peerDependency status"></a> |
| 10 | + <a href="https://codeclimate.com/github/BoolJS/booljs-sequelize/maintainability"><img src="https://api.codeclimate.com/v1/badges/102e5750974935be2b3b/maintainability" /></a> |
| 11 | + <a href="https://codecov.io/gh/BoolJS/booljs"><img src="https://img.shields.io/codecov/c/github/booljs/booljs-sequelize.svg?style=flat-square" alt="Code Coverage"></a> |
| 12 | + <a href="http://inch-ci.org/github/booljs/booljs-sequelize"><img src="http://inch-ci.org/github/booljs/booljs-sequelize.svg?branch=master" alt="Inline docs"></a> |
| 13 | + <a href="https://gitter.im/BoolJS/booljs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://img.shields.io/gitter/room/booljs/booljs-sequelize.svg?style=flat-square" alt="Join the chat at https://gitter.im/BoolJS/booljs-sequelize"></a> |
| 14 | +</p> |
4 | 15 |
|
5 | | -[](https://npmjs.com/package/@booljs/sequelize) |
| 16 | +<p align="center"> |
| 17 | + <a href="https://npmjs.com/package/@booljs/sequelize"><img src="https://nodei.co/npm/@booljs/sequelize.png" alt="NPM icon"></a> |
| 18 | +</p> |
6 | 19 |
|
7 | | -[](https://gitter.im/BoolJS/booljs-sequelize?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 20 | +`@booljs/sequelize` is a database loader intended to enable developers to use Sequelize in the [BoolJS Framework](http://bool.js.org/). |
8 | 21 |
|
9 | | -## FAQ |
| 22 | +## Install |
10 | 23 |
|
11 | | -### What is bool.js? |
12 | | -Bool.js is an MVC Framework. But is not just any other framework; it gives us back the power to choose how to organize a well-designed project, so we can choose our dependencies, craft our architecture, choose our data connectors, and finally, work based on cool development structures without hesitating about learning the framework as is. |
| 24 | +Install the package using |
13 | 25 |
|
14 | | -Bool.js also reminds the importance of having a cool workspace structure. That's why it's based on namespaces, leading us to focus on our code rather than focusing on managin complicated references to other files in our project. |
| 26 | +``` |
| 27 | +npm install @booljs/sequelize |
| 28 | +``` |
15 | 29 |
|
16 | | -### Can I migrate my projects to bool.js? |
17 | | -Of course you can. Bool.js is Free Software (not as in a *free* beer, but in *free* as a bird). Just remember to update all of your dependencies, arrange your code in the right project structure (we're very tight at that) and finally, use Node LTS, and further versions. |
| 30 | +BoolJS Sequelize uses some peerDependencies you must have in your project. We encourage using `npm 6+` in all your projects, because is strict in making you declare them in your project. |
18 | 31 |
|
19 | | -### What is this? |
20 | | -`booljs.sequelize` is a driver to enable MySQL users to use `sequelize` library in bool.js |
| 32 | +``` |
| 33 | +npm install sequelize@latest |
| 34 | +``` |
| 35 | + |
| 36 | +Finally, you might need to get some documentation on the usage of Sequelize. Find it on [their](http://www.sequelize.org) website. |
| 37 | + |
| 38 | + |
| 39 | +## Usage |
| 40 | + |
| 41 | +First, register the `@booljs/sequelize` module in your BoolJS application. Then, add it to the [database drivers](https://) |
| 42 | + |
| 43 | +In `index.js`, declare: |
| 44 | + |
| 45 | +```js |
| 46 | +const Bool = require('booljs'); |
| 47 | + |
| 48 | +async function main () { |
| 49 | + const API = new Bool('com.example.api', [ '@booljs/sequelize' ]); |
| 50 | + .setDatabaseDrivers('booljs.sequelize'); |
| 51 | + |
| 52 | + return API.run(); |
| 53 | +} |
| 54 | + |
| 55 | +module.exports = main(); |
| 56 | +``` |
0 commit comments