On Tue, Sep 15, 2020, at 12:02 AM, sonsshh wrote:
> Hi Mike,
>
> My use case involves receiving a lot of data over the network, processing on
> the model and persisting them.
> Therefore, using the manual approach would be quite inefficient.
session.merge() is not any more efficient than what
Hi Mike,
My use case involves receiving a lot of data over the network, processing
on the model and persisting them.
Therefore, using the manual approach would be quite inefficient.
Currently I have to use raw sql and session.execute(), is this the only way?
Is there any other way for example
you would need to accomplish this manually.
existing_obj = session.query(MyClass).get(obj.id)
if existing_obj is not None:
existing_obj.links.extend(obj.links)
obj = session.merge(obj)
On Sat, Sep 12, 2020, at 3:45 AM, sonsshh wrote:
> Hi,
>
> I'm trying to change the behavior of
Hi,
I'm trying to change the behavior of Postgres ARRAY type when calling
*session.merge(obj)*
where *obj* has a *links *ARRAY(Text) column.
What I want is as below:
*obj = Obj(links=['link2'],...)*
*in DB I have obj row already and obj.links=['link1']*
*session.merge(obj)*
*