title: Hardcode Boolean Query In Room Database
body: <p>I'm building an Android application that displays a list of potential matches for a user. The user can click on one to like the user, and I save all of those likes locally. </p>
  
  <p>I can write a query to get the list of matches like this:</p>
  
  <pre><code>@Query("SELECT * FROM match WHERE liked = :liked ORDER BY match DESC LIMIT :limit")
  fun getMatches(limit: Int = 6, liked: Boolean = true): Flowable&lt;List&lt;Match&gt;&gt;
  </code></pre>
  
  <p>I've learned that this works fine. However, I don't foresee any scenario where I'll ever set <code>liked</code> to false, and so I'm curious if there is a way to hardcode my Boolean condition? If I try:</p>
  
  <pre><code>@Query("SELECT * FROM match WHERE liked = true ORDER BY match DESC LIMIT :limit")
  </code></pre>
  
  <p>I get the following error at compile time:</p>
  
  <pre><code>Error:(8, 0) Gradle: error: There is a problem with the query: [SQLITE_ERROR] SQL error or missing database (no such column: true)
  </code></pre>
  
  <p>How can I hard code this Boolean in my query string?</p>
  
  <p>I have also tried:</p>
  
  <ul>
  <li>Wrapping the condition in single quotes
  
  <ul>
  <li><code>@Query("SELECT * FROM match WHERE liked = 'true' ORDER BY match DESC LIMIT :limit")</code></li>
  </ul></li>
  </ul>