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 diesel conversions for "single column types" #11

Closed
wants to merge 7 commits into from
Closed

Conversation

smklein
Copy link
Contributor

@smklein smklein commented Aug 26, 2021

The conversions for multi-column types will remain in Omicron, but for single-column types, we define their conversion functions within steno to avoid orphan rule problems.

Tightly coupled with: oxidecomputer/omicron#192

@davepacheco
Copy link
Collaborator

If I recall, Steno today doesn't know anything about how the consumer wants to persist state. It just has a notion of what state needs to be persisted when. That felt like a useful decoupling. It seems like this PR adds a bunch of Diesel-specific, SQL-specific knowledge. Do you think that decoupling doesn't make sense or is there not really a great way to do that with Diesel?

@smklein
Copy link
Contributor Author

smklein commented Aug 30, 2021

If I recall, Steno today doesn't know anything about how the consumer wants to persist state. It just has a notion of what state needs to be persisted when. That felt like a useful decoupling. It seems like this PR adds a bunch of Diesel-specific, SQL-specific knowledge. Do you think that decoupling doesn't make sense or is there not really a great way to do that with Diesel?

Ack. I can make that work - as mentioned in the commit message, we are implementing diesel traits for steno types. Omicron cannot do this, as the trait + structure are both foreign types.

I can accomplish this in Omicron only by using the newtype pattern - though maybe this isn't a big deal for single column types anyway.

@smklein smklein closed this Aug 30, 2021
@smklein smklein deleted the diesel branch August 30, 2021 19:28
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