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

Using QGIS Expressions in any datasource URI #59608

Open
cxcandid opened this issue Nov 27, 2024 · 4 comments
Open

Using QGIS Expressions in any datasource URI #59608

cxcandid opened this issue Nov 27, 2024 · 4 comments

Comments

@cxcandid
Copy link

cxcandid commented Nov 27, 2024

Feature description

Maybe I miss a point here, but wouldn't it be nice if we could use QGIS Expressions in any datasource URI (even PostGIS)?

At the moment we can only use QGIS Expression Functions in virtual layers (i.e. SELECT * FROM mylayer WHERE name LIKE(var('filter')))

Would it cost to much processing time to parse the datasource string every time before rendering.
I'm thinking about having something like that:

SELECT * FROM mylayer WHERE name LIKE([% @filter %])

Can someone explain why this is not possible?

Additional context

No response

@elpaso
Copy link
Contributor

elpaso commented Nov 27, 2024

Do you mean something like https://plugins.qgis.org/plugins/qgis-subset-expression-plugin/ ?

@cxcandid
Copy link
Author

@elpaso cool plugin, thanks! ... In principle, it does what I want to achieve, but unfortunately only with filters (which my bad example also shows).

In truth, it's about more than that:

SELECT * FROM mypgfunction([% @myid %])

@cxcandid
Copy link
Author

@elpaso your plugin is a very good starting point... didn't know that we can implement a handler for the customVariablesChanged signal in PyQGIS.

So, let's implement (Python) Expressions in QGIS variables! 😁😅

@elpaso
Copy link
Contributor

elpaso commented Nov 27, 2024

Sounds good, feel free to add the functionality to the qgis-subset-expression-plugin/ if you feel like to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants