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

feat(database): add json data type #709

Merged
merged 2 commits into from
Nov 12, 2024
Merged

feat(database): add json data type #709

merged 2 commits into from
Nov 12, 2024

Conversation

MrYamous
Copy link
Contributor

@MrYamous MrYamous commented Nov 9, 2024

Part of #547 to add the json data type to the table statements

Latest versions of MySQL accept default value for json but this require a version check.
I didn't want to add this complexity (at least for this pr) as this was not done either for text type before

Do you think we should check if value provided as default is a valid json ? json_validate seems free to use as Tempest require 8.3+

@innocenzi innocenzi changed the title feat: add json data type (#547) feat(database): add json data type Nov 9, 2024
@brendt
Copy link
Member

brendt commented Nov 9, 2024

Do you think we should check if value provided as default is a valid json ? json_validate seems free to use as Tempest require 8.3+

Yes, that makes sense!

Latest versions of MySQL accept default value for json but this require a version check.
I didn't want to add this complexity (at least for this pr) as this was not done either for text type before

Yeah we can ignore this for now :)

We should also make sure that JSON columns are eventually mapped to array properties. But that's outside the scope of this PR.

@MrYamous
Copy link
Contributor Author

MrYamous commented Nov 9, 2024

json_validate added :)
I'm not sure about the Exception name and the new test, let me know if this is suitable

@brendt brendt merged commit d599d50 into tempestphp:main Nov 12, 2024
56 checks passed
@brendt
Copy link
Member

brendt commented Nov 12, 2024

Thanks!

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11756751614

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 31 of 31 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 82.508%

Totals Coverage Status
Change from base Build 11760861421: 0.06%
Covered Lines: 7283
Relevant Lines: 8827

💛 - Coveralls

@MrYamous MrYamous deleted the json branch November 12, 2024 18:15
brendt pushed a commit that referenced this pull request Nov 14, 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