Working with IPs
IP addresses are represented as VARCHAR or BLOB values and support containment testing operations. BLOB is the preferred type for storing IP addresses.
Actions
Create
IP addresses are created as string literals:
For BLOB storage (preferred):
Reading
IP addresses can be read directly as string values from columns:
Comparing
Containment Testing
The | operator tests if an IP address is contained within a CIDR block:
Example:
This returns true if the IP address is within the specified CIDR range.
Equality
IP addresses can be compared for equality using standard comparison operators:
Limitations
IP addresses have the following limitations:
- IP addresses are stored as strings and do not have a dedicated IP data type
- Only containment testing (
|) and equality comparison are supported - Mathematical operations on IP addresses are not supported
- IP address validation is not automatically performed