Helper function that returns Boolean true if a query starts with a comment. This saves us from relying on sqlparse filtering, which can be slow.
(raw_line)
| 1824 | |
| 1825 | @staticmethod |
| 1826 | def _has_leading_comment(raw_line): |
| 1827 | """ |
| 1828 | Helper function that returns Boolean true if a query starts with a comment. |
| 1829 | This saves us from relying on sqlparse filtering, which can be slow. |
| 1830 | """ |
| 1831 | line = raw_line.lstrip() |
| 1832 | if line and (line.startswith('--') or line.startswith('/*')): |
| 1833 | return True |
| 1834 | else: |
| 1835 | return False |
| 1836 | |
| 1837 | @staticmethod |
| 1838 | def strip_leading_comment(sql): |