integrate sync_db with the rest of the pipeline