<p dir="auto"><strong>Migrated issue, originally created by florent breheret (<a href="https://github.com/florentbr">@florentbr</a>)</strong></p>
<p dir="auto">python 2.7.8, firebird 2.5.3, sqlalchemy 0.9.8, fdb 1.4.3</p>
<p dir="auto">For a table with a check constraint, I noticed that this check constraint is missing in the reflected metadata.<br>
The test case to reproduce:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import unittest
from sqlalchemy import *

class TestSuite(unittest.TestCase):

    def setUp(self):
        self.engine = create_engine('firebird+fdb://SYSDBA:masterkey@/c:/unitest.fdb')
        self.connection = self.engine.connect()

    def tearDown(self):
        self.connection.execute(&quot;DROP TABLE TMP_TABLE&quot;)
        self.connection.close()

    def test_check_constraint_reflected(self):
        table = Table('TMP_TABLE', MetaData(bind=self.connection),
            Column('dt', Integer),
            CheckConstraint('dt &gt; 1')
        )
        table.create(self.engine)
        reflected_constraints = MetaData(bind=self.connection, reflect=True).tables['tmp_table'].constraints
        self.assertItemsEqual(
            [c.__class__.__name__ for c in table.constraints],
            [c.__class__.__name__ for c in reflected_constraints]
        )
        
if __name__ == '__main__':
    unittest.main()
"><pre class="notranslate"><code class="notranslate">import unittest
from sqlalchemy import *

class TestSuite(unittest.TestCase):

    def setUp(self):
        self.engine = create_engine('firebird+fdb://SYSDBA:masterkey@/c:/unitest.fdb')
        self.connection = self.engine.connect()

    def tearDown(self):
        self.connection.execute("DROP TABLE TMP_TABLE")
        self.connection.close()

    def test_check_constraint_reflected(self):
        table = Table('TMP_TABLE', MetaData(bind=self.connection),
            Column('dt', Integer),
            CheckConstraint('dt &gt; 1')
        )
        table.create(self.engine)
        reflected_constraints = MetaData(bind=self.connection, reflect=True).tables['tmp_table'].constraints
        self.assertItemsEqual(
            [c.__class__.__name__ for c in table.constraints],
            [c.__class__.__name__ for c in reflected_constraints]
        )
        
if __name__ == '__main__':
    unittest.main()

</code></pre></div>
<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">I'm not sure about other DB backends, but postgres supports also unique/check constraints to be inspected on db. Any change to get this into SA?</p>