早先开发一直直接使用node-mysql, 最近要新起一个项目,请问哪个orm好用, 找到下面这么多
ODM / ORM Bookshelf - ORM for PostgreSQL, MySQL and SQLite3 in the style of Backbone.js. Massive - PostgreSQL data access tool. Mongoose - Elegant MongoDB object modeling. Sequelize - Multi-dialect ORM. Supports PostgreSQL, SQLite, MySQL. Waterline - Datastore-agnostic tool that dramatically simplifies interaction with one or more databases. Iridium - A high performance MongoDB ORM with support for promises, distributed caching, preprocessing, validation and plugins. OpenRecord - ORM for PostgreSQL, MySQL, SQLite3 and RESTful datastores. Similar to ActiveRecord. orm2 - ORM for PostgreSQL, MariaDB, MySQL, Amazon Redshift, SQLite, MongoDB. firenze - Adapter-based ORM for MySQL, Memory, Redis, localStorage and more.
node-mysql直接写SQL语句不好吗?
sequelize
@bgdsh 我一直就是直接写,现在想改变一下
@IkarosCoCo 研究了一下,orm2感觉比较轻巧
我用 bookshelf,主要 knex 很强大灵活
@simdm 我觉得orm系列有一点不好,我同事写一个update,需要先查询出来然后再save,不太好。
我们的项目也选择了sequelize,主要是文档完整齐全
sequelize 吧…看星星就知道了…而且…sequelize 有全测试用例ci…
@FishThirteen bookshelf总感觉用起不习惯。
sequelize 有种rubyonrails的开发体验
sequelize模型需要手动声明字段,太麻烦,一个表几十个字段表示伤不起
@zstxt1989 https://github.com/sequelize/sequelize-auto 怎么说呢…如果是已经有数据库表了…可以自动生成…
我博客就是用的sequelize,个人感觉不粗,之前用的orm2问题好多放弃了 我博客源码https://github.com/9958/NEMBlog/