PG::
Coder class
Superclass | Object |
This is the base class for all type cast encoder and decoder classes.
It can be used for implicit type casts by a PG::TypeMap
or to convert single values to/from their string representation by encode and decode.
Ruby nil
values are not handled by encoders, but are always transmitted as SQL NULL
value. Vice versa SQL NULL
values are not handled by decoders, but are always returned as a nil
value.
Constants
- FORMAT_ERROR_MASK
- FORMAT_ERROR_TO_PARTIAL
- FORMAT_ERROR_TO_RAISE
- FORMAT_ERROR_TO_STRING
- TIMESTAMP_APP_LOCAL
- TIMESTAMP_APP_UTC
- TIMESTAMP_DB_LOCAL
- TIMESTAMP_DB_UTC
define flags to be used with
PG::Coder#flags=
Attributes
- name RW
Name of the coder or the corresponding data type.
This accessor is only used in
PG::Coder#inspect
.
Public Class Methods
Create a new coder object based on the attribute Hash.
Public Instance Methods
Get current bitwise OR-ed coder flags.
Set coder specific bitwise OR-ed flags. See the particular en- or decoder description for available flags.
The default is 0
.
The format code that is sent alongside with an encoded query parameter value.
Specifies the format code that is sent alongside with an encoded query parameter value.
The default is 0
.
The type OID that is sent alongside with an encoded query parameter value.
Specifies the type OID that is sent alongside with an encoded query parameter value.
The default is 0
.
Returns coder attributes as Hash.