I see that LiquiBase is being ported to .NET. But from what I’ve been able to gather, it seems like I should still be able to use the Java version in a .NET environment. Is that correct? Since all it is doing is maintaining my database schema and otherwise doesn’t really interact with my dev process, it seems like I should be able to use it.
If that is the case, what is the main goal of the .NET port? Just for people who prefer to not install the JRE?
Thanks.
Yes, you can use liquibase fine no matter what other technologies you use. You do need to install the java runtime, but once you do that, you can run liquibase just like any other command line application.
The main advantage that a real .net port would give you is the ability to integrate it into your .net execution environment more directly. In java, for example, we can pass our web server managed database connection to liquibase on server startup, write liquibase extensions in java, etc. It would be nice to do similar things in .net, plus remove the java-ish things like jdbc urls that sometimes confuses developers that haven’t looked at them before.
Nathan
Excellent, just what I wanted to hear. Thanks Nathan.
Hello @nvoxland,
For some reason there’s no documentation on running liquibase inside .Net Core.
How would I run migration commands directly in .NET?
I would like to do something like this:
Liquibase liquibase = new Liquibase()
liquibase.runUpdates() ?
Ability to create a runner class and run commands
// create the Liquibase runner object
var runner = new CommandLineRunner();
// configure the runner properties
runner.SetChangeLog("path/to/changelog.xml");
runner.SetUrl("jdbc:postgresql://localhost/mydatabase");
runner.SetUsername("myusername");
runner.SetPassword("mypassword");
// run Liquibase
runner.Run();
There is a Nuget available NuGet Gallery | Liquibase.Cli 4.21.1, however, adding it to the project, it doesn’t detect the package
Can you point me to some .NET Core documentation of Liquibase.