upper.io/db 类似ORM包 upper.io/db

polaris • 3353 次点击    
这是一个分享于 的项目,其中的信息可能已经有所发展或是发生改变。
# upper.io/db # ![icon](https://upper.io/images/icon.svg) ## The `db` package ## ![Upper.io](https://upper.io/db/res/general.png) `upper.io/db` is a [Go][2] package that allows developers to communicate with different databases through the use of *adapters* that wrap well-supported database drivers. ## Is `upper.io/db` an ORM? ## `upper.io/db` is not an ORM in the sense that it does not tell you how to design your software or how to validate your data, instead it only focuses on being a tool that deals with common operations on different databases: ```go // This code works the same for all supported databases. var people []Person res = col.Find(db.Cond{"name": "Max"}).Limit(10).Sort("-last_name") err = res.All(&people) ``` In strict sense `upper.io/db` could be considered a really basic non-magical ORM that rather stays out of the way. ## Supported databases ![Adapters](https://upper.io/db/res/adapters.png) `upper.io/db` attempts to provide full compatiblity for [CRUD][2] operations across adapters. Some other operations (such *transactions*) are supported only on specific database adapters, such as MySQL, PostgreSQL and SQLite. * [MongoDB](https://upper.io/db/mongo) via [mgo](http://godoc.org/labix.org/v2/mgo) * [MySQL](https://upper.io/db/mysql) via [mysql](https://github.com/go-sql-driver/mysql) * [PostgreSQL](https://upper.io/db/postgresql) via [pq](https://github.com/lib/pq) * [QL](https://upper.io/db/ql) via [ql](https://github.com/cznic/ql) * [SQLite3](https://upper.io/db/sqlite) via [go-sqlite3](https://github.com/mattn/go-sqlite3) ## User documentation # See the project page, recipes and user documentation at [upper.io/db][1]. [1]: https://upper.io/db [2]: http://golang.org [3]: http://en.wikipedia.org/wiki/Create,_read,_update_and_delete
授权协议:
开发语言:
Go 查看源码»
操作系统:
跨平台
3353 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传