title: Setting input parameter types in SQLAlchemy raw SQL
body: <p>I want to execute some raw SQL and take advantage of SQLAlchemy's SQL injection prevention.</p>
  
  <p>My code is similar to this bit: </p>
  
  <pre><code>import sqlalchemy
  from sqlalchemy.sql import text
  
  DB_URI = '...'
  engine = sqlalchemy.create_engine(DB_URI)
  
  sql = text("SELECT * FROM some_table WHERE userid = :userid")
  res = engine.execute(sql, userid=12345)
  # do something with the result... 
  </code></pre>
  
  <p>The problem is that <code>userid</code> in <code>some_table</code> is of type <code>varchar</code>. All I want to do is to tell SQLAlchemy to convert <code>12345</code> to a string before executing the statement. I know how I could do the conversion both in Python and in SQL. But I remember that I once used a explicit type definition in SQLAlchemy, I just can't find it anymore. Can someone point me to the right direction?
  (My actual question involves postgresql arrays of BIGINTs vs. INTs, but I tried to keep it simple.) </p>
  
  <p>Thanks for any help!</p>