Update obsolete documentation refs to TextEncoder and BinaryEncoder

pull/37/head
Jack Christensen 2014-09-19 17:45:44 -05:00
parent f8e59bbd7d
commit 174929c406
3 changed files with 32 additions and 39 deletions

View File

@ -3,6 +3,7 @@
* Add per connection oid to name map * Add per connection oid to name map
* Add Hstore support (Andy Walker) * Add Hstore support (Andy Walker)
* Move introductory docs to godoc from readme * Move introductory docs to godoc from readme
* Fix documentation references to TextEncoder and BinaryEncoder
# 2.3.0 (September 16, 2014) # 2.3.0 (September 16, 2014)

View File

@ -87,7 +87,7 @@ func newWriteBuf(buf []byte, t byte) *WriteBuf {
} }
// WrifeBuf is used build messages to send to the PostgreSQL server. It is used // WrifeBuf is used build messages to send to the PostgreSQL server. It is used
// by the BinaryEncoder interface when implementing custom encoders. // by the Encoder interface when implementing custom encoders.
type WriteBuf struct { type WriteBuf struct {
buf []byte buf []byte
sizeIdx int sizeIdx int

View File

@ -104,10 +104,9 @@ type Encoder interface {
FormatCode() int16 FormatCode() int16
} }
// NullFloat32 represents an float4 that may be null. // NullFloat32 represents an float4 that may be null. NullFloat32 implements the
// NullFloat32 implements the Scanner, TextEncoder, and BinaryEncoder interfaces // Scanner and Encoder interfaces so it may be used both as an argument to
// so it may be used both as an argument to Query[Row] and a destination for // Query[Row] and a destination for Scan.
// Scan for prepared and unprepared queries.
// //
// If Valid is false then the value is NULL. // If Valid is false then the value is NULL.
type NullFloat32 struct { type NullFloat32 struct {
@ -144,10 +143,9 @@ func (n NullFloat32) Encode(w *WriteBuf, oid Oid) error {
return encodeFloat4(w, n.Float32) return encodeFloat4(w, n.Float32)
} }
// NullFloat64 represents an float8 that may be null. // NullFloat64 represents an float8 that may be null. NullFloat64 implements the
// NullFloat64 implements the Scanner, TextEncoder, and BinaryEncoder interfaces // Scanner and Encoder interfaces so it may be used both as an argument to
// so it may be used both as an argument to Query[Row] and a destination for // Query[Row] and a destination for Scan.
// Scan for prepared and unprepared queries.
// //
// If Valid is false then the value is NULL. // If Valid is false then the value is NULL.
type NullFloat64 struct { type NullFloat64 struct {
@ -184,10 +182,9 @@ func (n NullFloat64) Encode(w *WriteBuf, oid Oid) error {
return encodeFloat8(w, n.Float64) return encodeFloat8(w, n.Float64)
} }
// NullString represents an string that may be null. NullString implements // NullString represents an string that may be null. NullString implements the
// the Scanner and TextEncoder interfaces so it may be used both as an // Scanner Encoder interfaces so it may be used both as an argument to
// argument to Query[Row] and a destination for Scan for prepared and // Query[Row] and a destination for Scan.
// unprepared queries.
// //
// If Valid is false then the value is NULL. // If Valid is false then the value is NULL.
type NullString struct { type NullString struct {
@ -219,10 +216,9 @@ func (s NullString) Encode(w *WriteBuf, oid Oid) error {
return encodeText(w, s.String) return encodeText(w, s.String)
} }
// NullInt16 represents an smallint that may be null. // NullInt16 represents an smallint that may be null. NullInt16 implements the
// NullInt16 implements the Scanner, TextEncoder, and BinaryEncoder interfaces // Scanner and Encoder interfaces so it may be used both as an argument to
// so it may be used both as an argument to Query[Row] and a destination for // Query[Row] and a destination for Scan for prepared and unprepared queries.
// Scan for prepared and unprepared queries.
// //
// If Valid is false then the value is NULL. // If Valid is false then the value is NULL.
type NullInt16 struct { type NullInt16 struct {
@ -259,10 +255,9 @@ func (n NullInt16) Encode(w *WriteBuf, oid Oid) error {
return encodeInt2(w, n.Int16) return encodeInt2(w, n.Int16)
} }
// NullInt32 represents an integer that may be null. // NullInt32 represents an integer that may be null. NullInt32 implements the
// NullInt32 implements the Scanner, TextEncoder, and BinaryEncoder interfaces // Scanner and Encoder interfaces so it may be used both as an argument to
// so it may be used both as an argument to Query[Row] and a destination for // Query[Row] and a destination for Scan.
// Scan for prepared and unprepared queries.
// //
// If Valid is false then the value is NULL. // If Valid is false then the value is NULL.
type NullInt32 struct { type NullInt32 struct {
@ -299,10 +294,9 @@ func (n NullInt32) Encode(w *WriteBuf, oid Oid) error {
return encodeInt4(w, n.Int32) return encodeInt4(w, n.Int32)
} }
// NullInt64 represents an bigint that may be null. // NullInt64 represents an bigint that may be null. NullInt64 implements the
// NullInt64 implements the Scanner, TextEncoder, and BinaryEncoder interfaces // Scanner and Encoder interfaces so it may be used both as an argument to
// so it may be used both as an argument to Query[Row] and a destination for // Query[Row] and a destination for Scan.
// Scan for prepared and unprepared queries.
// //
// If Valid is false then the value is NULL. // If Valid is false then the value is NULL.
type NullInt64 struct { type NullInt64 struct {
@ -339,10 +333,9 @@ func (n NullInt64) Encode(w *WriteBuf, oid Oid) error {
return encodeInt8(w, n.Int64) return encodeInt8(w, n.Int64)
} }
// NullBool represents an bool that may be null. // NullBool represents an bool that may be null. NullBool implements the Scanner
// NullBool implements the Scanner, TextEncoder, and BinaryEncoder interfaces // and Encoder interfaces so it may be used both as an argument to Query[Row]
// so it may be used both as an argument to Query[Row] and a destination for // and a destination for Scan.
// Scan for prepared and unprepared queries.
// //
// If Valid is false then the value is NULL. // If Valid is false then the value is NULL.
type NullBool struct { type NullBool struct {
@ -379,10 +372,9 @@ func (n NullBool) Encode(w *WriteBuf, oid Oid) error {
return encodeBool(w, n.Bool) return encodeBool(w, n.Bool)
} }
// NullTime represents an bigint that may be null. // NullTime represents an bigint that may be null. NullTime implements the
// NullTime implements the Scanner, TextEncoder, and BinaryEncoder interfaces // Scanner and Encoder interfaces so it may be used both as an argument to
// so it may be used both as an argument to Query[Row] and a destination for // Query[Row] and a destination for Scan.
// Scan for prepared and unprepared queries.
// //
// If Valid is false then the value is NULL. // If Valid is false then the value is NULL.
type NullTime struct { type NullTime struct {
@ -421,10 +413,10 @@ func (n NullTime) Encode(w *WriteBuf, oid Oid) error {
return encodeTimestampTz(w, n.Time) return encodeTimestampTz(w, n.Time)
} }
//Hstore represents an hstore column. It does not support a null column or null // Hstore represents an hstore column. It does not support a null column or null
// key values (use NullHstore for this). Hstore implements the Scanner and // key values (use NullHstore for this). Hstore implements the Scanner and
// TextEncoder interfaces so it may be used both as an argument to Query[Row] // Encoder interfaces so it may be used both as an argument to Query[Row] and a
// and a destination for Scan for prepared and unprepared queries. // destination for Scan.
type Hstore map[string]string type Hstore map[string]string
func (h *Hstore) Scan(vr *ValueReader) error { func (h *Hstore) Scan(vr *ValueReader) error {
@ -481,13 +473,13 @@ func (h Hstore) Encode(w *WriteBuf, oid Oid) error {
} }
// NullHstore represents an hstore column that can be null or have null values // NullHstore represents an hstore column that can be null or have null values
// associated with its keys. NullHstore implements the Scanner and TextEncoder // associated with its keys. NullHstore implements the Scanner and Encoder
// interfaces so it may be used both as an argument to Query[Row] and a // interfaces so it may be used both as an argument to Query[Row] and a
// destination for Scan for prepared and unprepared queries. // destination for Scan.
// //
// If Valid is false, then the value of the entire hstore column is NULL // If Valid is false, then the value of the entire hstore column is NULL
// If any of the NullString values in Store has Valid set to false, the key // If any of the NullString values in Store has Valid set to false, the key
// appears in the hstore column, but its value is explicitly set to NULL // appears in the hstore column, but its value is explicitly set to NULL.
type NullHstore struct { type NullHstore struct {
Hstore map[string]NullString Hstore map[string]NullString
Valid bool Valid bool