BulkFlow.Sqlite
1.0.1
dotnet add package BulkFlow.Sqlite --version 1.0.1
NuGet\Install-Package BulkFlow.Sqlite -Version 1.0.1
<PackageReference Include="BulkFlow.Sqlite" Version="1.0.1" />
<PackageVersion Include="BulkFlow.Sqlite" Version="1.0.1" />
<PackageReference Include="BulkFlow.Sqlite" />
paket add BulkFlow.Sqlite --version 1.0.1
#r "nuget: BulkFlow.Sqlite, 1.0.1"
#:package BulkFlow.Sqlite@1.0.1
#addin nuget:?package=BulkFlow.Sqlite&version=1.0.1
#tool nuget:?package=BulkFlow.Sqlite&version=1.0.1
BulkFlow - Yüksek Performanslı EF Core Bulk Operations
BulkFlow, Entity Framework Core için profesyonel, yüksek performanslı bulk insert, update ve delete işlemleri sunan açık kaynak bir kütüphanedir.
🚀 Özellikler
- ✅ BulkInsert - Toplu veri ekleme
- ✅ BulkUpdate - Toplu veri güncelleme
- ✅ BulkDelete - Toplu veri silme
- ✅ 5 Veritabanı Desteği: SQL Server, PostgreSQL, MySQL, SQLite, Oracle
- ✅ EF Core 6, 8, 9 desteği
- ✅ Batch Processing - Büyük veri setleri için otomatik batch işleme
- ✅ Progress Callback - İlerleme takibi
- ✅ Transaction Desteği - Mevcut transaction'lar ile uyumlu
- ✅ Primary Key Desteği - Tek ve çoklu kolonlu primary key'ler
📦 Kurulum
SQL Server
dotnet add package BulkFlow.Core
dotnet add package BulkFlow.SqlServer
PostgreSQL
dotnet add package BulkFlow.Core
dotnet add package BulkFlow.PostgreSql
MySQL
dotnet add package BulkFlow.Core
dotnet add package BulkFlow.MySql
SQLite
dotnet add package BulkFlow.Core
dotnet add package BulkFlow.Sqlite
Oracle
dotnet add package BulkFlow.Core
dotnet add package BulkFlow.Oracle
💻 Kullanım
BulkInsert
using BulkFlow.Core.Extensions;
using Microsoft.EntityFrameworkCore;
// Veritabanı bağlantınızı yapılandırın
var options = new DbContextOptionsBuilder<MyDbContext>()
.UseSqlServer("your-connection-string")
.Options;
await using var context = new MyDbContext(options);
// Toplu ekleme
var entities = Enumerable.Range(1, 10000)
.Select(i => new Product
{
Name = $"Product {i}",
Price = i * 10,
CreatedAt = DateTime.UtcNow
})
.ToList();
await context.BulkInsertAsync(entities);
BulkUpdate
// Önce verileri çekin
var products = await context.Products
.Where(p => p.Price < 100)
.ToListAsync();
// Güncellemeleri yapın
foreach (var product in products)
{
product.Price *= 1.1m; // %10 zam
}
// Toplu güncelleme
await context.BulkUpdateAsync(products);
BulkDelete
// Silinecek verileri çekin
var productsToDelete = await context.Products
.Where(p => p.CreatedAt < DateTime.UtcNow.AddYears(-1))
.ToListAsync();
// Toplu silme
await context.BulkDeleteAsync(productsToDelete);
Gelişmiş Kullanım
// Batch size ve progress callback ile
await context.BulkInsertAsync(entities, options =>
{
options.BatchSize = 1000; // Her batch'te 1000 kayıt
options.ProgressCallback = (processed) =>
{
Console.WriteLine($"İşlenen kayıt sayısı: {processed}");
};
});
// SQL Server için özel seçenekler
await context.BulkInsertAsync(entities, options =>
{
options.KeepIdentity = true; // Identity değerlerini koru
options.FireTriggers = true; // Trigger'ları tetikle
options.BatchSize = 5000;
});
🎯 Desteklenen Veritabanları
| Veritabanı | BulkInsert | BulkUpdate | BulkDelete |
|---|---|---|---|
| SQL Server | ✅ SqlBulkCopy | ✅ MERGE | ✅ DELETE WHERE IN |
| PostgreSQL | ✅ COPY | ✅ UPDATE FROM | ✅ DELETE USING |
| MySQL | ✅ MySqlBulkCopy | ✅ INSERT ON DUPLICATE | ✅ DELETE WHERE IN |
| SQLite | ✅ Batched INSERT | ✅ UPDATE WHERE IN | ✅ DELETE WHERE IN |
| Oracle | ✅ OracleBulkCopy | ✅ MERGE INTO | ✅ DELETE WHERE IN |
📋 Gereksinimler
- .NET 6.0, 8.0 veya 9.0
- Entity Framework Core 6.0, 8.0 veya 9.0
- İlgili veritabanı provider'ı (örn:
Microsoft.EntityFrameworkCore.SqlServer)
🔧 Yapılandırma
BulkFlow otomatik olarak kayıt yapılır (Module Initializer kullanarak). Herhangi bir ek yapılandırma gerekmez.
// Sadece ilgili provider paketini yükleyin ve kullanmaya başlayın!
// Otomatik kayıt için:
_ = typeof(BulkFlow.SqlServer.SqlServerBulkOperationExecutor); // SQL Server için
⚡ Performans
BulkFlow, standart EF Core SaveChanges() metoduna göre 10-100x daha hızlı performans sunar:
- 1 milyon kayıt insert: ~5-10 saniye (EF Core: ~5-10 dakika)
- 100 bin kayıt update: ~2-5 saniye (EF Core: ~2-5 dakika)
- 50 bin kayıt delete: ~1-3 saniye (EF Core: ~1-3 dakika)
Not: Performans veritabanı, network ve donanıma göre değişiklik gösterebilir.
📝 Örnek Entity
public class Product
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public decimal Price { get; set; }
public DateTime CreatedAt { get; set; }
}
public class MyDbContext : DbContext
{
public MyDbContext(DbContextOptions<MyDbContext> options)
: base(options)
{
}
public DbSet<Product> Products { get; set; } = null!;
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Product>(entity =>
{
entity.HasKey(e => e.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
}
}
🐛 Bilinen Sınırlamalar
- MySQL/SQLite/Oracle: Aktif DbContext transaction içinde bulk operasyonlar desteklenmiyor
- SQLite/Oracle:
KeepIdentityseçeneği desteklenmiyor - Primary Key Gereklidir: BulkUpdate ve BulkDelete için entity'lerin primary key'e sahip olması gerekir
📄 Lisans
MIT License - Detaylar için LICENSE dosyasına bakın.
🤝 Katkıda Bulunma
Katkılarınızı bekliyoruz! Lütfen issue açmadan önce mevcut issue'ları kontrol edin.
📧 İletişim
Sorularınız için issue açabilirsiniz.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net6.0
- BulkFlow.Core (>= 1.0.1)
- Microsoft.Data.Sqlite (>= 6.0.35)
- Microsoft.EntityFrameworkCore.Sqlite (>= 6.0.35)
-
net8.0
- BulkFlow.Core (>= 1.0.1)
- Microsoft.Data.Sqlite (>= 8.0.3)
- Microsoft.EntityFrameworkCore.Sqlite (>= 8.0.3)
-
net9.0
- BulkFlow.Core (>= 1.0.1)
- Microsoft.Data.Sqlite (>= 9.0.0-preview.2.24128.4)
- Microsoft.EntityFrameworkCore.Sqlite (>= 9.0.0-preview.2.24128.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|