coopernurse/gorp — pull request #42 by sqs (2013-05-22 22:55:56+00:00)
Title: Support nested fields in embedded structs

Adds support for nested fields in embedded structs.

For example, you can map `WithEmbeddedStruct` below to a table. Embedded structs are flattened so that all nested fields exist at the same level in the database. The table for `WithEmbeddedStruct` will have columns id, first_name, and last_name.

```go
type WithEmbeddedStruct struct {
Id int64
Names
}

type Names struct {
FirstName string
LastName string
}

```

I have confirmed it passes the tests on PostgreSQL and SQLite. I don't have MySQL set up to test it, but this seems like a DB-agnostic change.

Fixes https://github.com/coopernurse/gorp/issues/9.