MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / create_connect_args

Method create_connect_args

lib/sqlalchemy/engine/interfaces.py:1242–1273  ·  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

1240 raise NotImplementedError()
1241
1242 def create_connect_args(self, url: URL) -> ConnectArgsType:
1243 """Build DB-API compatible connection arguments.
1244
1245 Given a :class:`.URL` object, returns a tuple
1246 consisting of a ``(*args, **kwargs)`` suitable to send directly
1247 to the dbapi's connect function. The arguments are sent to the
1248 :meth:`.Dialect.connect` method which then runs the DBAPI-level
1249 ``connect()`` function.
1250
1251 The method typically makes use of the
1252 :meth:`.URL.translate_connect_args`
1253 method in order to generate a dictionary of options.
1254
1255 The default implementation is::
1256
1257 def create_connect_args(self, url):
1258 opts = url.translate_connect_args()
1259 opts.update(url.query)
1260 return ([], opts)
1261
1262 :param url: a :class:`.URL` object
1263
1264 :return: a tuple of ``(*args, **kwargs)`` which will be passed to the
1265 :meth:`.Dialect.connect` method.
1266
1267 .. seealso::
1268
1269 :meth:`.URL.translate_connect_args`
1270
1271 """
1272
1273 raise NotImplementedError()
1274
1275 @classmethod
1276 def import_dbapi(cls) -> DBAPIModule:

Calls

no outgoing calls