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

[DAT-101] Clean up premint topics and declare them via config #6

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

erikreppel
Copy link
Contributor

Derive premint types the user wants to listen to from envar config.

PREMINT_TYPES=<comma separated list of premint types>

Each Premint type returns a commonly formatted topic for actions required

@@ -59,7 +59,7 @@ impl PremintStorage {
VALUES (?, ?, ?, ?, ?, ?, ?)
"#,
metadata.id,
metadata.kind,
metadata.kind.0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I'm understanding this syntax correctly it would pull the first field from the PremintName struct/tuple. If other fields were added before it, that would break this one, right? Not sure what the convention is here, but in python we could use a NamedTuple here to make the intention clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PremintName is a wrapper on the type String, in this case kind.0 just pulls the inner value of string since the outer type PremintName doesn't implement sqlx's traits required for storage via macro

@erikreppel erikreppel merged commit 9aee185 into main Mar 26, 2024
2 checks passed
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.

2 participants