-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
Implement filtering options for the URI type #413
Comments
The set of valid schemes is unknown. There's a set of "official" URI schemes, but a scheme can be unofficial too. I think we'll have to ask the user to input a scheme to filter against himself. |
@dmos62 For the first version, let's use the official schemes. We want the UI to be user friendly, a non-technical user might not know what a scheme is so we should provide them some options. |
@kgodey how should we expose the supported schemes to the client-side? Maybe hardcode a set on the clientside? Alternatively, we could introduce something like a Before I said "the set of valid schemes is unknown". I realised that's not true. Any scheme used in the filtered column is valid. So, a more generalizable feature would be to expose information on things like unique schemes used in this URI column, or unique domains used in that email column. Whatever we might use for equality filtering. Then use that for autocomplete. That would probably be most useful to the user. |
Quick update:
A solution is to extend |
I agree with this, perhaps it could be metadata on the column object in the column endpoint. I don't think we need anything else like a hardcoded list or a separate endpoint.
Can't you get which part is the domain from the type itself? |
@kgodey that's a good point. I'm looking into how to use |
I did not find a way to use |
@dmos62 Hopefully you can reuse some code from |
The way to do this with |
@dmos62 I assume you noticed the DB function that is installed with the URI type that returns the URI pieces (according to the RFC). The regex used is directly from https://datatracker.ietf.org/doc/html/rfc3986/#appendix-B . Combined with my previous comment, you should be able to achieve pretty expressive filtering. |
@mathemancer yeah, I was looking for a way to fully specify the filter via |
Fair enough. I'm also not convinced |
Problem
We need to ensure that records that include columns of the custom URI type support the following filters via API:
The ones in bold are unique to the URI type.
This involves:
/api/v0/databases/<id>/types/
endpoint to store available filters on this typeis
needs 1 parameter,is empty
needs 0)Additional context
sqlalchemy-filters
to provide filtering. See: https://github.com/centerofci/sqlalchemy-filters.The text was updated successfully, but these errors were encountered: