MCPcopy
hub / github.com/andialbrecht/sqlparse / get_parent_name

Method get_parent_name

sqlparse/sql.py:376–383  ·  view source on GitHub ↗

Return name of the parent object if any. A parent object is identified by the first occurring dot.

(self)

Source from the content-addressed store, hash-verified

374 return None
375
376 def get_parent_name(self):
377 """Return name of the parent object if any.
378
379 A parent object is identified by the first occurring dot.
380 """
381 dot_idx, _ = self.token_next_by(m=(T.Punctuation, '.'))
382 _, prev_ = self.token_prev(dot_idx)
383 return remove_quotes(prev_.value) if prev_ is not None else None
384
385 def _get_first_name(self, idx=None, reverse=False, keywords=False,
386 real_name=False):

Calls 3

token_next_byMethod · 0.95
token_prevMethod · 0.95
remove_quotesFunction · 0.90