Nevermind about sqlparse, too slow for my taste at the moment.

This was adding about 100ms to my start times for Etiquette,
which is too high as I'm trying to make Etiquette more cli friendly.
This commit is contained in:
Ethan Dalool 2020-02-25 10:41:13 -08:00
parent 104fdf637c
commit b0c33b8137
2 changed files with 3 additions and 3 deletions

View file

@ -12,7 +12,6 @@ setuptools.setup(
url='https://github.com/voussoir/voussoirkit', url='https://github.com/voussoir/voussoirkit',
install_requires=[ install_requires=[
'pyperclip', 'pyperclip',
'sqlparse',
'pywin32;platform_system=="Windows"', 'pywin32;platform_system=="Windows"',
'winshell;platform_system=="Windows"', 'winshell;platform_system=="Windows"',
] ]

View file

@ -1,5 +1,4 @@
import re import re
import sqlparse
import types import types
def delete_filler(pairs): def delete_filler(pairs):
@ -164,7 +163,9 @@ def listify(items):
return output return output
def _extract_create_table_statements(script): 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(';'): for statement in script.split(';'):
statement = statement.strip() statement = statement.strip()
if statement.lower().startswith('create table'): if statement.lower().startswith('create table'):