MCPcopy Create free account
hub / github.com/dbcli/mycli / _charset_suggestion

Function _charset_suggestion

mycli/packages/completion_engine.py:586–600  ·  view source on GitHub ↗
(tokens: list[Token])

Source from the content-addressed store, hash-verified

584
585
586def _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
603def _is_where_or_having(token: Token | None) -> bool:

Callers 2

test_charset_suggestionFunction · 0.90
_emit_where_tokenFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_charset_suggestionFunction · 0.72