Implement sqlite db, saving samples