Skip to content

Commit 01b4eb4

Browse files
docs: Add clarifying comments about SQLAlchemy URL structure mapping
- Explain that url.database maps to engine_name in Firebolt context - Explain that url.host maps to database name in Firebolt context - Address reviewer concerns about validation consistency Co-Authored-By: [email protected] <[email protected]>
1 parent d57b5e2 commit 01b4eb4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/firebolt_db/firebolt_dialect.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ def create_connect_args(self, url: URL) -> Tuple[List, Dict]:
168168
return ([], kwargs)
169169

170170
def _validate_core_connection(self, url: URL, parameters: Dict[str, str]) -> None:
171-
"""Validate that Core connection parameters are correct."""
171+
"""Validate that Core connection parameters are correct.
172+
173+
Note: In SQLAlchemy URL structure, url.database maps to engine_name
174+
and url.host maps to database name in Firebolt context.
175+
"""
172176
if url.username or url.password:
173177
raise ArgumentError(
174178
"Core connections do not support username/password authentication"
@@ -187,7 +191,12 @@ def _parse_token_cache_flag(self, parameters: Dict[str, str]) -> bool:
187191
def _build_connection_kwargs(
188192
self, url: URL, parameters: Dict[str, str], auth: Auth, is_core_connection: bool
189193
) -> Dict[str, Union[str, Auth, Dict[str, Any], None]]:
190-
"""Build connection kwargs for the SDK."""
194+
"""Build connection kwargs for the SDK.
195+
196+
SQLAlchemy URL mapping:
197+
- url.host -> database (Firebolt database name)
198+
- url.database -> engine_name (Firebolt engine name)
199+
"""
191200
kwargs: Dict[str, Union[str, Auth, Dict[str, Any], None]] = {
192201
"database": url.host or None,
193202
"auth": auth,

0 commit comments

Comments
 (0)