|
|
|
|
@ -31,6 +31,43 @@ interface TopicFtsDao {
|
|
|
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
|
|
|
suspend fun insertAll(topics: List<TopicFtsEntity>)
|
|
|
|
|
|
|
|
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
|
|
|
suspend fun insert(topic: TopicFtsEntity)
|
|
|
|
|
|
|
|
|
|
@Query(
|
|
|
|
|
"""
|
|
|
|
|
DELETE
|
|
|
|
|
FROM topicsFts
|
|
|
|
|
WHERE topicId = :topicId
|
|
|
|
|
""",
|
|
|
|
|
)
|
|
|
|
|
suspend fun deleteById(topicId: String)
|
|
|
|
|
|
|
|
|
|
@Query(
|
|
|
|
|
"""
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM topicsFts
|
|
|
|
|
WHERE topicId = :topicId
|
|
|
|
|
""",
|
|
|
|
|
)
|
|
|
|
|
suspend fun getFtsEntityById(topicId: String): List<TopicFtsEntity>
|
|
|
|
|
|
|
|
|
|
@Query(
|
|
|
|
|
"""
|
|
|
|
|
UPDATE topicsFts
|
|
|
|
|
SET name = :name,
|
|
|
|
|
shortDescription = :shortDescription,
|
|
|
|
|
longDescription = :longDescription
|
|
|
|
|
WHERE topicId = :topicId
|
|
|
|
|
""",
|
|
|
|
|
)
|
|
|
|
|
suspend fun update(
|
|
|
|
|
name: String,
|
|
|
|
|
shortDescription: String,
|
|
|
|
|
longDescription: String,
|
|
|
|
|
topicId: String,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@Query("SELECT topicId FROM topicsFts WHERE topicsFts MATCH :query")
|
|
|
|
|
fun searchAllTopics(query: String): Flow<List<String>>
|
|
|
|
|
|
|
|
|
|
|