will / crystal-pg

a postgres driver for crystal
BSD 3-Clause "New" or "Revised" License
463 stars 78 forks source link

Make column_type_oid return oid and introduce PG::Type::*OID constants #153

Closed sanderhahn closed 5 years ago

sanderhahn commented 6 years ago

Was looking for a way to reflect on the type of the column returned by a ResultSet and found the column_type method. However using it resulted in a compile error, maybe because of changes in how decoders are registered. This PR will make it return oid information from the pg_type table.

bcardiff commented 6 years ago

Actually the column_type is no longer used by crystal-db so for now it can even be removed. But if preserved at least in this adaptar it is weird that for the return type to be a tuple.

sanderhahn commented 6 years ago

Changed the column_type to return an oid value and introduced constants for the pg_type for easy reference.