On 21/12/06, John Napiorkowski <[EMAIL PROTECTED]> wrote:

--- Carl Franks <[EMAIL PROTECTED]> wrote:

> On 20/12/06, Matt S Trout <[EMAIL PROTECTED]>
> wrote:
> > While I remember: can everybody with an active
> branch off -current sing
> > out and tell us
>
> "columns_info_for"
>
> > (1) what it's designed for
>
> Detailed column specs (as much as each database will
> provide).
> Primarily designed for use by form validators - to
> allow automatic
> length / datatype constraints based on the column
> type.
>
> > (2) where it's up to
>
> mysql support.
> enum handling needs changed to how sqlfairy does it.
>
> > (3) when you expect it to be ready for audit
> before merge to -current
>
> Need to find time to learn how dbix-class does tests
> - and write some.
> Would be good to also add support for at least
> SQL::Lite, to see if
> chosen column attribute names make sense outside of
> mysql.

Carl,

Seems like some of this could overlap with my needs,
since I created a 'bind_attribute_by_data_type' method
in package 'DBIx::Class::Storage::DBI' where I let a
storage driver provide the required binding attributes
for a particular column type.  Right now I just have
some dumb mapping for the Pg driver.  Basically what
this method does is take a look at the data_type
attribute out of col_info and returns the correct
hashref that DBI->bind_param wants.

How is you new 'columns_info_for' method accessed?

columns_info_for() isn't a new method, it's just overridden, to allow
the db engine to provide more detailed info.

Right now my code rewrites the insert and update
methods to pass the entire result source so that I can
do: $source->column_info($column)->{data_type} and get
something meaningful I can map to.

It doesn't change {data_type}
it adds extra attributes, such as 'default_value', 'is_nullable',
'is_unsigned', the max/min range for integers + floats, the set of
values for an enum, etc...

Is part of what you are trying to do potentially able
to return the bind constant?  I know that Oracle has
that information in it's tables somewhere.  I'll see
if Postgresql does as well.

Don't know anything about that :)

Carl

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to