(token_stream)
| 41 | |
| 42 | |
| 43 | def extract_table_identifiers(token_stream): |
| 44 | for item in token_stream: |
| 45 | if isinstance(item, IdentifierList): |
| 46 | for identifier in item.get_identifiers(): |
| 47 | yield identifier.get_name() |
| 48 | elif isinstance(item, Identifier): |
| 49 | yield item.get_name() |
| 50 | # It's a bug to check for Keyword here, but in the example |
| 51 | # above some tables names are identified as keywords... |
| 52 | elif item.ttype is Keyword: |
| 53 | yield item.value |
| 54 | |
| 55 | |
| 56 | def extract_tables(sql): |
no test coverage detected
searching dependent graphs…