MCPcopy
hub / github.com/tortoise/tortoise-orm / _create_connection

Method _create_connection

tortoise/connection.py:145–153  ·  view source on GitHub ↗
(self, conn_alias: str)

Source from the content-addressed store, hash-verified

143 await connection.db_create()
144
145 def _create_connection(self, conn_alias: str) -> BaseDBAsyncClient:
146 db_info = self._get_db_info(conn_alias)
147 if isinstance(db_info, str):
148 db_info = expand_db_url(db_info)
149 client_class = self._discover_client_class(db_info)
150 db_params = db_info["credentials"].copy()
151 db_params.update({"connection_name": conn_alias})
152 connection: BaseDBAsyncClient = client_class(**db_params)
153 return connection
154
155 def get(self, conn_alias: str) -> BaseDBAsyncClient:
156 """

Callers 3

getMethod · 0.95

Calls 4

_get_db_infoMethod · 0.95
expand_db_urlFunction · 0.90
updateMethod · 0.80