You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to allow more seamless usage of the database instance or
more customized configurations, this adds a configuration option
of 'sequelize' that will use that instance instead of creating a
new instance.
Copy file name to clipboardExpand all lines: README.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,24 @@ jsonApi.define({
41
41
42
42
**Note:** the `logging` property controls the logging of the emitted SQL and can either be `false` (which will mean it will be captured by the internal debugging module under the namespace `jsonApi:store:relationaldb:sequelize`) or a user provided function (e.g. `console.log`) to which a string containing the information to be logged will be passed as the first argument.
43
43
44
+
#### Alternative Usage - Provide Sequelize instance
45
+
46
+
If you are already using sequelize or need to have access to the sequelize instance, you may provide an instance to the store to be used instead of having the store create a new instance from the given config.
47
+
48
+
```javascript
49
+
var RelationalDbStore =require("jsonapi-store-relationaldb");
50
+
var Sequelize =require("Sequelize");
51
+
52
+
var sequelize =newSequelize("jsonapi", "root", null, {dialect:"mysql"}));
0 commit comments