package Ġcom . words . storage app . database Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . room .* Ċ import Ġcom . words . storage app . database . model . All Skill And Comments Ċ import Ġcom . words . storage app . database . model . Mini Skill Model Ċ import Ġcom . words . storage app . database . model . All Skills Db Model Ċ Ċ @ Dao Ċ interface ĠAll Skills Db Dao Ġ{ ĊĊĠĠĠ Ġ@ Query ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠĠĠĠĠ ĠSELECT Ġall _ skills .* ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFROM Ġf ts _ table ĊĠĠĠĠĠĠĠĠĠĠĠ ĠJOIN Ġall _ skills ĠON Ġ( fts _ table . row Id Ġ= row Id ) ĠĊĠĠĠĠĠĠĠĠĠĠĠ ĠWHERE Ġf ts _ table ĠMATCH Ġ: query ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠ Ġ) ĊĠĠĠ Ġfun Ġsearch Skill ( query : ĠString ): ĠLive Data < List < Mini Skill Model >> ĊĊĠĠĠ Ġ@ Transaction ĊĠĠĠ Ġ@ Query ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ ĠSELECT Ġ* FROM Ġall _ skills ĠWHERE Ġid Ġ= Ġ: userId ĊĠĠĠ Ġ""" ĊĠĠĠ Ġ) ĊĠĠĠ Ġfun Ġget Sk illed With Comment ( userId : ĠString ): ĠLive Data < All Skill And Comments > ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġall _ skills ĠWHERE Ġid Ġ= Ġ: userId ") ĊĠĠĠ Ġfun Ġget Sk illed User ( userId : ĠString ): ĠLive Data < All Skills Db Model > ĊĊĠĠĠ Ġ@ Query (" ĠSELECT Ġ* FROM Ġall _ skills ") ĊĠĠĠ Ġfun ĠgetAll Skills (): ĠLive Data < List < Mini Skill Model >> ĊĊĠĠĠ Ġ// execute Ġthis Ġquery Ġin Ġco - routine Ġbackground Ġthread ĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġsuspend Ġfun Ġinsert All ( all Skills : ĠList < All Skills Db Model >) ĊĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġsuspend Ġfun Ġinsert ( all Skills : ĠAll Skills Db Model ) ĊĊĠĠĠ Ġ@ Update ĊĠĠĠ Ġsuspend Ġfun Ġupdate ( all Skills : ĠAll Skills Db Model ) ĊĊĠĠĠ Ġ@ Query (" DELETE ĠFROM Ġall _ skills ") ĊĠĠĠ Ġsuspend Ġfun Ġdelete All Users () ĊĊĠĠĠ Ġ@ Transaction ĊĠĠĠ Ġsuspend Ġfun Ġupdate All Skill ( all Skills : ĠList < All Skills Db Model >) Ġ{ ĊĠĠĠĠĠĠĠ Ġdelete All Users () ĊĠĠĠĠĠĠĠ Ġinsert All ( all Skills ) ĊĠĠĠ Ġ} Ċ Ċ } Ċ