def get_sql(self, gid, sid, data, scid, tid, cid=None):
    '\n        Generates the SQL statements to create/update the Check Constraint.\n\n         Args:\n            gid: Server Group Id\n            sid: Server Id\n            did: Database Id\n            scid: Schema Id\n            tid: Table Id\n            cid: Check Constraint Id\n        '
    if (cid is not None):
        SQL = render_template('/'.join([self.template_path, 'properties.sql']), tid=tid, cid=cid)
        (status, res) = self.conn.execute_dict(SQL)
        if (not status):
            return (False, internal_server_error(errormsg=res))
        if (len(res['rows']) == 0):
            return (False, gone(_('Could not find the object on the server.')))
        old_data = res['rows'][0]
        required_args = ['name']
        for arg in required_args:
            if (arg not in data):
                data[arg] = old_data[arg]
        SQL = render_template('/'.join([self.template_path, 'update.sql']), data=data, o_data=old_data, conn=self.conn)
    else:
        required_args = ['consrc']
        for arg in required_args:
            if (arg not in data):
                return _('-- definition incomplete')
            elif (isinstance(data[arg], list) and (len(data[arg]) < 1)):
                return _('-- definition incomplete')
        SQL = render_template('/'.join([self.template_path, 'create.sql']), data=data)
    return (SQL, (data['name'] if ('name' in data) else old_data['name']))
Generates the SQL statements to create/update the Check Constraint.

 Args:
    gid: Server Group Id
    sid: Server Id
    did: Database Id
    scid: Schema Id
    tid: Table Id
    cid: Check Constraint Id
def get_sql(self, gid, sid, data, scid, tid, cid=None):
    '\n        Generates the SQL statements to create/update the Check Constraint.\n\n         Args:\n            gid: Server Group Id\n            sid: Server Id\n            did: Database Id\n            scid: Schema Id\n            tid: Table Id\n            cid: Check Constraint Id\n        '
    if (cid is not None):
        SQL = render_template('/'.join([self.template_path, 'properties.sql']), tid=tid, cid=cid)
        (status, res) = self.conn.execute_dict(SQL)
        if (not status):
            return (False, internal_server_error(errormsg=res))
        if (len(res['rows']) == 0):
            return (False, gone(_('Could not find the object on the server.')))
        old_data = res['rows'][0]
        required_args = ['name']
        for arg in required_args:
            if (arg not in data):
                data[arg] = old_data[arg]
        SQL = render_template('/'.join([self.template_path, 'update.sql']), data=data, o_data=old_data, conn=self.conn)
    else:
        required_args = ['consrc']
        for arg in required_args:
            if (arg not in data):
                return _('-- definition incomplete')
            elif (isinstance(data[arg], list) and (len(data[arg]) < 1)):
                return _('-- definition incomplete')
        SQL = render_template('/'.join([self.template_path, 'create.sql']), data=data)
    return (SQL, (data['name'] if ('name' in data) else old_data['name']))