title: How to create integer of a certain length with Sqlalchemy?
body: <p>I've tried two approaches and both are not working, I searched on Google and didn't find any proper solutions. My code looks like:</p>
  
  <pre><code>intField = Column(SmallInt(), length=5)
  </code></pre>
  
  <p>And the error says: </p>
  
  <pre><code>Unknown arguments passed to Column: ['length']
  </code></pre>
  
  <p>I also tried, knowing it shouldn't work, this solution:</p>
  
  <pre><code>intField = Column(SmallInt(5))
  </code></pre>
  
  <p>And it does not work because this SqlAlchemy datatype doesn't accept arguments. </p>
  
  <p>Any ideas? </p>
  
  <p><strong>[Update]</strong></p>
  
  <p>I'm using <code>MySQL</code> as database engine, so the solution here is to import mysql's own Integer type, and then specify the length I want it to be. </p>
  
  <p>In the above example, I would only need to do: </p>
  
  <pre><code>from sqlalchemy.dialects import mysql
  
  Integer = mysql.INTEGER 
  
  class ...
      ...
      intField = Column(Integer(5))
  </code></pre>
  
  <p>But I still wonder if there is a more generic approach? </p>