import sys
from sqlconvert.print_tokens import print_tokens
-from sqlconvert.process_tokens import requote_names, find_error, \
- StatementGrouper
+from sqlconvert.process_mysql import requote_names
+from sqlconvert.process_tokens import find_error, StatementGrouper
def main(filename):
import sys
from sqlconvert.print_tokens import print_tokens
-from sqlconvert.process_tokens import requote_names, find_error, \
- StatementGrouper
+from sqlconvert.process_mysql import requote_names
+from sqlconvert.process_tokens import find_error, StatementGrouper
def main(*queries):
import sys
from sqlparse import parse
from sqlconvert.print_tokens import print_tokens
-from sqlconvert.process_tokens import requote_names, find_error
+from sqlconvert.process_mysql import requote_names
+from sqlconvert.process_tokens import find_error
def main(filename):
import sys
from sqlparse import parse
from sqlconvert.print_tokens import print_tokens
-from sqlconvert.process_tokens import requote_names, find_error
+from sqlconvert.process_mysql import requote_names
+from sqlconvert.process_tokens import find_error
def main(*queries):
from sqlparse.compat import text_type
from sqlconvert.print_tokens import print_tokens
-from sqlconvert.process_tokens import requote_names, StatementGrouper
+from sqlconvert.process_mysql import requote_names
+from sqlconvert.process_tokens import StatementGrouper
from m_lib.defenc import default_encoding
from m_lib.pbar.tty_pbar import ttyProgressBar
--- /dev/null
+
+from sqlparse.tokens import Name
+
+
+def requote_names(token_list):
+ """Remove backticks, quote non-lowercase identifiers"""
+ for token in token_list.flatten():
+ if token.ttype is Name:
+ value = token.value
+ if (value[0] == "`") and (value[-1] == "`"):
+ value = value[1:-1]
+ if value.islower():
+ token.normalized = token.value = value
+ else:
+ token.normalized = token.value = '"%s"' % value
from sqlparse import parse
from sqlparse.compat import PY3
-from sqlparse.tokens import Name, Error, Punctuation, Comment, Newline, \
- Whitespace
-
-
-def requote_names(token_list):
- """Remove backticks, quote non-lowercase identifiers"""
- for token in token_list.flatten():
- if token.ttype is Name:
- value = token.value
- if (value[0] == "`") and (value[-1] == "`"):
- value = value[1:-1]
- if value.islower():
- token.normalized = token.value = value
- else:
- token.normalized = token.value = '"%s"' % value
+from sqlparse.tokens import Error, Punctuation, Comment, Newline, Whitespace
def find_error(token_list):
import unittest
from sqlconvert.print_tokens import tlist2str
-from sqlconvert.process_tokens import requote_names, StatementGrouper
+from sqlconvert.process_mysql import requote_names
+from sqlconvert.process_tokens import StatementGrouper
from tests import main
import unittest
from sqlparse import parse
-from sqlconvert.process_tokens import requote_names
from sqlconvert.print_tokens import tlist2str
+from sqlconvert.process_mysql import requote_names
from tests import main