Share post connect code between DBIs

Signed-off-by: Michal Čihař <michal@cihar.com>