Last Modified
  2016-09-30 19:32:14 +0000
Requires
  - ipaddr
  - adapters/utils/pg_types

## Description

The pg_inet extension adds support for Sequel to handle PostgreSQL's inet and cidr types using ruby's IPAddr class.

This extension integrates with Sequel's native postgres adapter, so that when inet/cidr fields are retrieved, they are returned as IPAddr instances

After loading the extension, you should extend your dataset with a module so that it correctly handles the inet/cidr type:

    DB.extension :pg_inet

If you are not using the native postgres adapter and are using inet/cidr types as model column values you probably should use the pg_typecast_on_load plugin if the column values are returned as a string.

This extension integrates with the pg_array extension. If you plan to use the inet[] or cidr[] types, load the pg_array extension before the pg_inet extension:

    DB.extension :pg_array, :pg_inet

This extension does not add special support for the macaddr type. Ruby doesn't have a stdlib class that represents mac addresses, so these will still be returned as strings. The exception to this is that the pg_array extension integration will recognize macaddr[] types return them as arrays of strings.

See the schema modification guide for details on using inet/cidr columns in CREATE/ALTER TABLE statements.