FirebirdDbComparer is a .NET library that allows comparing of two Firebird databases and producing alter script to get the target database to the sources’ structure.
Firebird 2.5 (any edition) is supported. Firebird 3.0 (any edition) is supported.
The library targets .NET Framework 4.8, .NET Standard 2.0 and .NET 5.0.
FirebirdDbComparer.Compare.Comparer.ForTwoDatabases providing connection strings (in .NET (FirebirdClient) format) for source and target and
IComparerSettings where you can specify server version you’re going to use and whether or not to ignore permissions on database objects. The
Compare method then gives you the result as a
CompareResult, where you can find the statements structured as well as just a list.
TestApp to see it in action.
The alter script is aimed to use only what Firebird permits (no direct changes in system tables) and breaking dependencies chain as early as possible to avoid long scripts. The script should look familiar as if you’d have written it manually. That means, we expect this library to be used by sane developers.
Because it’s a library you can take the output, which is structured (not a single string), and do whatever you need to – save to file, execute one by one, etc.
The library is heavily tested with hundreds of tests and used in production since 2015, giving us confidence it works in wide range of scenarios.
Keep it working
It took a lot of man-days to have the library in the current state. Although the work was sponsored by SMS-Timing, we’re not keeping the library for ourselves. We’re providing it for free and we expect you to honestly decide how to contribute back. It might be just sending an email and saying thank you. Or providing a good bug report. Or using the “Donate” button below. Whatever works for you. Just keep it honest.