[Dbix-class] Accessing $dbh for blobs/large-objects
jjn1056 at yahoo.com
Wed May 10 10:34:19 CEST 2006
--- Jesper Krogh <jesper at krogh.cc> wrote:
> > I've only been using this toolkit for about a
> > but I am also running Postgres8.1 and had had no
> trouble accessing BLOB
> > type fields using a bytea data type and the normal
> DBIx accessors, like
> > $"result_row->blob". However I haven't tried to
> > megabytes of stuff yet. So I think it 'just
> works' the way you might hope,
> > although I am sure someone with more experience on
> the system will have
> > more informed thoughts than I.
> Storing data to BYTEA does _not_ work currently.
> Retrieving works
> flawlessly, since there is not changes to be done.
> (perldoc DBD::Pg)
> For storing BYTEA, I currently add a method to the
> individual class that
> does the magic on the database-handle. Works
> flawlessly and gives me
> "lazy" loading
> of the BYTEA-columns too, which (I think) is
> generally desireable.
You're right, it doesn't work if your data runs longer
than 4000 bytes. At least I discovered it to be so on
the system I am using. Since I used for small stuff
like web session data I never noticed.
I'll be watching this thread with interest since this
is something I'll eventually need. I had a similar
problem back when I was using Oracle (and when I was
using straight DBI + SQL) I had to write some
function to stream the data in/out from blob columns.
Guess I'll need the same thing for here.
One thing that great about DBIx is that I'll be able
to add inflator/deflators for blobs that are images or
videos to automatically create EXIF and media
metadata. The project I am working on will need
eventually need to stream video, allowing you to
choose an index point to start the stream. Sounds
like you might be doing something similar ? --john
> Jesper Krogh
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
More information about the Dbix-class