|
| 1 | +# AGENTS.md — PhenX.EntityFrameworkCore.BulkInsert |
| 2 | + |
| 3 | +## Project |
| 4 | +High-performance, provider-agnostic bulk insert for EF Core 8+. Supports SQL Server, PostgreSQL, SQLite, MySQL, Oracle. |
| 5 | + |
| 6 | +## Commands |
| 7 | + |
| 8 | +```shell |
| 9 | +# Build (default TFM = net9.0) |
| 10 | +dotnet build PhenX.EntityFrameworkCore.BulkInsert.slnx |
| 11 | + |
| 12 | +# Build specific TFM |
| 13 | +dotnet build . --framework net8.0 |
| 14 | + |
| 15 | +# Run tests (net9.0 by default) |
| 16 | +dotnet test PhenX.EntityFrameworkCore.BulkInsert.slnx |
| 17 | +dotnet test . --framework net8.0 |
| 18 | +dotnet test . --framework net10.0 |
| 19 | + |
| 20 | +# Filter by provider |
| 21 | +dotnet test . --filter "FullyQualifiedName~Sqlite" |
| 22 | +dotnet test . --filter "FullyQualifiedName~PostgreSql" |
| 23 | + |
| 24 | +# Run a single test class |
| 25 | +dotnet test . --filter "FullyQualifiedName~BasicTestsSqlite" |
| 26 | + |
| 27 | +# Release build |
| 28 | +dotnet build -c Release |
| 29 | +dotnet test -c Release |
| 30 | + |
| 31 | +# Pack |
| 32 | +dotnet pack -c Release --output nupkgs |
| 33 | + |
| 34 | +# Benchmarks |
| 35 | +dotnet run --project tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark -c Release |
| 36 | +``` |
| 37 | + |
| 38 | +## Solution structure |
| 39 | +- **`src/PhenX.EntityFrameworkCore.BulkInsert/`** — Common library (abstract base, dialect builder, metadata, options, public API) |
| 40 | +- **`src/PhenX.EntityFrameworkCore.BulkInsert.{SqlServer,PostgreSql,Sqlite,MySql,Oracle}/`** — Provider-specific implementation |
| 41 | +- **`tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/`** — xUnit integration tests (Testcontainers for DBs) |
| 42 | +- **`tests/PhenX.EntityFrameworkCore.BulkInsert.Benchmark/`** — BenchmarkDotNet benchmarks |
| 43 | + |
| 44 | +## Test conventions |
| 45 | +- **xUnit** + **FluentAssertions** + **Xunit.Combinatorial** + **SkippableFact** |
| 46 | +- Abstract base per domain (`BasicTestsBase<TDbContext>`) → provider-specific class (`BasicTestsSqlite`) |
| 47 | +- Tests require **Docker** (via Testcontainers) for all DBs except SQLite (in-memory/file) |
| 48 | +- Tests skipped automatically when Docker is unavailable or DB container can't start |
| 49 | + |
| 50 | +## Multi-targeting |
| 51 | +All projects target `net8.0;net9.0;net10.0`. C# 12, nullable enabled, implicit usings. |
| 52 | + |
| 53 | +## Code style |
| 54 | +- No comments inside method bodies describing investigation or reasoning. Comments should explain *what* code does or *why* a design decision was made, not document an ongoing investigation. |
| 55 | +- `_camelCase` for private fields, `s_` for statics, `PascalCase` for constants (`.editorconfig`) |
| 56 | +- Treat warnings as errors in non-Debug builds (`TreatWarningsAsErrors`) |
| 57 | +- Internals visible to test/benchmark/provider projects via `InternalsVisibleTo` |
| 58 | + |
| 59 | +## Workflow |
| 60 | +- For every public-facing change (new feature, API change, behavior change), update the **README.md** and any relevant **docs/** files. |
| 61 | +- For every code change, add or update corresponding **tests** (unit/integration/benchmark). |
| 62 | + |
| 63 | +## CI |
| 64 | +- PRs to `main` → build + test on all 3 TFMs |
| 65 | +- Tags `v*` → build, test on all 3 TFMs, pack, push to NuGet.org |
0 commit comments