-
Notifications
You must be signed in to change notification settings - Fork 24
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 introspection support for PostgreSQL and MSSQL data stores #369
Merged
daneshk
merged 31 commits into
ballerina-platform:main
from
hasathcharu:introspection-mssql
May 7, 2024
Merged
Add introspection support for PostgreSQL and MSSQL data stores #369
daneshk
merged 31 commits into
ballerina-platform:main
from
hasathcharu:introspection-mssql
May 7, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit refactors the introspect package by moving the database driver resolution logic inside the Introspector class. Moreover, this also handles the database connection within the Introspector class.
These test cases are not enabled yet. They are created to test the pull command with postgresql.
This commit fixes certain issues with the driver resolution logic and refines the SQL queries used to introspect PostgreSQL databases.
This commit includes the following changes: - Add test cases for postgresql - Fix some issues in queries used in postgresql introspection
- This also adds the necessary queries for MSSQL database introspection
This configures MSSQL as a supported datastore for testing introspection support for MSSQL.
This commit fixes an issue where the clients are generated/migrated even if all the entities contain at least one unsupported datatype.
Add test cases to prevent client generation when all entities have unsupported fields
This commit fixes the issue where the unique index is created twice when the field is a one-to-one foreign key. This was due to the field being marked as 'UNIQUE' and also having a Unique Index created if the foreign key is declared custom through the 'Relation' annotation. Now, the CLI checks if the foreign key has a unique index created and skips being marked 'UNIQUE' at the column definition.
This commit fixes the issue where when there are more than one association between two entities, the generated script contains the cardinality of the first association for all the associations, ignoring the cardinality of the other associations.
hasathcharu
force-pushed
the
introspection-mssql
branch
2 times, most recently
from
May 6, 2024 10:36
593064a
to
82efbd0
Compare
hasathcharu
force-pushed
the
introspection-mssql
branch
from
May 6, 2024 10:39
82efbd0
to
72c2882
Compare
hasathcharu
changed the title
Introspection mssql
Add introspection support for PostgreSQL and MSSQL data stores
May 6, 2024
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/input/tool_test_pull_33_postgresql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/input/tool_test_pull_34_postgresql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/input/tool_test_pull_43_postgresql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/input/tool_test_pull_46_postgresql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/input/tool_test_pull_47_postgresql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/input/tool_test_pull_57_mssql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/input/tool_test_pull_58_mssql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/input/tool_test_pull_67_mssql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/input/tool_test_pull_70_mssql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/output/tool_test_pull_32_postgresql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/output/tool_test_pull_33_postgresql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/output/tool_test_pull_34_postgresql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/output/tool_test_pull_43_postgresql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/output/tool_test_pull_46_postgresql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/output/tool_test_pull_47_postgresql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/output/tool_test_pull_56_mssql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/output/tool_test_pull_57_mssql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/output/tool_test_pull_67_mssql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
persist-cli-tests/src/test/resources/test-src/output/tool_test_pull_70_mssql/script.sql
Outdated
Show resolved
Hide resolved
daneshk
reviewed
May 7, 2024
daneshk
previously approved these changes
May 7, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add minor comments. Overall LGTM
Quality Gate passedIssues Measures |
daneshk
approved these changes
May 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This is to add introspection support for MSSQL and PostgreSQL databases. This PR also contains some bug fixes as well.
Fixes:
script.sql
in one-to-one associationsExamples
Checklist