Skip to content

Commit 2367e59

Browse files
committed
Support cluster-based driver updates
1 parent b847513 commit 2367e59

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ features = {}
4646

4747
[dependencies.typedb-driver]
4848
features = []
49+
rev = "d2ce9ab4f85f8316a9087c130a20c7b1e731e8c4"
4950
git = "https://github.com/typedb/typedb-driver"
50-
tag = "3.4.4"
5151
default-features = false
5252

5353
[dependencies.futures]

dependencies/typedb/repositories.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ def typedb_dependencies():
1212
)
1313

1414
def typedb_driver():
15+
# TODO: Return typedb
1516
git_repository(
1617
name = "typedb_driver",
17-
remote = "https://github.com/typedb/typedb-driver",
18-
tag = "3.4.4", # sync-marker: do not remove this comment, this is used for sync-dependencies by @typedb_driver
18+
remote = "https://github.com/farost/typedb-driver",
19+
commit = "d2ce9ab4f85f8316a9087c130a20c7b1e731e8c4", # sync-marker: do not remove this comment, this is used for sync-dependencies by @typedb_driver
1920
)
2021

2122
def typeql():

src/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ pub mod common {
1414
pub const SECONDS_IN_HOUR: u64 = SECONDS_IN_MINUTE * MINUTES_IN_HOUR;
1515
}
1616

17-
pub const DEFAULT_TRANSACTION_TIMEOUT: Duration = Duration::from_secs(1 * SECONDS_IN_HOUR);
17+
pub const DEFAULT_TRANSACTION_TIMEOUT: Duration = Duration::from_secs(10);

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use clap::Parser;
2222
use home::home_dir;
2323
use rustyline::error::ReadlineError;
2424
use sentry::ClientOptions;
25-
use typedb_driver::{Credentials, DriverOptions, Transaction, TransactionType, TypeDBDriver};
25+
use typedb_driver::{Addresses, Credentials, DriverOptions, Transaction, TransactionType, TypeDBDriver};
2626

2727
use crate::{
2828
cli::{Args, ADDRESS_VALUE_NAME, USERNAME_VALUE_NAME},
@@ -165,9 +165,9 @@ fn main() {
165165

166166
let runtime = BackgroundRuntime::new();
167167
let driver = match runtime.run(TypeDBDriver::new(
168-
address,
168+
Addresses::try_from_address_str(&address).unwrap(),
169169
Credentials::new(&username, args.password.as_ref().unwrap()),
170-
DriverOptions::new(!args.tls_disabled, tls_root_ca_path).unwrap(),
170+
DriverOptions::new().tls_enabled(!args.tls_disabled).tls_root_ca(tls_root_ca_path).unwrap(),
171171
)) {
172172
Ok(driver) => Arc::new(driver),
173173
Err(err) => {

src/operations.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub(crate) fn user_list(context: &mut ConsoleContext, _input: &[String]) -> Comm
117117
println!("No users are present.");
118118
} else {
119119
for user in users {
120-
println!("{}", user.name);
120+
println!("{}", user.name());
121121
}
122122
}
123123
Ok(())
@@ -169,13 +169,13 @@ pub(crate) fn user_update_password(context: &mut ConsoleContext, input: &[String
169169
};
170170
let current_user = driver
171171
.users()
172-
.get_current_user()
172+
.get_current()
173173
.await
174174
.map_err(|err| Box::new(err) as Box<dyn Error + Send>)?
175175
.expect("Could not fetch currently logged in user.");
176176

177177
user.update_password(new_password).await.map_err(|err| Box::new(err) as Box<dyn Error + Send>)?;
178-
Ok(current_user.name == username)
178+
Ok(current_user.name() == username)
179179
})?;
180180
if updated_current_user {
181181
println!("Successfully updated current user's password, exiting console. Please log in with the updated credentials.");

0 commit comments

Comments
 (0)