Repository navigation
#1535: extend --dependencies to find tables selected in SQL queries - #2692
Open
valentinatihova wants to merge 3 commits into
Open
valentinatihova wants to merge 3 commits into
valentinatihova wants to merge 3 commits into
Conversation
…ncies Query.getDependentFiles now reads the SQL of each found query, extracts the tables after FROM, JOIN and APPLY with a small dependency-free tokenizer (lib/util/sqlTables.js), resolves their names to keys via DataExtension.retrieveForCache() once per BU and run, and passes the keys to DataExtension.getDependentFiles. Shared dataExtensions keep the existing _ParentBU_ warning. Tables that cannot be resolved or read are reported as warnings.
Author
|
Hi, a gentle ping on this one. Could a maintainer approve the CI workflows so the checks can run? I’m happy to address any review feedback or rebase on the latest develop if needed. Thanks! |
This file contains hidden or 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
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.
PR details
What changes did you make? (Give an overview)
--dependenciesnow also adds the dataExtensions a query reads from (FROM,JOIN,APPLY), not only its target. Works forbuild,buildTemplate,buildDefinitionandcreateDeltaPkg.Query.getDependentFiles()override.MetadataType.jsis unchanged.lib/util/sqlTables.js: small SQL tokenizer, no dependencies. Skips comments, strings, subqueries, CTEs, functions and data views (_...). Supports[names],ENT., aliases and non-ASCII names.DataExtension.retrieveForCache(), once per BU and run._ParentBU_warning.Further details (optional)
process.exitCode = 1, or stay a warning?ENT.be a warning?postRetrieveTasks, block the deploy of the query inpreDeployTasksif a table does not exist.Tests:
test/sqlTables.test.js: 39 tests, including 15 realistic queries.test/type.query.test.js:buildTemplate --dependencieswith local, shared, missing and unreadable tables, with exact API call counts.npm run lint-and-testandnpm run lint-tspass.Checklist