Code Monkey home page Code Monkey logo

Comments (3)

kasium avatar kasium commented on September 27, 2024 1

Hi, I guess beside not using UPSERT but a kind of UPDATE/SELECT/INSERT combination with exception handling, I'm not aware of other options than adding support for UPSERT in sqlalchemy-hana. I'm currently busy working on cleanup tasks, but I can have a look in the following weeks

from sqlalchemy-hana.

kasium avatar kasium commented on September 27, 2024

@therhaag I did some research and I guess we need to make a difference between SQLAlchemy core and SQLAlchemy ORM.
For SQLAlchemy core, the only way is a manual approach using SELECT, INSERT and UPDATE. Not nice and it has some roundtrips. For this, we could build an UPSERT construct.

For SQLAlchemy ORM using the Session API on the other hand it's not quite easy, because how sessions work. For this, I would recommend using session.merge. I also found a blog explaining the idea.

So let's focus on SQLAlchemy Core. I guess it makes sense to invent a completly new construct, because neither insert nor update have a similar syntax compared to UPSERT.

As said, I'm happy to work on this in the next weeks but to be transparent, It will most likely somewhen in January. If you like you can also try to open a PR

from sqlalchemy-hana.

kasium avatar kasium commented on September 27, 2024

@therhaag 1.2.0 was just released 😄

from sqlalchemy-hana.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.