Closed CR1AT0RS closed 6 days ago
@CR1AT0RS Hasura doesn't support CIDR operators (functions) on its graphql API yet. The console UI also doesn't have the CIDR
as a type of column yet.
One workaround for this, for now, could be:
Does this help ? I will mark this issue as a feature request for CIDR datatypes and related functions/operators.
@0x777 Facing a similar issue here. Can you give feedback if there is any progress around this issue? Would be great to have the following filter query work with cidr logic to return all overlapping ip addresses (in this example all ip addresses in the network 10.2.0.0/16):
query filterNetworkObjects($objIpMatch: cidr) { object(where: {obj_ip: {_gte: $objIpMatch, _lte: $objIpMatch}}) { obj_name obj_ip }
variables: {"objIpMatch": "10.2.0.0/16"}
@ecthiender yes I was able to get around it but a native type support would be awesome. Thanks for adding in enhancement tag.
@marionschleifer do you think there is any chance this will be implemented in the near future? Our project is really depending on it, so we would need an indication if hasura might be suitable or not. many TIA.
I agree - this feature would be really helpful,
Any news?
@coco98 I am wondering if there is a chance this issue might be prioritized?
Hello! Is there anything on the roadmap for supporting such filtered queries on CIDR objects? It is a very useful use case for systems that store e.g., IP prefix-related data, using hasura as the GQL middleware.
Hasura v3's ndc-postgres now supports CIDR and other native PostgreSQL types. The CIDR operator '>>
' is exposed as the procedure name 'network_sup
'.
I am trying to move my database over to Hasura but its not clear how can I store and use native Postgres functionality of querying and storing CIDR values. For example:
Create table to store INET/CIDR:
CREATE TABLE test_cidr ( id SERIAL PRIMARY KEY, ip CIDR UNIQUE, region VARCHAR(1000), service VARCHAR(1000));
Table contents
Select query on Table
SELECT * FROM test_cidr WHERE ip >> '152.53.xxx.xx';
This returns a list of CIDR which includes this IP. This works on native Postgres. I am wondering how can I achieve this using implicit datatype?