title: SQLAlchemy: Error binding parameter 0 - probably unsupported type
body: <p>I am trying to create an instance of a table with the following code:</p>
  
  <pre><code>c = 'dcoh92j'
  new_comment = Comment(rcomment = c, rtime = datetime.datetime.now())
  </code></pre>
  
  <p>But I receive this error:</p>
  
  <pre><code>sqlalchemy.exc.InterfaceError: (sqlite3.InterfaceError) Error binding parameter 0 - probably unsupported type. [SQL: 'INSERT INTO comments (rcomment, rtime) VALUES (?, ?)'] [parameters: (Comment(id='dcoh92j'), datetime.datetime(2017, 1, 20, 12, 38, 38, 836433))
  </code></pre>
  
  <p>Here is my table schema:</p>
  
  <pre><code>class Comment(Base):
      __tablename__ = 'comments'
      id = Column(Integer, Sequence('comment_id_seq'), primary_key=True)
      rcomment = Column(String)
      rtime = Column(String)
  
      def __repr__(self):
          return "&lt;Comment(rcomment='{0}', rtime='(1)')&gt;".format(self.rcomment, self.rtime)
  </code></pre>
  
  <ol>
  <li>Why does SQLAlchemy think the parameters I'm trying to insert into the database are <code>(Comment(id='dcoh92j'), datetime.datetime(2017, 1, 20, 12, 38, 38, 836433)</code>? Instead of just <code>'dcoh92j'</code> and <code>2017, 1, 20, 12, 38, 38, 836433</code></li>
  <li>Where is this <code>Comment(id='dcoh92j')</code> coming from?</li>
  </ol>
  
  <p>Full code <a href="https://github.com/Logicmn/Reddit-Stock-Bot/blob/master/src/stock_bot.py" rel="nofollow noreferrer">here</a>.</p>