csdb
wrap for ceresdb-client-rs
use example :
use ;
use lazy_static;
lazy_static!
async
output:
Compiling csdb v0.1.4 (/Users/z/wac.tax/rsrv/csdb)
Finished test [unoptimized + debuginfo] target(s) in 0.58s
Running tests/test.rs (/Users/z/wac.tax/rsrv/target/debug/deps/test-de4776b8ba9c98fe)
running 1 test
INFO csdb: 12ms DROP TABLE test
INFO csdb: 3ms CREATE TABLE test (
ts TIMESTAMP NOT NULL,
uid uint64 NOT NULL,
tag string NOT NULL,
TIMESTAMP KEY(ts),
PRIMARY KEY(uid, ts)
) ENGINE=Analytic WITH (
compression='ZSTD',
enable_ttl='false'
)
INFO csdb: 2ms INSERT INTO test (ts,uid,tag) VALUES (1,2,'test')
INFO csdb: 1ms INSERT INTO test (ts,uid,tag) VALUES (2,2,'\'"\r\n')
INFO csdb: 3ms SELECT * FROM test
[csdb/tests/test.rs:38] i = Row {
columns: [
Column {
name: "uid",
value: UInt64(
2,
),
},
Column {
name: "ts",
value: Timestamp(
1,
),
},
Column {
name: "tag",
value: String(
"test",
),
},
],
}
[csdb/tests/test.rs:38] i = Row {
columns: [
Column {
name: "uid",
value: UInt64(
2,
),
},
Column {
name: "ts",
value: Timestamp(
2,
),
},
Column {
name: "tag",
value: String(
"'\"\r\n",
),
},
],
}
test main ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
in this output
INFO csdb: 4ms INSERT INTO test (ts,uid,tag) VALUES (1,2,'test')
means cost 4ms for this query