Creates a new DataAPIInet
instance from a vector-like value.
If you pass a version
, the value will be validated as an IPv4 or IPv6 address; otherwise, it'll be validated as
either, and the version will be inferred from the value.
You can set validate
to false
to bypass any validation if you're confident the value is a valid inet address.
The address to create the DataAPIInet
from
Optional
version: null | 4 | 6The IP version to validate the address as
Whether to actually validate the address
TypeError If the address is not a valid IPv4 or IPv6 address
Readonly
_rawReturns the IP version of the inet address.
The IP version of the inet address
Errorful implementation of $SerializeForCollection
for TableCodec
Throws a human-readable error message warning that this datatype may not be used with collections without writing a custom ser/des codec.
Implementation of $SerializeForTable
for TableCodec
Static
[$Implementation of $DeserializeForTable
for TableCodec
Static
isIPv4Checks if a string is a valid IPv4 address.
NOTE: Will cover all common cases of IP addresses, but may reject otherwise valid addresses in more esoteric, yet still technically legal, forms.
However, this will never return true
on an IP which is actually invalid.
Static
isIPv6Checks if a string is a valid IPv6 address.
NOTE: Will cover all common cases of IP addresses, but may reject otherwise valid addresses in more esoteric, yet still technically legal, forms.
However, this will never return true
on an IP which is actually invalid.
Represents an
inet
column for Data API tables.You may use the inet function as a shorthand for creating a new
DataAPIInet
.See the official DataStax documentation for more information.