]> git.phdru.name Git - sqlconvert.git/commitdiff
Refactor(process_mysql): Get DML type
authorOleg Broytman <phd@phdru.name>
Fri, 3 Nov 2017 22:32:55 +0000 (01:32 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 3 Nov 2017 22:32:55 +0000 (01:32 +0300)
sqlconvert/process_mysql.py

index e99ea79edc2816c57787f0578589a38bacea6173..fad7e4cc291a04241834557bbb90aa4c36283e67 100644 (file)
@@ -147,10 +147,10 @@ def process_statement(statement, dbname='sqlite'):
     remove_directive_tokens(statement)
     escape_strings(statement, dbname)
     try:
-        is_insert = get_DML_type(statement) == 'INSERT'
+        dml_type = get_DML_type(statement)
     except ValueError:
-        is_insert = False
-    if is_insert:
+        dml_type = 'UNKNOWN'
+    if dml_type == 'INSERT':
         for statement in split_ext_insert(statement):
             yield statement
     else: