db upgrade: drop wrapper functions, expose $db and $dbconfigs to patches
patches: use query placeholders