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

[feature] Add stored query support to Execute SQL window #60761

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nyalldawson
Copy link
Collaborator

This ports the equivalent functionality from DB Manager over to the core/browser "Execute SQL" dialog.

Users can insert stored queries into their current query, save new stored queries, and remove queries via a new toolbar action.

Users can opt to store queries in either the current project (ie the DB Manager approach, and this is fully compatible with
existing queries stored via DB Manager) or in the local user profile (so that they are available across different projects)

Sponsored by City of Canning

Peek.2025-02-26.11-56.mp4

This class is designed to be compatible with DB Manager's storage
of queries in projects, but extended to allow storage within
the local profile too.
This ports the equivalent functionality from DB Manager over to
the core/browser "Execute SQL" dialog.

Users can insert stored queries into their current query, save
new stored queries, and remove queries via a new toolbar action.

Users can opt to store queries in either the current project
(ie the DB Manager approach, and this is fully compatible with
existing queries stored via DB Manager) or in the local user
profile (so that they are available across different projects)

Sponsored by City of Canning
This is all functionally dead code -- it is not called from anywhere
@nyalldawson nyalldawson added Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Feb 26, 2025
@qgis-bot
Copy link
Collaborator

@nyalldawson
This pull request has been tagged as requiring documentation.

A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged.

Please update the description (not the comments) with helpful description and screenshot to help the work from documentors.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@qgis-bot
Copy link
Collaborator

@nyalldawson

This pull request has been tagged for the changelog.

  • The description will be harvested so please provide a "nearly-ready" text for the final changelog
  • If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
  • If you can, it's better to give credits to your sponsor, see below for different formats.

You can edit the description.

Format available for credits
  • Funded by NAME
  • Funded by URL
  • Funded by NAME URL
  • Sponsored by NAME
  • Sponsored by URL
  • Sponsored by NAME URL

Thank you!

@github-actions github-actions bot added this to the 3.44.0 milestone Feb 26, 2025
Copy link

github-actions bot commented Feb 26, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit afdf432)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit afdf432)

} );


const QList< QgsStoredQueryManager::QueryDetails > storedQueries = QgsGui::storedQueryManager()->allQueries();
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note, this may be not very convenient when user has A LOT of saved queries. But I do not know how common this scenario is and, unfortunately, right now I do not have a better idea how to implement it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I realise there's an inherent limit in the number of queries the UI will handle. I couldn't think of an alternative though, and the current db manager UI has had a similar constraint for years now without any requests to improve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog Items that are queued to appear in the visual changelog - remove after harvesting Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants