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

usage.ejs 999 Bytes
To get the ball rollin' you first have to create an instance of Sequelize. Use it the following way:

<pre><%- koala(".js", "var sequelize = new Sequelize('database', 'username'[, 'password'])") %></pre>

This will save the passed database credentials and provide all further methods. Furthermore you can specify
a non-default host or port and some options:

<pre><%- koala(".js", partial("code/usage/options.ejs")) %></pre>

To define mappings between a class and a table, use the define method (Stop telling me that JavaScript don't know classes. Name it however you want to!):

<pre><%- koala(".js", partial("code/usage/basic-mapping.ejs")) %></pre>

Sequelize currently supports the following datatypes:

<pre><%= partial("code/usage/data-types.ejs") %></pre>

You can also store your model definitions in a single file using the import method:

<pre><%- koala(".js", partial("code/usage/import.ejs")) %></pre>

The returned object is exactly the same as defined in the imported file's function.