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 and UsePostgreSqlReadModel
- I added
[PostgreSqlReadModelIdentityColumn] attribute to ReadModel's property Id
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"; |
- on this line prefix and suffix - not used at all, so probably it is a bug, because they are used here -
|
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?
Hi!
I am using PostgreSQL read models and discovered an issue with the column names.
STR
ConfigurePostgreSqlandUsePostgreSqlReadModel[PostgreSqlReadModelIdentityColumn]attribute to ReadModel's propertyIdAR
When working with read models I am receiving an error from PostgreSQL that column
iddoes not existsER
Should work well with such configuration by default OR should be configured by registering custom
ReadModelSqlGenerator:But even registration of this custom
ReadModelSqlGeneratordoes not help, because probably there is a bug in ReadModelSqlGenerator.EventFlow/Source/EventFlow.Sql/ReadModels/ReadModelSqlGenerator.cs
Line 105 in cf4287b
EventFlow/Source/EventFlow.Sql/ReadModels/ReadModelSqlGenerator.cs
Line 149 in cf4287b
Also, there is a question, why
columnQuotedIdentifierPrefix: "\""andcolumnQuotedIdentifierSuffix: "\""- not used by default for PostgreSql configuration?