-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: remove deny with sqlx #4663
chore: remove deny with sqlx #4663
Conversation
9c8021d
f2e5cda
to
9c8021d
Compare
.await | ||
.map_err(|err| Error::DB(err.to_string()))?; | ||
|
||
Ok(row_lock.get::<bool, _>(0) || row_type.get::<bool, _>(0)) | ||
Ok(row_lock.get::<i64, _>(0) == 1 || row_type.get::<i64, _>(0) == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can check and return early with Ok(row_lock.get::<i64, _>(0) == 1)
after immediately fetching row_lock
after L220
?
@@ -215,7 +215,7 @@ async fn script_exists_in_output( | |||
"#, | |||
) | |||
.bind(script_id) | |||
.fetch_one(&mut *tx) | |||
.fetch_one(tx.as_mut()) | |||
.await | |||
.map_err(|err| Error::DB(err.to_string()))?; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about move row_lock.get::<i64, _>(0) == 1
checking in this line?
@driftluo
|
What problem does this PR solve?
remove deny with sqlx
By the way, I think that SQL creates tables and indexes that can use
IF NOT EXISTS
to avoid judging whether it has been initialized. Although it is a non-standard statement, but both SQLite and Postgresql support it.ckb/util/rich-indexer/resources/create_postgres_table.sql
Line 1 in 21f49f2
ckb/util/rich-indexer/src/store.rs
Line 68 in 21f49f2
ckb/util/rich-indexer/src/store.rs
Lines 77 to 79 in 21f49f2
ckb/util/rich-indexer/src/store.rs
Lines 251 to 266 in 21f49f2
ckb/util/rich-indexer/src/store.rs
Lines 204 to 221 in 21f49f2
Check List
Tests
Release note