jw
04/07/2021, 3:49 PMmapper = ::CountryData
?Daniele B
04/07/2021, 3:56 PMDaniele B
04/07/2021, 3:56 PMDaniele B
04/07/2021, 3:56 PMfun LocalDb.setCountriesList(list : List<CountryListData>) {
countriesQueries.transaction {
list.forEach {
countriesQueries.updateCountry(
name = it.name,
population = it.population,
first_doses = it.firstDoses,
fully_vaccinated = it.fullyVaccinated,
)
}
}
}
where
updateCountry:
INSERT OR REPLACE INTO Countries(name,population,first_doses,fully_vaccinated)
VALUES(?,?,?,?);