Skip to content

EF Core: Missing ISqlGenerationHelper with provider-specific identifier quoting #133

@DaveRMaltby

Description

@DaveRMaltby

Summary

The EF Core providers register the generic RelationalSqlGenerationHelper rather than a provider-specific implementation. This means SQL generation uses default identifier quoting (double quotes) rather than the square bracket quoting ([identifier]) used by the ADO.NET layer's DbCommandBuilder.

Inconsistency

  • ADO.NET layer: Uses [ and ] for identifier quoting (set in FileCommandBuilder)
  • EF Core layer: Uses " for identifier quoting (default RelationalSqlGenerationHelper)

This mismatch could cause issues when EF Core generates SQL that the underlying ADO.NET command parser interprets differently.

What's Needed

A custom FileSqlGenerationHelper that:

  • Uses [ / ] for identifier quoting (matching the ADO.NET layer)
  • Sets the correct statement terminator
  • Handles provider-specific SQL syntax quirks

Location

Service registration: e.g., src/EFCore.Csv/Extensions/CsvServiceCollectionExtensions.cs
Currently: .AddSingleton<ISqlGenerationHelper, RelationalSqlGenerationHelper>()

Standard Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    deferredDeferred — not addressing now

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions