AuroraDbStatementBuilder
A class used to build the SQL statements for Aurora PostgreSQL.
This class is the BaseStatementBuilder-derived implementation for Aurora PostgreSQL. It is automatically registered by AuroraDbBootstrap — you do not need to instantiate it directly under normal use.
Constructors
public AuroraDbStatementBuilder()
public AuroraDbStatementBuilder(IDbSetting dbSetting,
IResolver<Field, IDbSetting, string> convertFieldResolver = null,
IResolver<Type, Type> averageableClientTypeResolver = null)
The parameterless constructor defaults convertFieldResolver to AuroraDbConvertFieldResolver.
Aurora PostgreSQL-specific generation notes
- Paging uses
LIMIT/LIMIT ... OFFSETfor 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, casting it to its SQL type first when one can be resolved. - InsertAll builds a single multi-row
INSERT ... VALUES (...), (...), ...with one trailingRETURNINGclause for the whole batch — this assumes the returned rows come back in the same order the rows were listed, which has not been independently verified against an Aurora cluster. - Merge/MergeAll compile to
INSERT ... ON CONFLICT (qualifiers) DO UPDATE SET ..., each with a trailingRETURNINGclause (MergeAll also returns a per-row__RepoDb_OrderColumnparameter alongside the key, to align results back to the source rows). An identity column is inserted withOVERRIDING SYSTEM VALUEso an explicit value on the entity is respected instead of silently ignored. - Truncate is
TRUNCATE TABLE ... RESTART IDENTITY. - Passing a non-null
hintsargument to anyCreate*method throwsNotSupportedException, sinceAuroraDbDbSetting.AreTableHintsSupportedisfalse.
Aurora PostgreSQL is PostgreSQL-compatible, so the generated SQL matches RepoDb.PostgreSql rather than RepoDb.CockroachDb — in particular,
Truncaterestarts the identity sequence here, while CockroachDB’s does not.
Usability
Use StatementBuilderMapper to override it with a custom implementation.
StatementBuilderMapper.Add(typeof(AuroraDbConnection), new MyCustomAuroraDbStatementBuilder(dbSetting), true);