coopernurse/gorp — pull request #13 by robfig (2012-12-04 17:32:51+00:00)
Title: Allow queries from PostGet 

When using Gorp with sqlite3, I implemented a PostGet hook to load relations for my objects, using the provided SqlExecutor.Get. This query deadlocked -- the reason is that PostGet hooks are run at the same time gorp is iterating through the result rows. Since a transaction must use the same connection, this doesn't work. I fixed it by completing the Select and then iterating through the results to run the hooks.

I wasn't able to run the tests with or without my change -- I get this:

```
gorptest: 09:27:50.098829 create table PersistentUserTagged (mykey int not null primary key, Id varchar(255), PassedTraining varchar(255)) engine=InnoDB charset=UTF8; [[]]
panic: driver: bad connection [recovered]
panic: driver: bad connection
```

I didn't try to debug, though.

Thanks for the great library!