(self, sql, local_tables, local_seqs)
return sql
Replace replacement tags in sql with actual local names.
Replace replacement tags in sql with actual local names.
Replace replacement tags in sql with actual local names .
def process_sql(self, sql, local_tables, local_seqs):
        """Replace replacement tags in sql with actual local names."""
        for k, vlist in self.attrs.items():
            m = META_KEYS[k]
            if not m.local_rename():
                continue
            for v in vlist:
                repname = '@%s@' % v
                fqname = skytools.fq_name(v)
                if fqname in local_tables:
                    localname = local_tables[fqname]
                elif fqname in local_seqs:
                    localname = local_seqs[fqname]
                else:
                    # should not happen
                    raise Exception("bug: lost table: "+v)
                qdest = skytools.quote_fqident(localname)
                sql = sql.replace(repname, qdest)
        return sql
def process_sql ( self , sql , local_tables , local_seqs ) : for k , vlist in self . attrs . items ( ) : m = META_KEYS [ k ] if not m . local_rename ( ) : continue for v in vlist : repname = '@%s@' % v fqname = skytools . fq_name ( v ) if fqname in local_tables : localname = local_tables [ fqname ] elif fqname in local_seqs : localname = local_seqs [ fqname ] else : # should not happen raise Exception ( "bug: lost table: " + v ) qdest = skytools . quote_fqident ( localname ) sql = sql . replace ( repname , qdest ) return sql