denodrivers / postgres

PostgreSQL driver for Deno

Home Page:https://denodrivers.github.io/postgres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add missing postgres types mapping / decoders / parser

bombillazo opened this issue · comments

Is your feature request related to a problem? Please describe.

Data returned by the driver is serialized in a string by default. Semantically, some DB types (like cidr, macaddress, text) can stay as strings. However, other data can be represented by a native JS type or a JS data object representing the database value in JS land.

The following is a list of Postgres database type oids, with the unmarked ones indicating a decoder is not yet implemented by deno-postgres. Any unimplemented oid type is returned untouched as a string.

source

  • 16 : bool
  • 17 : bytea
  • 18 : char
  • 19 : name
  • 20 : int8
  • 21 : int2
  • 22 : _int2vector_0
  • 23 : int4
  • 24 : regproc
  • 25 : text
  • 26 : oid
  • 27 : tid (#228)
  • 28 : xid
  • 29 : _cid_0
  • 30 : _oidvector_0
  • 32 : _pg_ddl_command
  • 71 : _pg_type
  • 75 : _pg_attribute
  • 81 : _pg_proc
  • 83 : _pg_class
  • 114 : json
  • 142 : _xml_0
  • 143 : _xml_1
  • 194 : _pg_node_tree
  • 199 : json_array (#179)
  • 210 : _smgr
  • 325 : _index_am_handler
  • 600 : point (#185)
  • 601 : lseg (#233)
  • 602 : path (#235)
  • 603 : box (#234)
  • 604 : polygon (#236)
  • 628 : line (#232)
  • 629 : line_array (#232)
  • 650 : cidr
  • 651 : cidr_array
  • 700 : float4 (#444)
  • 701 : float8
  • 702 : _abstime_0
  • 703 : _reltime_0
  • 704 : _tinterval_0
  • 705 : _unknown
  • 718 : circle (#237)
  • 719 : circle_array (#237)
  • 790 : _money_0
  • 791 : _money_1
  • 829 : macaddr
  • 869 : inet
  • 1000 : bool_array (#189)
  • 1001 : byte_array (#189)
  • 1002 : char_array
  • 1003 : name_array
  • 1005 : int2_array
  • 1006 : _int2vector_1
  • 1007 : int4_array
  • 1008 : regproc_array
  • 1009 : text_array
  • 1010 : tid_array (#228)
  • 1011 : xid_array
  • 1012 : _cid_1
  • 1013 : _oidvector_1
  • 1014 : bpchar_array
  • 1015 : varchar_array
  • 1016 : int8_array
  • 1017 : point_array (#185)
  • 1018 : lseg_array (#233)
  • 1019 : path_array (#235)
  • 1020 : box_array (#234)
  • 1021 : float4_array (#444)
  • 1022 : float8_array (#227)
  • 1023 : _abstime_1
  • 1024 : _reltime_1
  • 1025 : _tinterval_1
  • 1027 : polygon_array (#236)
  • 1028 : oid_array
  • 1033 : _aclitem_0
  • 1034 : _aclitem_1
  • 1040 : macaddr_array
  • 1041 : inet_array
  • 1042 : bpchar
  • 1043 : varchar
  • 1082 : date
  • 1083 : time
  • 1114 : timestamp
  • 1115 : timestamp_array (#229)
  • 1182 : date_array (#231)
  • 1183 : time_array
  • 1184 : timestamptz
  • 1185 : timestamptz_array (#229)
  • 1186 : _interval_0
  • 1187 : _interval_1
  • 1231 : numeric_array - parsing to string[] due to limited JS number range (more info)
  • 1248 : _pg_database
  • 1263 : _cstring_0
  • 1266 : timetz
  • 1270 : timetz_array
  • 1560 : _bit_0
  • 1561 : _bit_1
  • 1562 : _varbit_0
  • 1563 : _varbit_1
  • 1700 : numeric - parsing to string due to limited JS number range (more info)
  • 1790 : _refcursor_0
  • 2201 : _refcursor_1
  • 2202 : regprocedure
  • 2203 : regoper
  • 2204 : regoperator
  • 2205 : regclass
  • 2206 : regtype
  • 2207 : regprocedure_array
  • 2208 : regoper_array
  • 2209 : regoperator_array
  • 2210 : regclass_array
  • 2211 : regtype_array
  • 2249 : _record_0
  • 2275 : _cstring_1
  • 2276 : _any
  • 2277 : _anyarray
  • 2278 : void
  • 2279 : _trigger
  • 2280 : _language_handler
  • 2281 : _internal
  • 2282 : _opaque
  • 2283 : _anyelement
  • 2287 : _record_1
  • 2776 : _anynonarray
  • 2842 : _pg_authid
  • 2843 : _pg_auth_members
  • 2949 : _txid_snapshot_0
  • 2950 : uuid
  • 2951 : uuid_array
  • 2970 : _txid_snapshot_1
  • 3115 : _fdw_handler
  • 3220 : _pg_lsn_0
  • 3221 : _pg_lsn_1
  • 3310 : _tsm_handler
  • 3500 : _anyenum
  • 3614 : _tsvector_0
  • 3615 : _tsquery_0
  • 3642 : _gtsvector_0
  • 3643 : _tsvector_1
  • 3644 : _gtsvector_1
  • 3645 : _tsquery_1
  • 3734 : regconfig
  • 3735 : regconfig_array
  • 3769 : regdictionary
  • 3770 : regdictionary_array
  • 3802 : jsonb
  • 3807 : jsonb_array (#179)
  • 3831 : _anyrange
  • 3838 : _event_trigger
  • 3904 : _int4range_0
  • 3905 : _int4range_1
  • 3906 : _numrange_0
  • 3907 : _numrange_1
  • 3908 : _tsrange_0
  • 3909 : _tsrange_1
  • 3910 : _tstzrange_0
  • 3911 : _tstzrange_1
  • 3912 : _daterange_0
  • 3913 : _daterange_1
  • 3926 : _int8range_0
  • 3927 : _int8range_1
  • 4066 : _pg_shseclabel
  • 4089 : regnamespace
  • 4090 : regnamespace_array
  • 4096 : regrole
  • 4097 : regrole_array

Describe the solution you'd like

Implement the missing type Oid parsers. node-pg-types can be used as inspiration for some of the type parsers.

Range types issue is discussed here: #61

If there is an error with the list, like a missing type or a type marked as implemented but not returning the correct JS type, please notify us so it can be updated.

Describe alternatives you've considered

N/A

Additional context

Related issues: #184