Link Search Menu Expand Document

EnterpriseDbStatementBuilder


This class is the BaseStatementBuilder-derived implementation for EnterpriseDB. It is automatically registered by EnterpriseDbBootstrap — you do not need to instantiate it directly under normal use.

Constructors

public EnterpriseDbStatementBuilder()
public EnterpriseDbStatementBuilder(IDbSetting dbSetting,
    IResolver<Field, IDbSetting, string> convertFieldResolver = null,
    IResolver<Type, Type> averageableClientTypeResolver = null)

The parameterless constructor defaults convertFieldResolver to EnterpriseDbConvertFieldResolver.

EnterpriseDB-specific generation notes

  • Paging uses LIMIT/LIMIT ... OFFSET for Query/top-N queries and BatchQuery/skip-take queries.
  • Insert appends a trailing RETURNING ... AS "Result" clause so the generated/primary key is returned in the same round trip.
  • InsertAll is a plain multi-row INSERT ... VALUES (...), (...), ... — no RETURNING clause, since EDB Postgres rejects a RETURNING list against a sub-table VALUES expression (see issue #1143).
  • Merge/MergeAll compile to INSERT ... ON CONFLICT (qualifiers) DO UPDATE SET ..., each with a trailing RETURNING clause (MergeAll also returns a per-row __RepoDb_OrderColumn alongside the key, to align results back to the source rows). An identity column is inserted with OVERRIDING SYSTEM VALUE so an explicit value on the entity is respected instead of silently ignored.
  • Truncate appends RESTART IDENTITY.
  • Passing a non-null hints argument to any Create* method throws NotSupportedException, since EnterpriseDbDbSetting.AreTableHintsSupported is false.

Usability

Use StatementBuilderMapper to override it with a custom implementation.

StatementBuilderMapper.Add(typeof(EDBConnection), new MyCustomEnterpriseDbStatementBuilder(dbSetting), true);