-
-
Notifications
You must be signed in to change notification settings - Fork 458
Open
Labels
Description
Hi!
I am using PostgreSQL read models and discovered an issue with the column names.
STR
- I created all tables with double-quoted values for table and column names using FluentMigrator (this is the default FluentMigrator PostgreSQl configuration).
- I registered PostgreSql readModels using
ConfigurePostgreSql
andUsePostgreSqlReadModel
- I added
[PostgreSqlReadModelIdentityColumn]
attribute to ReadModel's propertyId
AR
When working with read models I am receiving an error from PostgreSQL that column id
does not exists
ER
Should work well with such configuration by default OR should be configured by registering custom ReadModelSqlGenerator
:
internal sealed class CustomPostgresReadModelSqlGenerator : ReadModelSqlGenerator
{
public CustomPostgresReadModelSqlGenerator()
: base(new ReadModelSqlGeneratorConfiguration(
tableQuotedIdentifierPrefix: "\"",
tableQuotedIdentifierSuffix: "\"",
columnQuotedIdentifierPrefix: "\"",
columnQuotedIdentifierSuffix: "\""))
{
}
}
But even registration of this custom ReadModelSqlGenerator
does not help, because probably there is a bug in ReadModelSqlGenerator.
sql = $"SELECT * FROM {tableName} WHERE {identityColumn} = @EventFlowReadModelId"; |
sql = $"UPDATE {tableName} SET {updateColumns} WHERE {Configuration.ColumnQuotedIdentifierPrefix}{identityColumn}{Configuration.ColumnQuotedIdentifierSuffix} = @{identityColumn} {versionCheck}"; |
Also, there is a question, why columnQuotedIdentifierPrefix: "\""
and columnQuotedIdentifierSuffix: "\""
- not used by default for PostgreSql configuration?