LiteMigrator is a tiny cross-platform SQLite migration framework for .NET cross-platform applications using (.NET Standard). This library was built for use with .NET MAUI 🐒, Avalonia, and Uno projects. So it needs to be quick, simple, and reliable when managing databases.
LiteMigrator takes a "migrate-up" approach. In most app deployments, we usually move forward and rarely downgrade (consider app stores). This helps keep the library small and nimble. Previously known as, SQLiteMigrator.
Breaking Change from 0.6.x to now:
Namespace changed from
Xeno.LiteMigrator
toLiteMigrator
Brought to you with nerd-love by Suess Labs, sponsored by Xeno Innovations.
Check out the .NET MAUI article on file system helpers for where you can store your files.
Platform | Status |
---|---|
Windows | Yes |
Linux | Yes |
Android | Yes |
iOS | Yes |
Contribute today and get your platform supported 👍
Get LiteMigrator on NuGet today!
Detailed instructions can be found on the Using LiteMigrator wiki page.
- Add LiteMigrator project to your solution
- Create a folder in your solution to hold the scripts
- Add SQL files as Embedded Resources
- You must use the naming convention, "YYYYMMDDhhmm-FileName.sql"
- Wire-up the controller
var scriptNamespace = "MyProject.Namespace.Scripts";
using (var migrator = new LiteMigration(
"c:\\path\\to\\sqlite.db3",
scriptNamespace,
Assembly.GetExecutingAssembly()))
{
bool isSuccessful = await migrator.MigrateUpAsync();
}
public async Task InstallMigrationsAsync()
{
// Your EXE/DLL with the scripts
var dbPath = @"C:\TEMP\MyDatabase.db3";
var migsNamespace = "MyProjNamespace.Scripts";
var resourceAssm = Assembly.GetExecutingAssembly();
var liteMig = new LiteMigration(dbPath, migsNamespace, resourceAssm);
bool = success = await liteMig.MigrateUpAsync();
// Required after v0.6
liteMig.Dispose();
}
Give it a test drive and support making LiteMigrator better :)
- Fork on GitHub
- Create a branch
- Code (and add tests)
- Create a Pull Request (PR) on GitHub
- Target the
develop
branch and we'll get it merged up tomaster
- Target the
master
branch for hotfixes
- Target the
- Get the PR merged
- Welcome to our contributors' list!
This project could use your assistance to crush any limitations.
Please visit the Known Limitations wiki page