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: APIs for Backend Changes for Default Values #965

Merged
merged 5 commits into from
Dec 20, 2024

Conversation

asthamohta
Copy link
Collaborator

The following PR contains APIs which will be used for Default Value migrations. For completeness on usage of these API, refer to the following PR: #952

@asthamohta asthamohta marked this pull request as ready for review December 17, 2024 16:37
@asthamohta asthamohta requested a review from a team as a code owner December 17, 2024 16:37
@asthamohta asthamohta requested review from darshan-sj and Deep1998 and removed request for a team December 17, 2024 16:37
@asthamohta asthamohta changed the title feat: APIs for Backend Changes feat: APIs for Backend Changes for Default Values Dec 17, 2024
Copy link
Collaborator

@darshan-sj darshan-sj left a comment

Choose a reason for hiding this comment

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

Left few comments.
Good work covering most of the methods with Unit tests!

conversion/conversion_from_source.go Show resolved Hide resolved
sources/common/toddl.go Show resolved Hide resolved
sources/common/toddl.go Outdated Show resolved Hide resolved
sources/common/toddl.go Show resolved Hide resolved
webv2/table/utilities.go Show resolved Hide resolved
expressions_api/expression_verify.go Outdated Show resolved Hide resolved
expressions_api/expression_verify.go Show resolved Hide resolved
expressions_api/expression_verify.go Show resolved Hide resolved
Copy link
Collaborator

@darshan-sj darshan-sj left a comment

Choose a reason for hiding this comment

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

LGTM

webv2/table/utilities.go Show resolved Hide resolved
sources/common/toddl.go Outdated Show resolved Hide resolved
@asthamohta asthamohta merged commit 1b5cf7d into GoogleCloudPlatform:master Dec 20, 2024
4 checks passed
taherkl pushed a commit to ollionorg/spanner-migration-tool-fork that referenced this pull request Dec 20, 2024
…m#965)

* backend apis

* linting

* comment changes

* comment changes
asthamohta added a commit that referenced this pull request Dec 26, 2024
* 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

* Updating version of msprod (#969)

* fix(deps): update module golang.org/x/net to v0.33.0 [security] (#967)

Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>

* feat: APIs for Backend Changes for Default Values (#965)

* backend apis

* linting

* comment changes

* comment changes

* feat: default value for mysql source  (#963)

* source dv

* test fix

* change

* comment changes

* test fix

* change

* fix github v

* change

* Check constraint backend (#9)

Backend Support for Check Constraint

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

* removed duplicate function

* Fixed UT

---------

Co-authored-by: taherkl <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Astha Mohta <35952883+asthamohta@users.noreply.github.com>
akashthawaitcc pushed a commit to ollionorg/spanner-migration-tool-fork that referenced this pull request Dec 26, 2024
…m#965)

* backend apis

* linting

* comment changes

* comment changes
akashthawaitcc added a commit to ollionorg/spanner-migration-tool-fork that referenced this pull request Dec 27, 2024
* chore(deps): update dependency jasmine-core to ~5.5.0 (GoogleCloudPlatform#953)

Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>

* removed duplicate function

* Fixed UT

* feat: make spanner config mandatory for schema migration (GoogleCloudPlatform#970)

* changes

* change

* change

* chore(deps): update gcr.io/cloud-spanner-emulator/emulator docker tag to v1.5.28 (GoogleCloudPlatform#974)

* chore(deps): update dependency @types/node to v20.17.10 (GoogleCloudPlatform#973)

Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>

* Add Support for Check Constraint - Backend code changes (GoogleCloudPlatform#945)

* 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

* Updating version of msprod (GoogleCloudPlatform#969)

* fix(deps): update module golang.org/x/net to v0.33.0 [security] (GoogleCloudPlatform#967)

Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>

* feat: APIs for Backend Changes for Default Values (GoogleCloudPlatform#965)

* backend apis

* linting

* comment changes

* comment changes

* feat: default value for mysql source  (GoogleCloudPlatform#963)

* source dv

* test fix

* change

* comment changes

* test fix

* change

* fix github v

* change

* Check constraint backend (#9)

Backend Support for Check Constraint

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

* removed duplicate function

* Fixed UT

---------

Co-authored-by: taherkl <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Astha Mohta <35952883+asthamohta@users.noreply.github.com>

* Check constraint backend (#9)

Backend Support for Check Constraint

* removed duplicate code after rebase

* 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

* feat: APIs for Backend Changes for Default Values (GoogleCloudPlatform#965)

* backend apis

* linting

* comment changes

* comment changes

* feat: default value for mysql source  (GoogleCloudPlatform#963)

* source dv

* test fix

* change

* comment changes

* test fix

* change

* fix github v

* change

* Check constraint backend (#9)

Backend Support for Check Constraint

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

* removed duplicate function

* Fixed UT

* Check constraint backend (#9)

Backend Support for Check Constraint

* removed duplicate code after rebase

* removed duplicate constants

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* updated the regrex for constraint name

* address the comment

* addressed the comment
1. change checkIfCcColumn to check in Spschema

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

* address the comment
1. when  interleave tab is shown 4 or 3

* fixed regular expression for check constraints name

* remove the node-sql-parser package

* handle check constraint without name.

* resolve the duplicate issue

* Check constraint backend (#9)

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

* PR and UT fixes

* added the verification api integration and struct changes

* added the verification at connect button

* added the integration of expression api

* code fix for expression api implementation

* code fix for expression verification on initial call

* added partial unit test of verify check constraint expression

* refactored expression verfication api mock

* Test added for verification api

* fix the UT issue

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Fixed unit test and code refactor

* fixed unit tests

* added source in conv object

* front-end ut fixed

* removed node sql parser import

* removed node dependencies

* rename handler

* added the generation of constraint name

* added dump flow

* added dump flow

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

Backend Support for Check Constraint

* fixed PR comments

* fix: added regular exprression to match the exact column

* Added test case for the column rename for check constraint

* 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Fixed unit test and code refactor

* removed node dependencies

* added dump flow

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

Backend Support for 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* removed node dependencies

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

Backend Support for 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* removed node dependencies

* added UT

* address the comment
1. handle the unexpected error
2. resuse the code

* updated the table exist query for version8.0.16

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

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

* rebase commit

* fixed regular expression for check constraints name

* remove the node-sql-parser package

* resolve the duplicate issue

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

* 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

* added the verification api integration and struct changes

* added the integration of expression api

* code fix for expression api implementation

* code fix for expression verification on initial call

* added partial unit test of verify check constraint expression

* refactored expression verfication api mock

* Test added for verification api

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* fixed unit tests

* front-end ut fixed

* 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 <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Fixed unit test and code refactor

* removed node dependencies

* added dump flow

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* 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

* Check constraint backend (#9)

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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* 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 <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* 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

* Check constraint backend (#9)

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

* Fix UT

* 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* 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

* added UT

* address the comment
1. handle the unexpected error
2. resuse the code

* added mock for RefreshSpannerClient function

* addressed the comment and feedback

---------

Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>
Co-authored-by: Taher Lakdawala <78196491+taherkl@users.noreply.github.com>
Co-authored-by: Astha Mohta <35952883+asthamohta@users.noreply.github.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: Vivek Yadav <105432992+VivekY1098@users.noreply.github.com>
akashthawaitcc added a commit to ollionorg/spanner-migration-tool-fork that referenced this pull request Dec 27, 2024
Support check constraint frontend (#22)

* chore(deps): update dependency jasmine-core to ~5.5.0 (GoogleCloudPlatform#953)

Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>

* removed duplicate function

* Fixed UT

* feat: make spanner config mandatory for schema migration (GoogleCloudPlatform#970)

* changes

* change

* change

* chore(deps): update gcr.io/cloud-spanner-emulator/emulator docker tag to v1.5.28 (GoogleCloudPlatform#974)

* chore(deps): update dependency @types/node to v20.17.10 (GoogleCloudPlatform#973)

Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>

* Add Support for Check Constraint - Backend code changes (GoogleCloudPlatform#945)

* 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

* Updating version of msprod (GoogleCloudPlatform#969)

* fix(deps): update module golang.org/x/net to v0.33.0 [security] (GoogleCloudPlatform#967)

Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>

* feat: APIs for Backend Changes for Default Values (GoogleCloudPlatform#965)

* backend apis

* linting

* comment changes

* comment changes

* feat: default value for mysql source  (GoogleCloudPlatform#963)

* source dv

* test fix

* change

* comment changes

* test fix

* change

* fix github v

* change

* Check constraint backend (#9)

Backend Support for Check Constraint

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

* removed duplicate function

* Fixed UT

---------

Co-authored-by: taherkl <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Astha Mohta <35952883+asthamohta@users.noreply.github.com>

* Check constraint backend (#9)

Backend Support for Check Constraint

* removed duplicate code after rebase

* 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

* feat: APIs for Backend Changes for Default Values (GoogleCloudPlatform#965)

* backend apis

* linting

* comment changes

* comment changes

* feat: default value for mysql source  (GoogleCloudPlatform#963)

* source dv

* test fix

* change

* comment changes

* test fix

* change

* fix github v

* change

* Check constraint backend (#9)

Backend Support for Check Constraint

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

* removed duplicate function

* Fixed UT

* Check constraint backend (#9)

Backend Support for Check Constraint

* removed duplicate code after rebase

* removed duplicate constants

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* updated the regrex for constraint name

* address the comment

* addressed the comment
1. change checkIfCcColumn to check in Spschema

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

* address the comment
1. when  interleave tab is shown 4 or 3

* fixed regular expression for check constraints name

* remove the node-sql-parser package

* handle check constraint without name.

* resolve the duplicate issue

* Check constraint backend (#9)

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

* PR and UT fixes

* added the verification api integration and struct changes

* added the verification at connect button

* added the integration of expression api

* code fix for expression api implementation

* code fix for expression verification on initial call

* added partial unit test of verify check constraint expression

* refactored expression verfication api mock

* Test added for verification api

* fix the UT issue

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Fixed unit test and code refactor

* fixed unit tests

* added source in conv object

* front-end ut fixed

* removed node sql parser import

* removed node dependencies

* rename handler

* added the generation of constraint name

* added dump flow

* added dump flow

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

Backend Support for Check Constraint

* fixed PR comments

* fix: added regular exprression to match the exact column

* Added test case for the column rename for check constraint

* 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Fixed unit test and code refactor

* removed node dependencies

* added dump flow

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

Backend Support for 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* removed node dependencies

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

Backend Support for 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* removed node dependencies

* added UT

* address the comment
1. handle the unexpected error
2. resuse the code

* updated the table exist query for version8.0.16

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

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

* rebase commit

* fixed regular expression for check constraints name

* remove the node-sql-parser package

* resolve the duplicate issue

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

* 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

* added the verification api integration and struct changes

* added the integration of expression api

* code fix for expression api implementation

* code fix for expression verification on initial call

* added partial unit test of verify check constraint expression

* refactored expression verfication api mock

* Test added for verification api

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* fixed unit tests

* front-end ut fixed

* 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 <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Fixed unit test and code refactor

* removed node dependencies

* added dump flow

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* 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

* Check constraint backend (#9)

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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* 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 <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* 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

* Check constraint backend (#9)

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

* Fix UT

* 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* 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

* added UT

* address the comment
1. handle the unexpected error
2. resuse the code

* added mock for RefreshSpannerClient function

* addressed the comment and feedback

---------

Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>
Co-authored-by: Taher Lakdawala <78196491+taherkl@users.noreply.github.com>
Co-authored-by: Astha Mohta <35952883+asthamohta@users.noreply.github.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: Vivek Yadav <105432992+VivekY1098@users.noreply.github.com>
VivekY1098 added a commit to ollionorg/spanner-migration-tool-fork that referenced this pull request Dec 27, 2024
Added sample session and dump file

Added integration test for mysql check constraints

Support check constraint frontend (#22)

* chore(deps): update dependency jasmine-core to ~5.5.0 (GoogleCloudPlatform#953)

Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>

* removed duplicate function

* Fixed UT

* feat: make spanner config mandatory for schema migration (GoogleCloudPlatform#970)

* changes

* change

* change

* chore(deps): update gcr.io/cloud-spanner-emulator/emulator docker tag to v1.5.28 (GoogleCloudPlatform#974)

* chore(deps): update dependency @types/node to v20.17.10 (GoogleCloudPlatform#973)

Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>

* Add Support for Check Constraint - Backend code changes (GoogleCloudPlatform#945)

* 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

* Updating version of msprod (GoogleCloudPlatform#969)

* fix(deps): update module golang.org/x/net to v0.33.0 [security] (GoogleCloudPlatform#967)

Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>

* feat: APIs for Backend Changes for Default Values (GoogleCloudPlatform#965)

* backend apis

* linting

* comment changes

* comment changes

* feat: default value for mysql source  (GoogleCloudPlatform#963)

* source dv

* test fix

* change

* comment changes

* test fix

* change

* fix github v

* change

* Check constraint backend (#9)

Backend Support for Check Constraint

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

* removed duplicate function

* Fixed UT

---------

Co-authored-by: taherkl <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Astha Mohta <35952883+asthamohta@users.noreply.github.com>

* Check constraint backend (#9)

Backend Support for Check Constraint

* removed duplicate code after rebase

* 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

* feat: APIs for Backend Changes for Default Values (GoogleCloudPlatform#965)

* backend apis

* linting

* comment changes

* comment changes

* feat: default value for mysql source  (GoogleCloudPlatform#963)

* source dv

* test fix

* change

* comment changes

* test fix

* change

* fix github v

* change

* Check constraint backend (#9)

Backend Support for Check Constraint

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

* removed duplicate function

* Fixed UT

* Check constraint backend (#9)

Backend Support for Check Constraint

* removed duplicate code after rebase

* removed duplicate constants

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* updated the regrex for constraint name

* address the comment

* addressed the comment
1. change checkIfCcColumn to check in Spschema

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

* address the comment
1. when  interleave tab is shown 4 or 3

* fixed regular expression for check constraints name

* remove the node-sql-parser package

* handle check constraint without name.

* resolve the duplicate issue

* Check constraint backend (#9)

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

* PR and UT fixes

* added the verification api integration and struct changes

* added the verification at connect button

* added the integration of expression api

* code fix for expression api implementation

* code fix for expression verification on initial call

* added partial unit test of verify check constraint expression

* refactored expression verfication api mock

* Test added for verification api

* fix the UT issue

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Fixed unit test and code refactor

* fixed unit tests

* added source in conv object

* front-end ut fixed

* removed node sql parser import

* removed node dependencies

* rename handler

* added the generation of constraint name

* added dump flow

* added dump flow

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

Backend Support for Check Constraint

* fixed PR comments

* fix: added regular exprression to match the exact column

* Added test case for the column rename for check constraint

* 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Fixed unit test and code refactor

* removed node dependencies

* added dump flow

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

Backend Support for 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* removed node dependencies

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

Backend Support for 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* removed node dependencies

* added UT

* address the comment
1. handle the unexpected error
2. resuse the code

* updated the table exist query for version8.0.16

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

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

* rebase commit

* fixed regular expression for check constraints name

* remove the node-sql-parser package

* resolve the duplicate issue

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

* 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

* added the verification api integration and struct changes

* added the integration of expression api

* code fix for expression api implementation

* code fix for expression verification on initial call

* added partial unit test of verify check constraint expression

* refactored expression verfication api mock

* Test added for verification api

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* fixed unit tests

* front-end ut fixed

* 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 <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* address the comment

* remove the node-sql-parser package

* Check constraint backend (#9)

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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* Fixed unit test and code refactor

* removed node dependencies

* added dump flow

* Feat/fe check contraints (#10)

* Add the UI changes  for supporting check constraints

---------

Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* 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

* Check constraint backend (#9)

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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* 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 <vivek.yadav@ollion.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>

* 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

* Check constraint backend (#9)

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

* Fix UT

* 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

* Support check constraint backend (GoogleCloudPlatform#962)

* 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 <taher.lakdawala@ollion.com>
Co-authored-by: Akash Thawait <aakash@ollion.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>

* 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

* added UT

* address the comment
1. handle the unexpected error
2. resuse the code

* added mock for RefreshSpannerClient function

* addressed the comment and feedback

---------

Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Vardhan Vinay Thigle <39047439+VardhanThigle@users.noreply.github.com>
Co-authored-by: taherkl <taher.lakdawala@ollion.com>
Co-authored-by: Taher Lakdawala <78196491+taherkl@users.noreply.github.com>
Co-authored-by: Astha Mohta <35952883+asthamohta@users.noreply.github.com>
Co-authored-by: Vivek Yadav <vivek.yadav@ollion.com>
Co-authored-by: Vivek Yadav <105432992+VivekY1098@users.noreply.github.com>
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.

3 participants