Hello all,

I am using NHibernate with Fluent to generate sql scripts to a PostGre
DB. The problem is that the script generated doesn't has the quotes
around the column declarations. Even if you witre the column names in
uper case without the quotes, PostGre creates the columns all lower
case. So, it needs the quotes to understand that you want upper case.
Also, I woul like to generate the script without connecting to any
database.
I am doing this:

 SchemaMetadataUpdater.QuoteTableAndColumns(
                                    Fluently.Configure()
                                           .Database
(FluentNHibernate.Cfg.Db.PostgreSQLConfiguration.Standard
                                           .ConnectionString(c => c.Is
("Data Source=" + mSQLFilePath)))
                                          .Mappings(m =>
 
m.FluentMappings.AddFromAssembly(ModuleEntitiesAssembly).ExportTo
(ExportTest))
                                          .ExposeConfiguration
(BuildSchema)
                                          .BuildConfiguration()
                                    );


 private static void BuildSchema(Configuration aConfig)
        {
            if (File.Exists(mSQLFilePath))
                File.Delete(mSQLFilePath);

            new SchemaExport(aConfig).SetDelimiter(";").SetOutputFile
(mSQLFilePath).Create(true, false);

        }
But I am getting this exception:

key=value argument incorrect in ConnectionString
Parameter name: data source
Stack Trace:
   at Npgsql.NpgsqlConnectionStringBuilder.GetKey(String key)
   at Npgsql.NpgsqlConnectionStringBuilder.set_Item(String keyword,
Object value)
   at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString
(String value)
   at Npgsql.NpgsqlConnectionStringBuilder..ctor(String
connectionString)
   at Npgsql.NpgsqlConnection.set_ConnectionString(String value)
   at NHibernate.Connection.DriverConnectionProvider.GetConnection()
   at NHibernate.Tool.hbm2ddl.ManagedProviderConnectionHelper.Prepare
()
   at NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords
(Dialect dialect, IConnectionHelper connectionHelper)
   at NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords
(IDictionary`2 cfgProperties)
   at
NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.QuoteTableAndColumns
(Configuration configuration)
   at Lynas.Tools.ClassBuilder.ModuleMetadata.CodeGenDatabase() in C:
\VMShared\LynasLogic\Source\Tools\AppBuilder\ClassBuilder
\ModuleMetadata.cs:line 343

Can anyone help me?

Gratefull,

David Leite

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to