question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Perform CIDR queries

See original GitHub issue

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

test_cidr 
ip 
64.6.64.0/24

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?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
tpurschkecommented, Oct 26, 2020

@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.

1reaction
tpurschkecommented, Mar 14, 2022

@coco98 I am wondering if there is a chance this issue might be prioritized?

Read more comments on GitHub >

github_iconTop Results From Across the Web

cidr Search Operator - Sumo Logic Docs
CIDR operators can be used to compare the network segment of two IPv4 addresses, or just identify the network segment involved in particular...
Read more >
Understanding IP Addresses, Subnets, and CIDR Notation for ...
IP addresses, networks, submasks, and CIDR notation can be difficult concepts to understand. In this guide, we will cover some of the ideas ......
Read more >
What is CIDR (Classless Inter-Domain Routing or supernetting)?
CIDR (Classless Inter-Domain Routing or supernetting) is a method of assigning IP addresses that improves the efficiency of address distribution and ...
Read more >
How can I do a CIDR query on SQL Server Binary Column Type
I'm intending to use binary(16), with IPv4 encoded as IPv4-mapped-IPv6 so there is one single consistent representation of any one IP address. I ......
Read more >
Classless Inter Domain Routing (CIDR) - GeeksforGeeks
Classless Inter Domain Routing (CIDR) · All IP addresses must be contiguous. · Block size must be the power of 2 (2 n...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found