@ -278,7 +273,7 @@ SELECT EXISTS(SELECT 1 FROM tasks WHERE parent > 0 AND deleted = 0) AS hasSubtas
}
@Query("SELECT _id FROM tasks LEFT JOIN google_tasks ON _id = gt_task AND gt_deleted = 0 LEFT JOIN caldav_tasks ON _id = cd_task AND cd_deleted = 0 WHERE gt_id IS NULL AND cd_id IS NULL AND parent = 0")
@Query("UPDATE caldav_tasks SET cd_order = :position, cd_remote_parent = :parent WHERE cd_id = :id")
internalabstract fun update(id:Long,position:Long?,parent:String?)
internalabstractsuspend fun update(id:Long,position:Long?,parent:String?)
@Query("UPDATE caldav_tasks SET cd_order = :position WHERE cd_id = :id")
internalabstract fun update(id:Long,position:Long?)
internalabstractsuspend fun update(id:Long,position:Long?)
@Query("UPDATE caldav_tasks SET cd_remote_parent = :remoteParent WHERE cd_id = :id")
internalabstract fun update(id:Long,remoteParent:String?)
internalabstractsuspend fun update(id:Long,remoteParent:String?)
@Update
abstract fun update(tasks:Iterable<CaldavTask>)
abstractsuspend fun update(tasks:Iterable<CaldavTask>)
@Delete
abstract fun delete(caldavTask:CaldavTask)
abstractsuspend fun delete(caldavTask:CaldavTask)
@Query("SELECT * FROM caldav_tasks WHERE cd_deleted > 0 AND cd_calendar = :calendar")
abstract fun getDeleted(calendar:String):List<CaldavTask>
abstractsuspend fun getDeleted(calendar:String):List<CaldavTask>
@Query("UPDATE caldav_tasks SET cd_deleted = :now WHERE cd_task IN (:tasks)")
abstract fun markDeleted(tasks:List<Long>,now:Long=currentTimeMillis())
abstractsuspend fun markDeleted(tasks:List<Long>,now:Long=currentTimeMillis())
@Query("SELECT * FROM caldav_tasks WHERE cd_task = :taskId AND cd_deleted = 0 LIMIT 1")
abstract fun getTask(taskId:Long):CaldavTask?
abstractsuspend fun getTask(taskId:Long):CaldavTask?
@Query("SELECT cd_remote_id FROM caldav_tasks WHERE cd_task = :taskId AND cd_deleted = 0")
abstract fun getRemoteIdForTask(taskId:Long):String?
abstractsuspend fun getRemoteIdForTask(taskId:Long):String?
@Query("SELECT * FROM caldav_tasks WHERE cd_calendar = :calendar AND cd_object = :obj LIMIT 1")
abstract fun getTask(calendar:String,obj:String):CaldavTask?
abstractsuspend fun getTask(calendar:String,obj:String):CaldavTask?
@Query("SELECT * FROM caldav_tasks WHERE cd_calendar = :calendar AND cd_remote_id = :remoteId")
abstract fun getTaskByRemoteId(calendar:String,remoteId:String):CaldavTask?
abstractsuspend fun getTaskByRemoteId(calendar:String,remoteId:String):CaldavTask?
@Query("SELECT * FROM caldav_tasks WHERE cd_task = :taskId")
abstract fun getTasks(taskId:Long):List<CaldavTask>
abstractsuspend fun getTasks(taskId:Long):List<CaldavTask>
@Query("SELECT * FROM caldav_tasks WHERE cd_task in (:taskIds) AND cd_deleted = 0")
abstract fun getTasks(taskIds:List<Long>):List<CaldavTask>
abstractsuspend fun getTasks(taskIds:List<Long>):List<CaldavTask>
@Query("SELECT task.*, caldav_task.* FROM tasks AS task "
+"INNER JOIN caldav_tasks AS caldav_task ON _id = cd_task "
+"WHERE cd_deleted = 0 AND cd_vtodo IS NOT NULL AND cd_vtodo != ''")
abstract fun getTasks():List<CaldavTaskContainer>
abstractsuspend fun getTasks():List<CaldavTaskContainer>
@Query("SELECT task.*, caldav_task.* FROM tasks AS task "
+"INNER JOIN caldav_tasks AS caldav_task ON _id = cd_task "
+"WHERE cd_calendar = :calendar "
+"AND modified > cd_last_sync "
+"AND cd_deleted = 0")
abstract fun getCaldavTasksToPush(calendar:String):List<CaldavTaskContainer>
abstractsuspend fun getCaldavTasksToPush(calendar:String):List<CaldavTaskContainer>
@Query("SELECT * FROM caldav_lists ORDER BY cdl_name COLLATE NOCASE")
abstract fun getCalendars():List<CaldavCalendar>
abstractsuspend fun getCalendars():List<CaldavCalendar>
@Query("SELECT * FROM caldav_lists WHERE cdl_uuid = :uuid LIMIT 1")
abstract fun getCalendar(uuid:String):CaldavCalendar?
abstractsuspend fun getCalendar(uuid:String):CaldavCalendar?
@Query("SELECT cd_object FROM caldav_tasks WHERE cd_calendar = :calendar")
abstract fun getObjects(calendar:String):List<String>
abstractsuspend fun getObjects(calendar:String):List<String>
fun getTasks(calendar:String,objects:List<String>):List<Long>=
suspend fun getTasks(calendar:String,objects:List<String>):List<Long>=
objects.chunkedMap{getTasksInternal(calendar,it)}
@Query("SELECT cd_task FROM caldav_tasks WHERE cd_calendar = :calendar AND cd_object IN (:objects)")
abstract fun getTasksInternal(calendar:String,objects:List<String>):List<Long>
abstractsuspend fun getTasksInternal(calendar:String,objects:List<String>):List<Long>
@Query("SELECT * FROM caldav_lists WHERE cdl_account = :account AND cdl_url NOT IN (:urls)")
abstract fun findDeletedCalendars(account:String,urls:List<String>):List<CaldavCalendar>
abstractsuspend fun findDeletedCalendars(account:String,urls:List<String>):List<CaldavCalendar>
@Query("SELECT * FROM caldav_lists WHERE cdl_account = :account AND cdl_url = :url LIMIT 1")
abstract fun getCalendarByUrl(account:String,url:String):CaldavCalendar?
abstractsuspend fun getCalendarByUrl(account:String,url:String):CaldavCalendar?
@Query("SELECT caldav_accounts.* from caldav_accounts"
+" INNER JOIN caldav_tasks ON cd_task = :task"
+" INNER JOIN caldav_lists ON cd_calendar = cdl_uuid"
+" WHERE cdl_account = cda_uuid")
abstract fun getAccountForTask(task:Long):CaldavAccount?
abstractsuspend fun getAccountForTask(task:Long):CaldavAccount?
@Query("SELECT DISTINCT cd_calendar FROM caldav_tasks WHERE cd_deleted = 0 AND cd_task IN (:tasks)")
abstract fun getCalendars(tasks:List<Long>):List<String>
abstractsuspend fun getCalendars(tasks:List<Long>):List<String>
@Query("SELECT caldav_lists.*, COUNT(tasks._id) AS count"
+" FROM caldav_lists"
@ -176,13 +176,13 @@ abstract class CaldavDao {
+" LEFT JOIN tasks ON caldav_tasks.cd_task = tasks._id AND tasks.deleted = 0 AND tasks.completed = 0 AND tasks.hideUntil < :now AND cd_deleted = 0"
+" WHERE caldav_lists.cdl_account = :uuid"
+" GROUP BY caldav_lists.cdl_uuid")
abstract fun getCaldavFilters(uuid:String,now:Long=currentTimeMillis()):List<CaldavFilters>
abstractsuspend fun getCaldavFilters(uuid:String,now:Long=currentTimeMillis()):List<CaldavFilters>
@Query("SELECT tasks._id FROM tasks "
+"INNER JOIN tags ON tags.task = tasks._id "
+"INNER JOIN caldav_tasks ON cd_task = tasks._id "
+"GROUP BY tasks._id")
abstract fun getTasksWithTags():List<Long>
abstractsuspend fun getTasksWithTags():List<Long>
@Query("UPDATE tasks SET parent = IFNULL(("
+" SELECT p.cd_task FROM caldav_tasks AS p"
@ -191,7 +191,7 @@ abstract class CaldavDao {
+" AND p.cd_calendar = caldav_tasks.cd_calendar"
+" AND p.cd_deleted = 0), 0)"
+"WHERE _id IN (SELECT _id FROM tasks INNER JOIN caldav_tasks ON _id = cd_task WHERE cd_deleted = 0)")
abstract fun updateParents()
abstractsuspend fun updateParents()
@Query("UPDATE tasks SET parent = IFNULL(("
+" SELECT p.cd_task FROM caldav_tasks AS p"
@ -202,10 +202,10 @@ abstract class CaldavDao {
+" AND p.cd_calendar = caldav_tasks.cd_calendar"
+" AND caldav_tasks.cd_deleted = 0), 0)"
+"WHERE _id IN (SELECT _id FROM tasks INNER JOIN caldav_tasks ON _id = cd_task WHERE cd_deleted = 0 AND cd_calendar = :calendar)")
abstract fun updateParents(calendar:String)
abstractsuspend fun updateParents(calendar:String)
@Transaction
open fun move(task:TaskContainer,newParent:Long,newPosition:Long?){
opensuspend fun move(task:TaskContainer,newParent:Long,newPosition:Long?){
valpreviousParent=task.parent
valcaldavTask=task.caldavTask
valpreviousPosition=task.caldavSortOrder
@ -221,7 +221,7 @@ abstract class CaldavDao {
}
@Transaction
open fun shiftDown(calendar:String,parent:Long,from:Long,to:Long?=null){
opensuspend fun shiftDown(calendar:String,parent:Long,from:Long,to:Long?=null){
valupdated=ArrayList<CaldavTask>()
valtasks=getTasksToShift(calendar,parent,from,to)
for(iintasks.indices){
@ -240,32 +240,32 @@ abstract class CaldavDao {
}
@Query("UPDATE tasks SET modified = :modificationTime WHERE _id in (:ids)")
internalabstract fun touchInternal(ids:List<Long>,modificationTime:Long=now())
internalabstractsuspend fun touchInternal(ids:List<Long>,modificationTime:Long=now())
@Query("SELECT task.*, caldav_task.*, IFNULL(cd_order, (created - $APPLE_EPOCH) / 1000) AS primary_sort FROM caldav_tasks AS caldav_task INNER JOIN tasks AS task ON _id = cd_task WHERE cd_calendar = :calendar AND parent = :parent AND cd_deleted = 0 AND deleted = 0 AND primary_sort >= :from AND primary_sort < IFNULL(:to, ${Long.MAX_VALUE}) ORDER BY primary_sort")
internalabstract fun getTasksToShift(calendar:String,parent:Long,from:Long,to:Long?):List<CaldavTaskContainer>
internalabstractsuspend fun getTasksToShift(calendar:String,parent:Long,from:Long,to:Long?):List<CaldavTaskContainer>
@Query("UPDATE caldav_lists SET cdl_order = $NO_ORDER")
abstract fun resetOrders()
abstractsuspend fun resetOrders()
@Query("UPDATE caldav_lists SET cdl_order = :order WHERE cdl_id = :id")
abstract fun setOrder(id:Long,order:Int)
abstractsuspend fun setOrder(id:Long,order:Int)
fun setupLocalAccount(context:Context):CaldavAccount{
suspend fun setupLocalAccount(context:Context):CaldavAccount{
valaccount=getLocalAccount()
getLocalList(context,account)
returnaccount
}
fun getLocalList(context:Context)=getLocalList(context,getLocalAccount())
suspend fun getLocalList(context:Context)=getLocalList(context,getLocalAccount())
private fun getLocalAccount()=getAccountByUuid(LOCAL)?:CaldavAccount().apply{
privatesuspend fun getLocalAccount()=getAccountByUuid(LOCAL)?:CaldavAccount().apply{
accountType=CaldavAccount.TYPE_LOCAL
uuid=LOCAL
id=insert(this)
}
private fun getLocalList(context:Context,account:CaldavAccount):CaldavCalendar=
privatesuspend fun getLocalList(context:Context,account:CaldavAccount):CaldavCalendar=
@Query("SELECT * FROM caldav_lists WHERE cdl_account = :account")
abstract fun getCalendars(account:String):List<CaldavCalendar>
abstractsuspend fun getCalendars(account:String):List<CaldavCalendar>
@Delete
abstract fun deleteCaldavAccount(caldavAccount:CaldavAccount)
abstractsuspend fun deleteCaldavAccount(caldavAccount:CaldavAccount)
@Query("DELETE FROM tasks WHERE _id IN (SELECT _id FROM tasks INNER JOIN caldav_tasks ON _id = cd_task INNER JOIN caldav_lists ON cdl_uuid = cd_calendar WHERE cdl_account = '$LOCAL' AND deleted > 0)")
abstract fun purgeDeleted()
abstractsuspend fun purgeDeleted()
@Transaction
open fun delete(caldavAccount:CaldavAccount):List<Long>{
opensuspend fun delete(caldavAccount:CaldavAccount):List<Long>{
@Query("UPDATE google_tasks SET gt_order = :order, gt_parent = :parent, gt_moved = 1 WHERE gt_id = :id")
abstract fun update(id:Long,parent:Long,order:Long)
abstractsuspend fun update(id:Long,parent:Long,order:Long)
@Query("UPDATE google_tasks SET gt_deleted = :now WHERE gt_task = :task OR gt_parent = :task")
abstract fun markDeleted(task:Long,now:Long=currentTimeMillis())
abstractsuspend fun markDeleted(task:Long,now:Long=currentTimeMillis())
@Delete
abstract fun delete(deleted:GoogleTask)
abstractsuspend fun delete(deleted:GoogleTask)
@Query("SELECT * FROM google_tasks WHERE gt_remote_id = :remoteId LIMIT 1")
abstract fun getByRemoteId(remoteId:String):GoogleTask?
abstractsuspend fun getByRemoteId(remoteId:String):GoogleTask?
@Query("SELECT * FROM google_tasks WHERE gt_task = :taskId AND gt_deleted > 0")
abstract fun getDeletedByTaskId(taskId:Long):List<GoogleTask>
abstractsuspend fun getDeletedByTaskId(taskId:Long):List<GoogleTask>
@Query("SELECT * FROM google_tasks WHERE gt_task = :taskId")
abstract fun getAllByTaskId(taskId:Long):List<GoogleTask>
abstractsuspend fun getAllByTaskId(taskId:Long):List<GoogleTask>
@Query("SELECT DISTINCT gt_list_id FROM google_tasks WHERE gt_deleted = 0 AND gt_task IN (:tasks)")
abstract fun getLists(tasks:List<Long>):List<String>
abstractsuspend fun getLists(tasks:List<Long>):List<String>
@Query("SELECT gt_task FROM google_tasks WHERE gt_parent IN (:ids) AND gt_deleted = 0")
abstract fun getChildren(ids:List<Long>):List<Long>
abstractsuspend fun getChildren(ids:List<Long>):List<Long>
@Query("SELECT tasks.* FROM tasks JOIN google_tasks ON tasks._id = gt_task WHERE gt_parent = :taskId")
abstract fun getChildTasks(taskId:Long):List<Task>
abstractsuspend fun getChildTasks(taskId:Long):List<Task>
@Query("SELECT * FROM google_tasks WHERE gt_parent = :id AND gt_deleted = 0")
abstract fun getChildren(id:Long):List<GoogleTask>
abstractsuspend fun getChildren(id:Long):List<GoogleTask>
@Query("SELECT IFNULL(MAX(gt_order), -1) + 1 FROM google_tasks WHERE gt_list_id = :listId AND gt_parent = :parent")
abstract fun getBottom(listId:String,parent:Long):Long
abstractsuspend fun getBottom(listId:String,parent:Long):Long
@Query("SELECT gt_remote_id FROM google_tasks JOIN tasks ON tasks._id = gt_task WHERE deleted = 0 AND gt_list_id = :listId AND gt_parent = :parent AND gt_order < :order AND gt_remote_id IS NOT NULL AND gt_remote_id != '' ORDER BY gt_order DESC")
abstract fun getPrevious(listId:String,parent:Long,order:Long):String?
abstractsuspend fun getPrevious(listId:String,parent:Long,order:Long):String?
@Query("SELECT gt_remote_id FROM google_tasks WHERE gt_task = :task")
abstract fun getRemoteId(task:Long):String?
abstractsuspend fun getRemoteId(task:Long):String?
@Query("SELECT gt_task FROM google_tasks WHERE gt_remote_id = :remoteId")
abstract fun getTask(remoteId:String):Long
abstractsuspend fun getTask(remoteId:String):Long
@SuppressWarnings(RoomWarnings.CURSOR_MISMATCH)
@Query("SELECT google_tasks.*, gt_order AS primary_sort, NULL AS secondary_sort FROM google_tasks JOIN tasks ON tasks._id = gt_task WHERE gt_parent = 0 AND gt_list_id = :listId AND tasks.deleted = 0 UNION SELECT c.*, p.gt_order AS primary_sort, c.gt_order AS secondary_sort FROM google_tasks AS c LEFT JOIN google_tasks AS p ON c.gt_parent = p.gt_task JOIN tasks ON tasks._id = c.gt_task WHERE c.gt_parent > 0 AND c.gt_list_id = :listId AND tasks.deleted = 0 ORDER BY primary_sort ASC, secondary_sort ASC")
abstract fun getByLocalOrder(listId:String):List<GoogleTask>
abstractsuspend fun getByLocalOrder(listId:String):List<GoogleTask>
@SuppressWarnings(RoomWarnings.CURSOR_MISMATCH)
@Query("SELECT google_tasks.*, gt_remote_order AS primary_sort, NULL AS secondary_sort FROM google_tasks JOIN tasks ON tasks._id = gt_task WHERE gt_parent = 0 AND gt_list_id = :listId AND tasks.deleted = 0 UNION SELECT c.*, p.gt_remote_order AS primary_sort, c.gt_remote_order AS secondary_sort FROM google_tasks AS c LEFT JOIN google_tasks AS p ON c.gt_parent = p.gt_task JOIN tasks ON tasks._id = c.gt_task WHERE c.gt_parent > 0 AND c.gt_list_id = :listId AND tasks.deleted = 0 ORDER BY primary_sort ASC, secondary_sort ASC")
abstract fun getByRemoteOrder(listId:String):List<GoogleTask>
abstractsuspend fun getByRemoteOrder(listId:String):List<GoogleTask>
@Query("UPDATE google_tasks"
+" SET gt_parent = IFNULL(("
@ -125,16 +125,16 @@ abstract class GoogleTaskDao {
+" AND p.gt_deleted = 0),"
+" 0)"
+" WHERE gt_moved = 0")
abstract fun updateParents()
abstractsuspend fun updateParents()
@Query("UPDATE google_tasks SET gt_parent = IFNULL((SELECT gt_task FROM google_tasks AS p WHERE p.gt_remote_id = google_tasks.gt_remote_parent), 0) WHERE gt_list_id = :listId AND gt_moved = 0")
abstract fun updateParents(listId:String)
abstractsuspend fun updateParents(listId:String)
@Query("UPDATE google_tasks SET gt_remote_parent = :parent, gt_remote_order = :position WHERE gt_remote_id = :id")
abstract fun updatePosition(id:String,parent:String,position:String)
abstractsuspend fun updatePosition(id:String,parent:String,position:String)
+" WHERE tasks.completed = 0 AND tasks.deleted = 0"
+" AND (geofences.arrival > 0 OR geofences.departure > 0)"
+" GROUP BY places.uid")
fun getPlacesWithGeofences():List<Place>
suspend fun getPlacesWithGeofences():List<Place>
@Query("SELECT places.*,"
+" max(geofences.arrival) as arrival,"
@ -27,92 +27,92 @@ interface LocationDao {
+" WHERE place = :uid AND tasks.completed = 0 AND tasks.deleted = 0"
+" AND (geofences.arrival > 0 OR geofences.departure > 0)"
+" GROUP BY places.uid")
fun getGeofencesByPlace(uid:String):MergedGeofence?
suspend fun getGeofencesByPlace(uid:String):MergedGeofence?
@Query("DELETE FROM geofences WHERE place = :place")
fun deleteGeofencesByPlace(place:String)
suspend fun deleteGeofencesByPlace(place:String)
@Query("SELECT geofences.* FROM geofences"
+" INNER JOIN tasks ON tasks._id = geofences.task"
+" WHERE place = :place AND arrival = 1 AND tasks.completed = 0"
+" AND tasks.deleted = 0 AND tasks.snoozeTime < :now AND tasks.hideUntil < :now")
fun getArrivalGeofences(place:String,now:Long):List<Geofence>
suspend fun getArrivalGeofences(place:String,now:Long):List<Geofence>
@Query("SELECT geofences.* FROM geofences"
+" INNER JOIN tasks ON tasks._id = geofences.task"
+" WHERE place = :place AND departure = 1 AND tasks.completed = 0"
+" AND tasks.deleted = 0 AND tasks.snoozeTime < :now AND tasks.hideUntil < :now")
fun getDepartureGeofences(place:String,now:Long):List<Geofence>
suspend fun getDepartureGeofences(place:String,now:Long):List<Geofence>
@Query("SELECT * FROM geofences"
+" INNER JOIN places ON geofences.place = places.uid"
+" WHERE task = :taskId ORDER BY name ASC LIMIT 1")
fun getGeofences(taskId:Long):Location?
suspend fun getGeofences(taskId:Long):Location?
@Query("SELECT geofences.*, places.* FROM geofences INNER JOIN places ON geofences.place = places.uid INNER JOIN tasks ON tasks._id = geofences.task WHERE tasks._id = :taskId AND tasks.deleted = 0 AND tasks.completed = 0")
fun getActiveGeofences(taskId:Long):List<Location>
suspend fun getActiveGeofences(taskId:Long):List<Location>
@Query("SELECT places.*"
+" FROM places"
+" INNER JOIN geofences ON geofences.place = places.uid"
+" WHERE geofences.task = :taskId")
fun getPlaceForTask(taskId:Long):Place?
suspend fun getPlaceForTask(taskId:Long):Place?
@Query("SELECT geofences.*, places.* FROM geofences INNER JOIN places ON geofences.place = places.uid INNER JOIN tasks ON tasks._id = geofences.task WHERE tasks.deleted = 0 AND tasks.completed = 0")
fun getActiveGeofences():List<Location>
suspend fun getActiveGeofences():List<Location>
@Query("SELECT COUNT(*) FROM geofences")
suspendfungeofenceCount():Int
@Delete
fun delete(location:Geofence)
suspend fun delete(location:Geofence)
@Delete
fun delete(place:Place)
suspend fun delete(place:Place)
@Insert
fun insert(location:Geofence):Long
suspend fun insert(location:Geofence):Long
@Insert(onConflict=OnConflictStrategy.IGNORE)
fun insert(place:Place):Long
suspend fun insert(place:Place):Long
@Update
fun update(place:Place)
suspend fun update(place:Place)
@Update
fun update(geofence:Geofence)
suspend fun update(geofence:Geofence)
@Query("SELECT * FROM places WHERE uid = :uid LIMIT 1")
fun getByUid(uid:String):Place?
suspend fun getByUid(uid:String):Place?
@Query("SELECT * FROM geofences WHERE task = :taskId")
fun getGeofencesForTask(taskId:Long):List<Geofence>
suspend fun getGeofencesForTask(taskId:Long):List<Geofence>
@Query("SELECT * FROM places")
fun getPlaces():List<Place>
suspend fun getPlaces():List<Place>
@Query("SELECT * FROM places WHERE place_id = :id")
fun getPlace(id:Long):Place?
suspend fun getPlace(id:Long):Place?
@Query("SELECT * FROM places WHERE uid = :uid")
fun getPlace(uid:String):Place?
suspend fun getPlace(uid:String):Place?
@Query("SELECT places.*, IFNULL(COUNT(geofence_id),0) AS count FROM places LEFT OUTER JOIN geofences ON geofences.place = places.uid GROUP BY uid ORDER BY COUNT(geofence_id) DESC")
fungetPlaceUsage():LiveData<List<PlaceUsage>>
@Query("SELECT * FROM places WHERE latitude LIKE :latitude AND longitude LIKE :longitude")
fun findPlace(latitude:String,longitude:String):Place?
suspend fun findPlace(latitude:String,longitude:String):Place?
@Query("SELECT places.*, COUNT(tasks._id) AS count FROM places "
+" LEFT JOIN geofences ON geofences.place = places.uid "
+" LEFT JOIN tasks ON geofences.task = tasks._id AND tasks.completed = 0 AND tasks.deleted = 0 AND tasks.hideUntil < :now"
+" GROUP BY places.uid"
+" ORDER BY name COLLATE NOCASE ASC")
fun getPlaceFilters(now:Long=currentTimeMillis()):List<LocationFilters>
suspend fun getPlaceFilters(now:Long=currentTimeMillis()):List<LocationFilters>
@Query("UPDATE places SET place_order = $NO_ORDER")
fun resetOrders()
suspend fun resetOrders()
@Query("UPDATE places SET place_order = :order WHERE place_id = :id")