Use Go casing convention for OID
This commit is contained in:
+14
-14
@@ -4,52 +4,52 @@ import (
|
||||
"database/sql/driver"
|
||||
)
|
||||
|
||||
// OidValue (Object Identifier Type) is, according to
|
||||
// https://www.postgresql.org/docs/current/static/datatype-OidValue.html, used
|
||||
// OIDValue (Object Identifier Type) is, according to
|
||||
// https://www.postgresql.org/docs/current/static/datatype-OIDValue.html, used
|
||||
// internally by PostgreSQL as a primary key for various system tables. It is
|
||||
// currently implemented as an unsigned four-byte integer. Its definition can be
|
||||
// found in src/include/postgres_ext.h in the PostgreSQL sources.
|
||||
type OidValue pguint32
|
||||
type OIDValue pguint32
|
||||
|
||||
// Set converts from src to dst. Note that as OidValue is not a general
|
||||
// Set converts from src to dst. Note that as OIDValue is not a general
|
||||
// number type Set does not do automatic type conversion as other number
|
||||
// types do.
|
||||
func (dst *OidValue) Set(src interface{}) error {
|
||||
func (dst *OIDValue) Set(src interface{}) error {
|
||||
return (*pguint32)(dst).Set(src)
|
||||
}
|
||||
|
||||
func (dst *OidValue) Get() interface{} {
|
||||
func (dst *OIDValue) Get() interface{} {
|
||||
return (*pguint32)(dst).Get()
|
||||
}
|
||||
|
||||
// AssignTo assigns from src to dst. Note that as OidValue is not a general number
|
||||
// AssignTo assigns from src to dst. Note that as OIDValue is not a general number
|
||||
// type AssignTo does not do automatic type conversion as other number types do.
|
||||
func (src *OidValue) AssignTo(dst interface{}) error {
|
||||
func (src *OIDValue) AssignTo(dst interface{}) error {
|
||||
return (*pguint32)(src).AssignTo(dst)
|
||||
}
|
||||
|
||||
func (dst *OidValue) DecodeText(ci *ConnInfo, src []byte) error {
|
||||
func (dst *OIDValue) DecodeText(ci *ConnInfo, src []byte) error {
|
||||
return (*pguint32)(dst).DecodeText(ci, src)
|
||||
}
|
||||
|
||||
func (dst *OidValue) DecodeBinary(ci *ConnInfo, src []byte) error {
|
||||
func (dst *OIDValue) DecodeBinary(ci *ConnInfo, src []byte) error {
|
||||
return (*pguint32)(dst).DecodeBinary(ci, src)
|
||||
}
|
||||
|
||||
func (src *OidValue) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error) {
|
||||
func (src *OIDValue) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error) {
|
||||
return (*pguint32)(src).EncodeText(ci, buf)
|
||||
}
|
||||
|
||||
func (src *OidValue) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error) {
|
||||
func (src *OIDValue) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error) {
|
||||
return (*pguint32)(src).EncodeBinary(ci, buf)
|
||||
}
|
||||
|
||||
// Scan implements the database/sql Scanner interface.
|
||||
func (dst *OidValue) Scan(src interface{}) error {
|
||||
func (dst *OIDValue) Scan(src interface{}) error {
|
||||
return (*pguint32)(dst).Scan(src)
|
||||
}
|
||||
|
||||
// Value implements the database/sql/driver Valuer interface.
|
||||
func (src *OidValue) Value() (driver.Value, error) {
|
||||
func (src *OIDValue) Value() (driver.Value, error) {
|
||||
return (*pguint32)(src).Value()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user