-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Sure, here is the detailed description of the issue for your problem statement:
Issue Description:
When using the DDLParser in Python with the provided code snippet, the parser is unable to correctly identify the database name when the CREATE DATABASE statement is followed by a conditional IF NOT EXISTS clause.
Steps to Reproduce:
- Execute the following code snippet:
ddl = """
CREATE DATABASE IF NOT EXISTS `employees`;
"""
result = DDLParser(ddl).run(output_mode="mysql")
print(result)-
The output returned is an empty list:
[]. -
Execute the following code snippet:
ddl = """
CREATE DATABASE `employees`;
"""
result = DDLParser(ddl).run(output_mode="mysql")
print(result)- The output returned is
[{'database_name': 'employees'}]which correctly identifies the database name.
Expected Behavior:
The DDLParser should be able to correctly identify the database name even when the CREATE DATABASE statement is followed by a conditional IF NOT EXISTS clause.
Actual Behavior:
The parser fails to recognize the database name when the CREATE DATABASE statement includes the IF NOT EXISTS clause.
Additional Information:
The issue seems to be related to how the parser handles conditional clauses before the database name in the CREATE DATABASE statement. It would be helpful to enhance the parser to properly handle such scenarios for improved functionality.
Please let me know if you need any further information or clarification on this issue.