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 Support for Check Constraint - Frontend code changes #949

Conversation

taherkl
Copy link
Contributor

@taherkl taherkl commented Dec 2, 2024

  • Users can view details of check constraints in the Check Constraint tab.
  • Users will be able to add, delete, and edit check constraints.
  • Deletion of a column is restricted if it is used in a check constraint.
  • Validation is performed to prevent adding duplicate expressions or constraint names in check constraints.
  • Check constraints have been incorporated into the Spanner query.
  • All other validations utilize the expression API.

  • Tests pass
  • Appropriate changes to README are included in PR

Copy link

google-cla bot commented Dec 2, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@akashthawaitcc akashthawaitcc force-pushed the support-check-constraint-frontend branch from 93872ca to 9fd86eb Compare December 26, 2024 19:47
@VivekY1098 VivekY1098 force-pushed the support-check-constraint-frontend branch 2 times, most recently from 9ae7e36 to 099e79c Compare December 27, 2024 11:08
@akashthawaitcc akashthawaitcc force-pushed the support-check-constraint-frontend branch from 099e79c to e38a37d Compare December 28, 2024 11:45
@taherkl taherkl marked this pull request as ready for review December 30, 2024 04:27
@taherkl taherkl requested a review from a team as a code owner December 30, 2024 04:27
@taherkl taherkl requested review from asthamohta and bharadwaj-aditya and removed request for a team December 30, 2024 04:27
@taherkl taherkl force-pushed the support-check-constraint-frontend branch 2 times, most recently from 9028e0f to 635dfbb Compare December 30, 2024 06:25
Backend Support for Check Constraint

renamed function name to formatCheckConstraints and added check if constraint name is empty

fixed PR comments

fix: added regular exprression to match the exact column

Added test case for the column rename for check constraint

reverted white spaces

reverted white spaces

nit: doesCheckConstraintNameExist

moved regex globally

modify the query to fetch the check constraint

added the verification api integration and struct changes

added partial unit test of verify check constraint expression

refactored expression verfication api mock

Test added for verification api
* Check constraint backend (#9)

Backend Support for Check Constraint

* update api

* fix PR comment

* remove api call to while validating constraints

* Fixed db collation regex to remove collation name from the results

* renamed function name to formatCheckConstraints and added check if constraint name is empty

* fixed PR comments

* added test case for the empty check constraint name

* fix: added regular exprression to match the exact column

* fix: added regular expression to replace table name

* Added test case for the column rename for check constraint

* 1. Refactored GetConstraint function
2. Fixed inforschema unit tests

* added comment at handling case for check constraints

* reverted white spaces

* reverted white spaces

* nit: doesCheckConstraintNameExist

* added comments for doesCheckConstraintNameExist

* PR and UT fixes

* fix UT

* UT fix

* Removed isCheckConstraintsTablePresent function

* moved regex globally

* Fix UT

* fixed UT

* fixed handling of the constraints

* removed unused function

* added unit tests for incompatable name

* Combined unit tests

* added test case for the renaming column having substring of other column

* added the query changes which return distinct value

---------

Co-authored-by: taherkl <[email protected]>
Co-authored-by: Akash Thawait <[email protected]>
Co-authored-by: Vivek Yadav <[email protected]>

Fixed unit test and code refactor

removed node dependencies

added dump flow
* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <[email protected]>
Co-authored-by: taherkl <[email protected]>

address the comment

address the comment
1.Modify the checkIfCcColumn to handle pk and check constraint

fixed regular expression for check constraints name

remove the node-sql-parser package

resolve the duplicate issue
Backend Support for Check Constraint

renamed function name to formatCheckConstraints and added check if constraint name is empty

fixed PR comments

added test case for the empty check constraint name

fix: added regular exprression to match the exact column

fix: added regular expression to replace table name

Added test case for the column rename for check constraint

added comment at handling case for check constraints

reverted white spaces

reverted white spaces

moved regex globally

modify the query to fetch the check constraint

added the verification api integration and struct changes

added partial unit test of verify check constraint expression

refactored expression verfication api mock

Test added for verification api
* Check constraint backend (#9)

Backend Support for Check Constraint

* update api

* fix PR comment

* remove api call to while validating constraints

* Fixed db collation regex to remove collation name from the results

* renamed function name to formatCheckConstraints and added check if constraint name is empty

* fixed PR comments

* added test case for the empty check constraint name

* fix: added regular exprression to match the exact column

* fix: added regular expression to replace table name

* Added test case for the column rename for check constraint

* 1. Refactored GetConstraint function
2. Fixed inforschema unit tests

* added comment at handling case for check constraints

* reverted white spaces

* reverted white spaces

* nit: doesCheckConstraintNameExist

* added comments for doesCheckConstraintNameExist

* PR and UT fixes

* fix UT

* UT fix

* Removed isCheckConstraintsTablePresent function

* moved regex globally

* Fix UT

* fixed UT

* fixed handling of the constraints

* removed unused function

* added unit tests for incompatable name

* Combined unit tests

* added test case for the renaming column having substring of other column

* added the query changes which return distinct value

---------

Co-authored-by: taherkl <[email protected]>
Co-authored-by: Akash Thawait <[email protected]>
Co-authored-by: Vivek Yadav <[email protected]>

fixed unit tests

front-end ut fixed

remove unwanted code

removed node sql parser import

removed node dependencies

rename handler

added the generation of constraint name

added dump flow

Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <[email protected]>
Co-authored-by: taherkl <[email protected]>

address the comment

address the comment
1.Modify the checkIfCcColumn to handle pk and check constraint
@taherkl taherkl force-pushed the support-check-constraint-frontend branch from 635dfbb to 1157b86 Compare December 30, 2024 06:29
@taherkl
Copy link
Contributor Author

taherkl commented Dec 30, 2024

Closing this PR as opened two seperate PRs

@taherkl taherkl closed this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants