in reply to Re: Updating/inserting Binary data using DBIx::Class
in thread Updating/inserting Binary data using DBIx::Class

Yes, this is a common issue with binary column data and DBI. I recently added support for explicit bind_param() calls to Rose::DB::Object in order to support Postgres's BYTEA column type. (Unfortunately, Rose::DB::Object does not currently support DB2.)

Calling bind_param() explicitly incurs a small performance hit, since it must be called on every value in a given query, even if it's only strictly needed on just one. Although the DBI docs say that calling execute() with arguments calls bind_param() on every value anyway, my testing has shown that there is a difference between allowing DBI to do it and doing it manually.

The compromise I came up with in Rose::DB::Object is to explicitly call bind_param() only if one or more columns in a particular table requires it. This eliminates the performance hit for the common case of tables without any binary columns.

Replies are listed 'Best First'.
Re^3: Updating/inserting Binary data using DBIx::Class
by hrr (Monk) on Aug 22, 2006 at 21:04 UTC
    It is very interesting that you identify this as a common issue with binary column data! That, after a rigorous analysis, you were able to come up with an elegant compromise, raises my hopes that an implementation in DBIx::Class is not too far away :)