add db struct and basic example