Generate a table alias, consisting of all upper-case letters in the table name, or, if there are no upper-case letters, the first letter + all letters preceded by _ param tbl - unescaped name of the table to alias
(tbl)
| 59 | |
| 60 | |
| 61 | def generate_alias(tbl): |
| 62 | """ Generate a table alias, consisting of all upper-case letters in |
| 63 | the table name, or, if there are no upper-case letters, the first letter + |
| 64 | all letters preceded by _ |
| 65 | param tbl - unescaped name of the table to alias |
| 66 | """ |
| 67 | return ''.join([l for l in tbl if l.isupper()] or |
| 68 | [l for l, prev in zip(tbl, '_' + tbl) if prev == '_' and l != '_']) |
| 69 | |
| 70 | |
| 71 | class MssqlCompleter(Completer): |
no outgoing calls
no test coverage detected