Skip to content

Commit

Permalink
removing multi DDL command in create tables
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadrezaPourreza committed Apr 4, 2024
1 parent 12c9ddd commit ed03a9f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dataherald/sql_generator/dataherald_sqlagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,9 @@ def _run(
replace_unprocessable_characters(table_name)
for table_name in table_names_list
]
tables_schema = ""
tables_schema = "```sql\n"
for table in self.db_scan:
if table.table_name in table_names_list:
tables_schema += "```sql\n"
tables_schema += table.table_schema + "\n"
descriptions = []
if table.description is not None:
Expand All @@ -419,7 +418,7 @@ def _run(
)
if len(descriptions) > 0:
tables_schema += f"/*\n{''.join(descriptions)}*/\n"
tables_schema += "```\n"
tables_schema += "```\n"
if tables_schema == "":
tables_schema += "Tables not found in the database"
return tables_schema
Expand Down

0 comments on commit ed03a9f

Please sign in to comment.