def get_ddl(self, table_name, object_type=None, echo=True):
    'Get ddl for table'
    Rec = namedtuple('DDL', 'ddl')
    self._fields = Rec._fields
    (schema, table) = self._split_schema_table(table_name)
    sql_tmpl = self._template('metadata.ddl')
    if sql_tmpl:
        rows = self.query(sql_tmpl.format(schema=schema, table=table, obj_type=object_type))
    else:
        self.get_engine(echo=echo)
        ddl = self.engine_inspect.get_view_definition(table, schema=schema)
        rows = ([Rec(ddl)] if ddl else [])
    self._fields = Rec._fields
    return rows
Get ddl for table
def get_ddl(self, table_name, object_type=None, echo=True):
    
    Rec = namedtuple('DDL', 'ddl')
    self._fields = Rec._fields
    (schema, table) = self._split_schema_table(table_name)
    sql_tmpl = self._template('metadata.ddl')
    if sql_tmpl:
        rows = self.query(sql_tmpl.format(schema=schema, table=table, obj_type=object_type))
    else:
        self.get_engine(echo=echo)
        ddl = self.engine_inspect.get_view_definition(table, schema=schema)
        rows = ([Rec(ddl)] if ddl else [])
    self._fields = Rec._fields
    return rows