不要怂,就是干,撸起袖子干!

Commit 9b90e788 by Kevin Simper Committed by Mick Hansen

Update getting started with how to test connection (#6024)

1 parent fce7d387
Showing with 15 additions and 0 deletions
......@@ -37,6 +37,21 @@ var sequelize = new Sequelize('postgres://user:pass@example.com:5432/dbname');
The Sequelize constructor takes a whole slew of options that are available via the [API reference](http://sequelize.readthedocs.org/en/latest/api/sequelize/).
## Test the connection
You can use the `.authenticate()` function like this to test the connection.
```
sequelize
.authenticate()
.then(function(err) {
console.log('Connection has been established successfully.');
})
.catch(function (err) {
console.log('Unable to connect to the database:', err);
});
```
## Your first model
Models are defined with `sequelize.define('name', {attributes}, {options})`.
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!