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

HCK-8126, HCK-8127: RE of sequences and synonyms improvements #137

Merged
merged 6 commits into from
Sep 26, 2024

Conversation

Vitalii4as
Copy link
Contributor

@Vitalii4as Vitalii4as commented Sep 26, 2024

Sub-taskHCK-8126 RE sequences directly used by the selected tables

Technical details

  • Now we reverse-engineer only those synonyms and sequences that are used in DDL of tables of views
  • Removed of GET_DDL call for synonyms, replaed it with LEFT JOIN with ALL_OBJECTS to obtain EDITIONABLE
  • Improved RE of sequences by calling GET_DDL of only used sequences
  • Improved logging

@Vitalii4as Vitalii4as requested a review from bigorn0 September 26, 2024 13:44
@Vitalii4as Vitalii4as self-assigned this Sep 26, 2024
@Vitalii4as Vitalii4as marked this pull request as draft September 26, 2024 13:57
@Vitalii4as Vitalii4as marked this pull request as ready for review September 26, 2024 14:13

logger.log(
'info',
{ message: 'Filter sequences finished', usedSequencesCount: usedSequences?.length || 0 },
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this means 'Filtering of sequences used in tables and views finished', at first I saw Getting sequences (which is the title i guess) and it was a bit misleading.

const sequenceDdlScriptsPromise = mapLimit(namesOfSequences, 50, async sequenceName => {
try {
const sequenceDdlScript = await execute(
`SELECT JSON_OBJECT('ddl' VALUE DBMS_METADATA.GET_DDL('SEQUENCE', '${sequenceName}', '${schema}')) FROM DUAL`,
Copy link
Contributor

Choose a reason for hiding this comment

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

@Vitalii4as FROM DUAL is new (it looks like), was it missing previously or you make sure that Duality views are properly handled explicitly?

Copy link
Contributor

@bigorn0 bigorn0 left a comment

Choose a reason for hiding this comment

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

LGTM and i will try to run some tests :)

@Vitalii4as Vitalii4as enabled auto-merge (squash) September 26, 2024 15:22
Copy link

@chulanovskyi-bs chulanovskyi-bs merged commit 58b4c2d into develop Sep 26, 2024
6 of 8 checks passed
@chulanovskyi-bs chulanovskyi-bs deleted the fix/HCK-8126-HCK-8127 branch September 26, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants