Skip to content
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

Add example postgres processor #113

Open
wants to merge 1 commit into
base: 03-04-postgres_crate
Choose a base branch
from

Conversation

rtso
Copy link
Collaborator

@rtso rtso commented Mar 6, 2025

Create a Postgres events processor that uses predefined Postgres implementations for getting starting version and version tracking. The user-defined parts are:

  1. The events model db migration 2025-03-06-231718_create_events
  2. EventsConfig
  3. EventsProcessor
  4. EventsStep
  5. main.rs

Testing

Screenshot 2025-03-06 at 6.36.04 PM.png

Screenshot 2025-03-06 at 6.35.59 PM.png

Screenshot 2025-03-06 at 6.35.55 PM.png

Screenshot 2025-03-06 at 6.35.42 PM.png

@rtso rtso changed the title example postgres processor Add example postgres processor Mar 6, 2025
Copy link
Collaborator Author

rtso commented Mar 6, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@rtso rtso marked this pull request as ready for review March 6, 2025 23:36
@rtso rtso mentioned this pull request Mar 6, 2025
@rtso rtso requested a review from a team as a code owner March 6, 2025 23:36
@rtso rtso force-pushed the 03-06-example_postgres_processor branch 3 times, most recently from 944ff81 to dfe9e00 Compare March 6, 2025 23:53
@rtso rtso force-pushed the 03-04-postgres_crate branch 2 times, most recently from 29a5768 to 43228c9 Compare March 10, 2025 21:26
@rtso rtso force-pushed the 03-06-example_postgres_processor branch 2 times, most recently from a3b0e55 to af1aa2d Compare March 10, 2025 21:31
@rtso rtso force-pushed the 03-04-postgres_crate branch from 43228c9 to f2b3903 Compare March 10, 2025 21:31
"libpq",
] }
anyhow = "1.0.86"
aptos-indexer-processor-sdk-server-framework = { path = "../aptos-indexer-processors-sdk/sdk-server-framework" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is this something that we can expose through sdk as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this doesn't require a lot of additional imports we can just move this into the sdk without having an additional feature.

Copy link
Contributor

@dermanyang dermanyang Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rtso did we decide to do this? if not in the vanilla crate maybe just in the postgres feature? otherwise i think its an unnecessary exposure

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we should consolidate crates. I'll follow up in another PR.

)
.await;

check_or_update_chain_id(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we mark/comment which ones are optional?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm this is an example for postgres processor

Copy link
Contributor

@dermanyang dermanyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combining crates in a follow up pr

@rtso rtso force-pushed the 03-04-postgres_crate branch from f2b3903 to e213695 Compare March 11, 2025 18:34
@rtso rtso force-pushed the 03-06-example_postgres_processor branch from af1aa2d to 8943b86 Compare March 11, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants