Xata Dashboard error when trying to delete a file

Hi 👋 I remember this working a few months ago, but now I'm getting an error whenever I try to update a record in the Dashboard that has a file. The error message:
Error updating record
invalid SQL: cannot update file and array type directly, use Xata API instead
Error updating record
invalid SQL: cannot update file and array type directly, use Xata API instead
Is this a bug or am I doing something wrong?
13 Replies
cmck
cmck5w ago
Hi Michael, I've not been able to recreate this error when editing records with files. Are you updating the record directly via the UI or through the playground?
Michael Schaufelberger
Hi cmck Directly via the UI. I clicked the pencil icon in the record, clicked on the image, clicked the trash icon, confirmed the deletion and tried to save the record, which failed.
cmck
cmck5w ago
Hmm, let me take another look, thanks for bearing with me. Do you have a request ID you can share, by any chance?
Michael Schaufelberger
Sure, it turns out, that I can't even save the record even if I don't make any changes. c8ebc55b-c219-97b0-b4d9-ecc25b28a05e
cmck
cmck5w ago
Thanks Michael, I'll have a look now and see what the story is.
Michael Schaufelberger
Same error when trying to create a fresh record: 4043c709-d726-94f1-a1a3-eb535eb899ff
cmck
cmck5w ago
Ok I was able to recreate the error. It's related to the Native SQL Table setting. If you disable this setting you'll be able to update the row with the file attachment. You can then re-enable this setting after making the edits.
Michael Schaufelberger
Where can I find this setting? Nvm, I found it. I'll check if it works now Btw, this solved the issue. Could you briefly explain the downsides of keeping this disabled?
cmck
cmck5w ago
Glad to hear it's resolved. Keeping it disabled means you have to have xata columns in all your databases and there's less support for postgres native types. I'll see if I can dig up some examples for you, Michael.
Michael Schaufelberger
That would be great, thanks! We would like to eventually move away from having to have all the Xata fields, though it's not much of an issue. I know you are working on that. Are there any updates when we can drop those, or has something changed regarding this? In any case, we would like to be able to edit those special fields in the dashboard. It's a great way to not have to have an up-and-running Xata SDK implementation that enables file field updates. So: Is will this issue be fixed, even for the native sql table editor setting?
cmck
cmck4w ago
Are there any updates when we can drop those, or has something changed regarding this?
There's no update, we're still working on known issues around functions that require the Xata fields (such as bulk upsert, for example).
Will this issue be fixed, even for the native sql table editor setting?
In order to use Files, you have to have the Native SQL Table setting disabled. The issue you observed happened because we enabled this setting by default when we released the "new" table. We have no plans to develop the Files functionality further. To share a little context, we had a lot of difficulty integrating Files with the Native SQL Table, which is why we introduced the toggle so you can flip between the "old" and "new" table. Sorry for the long-winded explanation, I hope that clarifies things 🙂
Michael Schaufelberger
To share a little context, we had a lot of difficulty integrating Files with the Native SQL Table, which is why we introduced the toggle so you can flip between the "old" and "new" table.
This makes sense. Although, currently, the Native SQL Table is unusable if you have a single file field in the table you want to edit. Editing is basically blocked until you switch the setting. May I make a suggestion to skip/block updating the file fields when having the setting enabled? So we can at least edit the other fields.
cmck
cmck4w ago
May I make a suggestion to skip/block updating the file fields when having the setting enabled? So we can at least edit the other fields.
A fair point. This is something we're working on. 👍
Want results from more Discord servers?
Add your server