# how to specifty output format other than XML for liquibase command line tool?

**URL:** https://forum.liquibase.org/t/how-to-specifty-output-format-other-than-xml-for-liquibase-command-line-tool/2387
**Category:** General Discussion
**Created:** [August 22, 2013, 3:19am UTC](https://forum.liquibase.org/t/how-to-specifty-output-format-other-than-xml-for-liquibase-command-line-tool/2387 "2013-08-22T03:19:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Vitaliy](https://avatars.discourse-cdn.com/v4/letter/v/4bbf92/32.png) [@Vitaliy](https://forum.liquibase.org/u/Vitaliy)
#### Post date: [August 22, 2013, 3:19am UTC](https://forum.liquibase.org/t/how-to-specifty-output-format-other-than-xml-for-liquibase-command-line-tool/2387/1 "2013-08-22T03:19:00Z")

</div>

Hi  
  
how to specify output format other than XML for liquibase command line tool?  
  
e.g. I want to use SQL or JSON as an output.  
  
it seems that [http://www.liquibase.org/documentation/command\_line.html](http://www.liquibase.org/documentation/command_line.html) is missing this parameter?  
  
Thanks in advance for response,&nbsp; and MANY MANY THANKS for developers for the great application!  
  
Regards,  
Vitaliy

---

<div class="post-metadata">

### Author: ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)
#### Post date: [August 22, 2013, 3:19am UTC](https://forum.liquibase.org/t/how-to-specifty-output-format-other-than-xml-for-liquibase-command-line-tool/2387/2 "2013-08-22T03:19:00Z")

</div>

You are talking about the generateChangeLog or diffChangeLog command, right?&nbsp;

It should chose the correct type based on the file extension, so you can use .json or .yaml. There isn’t support to generate an sql-based changelog at this point.

Nathan

---

<div class="post-metadata">

### Author: ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forum.liquibase.org/u/Guest)
#### Post date: [August 22, 2013, 3:19am UTC](https://forum.liquibase.org/t/how-to-specifty-output-format-other-than-xml-for-liquibase-command-line-tool/2387/3 "2013-08-22T03:19:00Z")

</div>

When I try to create .json and .yaml files it generates the files but they are empty. &nbsp;I’m using the same command that generates an .xml file just changing the extension.

liquibase --driver=org.postgresql.Driver --changeLogFile=db.changelog.yaml --url=“jdbc:postgresql://192.168.1.94:5432/postgres” --username=user --password=password --defaultSchemaName=ADMIN generateChangeLog

One thing I notice is when I run liquibase --version I get&nbsp;Liquibase Version: 3.0.0-SNAPSHOT even though I downloaded both&nbsp;

---

<div class="post-metadata">

### Author: ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)
#### Post date: [August 22, 2013, 3:19am UTC](https://forum.liquibase.org/t/how-to-specifty-output-format-other-than-xml-for-liquibase-command-line-tool/2387/4 "2013-08-22T03:19:00Z")

</div>

Good to hear Liquibase is working well for you.

Yes, if you use the formatted sql style, liquibase will just execute the sql listed. &nbsp;

The trouble with generating actual SQL as the output is that it is going to vary depending on the target database. Normally to add support for a new output format you need to add a new ChangeLogSerializer implementation and then override the needed methods. They are just passed the Changes needed to “fix” the database but no Database reference. You should be able, though, as part of the serialize method call the SqlGeneratorFactory with the passed Change and a mock Database instance to get the actual SQL and return that from the serialize method.&nbsp;

I would guess it would maybe take a day or so to get figured out.

Nathan

---

<div class="post-metadata">

### Author: ![vitaliy.se](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@vitaliy.se](https://forum.liquibase.org/u/vitaliy.se)
#### Post date: [August 22, 2013, 3:19am UTC](https://forum.liquibase.org/t/how-to-specifty-output-format-other-than-xml-for-liquibase-command-line-tool/2387/5 "2013-08-22T03:19:00Z")

</div>

Thank you for the fast reply and for the product Nathan.

Am I right that the SQL commands &nbsp;in a change log written in SQL format will be executed as is?

How many developer hours do u think are needed to implement exporting in SQL format?

With many… many… thanks for the great application and support,

Vitaliy&nbsp;

---

<div class="post-metadata">

### Author: ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)
#### Post date: [August 22, 2013, 3:19am UTC](https://forum.liquibase.org/t/how-to-specifty-output-format-other-than-xml-for-liquibase-command-line-tool/2387/6 "2013-08-22T03:19:00Z")

</div>

Shoot. Apparently the json/yaml specific methods to actually write the changesets did not make it into 3.0. I created&nbsp;[https://liquibase.jira.com/browse/CORE-1404](https://liquibase.jira.com/browse/CORE-1404)&nbsp;to track the fix.

Nathan
