Push into an existing array with xata's SDK
Hi, I'm using Xata's SDK for python to create new rows into my db, right now we try to find a solution to push new floats into a price array, but i can't find how to do it with Xata SDK without having to fetch all the information one by one. As this is a basic function on Postgres, i was wondering if it's not yet implemented onto the SDK. Thanks in advance.
2 Replies
To clarify, we are using xata.records().transaction({"operations": batch}) to upsert the records, and works flawlessly, but i think in case of an array, its going to just delete the current "price" instead of adding a value to the array.
Hi Craft, thanks for reaching out. Let me look into this and see if there's an existing method or workaround, thanks for bearing with me.
Hi Craft, I can confirm that array pop and push within bulk upsert is a limitation in Xata. The workaround for the moment is to fetch the array and overwrite as you have been doing.