-
Notifications
You must be signed in to change notification settings - Fork 5
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
Refactor events and DB #7
Refactor events and DB #7
Conversation
Signed-off-by: avichalp <[email protected]>
Signed-off-by: avichalp <[email protected]>
Signed-off-by: avichalp <[email protected]>
Signed-off-by: avichalp <[email protected]>
@@ -0,0 +1,26 @@ | |||
{ |
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.
sorry i'm not familiar with sqlx, but what are these json files and are they ok to be committed?
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.
sqlx uses these JSON files for compile time SQL checks without needing an active database connection. For instance, if you change a SQL query that is being used, but your new query has a wrong column name it will be caught at the compile time.
To include a new .sqlx
file for a new query, you would run sqlx prepare
(I have included a command in Makefile for this.)
I think it would be helpful if we commit these files. Otherwise, if you want this kind of check at dev time, you must generate these files every time.
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.
here is a nice explanation of what this is doing from the readme
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.
awesome, ty!
@@ -0,0 +1,9 @@ | |||
db_path = "sqlite:./farcaster.db" |
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.
🔥 - thank you for setting this up
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.
(i meant the config file)
} | ||
|
||
impl IdRegistry { | ||
impl<T: JsonRpcClient + Clone> Contract<T> { |
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.
ah, we're getting there 😆
This PR achieves the following:
.sql
files and use prepared queries.config.toml
getLogs
endpoint to fetch new events (todo: move to websocket connection in future).