SequelizeWithOptions.ejs
1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<script type="text/javascript" charset="utf-8">
document.observe("dom:loaded", function() {
buildNavigation([], ["<br />", "<a href=\"/examples/Count\">Count</a>",
"<a href=\"/examples/DefaultValues\">Default values</a>",
"<a href=\"/examples/fetchAssociations\">fetchAssociations</a>",
"<a href=\"/examples/MethodPassing\">MethodPassing</a>",
"<a href=\"/examples/Performance\">Performance</a>",
"<a href=\"/examples/SequelizeWithOptions\">SequelizeWithOptions</a>",
"<a href=\"/examples/ChainQueries\">Using the chainQueries function</a>",
"<a href=\"/examples/UsingMultipleModelFiles\">UsingMultipleModelFiles</a>",
"<a href=\"/examples/Associations\">Working with associations</a>"], { seperator: ' ' })
})
</script>
<div>
<a name="sequelize"></a>
<h1>SequelizeWithOptions</h1>
<p></p>
</div>
<div class="seperator"></div>
<div>
<a name="app.js"></a>
<h2>app.js</h2>
<p>
<pre>var Sequelize = require(__dirname + "/../../lib/sequelize/Sequelize").Sequelize,
sequelize = new Sequelize("sequelize_test", "root", null, {
// use other database server or port
host: 'my.srv.tld',
port: 12345,
// disable logging
disableLogging: true
}),
Smth = sequelize.define('Smth', {foo: Sequelize.STRING})
Smth.sync(function(_, err) {
if(err) Sequelize.Helper.log(err)
else Sequelize.Helper.log('Hey we established the connection successfully! Woot!')
})</pre>
</p>
</div>