dosubot[bot] commented on issue #33217:
URL: https://github.com/apache/superset/issues/33217#issuecomment-2822869688

   <!-- Answer -->
   The logic for handling database connections in Superset, specifically for 
Apache Doris, involves checking the uniqueness of the database name during the 
connection setup process. When you specify a catalog and database in the 
SQLAlchemy URI, Superset attempts to create a new database entry in its 
metadata if it doesn't already exist. This is why you're encountering the 
"database already exists" error when specifying an existing database.
   
   The `CreateDatabaseCommand` class in Superset checks for the uniqueness of 
the database name to differentiate between creating a new database and 
connecting to an existing one. If the name is not unique, it raises a 
`DatabaseExistsValidationError`, indicating that the database already exists 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset/commands/database/create.py)</sup>.
   
   To connect to an existing database without triggering the creation logic, 
ensure that the database name you provide in Superset's connection setup 
matches exactly with the existing database's name in Superset's metadata. If 
the database already exists in Superset, it should not attempt to create a new 
one.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   
   ---
   <sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/9c1c4fa0-a768-48ef-8304-1d46b3eba547?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/9c1c4fa0-a768-48ef-8304-1d46b3eba547?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/9c1c4fa0-a768-48ef-8304-1d46b3eba547?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/9c1c4fa0-a768-48ef-8304-1d46b3eba547?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/9c1c4fa0-a768-48ef-8304-1d46b3eba547?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/9c1c4fa0-a768-48ef-8304-1d46b3eba547?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/9c1c4fa0-a768-48ef-8304-1d46b3eba547?feedback_type=other)</sup>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to