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

[Improvement]: MongoDB database selected on local run #1792

Open
1 task done
tibs245 opened this issue Jun 3, 2024 · 2 comments
Open
1 task done

[Improvement]: MongoDB database selected on local run #1792

tibs245 opened this issue Jun 3, 2024 · 2 comments
Labels
S-Triage Awaiting decision for what to do T-Improvement Improvement or addition to existing features

Comments

@tibs245
Copy link

tibs245 commented Jun 3, 2024

Describe the improvement

Hello,

I test mongodb shared databases and if I understand correctly we have an error.

The databases selected on local-run is alway "admin". Or admin is a reserved databases for mongodb.

mongodb://mongodb:password@localhost:16352/admin

I see on the code :

provisioner/tests/helpers.rs

/// Execute commands in `mongosh` via `docker exec` against the provided `database_name`
/// or against the `admin` database by default
pub fn exec_mongosh(command: &str, database_name: Option<&str>) -> String {
    let output = Command::new("docker")
        .args([
            "exec",
            MONGODB_CONTAINER_NAME,
            "mongosh",
            "--quiet",
            "--username",
            "mongodb",
            "--password",
            "password",
            "--authenticationDatabase",
            "admin",
            database_name.unwrap_or("admin"),
            "--eval",
            command,
        ])
        .output()
        .unwrap()
        .stdout;

    String::from_utf8(output).unwrap().trim().to_string()
}

I suppose it's for local run.

And for shuttle side :

provisioner/src/lib.rs

            shared::Engine::Mongodb(_) => {
                let database_name = format!("mongodb-{project_name}");

If it's possible to confirm to me it's not the behaviour we want.

And say to me what is the fix you want :

  • Create mongodb-{project_name} database for be exactly like the production mode

    • We can create specific user with right ?
    • I don't known if we need test (and behaviour) when we run two shuttle instance with mongodb shared db
  • Or only create a static database shuttle-local to have empty database not use by mongodb system ?

I am interested to do the PR. I am not very experimented on Rust but I can do it with help (I am on shuttle discord) 😉

Thank you

Duplicate declaration

  • I have searched the issues and this improvement has not been requested before.
@tibs245 tibs245 added S-Triage Awaiting decision for what to do T-Improvement Improvement or addition to existing features labels Jun 3, 2024
@joshua-mo-143
Copy link
Member

Hi! We're currently in the process of actually deprecating our MongoDB addon. We're planning to add some replacements in lieu of it and will release an update when we are able to do so.

@Aditya-PS-05
Copy link
Contributor

@joshua-mo-143 , Please assign me this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Triage Awaiting decision for what to do T-Improvement Improvement or addition to existing features
Projects
None yet
Development

No branches or pull requests

3 participants