mirror of https://github.com/jackc/pgx.git
Remove oid constants from pgx
parent
6f0ec4c470
commit
9ab59a74a9
8
conn.go
8
conn.go
|
@ -38,10 +38,10 @@ var minimalConnInfo *pgtype.ConnInfo
|
||||||
func init() {
|
func init() {
|
||||||
minimalConnInfo = pgtype.NewConnInfo()
|
minimalConnInfo = pgtype.NewConnInfo()
|
||||||
minimalConnInfo.InitializeDataTypes(map[string]pgtype.Oid{
|
minimalConnInfo.InitializeDataTypes(map[string]pgtype.Oid{
|
||||||
"int4": Int4Oid,
|
"int4": pgtype.Int4Oid,
|
||||||
"name": NameOid,
|
"name": pgtype.NameOid,
|
||||||
"oid": OidOid,
|
"oid": pgtype.OidOid,
|
||||||
"text": TextOid,
|
"text": pgtype.TextOid,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1043,7 +1043,7 @@ func TestPrepareEx(t *testing.T) {
|
||||||
conn := mustConnect(t, *defaultConnConfig)
|
conn := mustConnect(t, *defaultConnConfig)
|
||||||
defer closeConn(t, conn)
|
defer closeConn(t, conn)
|
||||||
|
|
||||||
_, err := conn.PrepareEx("test", "select $1", &pgx.PrepareExOptions{ParameterOids: []pgtype.Oid{pgx.TextOid}})
|
_, err := conn.PrepareEx("test", "select $1", &pgx.PrepareExOptions{ParameterOids: []pgtype.Oid{pgtype.TextOid}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Unable to prepare statement: %v", err)
|
t.Errorf("Unable to prepare statement: %v", err)
|
||||||
return
|
return
|
||||||
|
|
|
@ -66,16 +66,16 @@ func init() {
|
||||||
sql.Register("pgx", d)
|
sql.Register("pgx", d)
|
||||||
|
|
||||||
databaseSqlOids = make(map[pgtype.Oid]bool)
|
databaseSqlOids = make(map[pgtype.Oid]bool)
|
||||||
databaseSqlOids[pgx.BoolOid] = true
|
databaseSqlOids[pgtype.BoolOid] = true
|
||||||
databaseSqlOids[pgx.ByteaOid] = true
|
databaseSqlOids[pgtype.ByteaOid] = true
|
||||||
databaseSqlOids[pgx.Int2Oid] = true
|
databaseSqlOids[pgtype.Int2Oid] = true
|
||||||
databaseSqlOids[pgx.Int4Oid] = true
|
databaseSqlOids[pgtype.Int4Oid] = true
|
||||||
databaseSqlOids[pgx.Int8Oid] = true
|
databaseSqlOids[pgtype.Int8Oid] = true
|
||||||
databaseSqlOids[pgx.Float4Oid] = true
|
databaseSqlOids[pgtype.Float4Oid] = true
|
||||||
databaseSqlOids[pgx.Float8Oid] = true
|
databaseSqlOids[pgtype.Float8Oid] = true
|
||||||
databaseSqlOids[pgx.DateOid] = true
|
databaseSqlOids[pgtype.DateOid] = true
|
||||||
databaseSqlOids[pgx.TimestampTzOid] = true
|
databaseSqlOids[pgtype.TimestamptzOid] = true
|
||||||
databaseSqlOids[pgx.TimestampOid] = true
|
databaseSqlOids[pgtype.TimestampOid] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
type Driver struct {
|
type Driver struct {
|
||||||
|
|
2
v3.md
2
v3.md
|
@ -30,6 +30,8 @@ Remove CopyTo
|
||||||
|
|
||||||
No longer can read raw bytes of any value into a []byte. Use pgtype.GenericBinary if this functionality is needed.
|
No longer can read raw bytes of any value into a []byte. Use pgtype.GenericBinary if this functionality is needed.
|
||||||
|
|
||||||
|
OID constants moved from pgx to pgtype package
|
||||||
|
|
||||||
## TODO / Possible / Investigate
|
## TODO / Possible / Investigate
|
||||||
|
|
||||||
Organize errors better
|
Organize errors better
|
||||||
|
|
45
values.go
45
values.go
|
@ -9,51 +9,6 @@ import (
|
||||||
"github.com/jackc/pgx/pgtype"
|
"github.com/jackc/pgx/pgtype"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PostgreSQL oids for common types
|
|
||||||
const (
|
|
||||||
BoolOid = 16
|
|
||||||
ByteaOid = 17
|
|
||||||
CharOid = 18
|
|
||||||
NameOid = 19
|
|
||||||
Int8Oid = 20
|
|
||||||
Int2Oid = 21
|
|
||||||
Int4Oid = 23
|
|
||||||
TextOid = 25
|
|
||||||
OidOid = 26
|
|
||||||
TidOid = 27
|
|
||||||
XidOid = 28
|
|
||||||
CidOid = 29
|
|
||||||
JsonOid = 114
|
|
||||||
CidrOid = 650
|
|
||||||
CidrArrayOid = 651
|
|
||||||
Float4Oid = 700
|
|
||||||
Float8Oid = 701
|
|
||||||
UnknownOid = 705
|
|
||||||
InetOid = 869
|
|
||||||
BoolArrayOid = 1000
|
|
||||||
Int2ArrayOid = 1005
|
|
||||||
Int4ArrayOid = 1007
|
|
||||||
TextArrayOid = 1009
|
|
||||||
ByteaArrayOid = 1001
|
|
||||||
VarcharArrayOid = 1015
|
|
||||||
Int8ArrayOid = 1016
|
|
||||||
Float4ArrayOid = 1021
|
|
||||||
Float8ArrayOid = 1022
|
|
||||||
AclitemOid = 1033
|
|
||||||
AclitemArrayOid = 1034
|
|
||||||
InetArrayOid = 1041
|
|
||||||
VarcharOid = 1043
|
|
||||||
DateOid = 1082
|
|
||||||
TimestampOid = 1114
|
|
||||||
TimestampArrayOid = 1115
|
|
||||||
DateArrayOid = 1182
|
|
||||||
TimestampTzOid = 1184
|
|
||||||
TimestampTzArrayOid = 1185
|
|
||||||
RecordOid = 2249
|
|
||||||
UuidOid = 2950
|
|
||||||
JsonbOid = 3802
|
|
||||||
)
|
|
||||||
|
|
||||||
// PostgreSQL format codes
|
// PostgreSQL format codes
|
||||||
const (
|
const (
|
||||||
TextFormatCode = 0
|
TextFormatCode = 0
|
||||||
|
|
Loading…
Reference in New Issue