|
|
|
|
|
|
|
|
# limitations under the License. |
|
|
# limitations under the License. |
|
|
# |
|
|
# |
|
|
import os |
|
|
import os |
|
|
|
|
|
import re |
|
|
from abc import ABC |
|
|
from abc import ABC |
|
|
import pandas as pd |
|
|
import pandas as pd |
|
|
import pymysql |
|
|
import pymysql |
|
|
|
|
|
|
|
|
single_sql = single_sql.replace('```','') |
|
|
single_sql = single_sql.replace('```','') |
|
|
if not single_sql: |
|
|
if not single_sql: |
|
|
continue |
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
single_sql = re.sub(r"\[ID:[0-9]+\]", "", single_sql) |
|
|
cursor.execute(single_sql) |
|
|
cursor.execute(single_sql) |
|
|
if cursor.rowcount == 0: |
|
|
if cursor.rowcount == 0: |
|
|
sql_res.append({"content": "No record in the database!"}) |
|
|
sql_res.append({"content": "No record in the database!"}) |