From d4b6b25e086e4ece6560b9538d68c88f1b3805eb Mon Sep 17 00:00:00 2001 From: Kalai <70625103+kalai-logicsoft@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:16:31 +0530 Subject: [PATCH] docs: clarify URL encoding requirement for connection strings Adding extra information for the better understanding of connection string which is used for the backend of Superset. Based on this [Issue](https://github.com/apache/superset/issues/29979) People are finding difficulties in understanding the connection string, The `SQLAlchemy` documentation clearly talks about this URL encoded connection string, but users of superset not required to read / understand the concept of `SQLAlchemy` so adding this extra information may help them. --- docs/docs/configuration/databases.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/docs/configuration/databases.mdx b/docs/docs/configuration/databases.mdx index 8bae5491b1662..875f8501ac28c 100644 --- a/docs/docs/configuration/databases.mdx +++ b/docs/docs/configuration/databases.mdx @@ -1287,6 +1287,13 @@ The connection string for SQL Server looks like this: mssql+pyodbc:///?odbc_connect=Driver%3D%7BODBC+Driver+17+for+SQL+Server%7D%3BServer%3Dtcp%3A%3Cmy_server%3E%2C1433%3BDatabase%3Dmy_database%3BUid%3Dmy_user_name%3BPwd%3Dmy_password%3BEncrypt%3Dyes%3BConnection+Timeout%3D30 ``` +:::note +You'all might have noticed that some special form of charecters are used in above connection string. For example see the `odbc_connect` parameter, the value is `Driver%3D%7BODBC+Driver+17+for+SQL+Server%7D%3B` which is URL encoded form of `Driver={ODBC+Driver+17+for+SQL+Server};`. It's important to give the connection string as URL encoded format. + +For more information about this check the [sqlalchemy documentation](https://docs.sqlalchemy.org/en/20/core/engines.html#escaping-special-characters-such-as-signs-in-passwords). Which says `When constructing a fully formed URL string to pass to create_engine(), special characters such as those that may be used in the user and password need to be URL encoded to be parsed correctly.. This includes the @ sign.` +::: + + #### StarRocks The [sqlalchemy-starrocks](https://pypi.org/project/starrocks/) library is the recommended