expfactory / expfactory-docker

container for deploying behavioral psychology experiments

Home Page:http://www.expfactory.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

saving BLOB into database

tfeige91 opened this issue · comments

Hi Vanessa,

we are about to implement a verbal fluency test where participants should verbally speak as many words in a given time (60s).
We want to record this and save it to the database (as a BLOB I guess).

Right now Expfactory is saving every data as a single string into the 'data' column, right? Is there a way to extend this to have another column the blob file would be saved to?

Kind regards,

Tim

Can you be more specific about this blob? I'm guessing you are referring to a BLOB type for sqlite, and for postgres it's (I think) called a Binary Data field.

First, can you be specific if you are using expfactory-docker here, or expfactory at https://github.com/expfactory/expfactory? They are very different.

Sorry. I use the Expfactory docker and save to a mysql Database.

Yes, I am refering to the BLOB datatype. Maybe it is fine to save as a string and create the blob later on?

(I'm new to all this. Sometimes it needs some time to sink in 😊)

You could definitely try saving as a string, and then converting later - I've tried this before with a different kind of blob (an OCI manifest) and wound up finding it easier to change to the BinaryField instead. I'm not a developer here anymore, but my intuition is that this would be a special use case that you'd best implement on your branch. if you want to give this a shot I'd first add a binarydata field alongside taskdata in turk.models.Result, and then you'd need to add logic where sync is done to check for the additional data (or something about the sync that indicates it's present) and then save to that field.