Ejemplo n.º 1
0
 def inserted_tables(self,
                     variables: Optional[Environment] = {}) -> List[Name]:
     return [
         obj for _l, _comment, stmt in iter_statement(self.sql)
         for obj in sql_syntax.inserted_tables(
             sql_syntax.substitute(stmt, self._all_vars(variables)))
     ]
Ejemplo n.º 2
0
 def each_statement(self,
                    variables: Optional[Environment]=None,
                    skip_unbound: bool=False) -> Iterable[ScriptStep]:
     for line, comment, statement in self.parse(self.sql):
         try:
             ss = sql_syntax.substitute(statement, self._all_vars(variables))
         except KeyError:
             if skip_unbound:
                 continue
             else:
                 raise
         yield line, comment, ss
Ejemplo n.º 3
0
 def each_statement(self,
                    variables: Optional[Environment]=None,
                    skip_unbound: bool=False) -> Iterable[ScriptStep]:
     for line, comment, statement in self.parse(self.sql):
         try:
             ss = sql_syntax.substitute(statement, self._all_vars(variables))
         except KeyError:
             if skip_unbound:
                 continue
             else:
                 raise
         yield line, comment, ss
Ejemplo n.º 4
0
 def inserted_tables(self,
                     variables: Optional[Environment]={}) -> List[Name]:
     return [obj
             for _l, _comment, stmt in iter_statement(self.sql)
             for obj in sql_syntax.inserted_tables(
                     sql_syntax.substitute(stmt, self._all_vars(variables)))]