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

[no-release-notes] Expose JSON type and comparison functions for use by Dolt #2597

Merged
merged 4 commits into from
Aug 12, 2024

Conversation

nicktobey
Copy link
Contributor

This is the GMS side of optimized three-way JSON merge. It has the following changes:

  • Makes some test code and functions accessible from Dolt
  • Adds an interface for JSON values that can be compared to each other.
  • Outlines a method for returning the type of a JSON document as would be returned by the JSON_TYPE() function.

Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

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

Looks good.

Just one question double checking that we won't start pulling in test dependencies to the main dolt executable from the test file refactoring.

}
val, inRange, err := types.JSON.Convert(val)
require.NoError(t, err)
Copy link
Contributor

@fulghum fulghum Aug 9, 2024

Choose a reason for hiding this comment

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

Does this file need to end in _test.go for it to be only included in the test closure? Or... will this end up pulling in test dependencies, like require into the main dolt executable? I think I remember you saying the partitioning was on a package level, so this package wouldn't be pulled in if it's only used by tests, but wanted to double check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We actually need this to not be included in test closure, or else we won't be able to import it in Dolt tests.

The package level partitioning is why this is pulled into its own package: since only the test closure depends on this package, it won't get pulled into the main dolt executable.

@nicktobey nicktobey merged commit ebc2871 into main Aug 12, 2024
8 checks passed
@nicktobey nicktobey deleted the nicktobey/json-cmp branch August 12, 2024 22:12
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