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

SequelizeWithOptions.ejs 1.46 KB
<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 + &quot;/../../lib/sequelize/Sequelize&quot;).Sequelize,
    sequelize = new Sequelize(&quot;sequelize_test&quot;, &quot;root&quot;, 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>