PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » MDB2 » Bug #3996

Get Column Types from DBMS

Details

Request #3996Get Column Types from DBMS
Submitted2005-03-29 20:06 UTC
Fromnick at silverorange dot com
Assignedlsmith
StatusClosed
PackageMDB2
PHP Version5.0.3
OSLinux
Roadmaps(Not assigned)

Comments

[2005-03-29 20:06 UTC] nick at silverorange dot com

Description:
------------
This patch makes use of php functions (pg_field_type, mssql_field_type, etc.) to get datatypes from a DBMS result. If types aren't passed into a query, the types are automatically assigned.

Currently implemented for MSSQL and PGSQL drivers.

The functionality of this maybe should be set as an MDB2 configuration option for backwards compatibility.

See patch:
http://worksintheory.org/files/pear/MDB2-types.diff

[2005-03-30 01:38 UTC] smith at backendmedia dot com

For now there is the tableinfo() method in the reverse module which should provide this kind of infos. I am planning on reworking the reverse module entirely. Actually its likely to become deprecated and instead the code will be split into the manager and datatype module. The manager module will optionally return the "raw" native datatypes instead of the mapping to MDB2 datatypes using the datatype module.

Let me know if the tableinfo() method does what you need for now.

[2005-04-04 16:26 UTC] nick at silverorange dot com

Here's a patch using the Reverse module which we'll be using. I'll post it here for you in case you want it, but it may be better to wait until the Reverse module is rewritten.

The important thing anyway is that it would be very useful to have the MDB2 type returned in addition to the raw native column type.

http://worksintheory.org/files/pear/MDB2-types-20050404.diff

[2005-04-05 07:02 UTC] smith at backendmedia dot com

Slightly bad timing. I dont know if you saw my recent commits? However I will look at your work and see if I can integrate it. One idea that comes to mind is optionally allowing getTableFieldDefinition() to optionally not do any mapping to mdb2 datatypes.

[2005-04-05 07:31 UTC] smith at backendmedia dot com

Ah I see what you did there. Lets see if I can integrate this with mapNativeDatatype() that I recently introduced in the datatype module.