# programatically call liquibase for data diff?

**URL:** <https://forum.liquibase.org/t/programatically-call-liquibase-for-data-diff/3387>\
**Category:** General Discussion\
**Created:** [July 15, 2016, 4:54pm UTC](https://forum.liquibase.org/t/programatically-call-liquibase-for-data-diff/3387 "2016-07-15T16:54:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JiHu](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@JiHu](https://forum.liquibase.org/u/JiHu)\
**Post date:** [July 15, 2016, 4:54pm UTC](https://forum.liquibase.org/t/programatically-call-liquibase-for-data-diff/3387/1 "2016-07-15T16:54:00Z")

</div>

Hi, I have read a similar post,&nbsp;[https://forum.liquibase.org/topic/is-it-possible-to-generatechangelog-difftypes-data-programatically,](https://forum.liquibase.org/topic/is-it-possible-to-generatechangelog-difftypes-data-programatically,) for generating data diff changelogs in java/junit code. I tried a similar way in my code with Liquibase 3.4.2 and set DiffTypes in code (code attached). However it did not work.

  

I am not sure if I set the DiffTypes correctly and wonder if this version of Library supports data diff or which version is capable of? Thanks.

  

- Diff DB

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;new DiffToChangeLog(finalDiffResult, new DiffOutputControl(false, true, true)).print(new PrintStream(output));

---

<div class="post-metadata">

**Author:** ![un1382561729492r88id](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@un1382561729492r88id](https://forum.liquibase.org/u/un1382561729492r88id)\
**Post date:** [July 15, 2016, 4:54pm UTC](https://forum.liquibase.org/t/programatically-call-liquibase-for-data-diff/3387/2 "2016-07-15T16:54:00Z")

</div>

When you say it “did not work”, could you be more specific? What did you expect to happen? What actually happened? Was there an error message?&nbsp;

Also, that link does not work - when I click it I get a ‘404 not found’ page.

Steve Donie  
Principal Software Engineer  
Datical, Inc. [http://www.datical.com/](http://www.datical.com/)

---

<div class="post-metadata">

**Author:** ![un1468574160748r9id](https://avatars.discourse-cdn.com/v4/letter/u/dbc845/32.png) [@un1468574160748r9id](https://forum.liquibase.org/u/un1468574160748r9id)\
**Post date:** [July 15, 2016, 4:54pm UTC](https://forum.liquibase.org/t/programatically-call-liquibase-for-data-diff/3387/3 "2016-07-15T16:54:00Z")

</div>

&nbsp;I tried including “data” in Difftypes parameter and inserting data in DB, then run my diff code against a null DB. However, I could see diffs of schema but no content diffs.&nbsp;

This happened by comparing both DBs and snapshots.

The link is at&nbsp;[http://forum.liquibase.org/topic/is-it-possible-to-generatechangelog-difftypes-data-programatically](http://forum.liquibase.org/topic/is-it-possible-to-generatechangelog-difftypes-data-programatically)

Thanks.

---

<div class="post-metadata">

**Author:** ![un1382561729492r88id](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@un1382561729492r88id](https://forum.liquibase.org/u/un1382561729492r88id)\
**Post date:** [July 15, 2016, 4:54pm UTC](https://forum.liquibase.org/t/programatically-call-liquibase-for-data-diff/3387/4 "2016-07-15T16:54:00Z")

</div>

It appears that you may need to call the method DiffOuitputControl.setDataDir() to get the data in the output.&nbsp;

Steve Donie  
Principal Software Engineer  
Datical, Inc. [http://www.datical.com/](http://www.datical.com/)
