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

Add query remarks #116

Merged
merged 2 commits into from
Oct 26, 2023
Merged

Add query remarks #116

merged 2 commits into from
Oct 26, 2023

Conversation

lpoulain
Copy link
Collaborator

@lpoulain lpoulain commented Oct 20, 2023

When executing a query, Metabase adds a comment providing the user ID, query type and hash:

PREPARE statement3 FROM -- Metabase:: userID: 1 queryType: MBQL queryHash: a5cd01e49cc4cef75ee341f2249ea177b7fefe3d71762318caa3b7a6d76d9cd0
SELECT "default"."customer"."custkey" FROM "default"."customer"

This PR adds extra information as it's already done with Redshift (https://github.com/metabase/metabase/blob/dc676e1e649249c4ddb2ff9ee3752682596b0f23/modules/drivers/redshift/src/metabase/driver/redshift.clj#L312). It adds the account ID, Dashboard ID and when card ID available:

PREPARE statement3 FROM -- Metabase:: userID: 1 queryType: native queryHash: e80d81488b5f52789240a8be468983ab5638ef272b524b5e7c6fb9830beeb201 accountID: d578dddb-cbda-41b2-b00d-599e445dac37
SELECT "default"."customer"."custkey" FROM "default"."customer"
PREPARE statement4 FROM -- Metabase:: userID: 1 queryType: MBQL queryHash: b2ad15ab0ef360e068ec906b53fdecfd8be58a1fde061225d484c0b3f2bc3301 accountID: d578dddb-cbda-41b2-b00d-599e445dac37 dashboardID: 1 cardID: 2
SELECT "default"."customer"."custkey" FROM "default"."customer"

@lpoulain lpoulain linked an issue Oct 20, 2023 that may be closed by this pull request
Copy link
Member

@andrewdibiasio6 andrewdibiasio6 left a comment

Choose a reason for hiding this comment

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

neat

Add query remarks
@lpoulain lpoulain merged commit 7e384ae into main Oct 26, 2023
2 checks passed
@paoliniluis
Copy link

Great! Let us know when you cut a release so we can ship it in our cloud

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.

Add query remarks
3 participants