Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input the database name through a URI #3

Open
magiclen opened this issue Apr 28, 2021 · 4 comments
Open

Input the database name through a URI #3

magiclen opened this issue Apr 28, 2021 · 4 comments
Labels
question Further information is requested

Comments

@magiclen
Copy link

magiclen commented Apr 28, 2021

A database name can be included in a mongo URI,

mongodb://$[hostlist]/$[database]?authSource=$[authSource]

The Client struct in this crate seems to aim to operate collections within a single database. Why not just parse the database in the URI to build the Client instead of using the database method of a ClientBuilder?

@alexkornitzer
Copy link
Collaborator

Hmm I am not opposed, but does this add anything apart from hiding stuff away? We could do the same thing for auth too but IMO using the builder is cleaner. We could always update it so that you can pass a complete URL or use the builder.

What is the use case you are thinking of? Or is the issue, that with the current client design a new client is required for each database being interacted with? The library currently only addresses our use cases so I would not be surprised if it can be improved in areas.

@alexkornitzer alexkornitzer added the question Further information is requested label Apr 29, 2021
@1216892614
Copy link
Contributor

1216892614 commented Oct 17, 2022

When I use Docker to build debenv, its help, and sometimes the Witch Part I don't really care about, is the username or password

@alexkornitzer
Copy link
Collaborator

Okay so we could just extend uri here so that we parse with url and if auth, path etc are set then we set them in the builder. We can then add a with_uri to the Client. Would that be sufficient?

@1216892614
Copy link
Contributor

cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants