Bulk Data Loading Overview
In DuckDB Appender can be used to efficiently add rows to the database. Appender always appends to a single table in the database.
There are two ways to use appender in .NET:
Mapped Appender (Recommended) - A strongly-typed appender that provides:
- Type Safety: Compile-time type checking for property mappings
- Automatic Validation: Runtime verification that mapped types match the table schema
- Declarative Mapping: Clear property-to-column definitions that prevent ordering errors
- Better Maintainability: Mapping logic separated from data insertion code
Standard Appender - A lower-level API using Create
Appender that requires manual row creation withCreateRowandAppendValuemethods. Use this for maximum performance when type safety is not needed.
For most use cases, the Mapped Appender is recommended as it eliminates common errors while maintaining excellent performance. Make sure to Dispose the appender to avoid data loss.