10-15-2024, 02:35 PM
(10-15-2024, 01:26 AM)linda Wrote: Additional information for each blob can be stored in user-created keys in the "cdbBlobs" table.
Thanks Linda,
I was a bit concerned about doing this because when I attempted this exact thing in LiveCloud recently, the LiveCloudManager became unresponsive and it was impossible to add or remove tables to the project. I could only "fix" this by deleting the entire project. I tried this 3 times with failures every time, requiring me to delete the entire project to be able to use LiveCloud again.
My assumption was (perhaps incorrectly from what you’re saying) that it wasn't possible to add keys to the cdbBlobs table.
So you see my concern... I work around it by creating a kind of join table that contains the cdbRecordID for the blob and the filename that was used to create said blob.
However if you say this is valid and will not cause issues, I'll explore it again with Appli in the first instance, before re-trying LiveCloud (although not sure why that would be different...).
(10-15-2024, 01:26 AM)linda Wrote: In Appli, the "get result" action from the "database" category can be used to check whether actions that call CanelaDB are successful or not. This can be done in LiveCloud and is the equivalent of the "cdb_result" API. True will be returned if the call was successful and false if it was not.
Yes - I do use this a lot in LiveCloud/LiveCode.
But with batch uploading blobs, it takes ages for liveCloud to actually show that something has been uploaded (in my example, uploading 98 short videos it showed 6, then after a while 24 then after about 5-10 minutes the 98 videos had been uploaded.
Given that I want to associate each upload with the filename of the blob passed to the createBlob handler (again, not sure why this isn't just a key in LiveCloud since the information is already passed to the function...), and given that uploads appear deferred to the future, if I attempt to add a value to a record that doesn't yet exist won't that cause a problem?
In liveCloud I poll the result with a recursive “send In time” handler to ensure that the record count in LiveCloud is equal to the number of elements of the array that contains the data to upload and only create a join table as above once the batch upload has finished. But again I ran into errors and found the only reproducible way was to upload 1 blob at a time and then create 1 joint table row at a time which is a bit slower.
Or maybe I’m making errors somewhere - I’ll have to double check. In the mean time the script I posted works…
Many thanks for taking time to look into this,
Stam