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

You need to sign in or sign up before continuing.
index.md 2.86 KB
![logo](manual/asset/logo-small.png)
Sequelize

npm version Travis Build Status Appveyor Build Status npm downloads codecov Last commit Merged PRs GitHub stars Slack Status node License semantic-release

Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. It features solid transaction support, relations, eager and lazy loading, read replication and more.

Sequelize follows Semantic Versioning and supports Node v10 and above.

You are currently looking at the Tutorials and Guides for Sequelize. You might also be interested in the API Reference.

Quick example

const { Sequelize, Model, DataTypes } = require('sequelize');
const sequelize = new Sequelize('sqlite::memory:');

class User extends Model {}
User.init({
  username: DataTypes.STRING,
  birthday: DataTypes.DATE
}, { sequelize, modelName: 'user' });

(async () => {
  await sequelize.sync();
  const jane = await User.create({
    username: 'janedoe',
    birthday: new Date(1980, 6, 20)
  });
  console.log(jane.toJSON());
})();

To learn more about how to use Sequelize, read the tutorials available in the left menu. Begin with Getting Started.