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

Function _find_password_after_eq

mycli/packages/sql_utils.py:545–553  ·  view source on GitHub ↗

Find a password literal following an = token (for SET PASSWORD = 'pw').

(tokens: list[sqlglot.tokens.Token])

Source from the content-addressed store, hash-verified

543
544
545def _find_password_after_eq(tokens: list[sqlglot.tokens.Token]) -> str | None:
546 """Find a password literal following an = token (for SET PASSWORD = 'pw')."""
547 tt = sqlglot.tokens.TokenType
548 for i, tok in enumerate(tokens):
549 if tok.token_type == tt.EQ and i + 1 < len(tokens):
550 next_tok = tokens[i + 1]
551 if next_tok.token_type == tt.STRING:
552 return next_tok.text
553 return None
554
555
556def is_sandbox_allowed(text: str) -> bool:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected