Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,sqlite,mssql,oracle,cockroach
Go to file
Lunny Xiao 7a109f220f fixed docs 2013-10-21 22:23:45 +08:00
docs fixed docs 2013-10-21 22:23:45 +08:00
examples added xorm reverse tool 2013-10-12 23:16:51 +08:00
xorm bug fixed & doc improved 2013-10-20 10:43:49 +08:00
.gitignore fix mysql test and sqlite test 2013-05-06 16:01:17 +08:00
README.md fixed name error on readme 2013-10-18 20:41:30 +08:00
README_CN.md fixed name error on readme 2013-10-18 20:41:30 +08:00
VERSION many bugs fixed 2013-09-26 15:19:39 +08:00
base_test.go added Iterate method; added Omit method 2013-10-17 12:50:46 +08:00
benchmark_base_test.go Added support for Find(*[]*Struct); added notnull; 2013-10-05 00:44:43 +08:00
cache.go cache bug fixed 2013-10-02 11:04:20 +08:00
doc.go improved doc.go 2013-10-07 12:07:35 +08:00
engine.go added Iterate method; added Omit method 2013-10-17 12:50:46 +08:00
error.go added xorm reverse tool 2013-10-12 23:16:51 +08:00
filter.go add Sync() method for sync column, index to table 2013-09-28 23:14:42 +08:00
helpers.go improved docs 2013-09-30 09:17:35 +08:00
install reverse tool improved 2013-10-14 15:40:24 +08:00
iterator.go added Iterate method; added Omit method 2013-10-17 12:50:46 +08:00
mapper.go added xorm reverse tool 2013-10-12 23:16:51 +08:00
mymysql.go added xorm reverse tool 2013-10-12 23:16:51 +08:00
mymysql_test.go Added support for Find(*[]*Struct); added notnull; 2013-10-05 00:44:43 +08:00
mysql.go added genJson for xorm tool 2013-10-14 17:46:04 +08:00
mysql_test.go Added support for Find(*[]*Struct); added notnull; 2013-10-05 00:44:43 +08:00
pool.go improved docs 2013-09-30 14:45:34 +08:00
postgres.go added genJson for xorm tool 2013-10-14 17:46:04 +08:00
postgres_test.go added Iterate method; added Omit method 2013-10-17 12:50:46 +08:00
session.go added Iterate method; added Omit method 2013-10-17 12:50:46 +08:00
sqlite3.go Added database reverse tool, now support generate go & c++ codes, some bug fixed. 2013-10-15 10:40:21 +08:00
sqlite3_test.go add Sync() method for sync column, index to table 2013-09-28 23:14:42 +08:00
statement.go added Iterate method; added Omit method 2013-10-17 12:50:46 +08:00
table.go added Iterate method; added Omit method 2013-10-17 12:50:46 +08:00
xorm.go added xorm reverse tool 2013-10-12 23:16:51 +08:00

README.md

xorm

中文

Xorm is a simple and powerful ORM for Go. It makes dabatabse operating simple.

Build Status Go Walker Bitdeli Badge

Discuss

Message me on G+

Drivers Support

Drivers for Go's sql package which currently support database/sql includes:

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 tags mapping

  • Database Transaction Support

  • Both ORM and SQL Operation Support

  • Simply usage

  • Support Id, In, Where, Limit, Join, Having, Sql functions and sturct as query conditions

  • Support simple cascade load just like Hibernate for Java

  • Code generator support, See Xorm Tool README

Installing xorm

go get github.com/lunny/xorm

Documents

Quick Start

GoDoc

GoWalker

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/