Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Re : How to dump data as SQL from the liquibase Java API?

$
0
0
So far I've done this (liquibase is a Liquibase object that already has been used to set up the schema)
  1.         CatalogAndSchema catalogAndSchema = null;
  2.         DiffToChangeLog changeLogWriter = null;
  3.         PrintStream outputStream = new PrintStream("dbdump.sql");
  4.         Class<? extends DatabaseObject>[] snapshotTypes = (Class<? extends DatabaseObject>[])new Class[1];
  5.         snapshotTypes[0] = Data.class;
  6.         liquibase.generateChangeLog(catalogAndSchema, changeLogWriter, outputStream, snapshotTypes);
 but it NPEs in this line in SnapshotGeneratorFactory.createSnapshot() because examples is an array with a single element, containing a null:
  1.             examples[i] = examples[i].customize(database);
I had hoped that when using a null catalogAndSchema I would just use the database I already had set up and populated with data....?

Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>