<commit_before>/*
 * Copyright (c) 2019 toastkidjp.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompany this distribution.
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html.
 */
package jp.toastkid.yobidashi.search.favorite

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Query
import androidx.room.Insert
import androidx.room.OnConflictStrategy

/**
 * @author toastkidjp
 */
@Dao
interface FavoriteSearchRepository {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(item: FavoriteSearch)

    @Query("SELECT * FROM FavoriteSearch WHERE query LIKE :keyword ORDER BY id DESC LIMIT 5")
    fun select(keyword: String): List<FavoriteSearch>

    @Query("SELECT * FROM FavoriteSearch")<commit_msg>bugfix #412 Fix incorrect specifying.<commit_after>/*
 * Copyright (c) 2019 toastkidjp.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompany this distribution.
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html.
 */
package jp.toastkid.yobidashi.search.favorite

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

/**
 * @author toastkidjp
 */
@Dao
interface FavoriteSearchRepository {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(item: FavoriteSearch)

    @Query("SELECT * FROM FavoriteSearch WHERE `query` LIKE :keyword ORDER BY id DESC LIMIT 5")
    fun select(keyword: String): List<FavoriteSearch>

    @Query("SELECT * FROM FavoriteSearch")
{'fraction_non_alphanumeric': 0.08888888888888889, 'fraction_numerical': 0.011666666666666667, 'mean_word_length': 4.628125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2501209', 'n_tokens_mistral': 546, 'n_tokens_neox': 506, 'n_words': 163}