Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
An experimental go ORM
Branch: master
Pull request Compare This branch is even with zetaben:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
misc
Connection.go
LICENSE
Makefile
Model.go
Model_test.go
MysqlConnection.go
README.md
Relation.go
Value.go
Value_test.go
XMLConnection.go
XMLConnection_test.go

README.md

GoUDA : Go Unified Data Accessor

Gouda is an experimental ORM for Go.

Features (and planned features):

  • Backend agnostic (though at the moment it knows only how to connect to MySQL and XML files ...)
  • Nice syntax for querying (ex : MyModel.Where(gouda.F("i").Eq("j")).Where(gouda.F("a").Eq("b")).Order("c","ASC").First())
  • Not so intrusive...
  • Pure Go

Installing

You first need Thoj Mysql Client Library

$ git clone git://github.com/zetaben/gouda.git
$ cd gouda
$ make
$ make install

Usage

  1. Declare your structs as ModelInterface (by implementing all the interface methods or by embeding gouda.NullModel)
  2. Connect to your database backend (eg : gouda.OpenMysql("mysql://root:@localhost:3306/test_db"))
  3. Optional : Register your models using gouda.GetModelStore().RegisterModel(m)
  4. Use it !

    Peruse through Model_test.go to view typical usages A sample application application can be found in misc directory

Known limitations

At the moment Gouda as the following limitations :

  • Connects only to mysql and XML files
  • limited support for associations (railslike HasMany, BelongsTo)
  • Knows only how to handle int and string attributes !
  • Connections needs to be registered in the store to be usable automatically...
  • Needs way more documentation !

Acknowlegments

This work is using work or ideas from other go projects :

Something went wrong with that request. Please try again.