[Dbix-class] RFC for moving the column type inference out from runtime

Zbigniew Lukasiak zzbbyy at gmail.com
Tue Jun 27 15:06:54 CEST 2006


Dear all,

The code inferring column types by querying the database causes numerous
issues and I would like to move it from the runtime
(DBIx::Class::ResultSource) to the DBIx::Class::Loader.  The reasons for
this are following:

1) The DBIx::Class schema objects are quite independent from the database so
you can have a schema that is not connected to a database or connected to a
database that does not have the tables that you declare (this last is case
is happening in t/cdbi-t/01-columns.t).  I can imagine that one could also
clone a schema and connect it to a different database with different types.
This all creates many exceptions and complicates both the code design and
the usage documentation.

2) For efficiency we cannot query the database about the column type each
time user accesses the type field - but rather cache the first answer.  This
is even further complicated by the cases when the database does not return
the column info because of for example the wrong case of the column name.

This all should be much cleaner if we rely only on the types explicitly
declared in the schema classes or built by the Loader.

I need your feedback to decide if such a move would not break to much code
relying on the current functionality.

-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/dbix-class/attachments/20060627/efabe09d/attachment.htm 


More information about the Dbix-class mailing list