Share implementation of insertId among DBIs

There is no need to have the method implemented three times.

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