title: How to write dynamic SQL queries with sql""" interpolation in slick
body: <p>I am new to Scala and Slick and trying to write a plain SQL queries with Slick interpolation.</p>
  
  <p>Case 1:
  I want the generalize the code so that queries are stored as constants.</p>
  
  <p>for instance:</p>
  
  <pre><code>val SQL_ALL_TABLE_METADATA: String = """SELECT DISTINCT table_name, column_name, data_type
                                              FROM information_schema.columns
                                                      WHERE table_schema = 'apollo' OR table_schema = 'dpa' ORDER BY table_name""";
  </code></pre>
  
  <p>And create plain query from constant something like</p>
  
  <pre><code>var plainQuery = sql"""$SQL_ALL_TABLE_METADATA""".as[List[String]]
  </code></pre>
  
  <p>Case 2:
  Replace a part of the query</p>
  
  <p>For instance: get information on column f_name from table 'table1'</p>
  
  <pre><code>var column= "f_name"
  var plainQuery = sql"""SELECT $column FROM table1""".as[String]
  </code></pre>
  
  <p>When I try the above cases it is not working as it looks like query is binding statically on compile time.</p>
  
  <p>Please note that as of now I want to use plain SQL and use advanced Slick API in future.</p>