Re: MDB getTextDeclaration

From: Date: Fri, 28 May 2004 11:12:25 +0000
Subject: Re: MDB getTextDeclaration
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-29770@lists.php.net to get a copy of this message
Ivan Montes wrote:
"Lukas Smith" <smith@backendmedia.com> wrote in message news:40B6E560.5040808@backendmedia.com...
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?).
Yes, it already uses Text when the Length is not set. This is how my overloaded getTextDeclaration() method for MySql looks like: function getTextDeclaration($name, $field) { $qry = $name; if ($field['length']>0 && $field['length']<64) //length<64 -> CHAR
    $qry .= " VARCHAR ({$field['length']})";
else if ($field['length']>64 && $field['length']<256) //64<Length<256 -> VARCHAR
    $qry .= " CHAR ({$field['length']})";
else //perhaps perform a check if length>64Kb then use a BLOB type
    $qry .= " TEXT";
$qry .= (isset($field['default']) ? ' DEFAULT ' . $this->getTextValue($field['default']) : '') . (isset($field['notnull']) ? ' NOT NULL' : ''); return $qry; }
could you open a bug report with this code?
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.
Well it looks like you are focused in MDB2 :) So is MDB2 useable yet? The project I'm doing is for a website with 50K unique hits a day so I need to make sure performance is not too bad and the API is not gonna suffer continuous changes.
then MDB2 is not yet ready for you 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 (#29770) next »