jinzhu/gorm — pull request #86 by nerdzeu (2014-04-06 02:02:01+00:00)
Title: Add support for primary key with name different from `id`

This can be useful for people that want to use gorm, but they already have an existing schema and they can't change table row names.

With these changes, is now possible to mark a field as primary key, and use the standard gorm methods that work with primary keys.

For example:
```go
type User struct {
Counter int64 `primaryKey:"yes"`
Last time.Time
NotifyStory string `sql:"type:json"`
Private bool
}
```

And I can work with gorm methods like:
```go
var user User

db.First(&user, 12)
```
And everything works fine.

Let me know what do you think about that.

Thank you!

(Now it's a single commit pull request :D)