I'd suggest to take a look into JOOQ. While it's a Java library, most likely you will find a lot of useful ideas and inspirations for you project.
This is what I was looking for, thanks!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.