Search found 10 matches

by acerbitdrain
Sat 21 Nov 2009 12:43
Forum: Entity Developer
Topic: Code generation via command line?
Replies: 1
Views: 2594

Code generation via command line?

Great work on this tool.

Is there a way to run code generation via the command line?
Our build is automated via MsBuild and it would be nice to be able to do code generation as a part of the automated build.

Something like:

Code: Select all

EntityDeveloper.exe /codeGeneration /myProject /separateFiles /csLanguage /o"c:\mybuild\myproject\entites"
Thank you.
by acerbitdrain
Sat 21 Nov 2009 12:36
Forum: dotConnect for PostgreSQL
Topic: Unprepared execute for EF?
Replies: 3
Views: 2856

Unprepared execute for EF?

Great work on getting unprepared execution implemented.
Recently we have been running test to convert our apps to EF.

When using EF, there is no way to programmatically access the PgSqlCommand object and set UnpreparedExecute flag to true.

Is there a way, or are there plans to have this configurable via a connection string setting?

Thank you.
by acerbitdrain
Sat 21 Nov 2009 12:30
Forum: Entity Framework support
Topic: Entity Framework and Oracle Timestamp with Time Zone
Replies: 11
Views: 6900

Thanks for your thoughtful answer Shalex.

I still believe that mapping TIMESTAMP WITH TIME ZONE to DateTimeOffSet is useful. It doesn't hurt to have the servers offset being returned along with DateTime. It is also very useful to be able save a DateTime with a different time zone.

Consider the following scenario:

My application and DB server is in +10 time zone and my client is in +9 time zone. My clients time zone is known to me from their preferences.
When I go to save a DateTime entered by that user I should be able to save it as something like

Code: Select all

DateTime userLocalTime = DateTime.Parse('User inputted date time');
DateTimeOffSet userDateTime = new DateTimeOffset(userLocalTime, new TimeSpan(9,0,0));
// Set my entities time
myEntity.CreationDate = userDateTime;
If I save this as a DateTime only, the server will assume its local time, +10, which is incorrect.

Thoughts?
by acerbitdrain
Fri 06 Nov 2009 13:02
Forum: Entity Framework support
Topic: Entity Framework and Oracle Timestamp with Time Zone
Replies: 11
Views: 6900

Shalex, that is great, but will it also be a fix for PostgreSQL?
by acerbitdrain
Wed 04 Nov 2009 08:33
Forum: Entity Framework support
Topic: Entity Framework and Oracle Timestamp with Time Zone
Replies: 11
Views: 6900

I think pcrissman is really asking why isn't Oracle TIMESTAMP WITH TIMEZONE mapped to .NET DateTimeOffSet?

I can only guess as I'm having the same issue with PostgreSQL and EF.

PgSqlDataReader returns DateTime for TIMESTAMP WITH TIMEZONE, I believe it should return DateTimeOffset.

Thoughts?

Regards,
Milos
by acerbitdrain
Thu 22 Oct 2009 11:36
Forum: dotConnect for PostgreSQL
Topic: PgSqlTimeStamp <-> DateTimeOffset conversion
Replies: 1
Views: 1469

PgSqlTimeStamp <-> DateTimeOffset conversion

What is your recommended practice for converting PgSqlTimeStamp to DateTimeOffset and vice versa?

Thank you.
by acerbitdrain
Mon 24 Aug 2009 12:35
Forum: dotConnect for PostgreSQL
Topic: Multiple insert statements with protocol 3
Replies: 53
Views: 9862

This is great Shalex, however can I suggest somethings that may make this feature easier to utilize.

You'll find that most developers will use your provider with an ORM tool such as NHibernate or EF. These tools know nothing about provider specific properties when instantiating Connection or Command objects.
For example, NHibernate calls CreateConnection() on its driver class to obtain a new connection, then internally (somwhere in NHibernate code base) it calls CreateConnection().CreateCommand() to get a new command. This is where the problem is, there is no way of intercepting this to set UnpreparedExecute to true on the newly created command. This means that your PgSqlCommand class would need to be sub-classed, then the CreateCommand() method overriden, something like

Code: Select all

public new PgSqlCommand CreateCommand() {
 PgSqlCommand cmd = base.CreateCommand();
 cmd.UnpreparedExecute = true;
 return cmd;
}
I guess what I'm getting at is, could true be made the default? OR have a property in the connection string that will set this accordingly.

Regards,
Milos
by acerbitdrain
Sat 21 Mar 2009 11:45
Forum: dotConnect for PostgreSQL
Topic: Multiple insert statements with protocol 3
Replies: 53
Views: 9862

I concur. This is a huge limitation of dotConnect for PostgreSQL.
There is a reason for a Prepare() method on the DbCommand base class. Preparing statements with parameters in many cases decreases performance as the planer has no knowledge up front of the values that it has to work with.

It would also be good to be able to execute this...

Code: Select all

command.CommandText = "CREATE TABLE test_table (test_table_id int);
INSERT INTO test_table SELECT 1::int;
- milos
by acerbitdrain
Fri 20 Feb 2009 08:43
Forum: dotConnect for PostgreSQL
Topic: dcPostgreSQL Express still version 4.0.20.0
Replies: 1
Views: 2083

dcPostgreSQL Express still version 4.0.20.0

The download version of the express provider hasn't been updated to the latest version 4.0.22.0.

Milos.
by acerbitdrain
Sat 07 Feb 2009 10:15
Forum: dotConnect for PostgreSQL
Topic: Exception at PgSqlDataReader.GetGuid(Int32 i)
Replies: 1
Views: 1671

Exception at PgSqlDataReader.GetGuid(Int32 i)

Hi,

I have encountered an exception from calling PgSqlDataReader.GetGuid(Int32 i)

System.InvalidOperationException was unhandled
Message="Cannot convert object of type 'System.Guid' to object of type 'System.Guid'."
Source="Devart.Data.PostgreSql"
StackTrace:
at Devart.Common.n.a7(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Data.PostgreSql.PgSqlDataReader.GetGuid(Int32 i)

The query is directly against a table 'foo' (integer, guid, varchar, integer, date)

Here is a simple test case:

Code: Select all

PgSqlConnection c = new PgSqlConnection();
            c.ConnectionString = "connection string";
            c.Open();

            PgSqlCommand cmd = c.CreateCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "SELECT * FROM foo LIMIT 1";

            PgSqlDataReader reader = cmd.ExecuteReader();
            reader.Read();
            reader.GetGuid(1); // Exception
            reader.Close();
Thank you,
Milos