Skip to content

Commit 6aa0241

Browse files
committed
fix: update get_connection_string method
1 parent 31328e4 commit 6aa0241

File tree

5 files changed

+8
-58
lines changed

5 files changed

+8
-58
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ crate-type = ["cdylib"]
1010

1111
[dependencies]
1212
anyhow = "1.0.99"
13-
atlas-local = { git = "https://github.com/mongodb/atlas-local-lib.git", rev = "df190245295e6675949fb5c63a164fadc0007dab" }
13+
atlas-local = { git = "https://github.com/mongodb/atlas-local-lib.git", rev = "532d5f3c52788cb14f746e7b10edb3ce33dad89e" }
1414
bollard = "0.19.2"
1515
napi = { version = "^3.3.0", features = ["async", "anyhow"] }
1616
napi-derive = "^3.2.5"

__test__/index.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ test('smoke test', async (t) => {
4343

4444
let getConnectionStringOptions = {
4545
containerIdOrName: createDeploymentOptions.name,
46+
dbUsername: "user",
47+
dbPassword: "password"
4648
}
49+
4750
let connString = await client.getConnectionString(getConnectionStringOptions)
48-
t.assert(connString === `mongodb://127.0.0.1:${getDeployment.portBindings.port}/?directConnection=true`)
51+
console.log(connString)
52+
t.assert(connString === `mongodb://user:[email protected]:${getDeployment.portBindings.port}/?directConnection=true`)
4953

5054
// Count deployments after creation
5155
let after_create_deployment_count = (await client.listDeployments()).length

src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,10 @@ impl Client {
7171
}
7272

7373
#[napi]
74-
pub async fn get_connection_string(
75-
&self,
76-
options: crate::models::get_connection_string::GetConnectionStringOptions,
77-
) -> Result<String> {
78-
let options: atlas_local::models::GetConnectionStringOptions = options.into();
74+
pub async fn get_connection_string(&self, deployment_name: String) -> Result<String> {
7975
self
8076
.client
81-
.get_connection_string(options)
77+
.get_connection_string(deployment_name)
8278
.await
8379
.context("get connection string")
8480
}

src/models/get_connection_string.rs

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/models/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
pub mod create_deployment;
2-
pub mod get_connection_string;
32
pub mod list_deployments;

0 commit comments

Comments
 (0)