Are you aware of Class::DBI::Loader, and the Class::DBI output mode of SQL::Translator? Class::DBI::mysql/pg does some of this too. I'm not sure why you made the INSERT statement though. And I'm not sure why this seems better than has_a() and has_many() to you. Those have additional functionality that you're losing here.