-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 info about usable "expression dialect" to filter dialog #58730
Add info about usable "expression dialect" to filter dialog #58730
Conversation
Can we not also add a link to each provider type documentation to allow users to see navigate to the documentation page so that they can explore available options with a specific provider i.e |
There's actual gdal API to retrieve the SQL dialect in use - see OSGeo/gdal#6154 That would be more appropriate to use here |
That looks great! Can I simply assume that QGIS is built with GDAL 3.6+? I will create the URLs and then link the different GDAL_DMD_SUPPORTED_SQL_DIALECTS to them. |
Nice, GDAL also provides My current state: I am linking to The code is probably a total mess, I will look at it again tomorrow. Any change recommendations are welcome of course :)
|
INSTALL.md says: GDAL/OGR >= 3.2.0 |
Thank you for the feedback! But I realised something and am not sure if this is going into a good direction because I introduced a "display of potential SQL dialects one could utilize if using GDAL directly" vs. what I really wanted which is "display of the SQL dialect in use by the provider filter". The But I just realised that even if a layer has
I assume that the native dialect is preferred (which makes great sense) but I could not figure it out from the sources. So now I worry if this PR would introduce more confusion than help... It should display the dialect that is actually used, instead of the dialects that the user could use if they were using GDAL directly. As far as I know there is no way for the user to specify the SQL dialect to use, so theoretical support is irrelevant and misleading. So I would rather remove the dialects display again. (Ideally the user could select the utilized dialect themselves, e.g. with a dropdown list. But that would require much more work.) |
The first value returned from the metadata value is always the default, which will be the one QGIS uses |
Oh fantastic, thank you! I will try to finish this asap. |
50b4474
to
304848b
Compare
Done! This is really cool, thank you so much. The text above the expression widget now just reads "Enter a [...] to filter the layer", where the appropriate name will be inserted as a hyperlink to the URL. I decided to still add a visible information about the provider in use to the dialog, now right after the layer name at the topmost label. Showing the storage type too seems not that useful to me anymore so I have not kept that. New screenshots are in the main post above. @nyalldawson are you sure that those dialects & URLs are all correct? For WFS it says "WFS query expression" and links to https://docs.ogc.org/is/09-025r2/09-025r2.html#83 but I have never seen a XML string used for a subset string. And for filtering WFS on load, the SQL Query composer exists, which uses SQL again (https://gis.stackexchange.com/questions/236847/tutorial-for-wfs-connection-sql-query-composer) |
the WFS provider can understand a subset of SQL WHERE clause or SQL SELECT as valid subsetStrings. I can't think of existing documentation where this clearly defined Examples from unit tests:
|
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
I have now made the initial description in the top post changelog friendly. Here is what was in it before: The user can enter query expressions in the filter/query dialog, but often people get confused as to why some expressions work but others don't. Random examples: This change hopefully makes it more obvious what kind of expressions are supported. Uses the new data provider methods introduced in #58781 Compiled and tested manually with several layer types, but not all. ScreenshotsOld screenshots from an earlier state:
|
Let's just remove that one then |
Woohoo! Thanks for that safety check and for merging it :) |
The query builder used for entering filter expressions on vector layers now shows the supported expression dialect. This uses the new data provider methods introduced in #58781.
Sponsored by WhereGroup GmbH.