core & db_text: start to redesign db api