Giter VIP home page Giter VIP logo

Comments (4)

rbock avatar rbock commented on July 19, 2024

On 2014-09-22 21:13, Thomas marsh wrote:

SQLite supports the "INSERT OR REPLACE" syntax for MERGE statements.
It doesn't look like this is supported in sqlpp11. Are there plans to
add this?


Reply to this email directly or view it on GitHub
#16.

As far as I can tell, INSERT OR REPLACE is not equivalent to MERGE
because it replaces ALL columns, not just those which are given in the
statement. Thus, INSERT OR REPLACE should be added to the sqlite connector.

That should be very simple, copy insert.h, move it into the sqlite3
namespace, replace the insert_t struct with an insert_or_replace struct
and add an insert_or_replace method. You might want to give that a try
(and send a pull request afterwards).

Otherwise, it will probably take a few more days :-)

Best,

Roland

from sqlpp11.

rbock avatar rbock commented on July 19, 2024

I just pushed a few commits to the develop branch of the sqlite3 connector. They give you insert_or_replace_into and insert_or_ignore_into, see tests/Sample.cpp (last two statements).

Please check and let me know.

from sqlpp11.

thomasmarsh avatar thomasmarsh commented on July 19, 2024

This looks good. Thank you for implementing that!

from sqlpp11.

rbock avatar rbock commented on July 19, 2024

Thanks for the request and the review.

It is the first extension of this kind. I am glad it worked out exactly as I had expected (and advertised at CppCon) :-)

from sqlpp11.

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.