Skip to content

Commit 3d026c2

Browse files
authored
Merge pull request #14 from mongodb-js/fix_get_conn_string_db_username_passowrd
fix: Update get_connection_string method
2 parents 998d8a8 + c13b808 commit 3d026c2

File tree

6 files changed

+5
-68
lines changed

6 files changed

+5
-68
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 = "0cc744d3af8b39c5db674d6d8d227c1f453536b5" }
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: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ test('smoke test', async (t) => {
4646
let getDeployment = await client.getDeployment(createDeploymentOptions.name)
4747
t.is(getDeployment.name,createDeploymentOptions.name)
4848

49-
let getConnectionStringOptions = {
50-
containerIdOrName: createDeploymentOptions.name,
51-
}
52-
let connString = await client.getConnectionString(getConnectionStringOptions)
49+
let connString = await client.getConnectionString(createDeploymentOptions.name)
5350
t.assert(connString === `mongodb://127.0.0.1:${getDeployment.portBindings.port}/?directConnection=true`)
5451

5552
// Count deployments after creation

index.d.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export declare class Client {
66
listDeployments(): Promise<Array<Deployment>>
77
deleteDeployment(deploymentName: string): Promise<void>
88
getDeployment(deploymentName: string): Promise<Deployment>
9-
getConnectionString(options: GetConnectionStringOptions): Promise<string>
9+
getConnectionString(deploymentName: string): Promise<string>
1010
getDeploymentId(clusterIdOrName: string): Promise<string>
1111
}
1212

@@ -68,12 +68,6 @@ export interface Deployment {
6868
telemetryBaseUrl?: string
6969
}
7070

71-
export interface GetConnectionStringOptions {
72-
containerIdOrName: string
73-
dbUsername?: string
74-
dbPassword?: string
75-
}
76-
7771
export interface MongoDbPortBinding {
7872
type: BindingType
7973
ip: string

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)