[development] Form field maxlengths vs. database field sizes

Chris Johnson chris at tinpixel.com
Thu Feb 9 04:28:16 UTC 2006


Adrian Rossouw wrote:

>
> On 08 Feb 2006, at 6:22 AM, Karthik wrote:
>
>> This issue stems from Killes' comment [
>> http://drupal.org/node/46306#comment-71971 ]. Should form field
>> maxlengths be consistent with corresponding database field sizes or
>> should unicode encoding be accounted for?
>
> Drupal has no way of knowing what the field size of the database is,
> and as such the forms api can't take that into account.


It does not presently, but Drupal could know the field sizes in the 
database tables.  However, is that worth doing?  (I'm presently 
developing a database abstraction layer for my employer where the db 
layer figures out the metadata, like field sizes, on the fly so that the 
applications need not know anything at all about it.)

..chrisxj


More information about the development mailing list