libAtoms / abcd

2 stars 4 forks source link

support for mongodb+srv:// URIs #114

Open stenczelt opened 5 months ago

stenczelt commented 5 months ago

Logging in to a MongoDB cluster with mongodb+srv:// is not possible, the URI is not recognised.

Traceback (most recent call last):
  File "/root/venv/bin/abcd", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/root/venv/lib/python3.11/site-packages/abcd/frontends/commandline/parser.py", line 121, in main
    callback_func(**kwargs)
  File "/root/venv/lib/python3.11/site-packages/abcd/frontends/commandline/decorators.py", line 15, in wrapper
    func(*args, config=config, **kwargs)
  File "/root/venv/lib/python3.11/site-packages/abcd/frontends/commandline/commands.py", line 17, in login
    db = ABCD.from_url(url=url)
         ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/venv/lib/python3.11/site-packages/abcd/__init__.py", line 47, in from_url
    raise NotImplementedError('Unable to recognise the type of connection. (url: {})'.format(url))
NotImplementedError: Unable to recognise the type of connection. (url: mongodb+srv://***)

Expected behaviour

Operate the same way as with mongodb:// and use uri-mode for the connection, i.e. not saving the credentials individually but simply use the URI.

ElliottKasoar commented 6 days ago

@stenczelt, I can't close this, but it should have been resolved by #115.