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.

Implements

Constructors

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

    Parameters

    • address: string

      The address to create the DataAPIInet from

    • Optional version: null | 4 | 6

      The IP version to validate the address as

    • validate: boolean = true

      Whether to actually validate the address

    Returns DataAPIInet

    Throws

    TypeError If the address is not a valid IPv4 or IPv6 address

Properties

_raw: string
_version: 4 | 6 | nullish

Accessors

  • get version(): 4 | 6
  • Returns the IP version of the inet address.

    Returns 4 | 6

    The IP version of the inet address

Methods

  • Returns the string representation of the inet address.

    Returns string

    The string representation of the inet address