diff --git a/setup.py b/setup.py index 3e257f8..b04e3b1 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,6 @@ setuptools.setup( url='https://github.com/voussoir/voussoirkit', install_requires=[ 'pyperclip', - 'sqlparse', 'pywin32;platform_system=="Windows"', 'winshell;platform_system=="Windows"', ] diff --git a/voussoirkit/sqlhelpers.py b/voussoirkit/sqlhelpers.py index 901609c..d33e8c5 100644 --- a/voussoirkit/sqlhelpers.py +++ b/voussoirkit/sqlhelpers.py @@ -1,5 +1,4 @@ import re -import sqlparse import types def delete_filler(pairs): @@ -164,7 +163,9 @@ def listify(items): return output def _extract_create_table_statements(script): - script = sqlparse.format(script, strip_comments=True) + # script = sqlparse.format(script, strip_comments=True) + # script = re.sub(r'\s*--.+$', '', script, flags=re.MULTILINE) + script = re.sub(r'\n\s*create ', ';\ncreate ', script, flags=re.IGNORECASE) for statement in script.split(';'): statement = statement.strip() if statement.lower().startswith('create table'):