Node.js的ORM框架:​Sequelize

jopen 10年前

Sequelize是一个易于使用,支持多SQL方言(dialect)的对象-关系映射框架(ORM),这个库完全采用JavaScript开发并且能够用在Node.JS环境中。它当前支持MySQL, MariaDB, SQLite 和 PostgreSQL 数据库。
Node.js的ORM框架:​Sequelize

var Sequelize = require('sequelize')    , sequelize = new Sequelize('database', 'username', 'password')     var User = sequelize.define('User', {    username: Sequelize.STRING,    birthday: Sequelize.DATE  })     sequelize.sync().success(function() {    User.create({      username: 'sdepold',      birthday: new Date(1986, 06, 28)    }).success(function(sdepold) {      console.log(sdepold.values)    })  })

项目主页:http://www.open-open.com/lib/view/home/1408605370569