Skip to content

Commit 4812165

Browse files
authored
feat: upgrade protos and use batch insert api (#1)
1 parent 2b5d575 commit 4812165

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dashmap = "5.4"
1212
enum_dispatch = "0.3"
1313
futures = "0.3"
1414
futures-util = "0.3"
15-
greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", rev = "e8abf8241c908448dce595399e89c89a40d048bd" }
15+
greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git", tag = "0.2.1" }
1616
parking_lot = "0.12"
1717
prost = "0.11"
1818
rand = "0.8"

src/database.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::api::v1::auth_header::AuthScheme;
1616
use crate::api::v1::greptime_request::Request;
1717
use crate::api::v1::{
1818
greptime_response, AffectedRows, AuthHeader, DeleteRequest, GreptimeRequest, InsertRequest,
19-
RequestHeader,
19+
InsertRequests, RequestHeader,
2020
};
2121

2222
use snafu::OptionExt;
@@ -64,8 +64,9 @@ impl Database {
6464
});
6565
}
6666

67-
pub async fn insert(&self, request: InsertRequest) -> Result<u32> {
68-
self.handle(Request::Insert(request)).await
67+
pub async fn insert(&self, requests: Vec<InsertRequest>) -> Result<u32> {
68+
self.handle(Request::Inserts(InsertRequests { inserts: requests }))
69+
.await
6970
}
7071

7172
pub async fn delete(&self, request: DeleteRequest) -> Result<u32> {

0 commit comments

Comments
 (0)