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:

  1. 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
  2. Standard Appender - A lower-level API using CreateAppender that requires manual row creation with CreateRow and AppendValue methods. 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.