(tokens: list[Token])
| 584 | |
| 585 | |
| 586 | def _charset_suggestion(tokens: list[Token]) -> list[dict[str, str]] | None: |
| 587 | token_values = [token.value.lower() for token in tokens if token.value] |
| 588 | |
| 589 | if len(token_values) >= 2 and token_values[-1] == 'set' and token_values[-2] == 'character': |
| 590 | return [{'type': 'character_set'}] |
| 591 | if len(token_values) >= 3 and token_values[-2] == 'set' and token_values[-3] == 'character': |
| 592 | return [{'type': 'character_set'}] |
| 593 | if len(token_values) >= 5 and token_values[-1] == 'using' and token_values[-4] == 'convert': |
| 594 | return [{'type': 'character_set'}] |
| 595 | if len(token_values) >= 6 and token_values[-2] == 'using' and token_values[-5] == 'convert': |
| 596 | return [{'type': 'character_set'}] |
| 597 | if len(token_values) >= 1 and token_values[-1] == 'collate': |
| 598 | return [{'type': 'collation'}] |
| 599 | |
| 600 | return None |
| 601 | |
| 602 | |
| 603 | def _is_where_or_having(token: Token | None) -> bool: |
no outgoing calls