Menu

#230 Upsert support

(future)
pending
nobody
upsert (1)
6
2019-04-09
2019-04-08
No

I'm working on a project where we use Apache Phoenix library for HBase access. In that implementation operations like "Insert" or "Update" don't exist, but a "Upsert" is present instead. It updates data, if it is present in DB, or inserts, if such record wasn't found. Because of this I can't use dbunit to prepare my test DB, since dbunit doesn't support it.

Discussion

  • Jeff Jensen

    Jeff Jensen - 2019-04-08
    • status: open --> pending
     
  • Jeff Jensen

    Jeff Jensen - 2019-04-08

    dbUnit uses SQL over JDBC so it supports SQL/traditional databases. Someone would have to implement support for NoSQL or you would use an existing adapter/product from JDBC to NoSQL.

    Potentially, the dbUnit DatabaseOperation helps you for refreshing data if you find an approach.

     
  • Emiliia Nesterovych

    For implementing custom upsert operation it would be nice to inherit it from "InsertOperation", because the SQL is build in same way, as for Insert just with replacing of "insert" with "upsert" in SQL. But because "InsertOperation" class's constructor is package-private I can't inherit from it.
    Could it be made public? Should I create a pull request for this?

     
  • Emiliia Nesterovych

    Or, maybe, I can contribute a complete UpsertOperation class.

     
    • Jeff Jensen

      Jeff Jensen - 2019-04-09

      It's great you have knowledge and setup to solve. Yes, please create a merge request of a solution with tests - unit tests for general logic and DB integration tests to prove it works with a DB (we'll want to make new Docker setups for each DB to test the Upsert with). Please also refer to Developer's Guide

       
  • Emiliia Nesterovych

    Ok, thank you :)

     
Monday.com Logo