libraries/db: correct connection creations