Skip to content

Neeke/xorm

 
 

Repository files navigation

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/

About

xorm is a simple and powerful ORM for Go.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.7%
  • Shell 0.3%