How to read/write blobs with mysqldb?

  • Thread starter Christopher J. Bottaro
  • Start date
C

Christopher J. Bottaro

First off, writing the blob. From what I gather on the internet, I'm
suppose to read the entire file into memory (a Python string), then create
a dbiRaw object with that string and use the dbiRaw object in an insert
statement?

That doesn't sound very efficient to me. What if my computer only has 64 MB
of memory and the data I want to insert is 128 MB?

It seems like there should be a way to read part of the data, insert that
part into the DB, then get the next part, append, etc.

Also, what if you are inserting a huge piece of data, like a GB, and you
want to have a progress bar in your UI? How would you do that if you
couldn't split up the insert statements?

Thanks for the help.
 
P

Paul Rubin

Christopher J. Bottaro said:
That doesn't sound very efficient to me. What if my computer only has 64 MB
of memory and the data I want to insert is 128 MB?

Don't use such large blobs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top