'Construct a CHECK constraint.
:param sqltext:
A string containing the constraint definition, which will be used
verbatim, or a SQL expression construct.   If given as a string,
the object is converted to a :class:`.Text` object.   If the textual
string includes a colon character, escape this using a backslash::
CheckConstraint(r"foo ~ E\'a(?\:b|c)d")
:param name:
Optional, the in-database name of the constraint.
:param deferrable:
Optional bool.  If set, emit DEFERRABLE or NOT DEFERRABLE when
issuing DDL for this constraint.
:param initially:
Optional string.  If set, emit INITIALLY <value> when issuing DDL
for this constraint.'

def __init__(self, sqltext, name=None, deferrable=None, initially=None, table=None, _create_rule=None, _autoattach=True):

    super(CheckConstraint, self).__init__(name, deferrable, initially, _create_rule)
    self.sqltext = _literal_as_text(sqltext)
    if (table is not None):
        self._set_parent_with_dispatch(table)
    elif _autoattach:
        cols = _find_columns(self.sqltext)
        tables = set([c.table for c in cols if isinstance(c.table, Table)])
        if (len(tables) == 1):
            self._set_parent_with_dispatch(tables.pop())
