read from sqlite database instead of dataframes