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
{{ message }}
This repository was archived by the owner on May 2, 2021. It is now read-only.
models: ['models/**/*.js', 'other/models/*.js'], // glob or an array of globs to directories containing your sequelize models
53
+
logging:false// sql query logging
54
+
sequelize: {} // Options object passed to the Sequelize constructor http://docs.sequelizejs.com/en/latest/api/sequelize/#new-sequelizedatabase-usernamenull-passwordnull-options
49
55
}
50
56
```
51
57
52
58
### Usage
53
-
Create your sequelize models in the models directory in the root of your hapi project. The plugin will automatically import all of your models and make them available throughout your application.
54
-
55
-
Your models will be availble throughout your application via server.plugins (which is also available through the request object ie: request.server.plugins)
59
+
Your models will be available throughout your application via server.plugins (which is also available through the request object ie: request.server.plugins)
56
60
57
61
```javascript
58
62
var db =request.server.plugins['hapi-sequelized'].db;
59
63
60
-
db.Test.create({
64
+
db.User.create({
61
65
email:'some@email.com',
62
-
password:'alskfjdfoa'
66
+
password:'password123'
63
67
});
64
68
```
69
+
70
+
### Model Definitions
71
+
Exports a function that returns a model definition
0 commit comments