docs | ||
examples | ||
xorm | ||
.gitignore | ||
base_test.go | ||
benchmark_base_test.go | ||
cache.go | ||
doc.go | ||
engine.go | ||
error.go | ||
filter.go | ||
helpers.go | ||
install | ||
iterator.go | ||
mapper.go | ||
mymysql_test.go | ||
mymysql.go | ||
mysql_test.go | ||
mysql.go | ||
pool.go | ||
postgres_test.go | ||
postgres.go | ||
README_CN.md | ||
README.md | ||
session.go | ||
sqlite3_test.go | ||
sqlite3.go | ||
statement.go | ||
table.go | ||
VERSION | ||
xorm.go |
xorm
Xorm is a simple and powerful ORM for Go. It makes dabatabse operating simple.
Discuss
Please visit xorm on Google Groups
Drivers Support
Drivers for Go's sql package which currently support database/sql includes:
-
MyMysql: github.com/ziutek/mymysql/godrv
-
SQLite: github.com/mattn/go-sqlite3
-
Postgres: github.com/bylevel/pq
-
Postgres: github.com/bylevel/pq
Changelog
- v0.2.1 : Added database reverse tool, now support generate go & c++ codes, see Xorm Tool README; some bug fixed.
- v0.2.0 : Added Cache supported, select is speeder up 3~5x; Added SameMapper for same name between struct and table; Added Sync method for auto added tables, columns, indexes;
- v0.1.9 : Added postgres and mymysql supported; Added ` and ? supported on Raw SQL even if postgres; Added Cols, StoreEngine, Charset function, Added many column data type supported, please see Mapping Rules.
- v0.1.8 : Added union index and union unique supported, please see Mapping Rules.
- v0.1.7 : Added IConnectPool interface and NoneConnectPool, SysConnectPool, SimpleConnectPool the three implements. You can choose one of them and the default is SysConnectPool. You can customrize your own connection pool. struct Engine added Close method, It should be invoked before system exit.
- v0.1.6 : Added conversion interface support; added struct derive support; added single mapping support
- v0.1.5 : Added multi threads support; added Sql() function for struct query; Get function changed return inteface; MakeSession and Create are instead with NewSession and NewEngine.
- v0.1.4 : Added simple cascade load support; added more data type supports.
- v0.1.3 : Find function now supports both slice and map; Add Table function for multi tables and temperory tables support
- v0.1.2 : Insert function now supports both struct and slice pointer parameters, batch inserting and auto transaction
- v0.1.1 : Add Id, In functions and improved README
- v0.1.0 : Inital release.
Features
-
Struct<->Table Mapping Supports, both name mapping and filed tag mapping
-
Database Transaction Support
-
Both ORM and SQL Operation Support
-
Simply chainable usage
-
Support Id, In, Where, Limit, Join, Having, Sql functions and sturct as query conditions
-
Cache Support
-
Reverse Tool Support
-
Simple cascade load support
-
Database Reverse Tool support, See Xorm Tool README
Installing xorm
go get github.com/lunny/xorm
Documents
Cases
FAQ
1.How the xorm tag use both with json?
Use space.
type User struct {
Name string `json:"name" xorm:"name"`
}
LICENSE
BSD License http://creativecommons.org/licenses/BSD/