These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Quotes at PostGre SQL script columns declaration
PostPosted: Wed Oct 14, 2009 10:39 pm 
Newbie

Joined: Wed Oct 14, 2009 5:25 pm
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.