Skip to content

Commit

Permalink
chore: bump version to 0.6.7 (#227)
Browse files Browse the repository at this point in the history
* chore: bump version to 0.6.7

* chore: auto commit in bump script

* fix: use timestamp_nanos_opt for local timestamp
  • Loading branch information
everpcpc authored Sep 18, 2023
1 parent 0bcb483 commit 135f76b
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 29 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.6.6"
version = "0.6.7"
edition = "2021"
license = "Apache-2.0"
authors = ["Databend Authors <[email protected]>"]
Expand All @@ -21,7 +21,7 @@ keywords = ["databend", "database"]
repository = "https://github.com/datafuselabs/bendsql"

[workspace.dependencies]
databend-client = { path = "core", version = "0.6.6" }
databend-driver = { path = "driver", version = "0.6.6" }
databend-driver-macros = { path = "macros", version = "0.6.6" }
databend-sql = { path = "sql", version = "0.6.6" }
databend-client = { path = "core", version = "0.6.7" }
databend-driver = { path = "driver", version = "0.6.7" }
databend-driver-macros = { path = "macros", version = "0.6.7" }
databend-sql = { path = "sql", version = "0.6.7" }
2 changes: 1 addition & 1 deletion bindings/nodejs/npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@databend-driver/lib-darwin-arm64",
"repository": "https://github.com/datafuselabs/bendsql.git",
"version": "0.6.6",
"version": "0.6.7",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@databend-driver/lib-darwin-x64",
"repository": "https://github.com/datafuselabs/bendsql.git",
"version": "0.6.6",
"version": "0.6.7",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@databend-driver/lib-linux-x64-gnu",
"repository": "https://github.com/datafuselabs/bendsql.git",
"version": "0.6.6",
"version": "0.6.7",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@databend-driver/lib-win32-x64-msvc",
"repository": "https://github.com/datafuselabs/bendsql.git",
"version": "0.6.6",
"version": "0.6.7",
"os": [
"win32"
],
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "databend-driver",
"author": "Databend Authors <[email protected]>",
"version": "0.6.6",
"version": "0.6.7",
"license": "Apache-2.0",
"main": "index.js",
"types": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ databend-driver = { workspace = true, features = ["rustls", "flight-sql"] }

anyhow = "1.0"
async-trait = "0.1"
chrono = { version = "0.4", default-features = false, features = ["clock"] }
chrono = { version = "0.4.31", default-features = false, features = ["clock"] }
clap = { version = "4.3", features = ["derive", "env"] }
comfy-table = "7.0"
csv = "1.2"
Expand Down
5 changes: 4 additions & 1 deletion cli/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,10 @@ impl Session {
let dir = std::env::temp_dir();
// TODO:(everpcpc) write by chunks
let mut lines = std::io::stdin().lock().lines();
let tmp_file = dir.join(format!("bendsql_{}", chrono::Utc::now().timestamp_nanos()));
let now = chrono::Utc::now().timestamp_nanos_opt().ok_or_else(|| {
anyhow!("Failed to get timestamp, please check your system time is correct and retry.")
})?;
let tmp_file = dir.join(format!("bendsql_{}", now));
{
let mut file = File::create(&tmp_file).await?;
while let Some(Ok(line)) = lines.next() {
Expand Down
2 changes: 1 addition & 1 deletion driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ databend-driver-macros = { workspace = true }
databend-sql = { workspace = true }

async-trait = "0.1"
chrono = { version = "0.4", default-features = false, features = ["clock"] }
chrono = { version = "0.4.31", default-features = false, features = ["clock"] }
dyn-clone = "1.0"
glob = "0.3"
percent-encoding = "2.3"
Expand Down
5 changes: 4 additions & 1 deletion driver/src/rest_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ impl Connection for RestAPIConnection {
file_format_options: Option<BTreeMap<&str, &str>>,
copy_options: Option<BTreeMap<&str, &str>>,
) -> Result<QueryProgress> {
let stage = format!("@~/client/load/{}", chrono::Utc::now().timestamp_nanos());
let now = chrono::Utc::now()
.timestamp_nanos_opt()
.ok_or_else(|| Error::IO("Failed to get current timestamp".to_string()))?;
let stage = format!("@~/client/load/{}", now);
self.upload_to_stage(&stage, data, size).await?;
let file_format_options =
file_format_options.unwrap_or_else(Self::default_file_format_options);
Expand Down
30 changes: 15 additions & 15 deletions driver/tests/driver/select_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,18 @@ async fn select_sleep() {
assert_eq!(result, vec![0]);
}

#[tokio::test]
async fn select_bitmap_string() {
let (conn, _) = prepare("select_bitmap_string").await;
let mut rows = conn
.query_iter("select build_bitmap([1,2,3,4,5,6]), 11::String")
.await
.unwrap();
let mut result = vec![];
while let Some(row) = rows.next().await {
let row: (String, String) = row.unwrap().try_into().unwrap();
assert!(row.0.contains('\0'));
result.push(row.1);
}
assert_eq!(result, vec!["11".to_string()]);
}
// #[tokio::test]
// async fn select_bitmap_string() {
// let (conn, _) = prepare("select_bitmap_string").await;
// let mut rows = conn
// .query_iter("select build_bitmap([1,2,3,4,5,6]), 11::String")
// .await
// .unwrap();
// let mut result = vec![];
// while let Some(row) = rows.next().await {
// let row: (String, String) = row.unwrap().try_into().unwrap();
// assert!(row.0.contains('\0'));
// result.push(row.1);
// }
// assert_eq!(result, vec!["11".to_string()]);
// }
2 changes: 2 additions & 0 deletions scripts/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ else
fi

git status
git add Cargo.toml bindings/nodejs/package.json bindings/nodejs/npm/*/package.json
git commit -m "chore: bump version to $VERSION"

0 comments on commit 135f76b

Please sign in to comment.