MigLib 2.4.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MigLib --version 2.4.0
NuGet\Install-Package MigLib -Version 2.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MigLib" Version="2.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MigLib" Version="2.4.0" />
<PackageReference Include="MigLib" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MigLib --version 2.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MigLib, 2.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MigLib@2.4.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MigLib&version=2.4.0
#tool nuget:?package=MigLib&version=2.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Migrate is a tool for performing declarative migrations by finding differences between an expected database schema and the existing one, currently in a SQLite database. It also generates type-safe F# code with CRUD operations for your database schema.
Installation
If you just want to test the tool without installing .Net, then you can use a Docker image:
podman run -it 'mcr.microsoft.com/dotnet/sdk:10.0' bash
Inside the container run:
export PATH="$PATH:/root/.dotnet/tools"
After having .Net in your system you can run
dotnet tool install --global migtool
Quickstart
mkdir test_db
cd test_db
mig init
# generated project files with example definitions
mig status
# output shows migration for existing definitions
mig commit
# generates and executes migration
mig log
# output shows migration metadata and a summary of executed steps
mig codegen
# generates type-safe F# code with CRUD operations
Features
- Declarative migrations
- Migration execution
- Migration execution as library
- F# code generation with type-safe CRUD operations
- Migration log
- Seed data management with idempotent upserts
Commands
mig init- Initialize a new migration project with example schema filesmig status- Generate migration SQL by comparing expected schema with current databasemig commit [-m <message>]- Generate and execute migrations step by stepmig schema- Show the current database schemamig log [-s <steps-id>]- Show migration history and execution metadatamig codegen [-d <directory>]- Generate type-safe F# code with CRUD operations from SQL schema filesmig seed- Execute seed statements (INSERT OR REPLACE) from SQL files
Contributing
How to contribute:
- Open an issue to discuss the change and approach
- Add relevant tests
- Create a pull request mentioning the issue and also including a summary of the problem and approach to solve it
- Wait for the review
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- dotenv.net (>= 3.2.1)
- Fabulous.AST (>= 1.2.0)
- FParsec (>= 1.1.1)
- FSharp.Core (>= 10.0.100)
- FSharpPlus (>= 1.6.1)
- FsToolkit.ErrorHandling (>= 4.18.0)
- Microsoft.Data.Sqlite (>= 9.0.0)
- SqlPrettify (>= 1.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
