MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / create_connect_args

Method create_connect_args

lib/sqlalchemy/engine/interfaces.py:1275–1306  ·  view source on GitHub ↗

Build DB-API compatible connection arguments. Given a :class:`.URL` object, returns a tuple consisting of a ``(*args, **kwargs)`` suitable to send directly to the dbapi's connect function. The arguments are sent to the :meth:`.Dialect.connect` method which then run

(self, url: URL)

Source from the content-addressed store, hash-verified

1273 raise NotImplementedError()
1274
1275 def create_connect_args(self, url: URL) -> ConnectArgsType:
1276 """Build DB-API compatible connection arguments.
1277
1278 Given a :class:`.URL` object, returns a tuple
1279 consisting of a ``(*args, **kwargs)`` suitable to send directly
1280 to the dbapi's connect function. The arguments are sent to the
1281 :meth:`.Dialect.connect` method which then runs the DBAPI-level
1282 ``connect()`` function.
1283
1284 The method typically makes use of the
1285 :meth:`.URL.translate_connect_args`
1286 method in order to generate a dictionary of options.
1287
1288 The default implementation is::
1289
1290 def create_connect_args(self, url):
1291 opts = url.translate_connect_args()
1292 opts.update(url.query)
1293 return ([], opts)
1294
1295 :param url: a :class:`.URL` object
1296
1297 :return: a tuple of ``(*args, **kwargs)`` which will be passed to the
1298 :meth:`.Dialect.connect` method.
1299
1300 .. seealso::
1301
1302 :meth:`.URL.translate_connect_args`
1303
1304 """
1305
1306 raise NotImplementedError()
1307
1308 @classmethod
1309 def import_dbapi(cls) -> DBAPIModule:

Calls

no outgoing calls