db -> struct