MCPcopy Create free account
hub / github.com/dbcli/mssql-cli / _strip_named_query

Function _strip_named_query

mssqlcli/packages/sqlcompletion.py:166–175  ·  view source on GitHub ↗

This will strip "save named query" command in the beginning of the line: '\ns zzz SELECT * FROM abc' -> 'SELECT * FROM abc' ' \ns zzz SELECT * FROM abc' -> 'SELECT * FROM abc'

(txt)

Source from the content-addressed store, hash-verified

164
165
166def _strip_named_query(txt):
167 """
168 This will strip "save named query" command in the beginning of the line:
169 '\ns zzz SELECT * FROM abc' -> 'SELECT * FROM abc'
170 ' \ns zzz SELECT * FROM abc' -> 'SELECT * FROM abc'
171 """
172
173 if named_query_regex.match(txt):
174 txt = named_query_regex.sub('', txt)
175 return txt
176
177
178function_body_pattern = re.compile(r'(\$.*?\$)([\s\S]*?)\1', re.M)

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected