Closed alagos closed 6 years ago
hi - cool to see the custom data store.
Because of the simplicity of the datastore interface, yes it will be expensive to get the name like you say.
The usual workaround is to store the name separately, outside the store, e.g. if you're using Rails you'd use the name
magic attribute http://markevans.github.io/dragonfly/models#magic-attributes by simply adding the image_name
column as well as the image_uid
you already have.
Is this something you can do in your case?
@markevans sorry for late reply, but at the end I added an extra field for metadata, because the problem was not only with name, but also with filesize. Maybe not the best solution, but at least fixed my problem
I'm developing a custom store for azure and so far is working, but I'm having a perfomance issue. My
.read
method is like this one:This is returning the meta and the data as it is described in the docs. The bad thing is that the
.get_blob
method downloads the complete file when I just need the file name contained in the meta. Imagine the scenario of a message with many attachments and I just want to display the filenames for each of those attachments, currently is downloading each of the files without needing it. Good thing is the azure gem has a.get_blob_properties
method to only request the meta info, but I don't find a way to make this work with the.read
method. Any suggestion?