Re: MDB getTextDeclaration

From: Date: Fri, 28 May 2004 07:08:16 +0000
Subject: Re: MDB getTextDeclaration
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-29766@lists.php.net to get a copy of this message
Ivan Montes wrote:
I like the idea of the DB schema in xml but I feel like it's a bit limited when it comes to text fields. AFAIK mysql has a limited length of 256 for char and varchar and Oracle has 2000 for the varchar2 type. I don't know about others but I guess they have different limits. The problem is that I've been defining some fields of lengths 300 and 512 but MDB assumes that it must be of type "char" when I use a length. The getTextDeclaration function is defined in common.php and not overloaded by the drivers. Would it be bad if it was defined for every driver? So for example in MySQL if the length is minor to 256 then a varchar can be used, otherwise it's declared as Text. In Oracle from 256 to 2000 gets defined as varchar2 and if bigger as Text.
Not likely to happen in MDB unless I can make sure I dont break BC (are you essentially asking that MySQL uses Text for text fields with more than 256 chars?). I may explore this for MDB2. MDB2 makes modifications to the datatype conversion easier since it splits the code out into a separate class. Essentially with MDB you should be using a max length of 256. Anything above that needs to be a clob. This is a bit clumsy as the LOB API is a bit verbose in MDB. Its much simpler in MDB2. regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

« previous php.pear.dev (#29766) next »