Skip to content

denis-ivanov/DuckDB.EFCore

Repository files navigation

DuckDB.EFCore

DuckDB provider for Entity Framework Core.

NuGet

Installation

Install the DuckDB.EFCore NuGet package:

.NET CLI

dotnet add package DuckDB.EFCore

Package Manager

Install-Package DuckDB.EFCore

Usage

To use DuckDB in your Entity Framework Core application, call UseDuckDB in your OnConfiguring method or when configuring your DbContext in AddDbContext.

Example

public class MyDbContext : DbContext
{
    public DbSet<Blog> Blogs { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        optionsBuilder.UseDuckDB("Data Source=my_database.db");
    }
}

public class Blog
{
    public int Id { get; set; }
    public string Title { get; set; }
    public string Content { get; set; }
}

Dependency Injection

builder.Services.AddDbContext<MyDbContext>(options =>
    options.UseDuckDB("Data Source=my_database.db"));

Supported Features

  • Basic CRUD operations
  • LINQ queries
  • Migrations
  • Transactions
  • Raw SQL queries

Acknowledgments

This provider is built on top of the DuckDB.NET ADO.NET provider.

About

DuckDB EF Core provider

Topics

Resources

License

Stars

7 stars

Watchers

1 watching

Forks

Sponsor this project

Packages

 
 
 

Contributors

Languages