Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

refactor(DB): replace rbatis with sqlx #424

Merged
merged 90 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
6343acd
remove unused code.
EthanYuan May 30, 2022
591c82e
add sqlx crate.
EthanYuan May 30, 2022
661503f
add db-sqlx crate.
EthanYuan Jun 2, 2022
1215722
add mod PgSqlx.
EthanYuan Jun 4, 2022
7cfab8a
impl query_block_x by sqlx.
EthanYuan Jun 5, 2022
09f6117
clean unused dep.
EthanYuan Jun 6, 2022
462d74b
use sqlx::Any for both pg and sqlite(test).
EthanYuan Jun 6, 2022
baacaa0
add fetch_count for SQLXPool.
EthanYuan Jun 6, 2022
1814970
refactoring db-sqlx.
EthanYuan Jun 6, 2022
5c72c58
refacotring.
EthanYuan Jun 6, 2022
d871d69
use QueryAs as sql builder.
EthanYuan Jun 7, 2022
119602c
refactoring.
EthanYuan Jun 7, 2022
2ad47b5
update dep crate path
EthanYuan Jun 8, 2022
c3696bb
refactoring: remove the concrete type mapped to a table.
EthanYuan Jun 20, 2022
bb39e42
refactoring: query_tip
EthanYuan Jun 20, 2022
bc59ee4
add unit tests.
EthanYuan Jun 21, 2022
4d6baf2
refactoring.
EthanYuan Jun 21, 2022
83522b8
impl get_transactions_with_status by input AnyRow.
EthanYuan Jun 22, 2022
af4d2df
impl query_simple_transaction by sqlx.
EthanYuan Jun 22, 2022
82f1534
impl query_spent_tx_hash by sqlx.
EthanYuan Jun 22, 2022
b9f31c0
add fetch_optional for SQLXPool.
EthanYuan Jun 23, 2022
5c5af63
impl fetch::query_transactions by sqlx.
EthanYuan Jun 23, 2022
ce9ad30
Limit the value range of `limit` from u64 to u16.
EthanYuan Jun 24, 2022
720427c
rm unused code.
EthanYuan Jun 27, 2022
f35a7b3
use fetch instead of fetch_all
EthanYuan Jun 27, 2022
6c7cfcb
use sql-builder to build sql string.
EthanYuan Jun 27, 2022
7a14691
refactoring pagination.
EthanYuan Jun 28, 2022
d07a517
impl query_scripts by sqlx.
EthanYuan Jun 29, 2022
9c0b541
impl query_cell_by_out_point by sqlx.
EthanYuan Jun 30, 2022
4afc42d
impl query_live_cell_by_out_point by sqlx.
EthanYuan Jul 4, 2022
1da5883
impl query_txs_input_cells and query_txs_output_cells by sqlx.
EthanYuan Jul 4, 2022
21d1010
update unit test storage::get_cell_test.
EthanYuan Jul 4, 2022
28d95ce
refactoring.
EthanYuan Jul 4, 2022
4b4d0f2
impl query_canonical_block_hash by sqlx.
EthanYuan Jul 4, 2022
d4b69a1
impl query_registered_address by sqlx.
EthanYuan Jul 4, 2022
e6f841e
refactoring.
EthanYuan Jul 5, 2022
393366f
impl query_cells by sqlx.
EthanYuan Jul 5, 2022
40e41e4
impl query_historical_live_cells by sqlx.
EthanYuan Jul 5, 2022
ef1230d
impl query_live_cells by sqlx.
EthanYuan Jul 6, 2022
27a7b3a
impl query_indexer_transactions sqlx.
EthanYuan Jul 6, 2022
2c91af2
impl indexer_synced_count and get_tip_number by sqlx.
EthanYuan Jul 6, 2022
3a1e2c4
impl get_transactions_by_scripts by sqlx.
EthanYuan Jul 6, 2022
514a263
impl get_scripts_by_partial_arg by sqlx.
EthanYuan Jul 7, 2022
d7b6512
refactoring.
EthanYuan Jul 7, 2022
f7dd6ef
fix unit tests: test_get_cells_out_point and test_get_historical_live…
EthanYuan Jul 11, 2022
33b9067
fix clippy warning.
EthanYuan Jul 11, 2022
e8e8733
remove unused code.
EthanYuan Jul 12, 2022
c59f073
Update limit field in RPC type PaginationRequest to Uint16 type.
EthanYuan Jul 12, 2022
f063b19
fix calculation of count: pagination should be ignored.
EthanYuan Jul 12, 2022
c609c45
Fix pagination skipping
EthanYuan Jul 12, 2022
10647aa
Refactor code according to code review recommendations.
EthanYuan Jul 13, 2022
d9e1fdb
impl insert_block_table and insert_transaction_table.
EthanYuan Jul 15, 2022
3cd2a84
refactoring code.
EthanYuan Jul 17, 2022
73cea2b
impl bulk_insert_output_cells.
EthanYuan Jul 19, 2022
fad9f9b
impl insert script table by sqlx.
EthanYuan Jul 19, 2022
46e6fc4
impl update mercury_live_cell and update_consumed_cells by sqlx.
EthanYuan Jul 20, 2022
83469f9
impl bulk_insert_indexer_cells by sqlx.
EthanYuan Jul 20, 2022
bb4211b
impl register_addresses by sqlx.
EthanYuan Jul 20, 2022
784ea4e
clean up code
EthanYuan Jul 21, 2022
149043e
impl rollback_block by sqlx.
EthanYuan Jul 21, 2022
8a96b41
remove rbatis dep in storage.
EthanYuan Jul 21, 2022
6eb2590
clean up duplicate code in rpc core crate.
EthanYuan Jul 22, 2022
9443433
replace rabtis with sqlx in xsql-test crate.
EthanYuan Jul 22, 2022
dbdd995
add sqlx log level setting.
EthanYuan Jul 22, 2022
43344dd
impl create_consume_info_table by sqlx.
EthanYuan Jul 25, 2022
5630822
add unit test test_sync.
EthanYuan Jul 25, 2022
90c5b38
add block_view build test.
EthanYuan Jul 26, 2022
9b9242a
impl by sqlx in sql mod in synchronization crate.
EthanYuan Jul 26, 2022
74d5e5c
update insert_block to bulk_insert_blocks.
EthanYuan Jul 27, 2022
81659f7
add insert_live_cells para in bulk_insert_output_cells in storage.
EthanYuan Jul 27, 2022
96865bb
impl sync_blocks by sqlx in Task mod.
EthanYuan Jul 27, 2022
11cfdda
impl set_state_cursor in sync task mod by sqlx.
EthanYuan Jul 28, 2022
53555e6
impl sync_indexer_cells in sync task mod by sqlx.
EthanYuan Jul 28, 2022
40c5895
rm rbatis deps.
EthanYuan Jul 28, 2022
cb49658
fix sql query error.
EthanYuan Jul 28, 2022
9cfea29
add indexer cells table check in unit test.
EthanYuan Jul 28, 2022
b09b31c
rm tracing crate: resolve compilation conflicts with sqlx v0.6.0.
EthanYuan Jul 28, 2022
be5fbf3
try impl H256 decode for sqlx.
EthanYuan Jul 29, 2022
c2daae7
Modifications based on review suggestions.
EthanYuan Aug 1, 2022
be0dca0
Modification as suggested by review: remove explicit type annotations
EthanYuan Aug 1, 2022
55fa8db
fix rollback_consume_cell sql.
EthanYuan Aug 2, 2022
e9bc69a
refactoring code in storage::relational::remove;
EthanYuan Aug 2, 2022
c77b5aa
remove unused code.
EthanYuan Aug 2, 2022
2a34a88
fix bulk insert binding when the batch rows number
EthanYuan Aug 10, 2022
0e26605
update sqlx to 0.6.1
EthanYuan Aug 10, 2022
12fc746
update db_log_level in config to override sqlx log level.
EthanYuan Aug 10, 2022
ef199a6
fix fmt.
EthanYuan Aug 10, 2022
2195910
fix: Postgres doesn't support multiple commands in one prepared state…
EthanYuan Aug 11, 2022
f90ce85
remove the config filed db_log_level and overide sqlx log level to TR…
EthanYuan Aug 11, 2022
63ce242
fix bind type mismatched.
EthanYuan Aug 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,335 changes: 294 additions & 1,041 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ edition = "2021"
[dependencies]
core-cli = { path = "core/cli" }
log = "0.4"
tokio = { version = "1.14", features = ["macros", "rt-multi-thread"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

[dev-dependencies]
criterion = { version = "0.3", features = ["async_tokio", "cargo_bench_support"] }
rand = "0.8"

[workspace]
members = [
"apm/tracing",
"apm/tracing-derive",

"common",
"logger",
"protocol",
Expand All @@ -27,13 +24,12 @@ members = [
"core/ckb-client",
"core/rpc/core",
"core/rpc/types",
"core/rpc/utility",
"core/service",
"core/storage",
"core/synchronization",

"db/xsql",
"db/xsql-test",
"db/db-sqlx",
"db/xsql-test"
]

[profile.release]
Expand Down
17 changes: 0 additions & 17 deletions apm/tracing-derive/Cargo.toml

This file was deleted.

137 changes: 0 additions & 137 deletions apm/tracing-derive/src/attr_parse.rs

This file was deleted.

121 changes: 0 additions & 121 deletions apm/tracing-derive/src/lib.rs

This file was deleted.

15 changes: 0 additions & 15 deletions apm/tracing/Cargo.toml

This file was deleted.

Loading