I haven't seen any working solution to solve your task, a quick google search doesn't give any useful information either (it doesn't look like HttpPerlModule could help with DB stored configuration).
It sounds like it's a good task to develop and contribute to Nginx project !