core: change design to improve database api ; db_text: fix bug when updating label