SQLite

Last Updated: 2019-02-03

Please remember that if you're going to use our provided packages for AspNetCore Identity you will need need to include Piranha.AspNetCore.Identity.SQLite. For more information, please refer to Identity Security.

SQLite is an awsome lightweight, portable database that is perfect for testing and development. As the database doesn't have the same support for foreign keys, index and other features that help ensure high data integrity we don't recommend it for production environments.

Installation

To use SQLite, make sure you add the NuGet package for running Entity Framework Core with SQLite.

Microsoft.EntityFrameworkCore.Sqlite

Registering The DbContext

After you've made sure you have the package reference you need you simply specify that you want to use SQLite and the connection information you want for your database in your Startup.cs.

public void ConfigureServices(IServiceCollection services)
{
...

services.AddPiranhaEF(options =>
options.UseSqlite("Filename=./mydatabase.db");

...
}

That's it! You're now using SQLite with Piranha.