From 2f2c377644e7085655ce264f5d590b43a9003e7d Mon Sep 17 00:00:00 2001 From: Hiller Date: Mon, 6 Sep 2021 16:34:19 +0600 Subject: [PATCH] Fixed Column names quoting (#16) Co-authored-by: Alexander Lybenko Fixes #15 --- .../IdentityServerBuilderNHibernateExtensions.cs | 4 ++++ README.md | 1 + RELEASENOTES.md | 10 +++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/IdentityServer4.NHibernate/IdentityServerBuilderNHibernateExtensions.cs b/IdentityServer4.NHibernate/IdentityServerBuilderNHibernateExtensions.cs index d2bfe57..3db1350 100644 --- a/IdentityServer4.NHibernate/IdentityServerBuilderNHibernateExtensions.cs +++ b/IdentityServer4.NHibernate/IdentityServerBuilderNHibernateExtensions.cs @@ -8,6 +8,7 @@ using IdentityServer4.Stores; using Microsoft.Extensions.Hosting; using NHibernate; +using NHibernate.Dialect; using NHibernate.Tool.hbm2ddl; // ReSharper disable MemberCanBePrivate.Global @@ -124,6 +125,9 @@ private static IIdentityServerBuilder AddNHibernatePersistenceSupport( databaseConfiguration.AddConfigurationStoreMappings(configurationStoreOptions); databaseConfiguration.AddOperationalStoreMappings(operationalStoreOptions); + //We need this to quote fields named with reserved keyword + SchemaMetadataUpdater.QuoteTableAndColumns(databaseConfiguration, Dialect.GetDialect(databaseConfiguration.Properties)); + // Registers NHibernate components builder.Services.AddSingleton(databaseConfiguration.BuildSessionFactory()); builder.Services.AddScoped(provider => diff --git a/README.md b/README.md index 1787d4a..822950d 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ That's why it's not recommended to use this provider in production with an in-me I wish to thank all the contributors to this project: - [Ivan](https://github.com/mtivan) +- [Hiller](https://github.com/Hiller) # Acknowledgements This package has been built using these awesome Open Source projects: diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 8cc7aff..23f5689 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,4 +1,12 @@ -## Build 1.1.7 +## Build 1.1.8 +_Release notes - IdentityServer4.NHibernate - Version 1.1.8_ + +__New features__ +- No new features + +__Resolved issues__ +- [#15](https://github.com/albertodall/IdentityServer4.NHibernate/issues/15) - SqlException: Incorrect syntax near the keyword 'Key'. ([@Hiller](https://github.com/Hiller)) + ## Build 1.1.7 _Release notes - IdentityServer4.NHibernate - Version 1.1.7_