Always good to have something like this. Throw it up on GitHub and give it a descriptive name :)
Lately I've been using RedBean ORM for my projects. It lets you write your SQL (no query builders or anything stupid), but creates tables, columns, and foreign keys on the fly.
Here's some RedBean code from one of my projects: