Import 'db' from oslo-incubator

Based on oslo-incubator a3302722c45f77ea923c6c289b6c10ef58193503

Change-Id: Ife5b9e355c4b1f6628f5dcd16fdfdd24154d8e8c
Merge "Import 'db' from oslo-incubator"