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

Projection implementation for MySQL support #177

Merged
merged 3 commits into from
Nov 30, 2024

Conversation

ptrdom
Copy link
Member

@ptrdom ptrdom commented Nov 18, 2024

Related to #158.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since we are breaking backwards compatibility here, can we convert from case class to class too? Similar to how R2dbcSettings is implemented.

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course this class is different from R2dbcSettings in a way that users can manually construct it - it is not constructed by config only, so will have to keep the means to set/modify its attributes.

Copy link
Member Author

Choose a reason for hiding this comment

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

@pjfanning Do you have a preferred solution for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see the TODO on the class - so I don't mind a rewrite for 1.1.0.

It would still be nice to minimise source incompatible changes - i.e. code with against 1.0.0 would ideally still be compilable with 1.1.0.

@pjfanning
Copy link
Contributor

I committed a fix for the merge conflict

MurmurHash3.finalizeHash(h, values.size)
}

private[this] def copy(
Copy link
Member Author

Choose a reason for hiding this comment

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

Technically making copy private is not a source compatible change, but IIUC it is necessary for an implementation that enables keeping backwards compatibility. @pjfanning please let me know if you want this handled differently.

@ptrdom ptrdom requested a review from pjfanning November 23, 2024 10:00
clock: Clock = Clock.systemUTC())
extends R2dbcOffsetStore(projectionId, sourceProvider, system, settings, r2dbcExecutor, clock) {

override lazy val timestampSql: String = "NOW(6)"
Copy link
Member

Choose a reason for hiding this comment

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

This seems like a dialect method, can we abstract a class 'Dialect'? like Hibernate SQL Dialects does.

Copy link
Member Author

Choose a reason for hiding this comment

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

We already have an ADT for Dialect, I guess more FP-ish way would be to add a private extension class with these methods, although these kinds of attributes are already present in core.

Copy link
Contributor

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

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

lgtm

@pjfanning pjfanning merged commit beee0d1 into apache:main Nov 30, 2024
41 checks passed
@pjfanning
Copy link
Contributor

Thanks. I merged this. We can do some tweaks in new PRs if anyone has any issues with these changes.

@pjfanning pjfanning added this to the v1.1.0 milestone Nov 30, 2024
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