If a database already existed and we try to execute "CREATE DATABASE IF NOT EXISTS DB2" then it currently fails with error:
snowflake.connector.errors.ProgrammingError: 002043 (02000): Binder Error: Unique file handle conflict: Database "DB2" is already attached with path "...fakesnow-testl1jfag6s/DB2.db"
This commit adds support for this functionality by converting the statement to the duckdb syntax of ATTACH IF NOT EXISTS when the exists clause is present.
Up to you if you want to keep the test in test_fakes.py or only use the one in test_transforms.py
If a database already existed and we try to execute "CREATE DATABASE IF NOT EXISTS DB2" then it currently fails with error:
This commit adds support for this functionality by converting the statement to the duckdb syntax of ATTACH IF NOT EXISTS when the exists clause is present.
Up to you if you want to keep the test in
test_fakes.py
or only use the one intest_transforms.py