Skip to content

Conversation

@brandur
Copy link
Contributor

@brandur brandur commented Jul 20, 2024

Follows up #451 with a significant code quality improvement in which we
can use sqlc.embed (which TIL about) to embed a RiverJob row
directly on the returned struct, which means we can use our normal
jobRowFromInternal to map it to a driver result instead of having to
manually construct RiverJob property by property.

Tipped off to the existence of sqlc.embed by @tadejsv [1]. Thank you!

[1] #451 (comment)

Follows up #451 with a significant code quality improvement in which we
can use `sqlc.embed` (which TIL about) to embed a `RiverJob` row
directly on the returned struct, which means we can use our normal
`jobRowFromInternal` to map it to a driver result instead of having to
manually construct `RiverJob` property by property.

Tipped off to the existence of `sqlc.embed` by @tadejsv [1]. Thank you!

[1] #451 (comment)
Copy link
Contributor

@bgentry bgentry left a comment

Choose a reason for hiding this comment

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

THE WHOLE TIME 🤦🏼‍♂️ glad to learn about this too.

@brandur
Copy link
Contributor Author

brandur commented Jul 20, 2024

THE WHOLE TIME 🤦🏼‍♂️ glad to learn about this too.

Haha, I know right??

@brandur brandur merged commit 3a4a06d into master Jul 20, 2024
@brandur brandur deleted the brandur-sqlc-embed branch July 20, 2024 02:06
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.

3 participants