You are doing it right already. If you use a standard named database, you can even omit the second statement. orm.NewOrm establishes a new relationship, not necessarily a new database connection. This ratio is necessary in the controller so that your data can be mapped to the correct database calls, after all, when another command is issued. As far as I have seen, this does not create any security problems.
source share