title: SQLAlchemy add condition to query
body: <p>Beginning of my raw sql statement looks like this:</p>
  
  <pre><code>select if(substr(Table.order_id,1,8)='STRING', Table1.name, t=Table2.type)
  </code></pre>
  
  <p>Tried to rewrite it in SQLAlchemy query:</p>
  
  <pre><code>query = db_session.query(Table,\ 
                           Table1.name if Table.order_id[1:8] == 'STRING' else Table2.type)
  </code></pre>
  
  <p>But it returned <code>Operator 'getitem' is not supported on this expression</code>.</p>
  
  <p>How can I add this condition to my ORM query without touching models?</p>
  
  <p>Or how can I add raw sql statement in query parameters?</p>
  
  <p><strong>PS:</strong> I would prefer not to make any changes to models.</p>