Skip to content

Allow creating new model file in existing data extension#2296

Merged
koesie10 merged 9 commits intomainfrom
koesie10/create-extension-model-file
Apr 14, 2023
Merged

Allow creating new model file in existing data extension#2296
koesie10 merged 9 commits intomainfrom
koesie10/create-extension-model-file

Conversation

@koesie10
Copy link
Copy Markdown
Member

This will allow a user to create a new model file in an existing data extension when opening the data extension editor. There is some validation on the name of the model file, which depends on reading in the qlpack.

Screen.Recording.2023-04-11.at.17.00.18.mov

Based on #2295

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

This will allow a user to create a new model file in an existing data
extension when opening the data extension editor. There is some
validation on the name of the model file, which depends on reading in
the qlpack.
`outputFile` will create the parent directory if it doesn't exist yet,
so this will allow users to specify a sub-directory for the model file.
@koesie10 koesie10 requested review from a team as code owners April 11, 2023 15:01
Comment thread extensions/ql-vscode/src/data-extensions-editor/extension-packs.ts
Comment thread extensions/ql-vscode/src/data-extensions-editor/extension-packs.ts Outdated
Comment thread extensions/ql-vscode/src/data-extensions-editor/extension-packs.ts Outdated
Comment thread extensions/ql-vscode/src/data-extensions-editor/extension-packs.ts
Base automatically changed from koesie10/pick-extension-model-file to main April 13, 2023 06:55
@koesie10 koesie10 requested review from a team and starcke April 13, 2023 08:05
Copy link
Copy Markdown
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Nice.


export async function pickExtensionPackModelFile(
cliServer: Pick<CodeQLCliServer, "resolveQlpacks" | "resolveExtensions">,
databaseItem: Pick<DatabaseItem, "name">,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The extension file doesn't need to be in an extension pack. If the extension file is in the pack that contains the query to run (or any of its transitive dependencies), then the extension file will be loaded during evaluation.

This is a bit of a complicated concept for most users since the set of extension files used depends on which query is run. So, maybe this isn't necessary to implement for the PoC, but keep this in mind for the general release.

@koesie10 koesie10 enabled auto-merge April 14, 2023 07:30
@koesie10 koesie10 merged commit 5a3630a into main Apr 14, 2023
@koesie10 koesie10 deleted the koesie10/create-extension-model-file branch April 14, 2023 09:09
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.

2 participants