Skip to main content

Posts

Showing posts from 2013

Npgsql 2.0.14 released!

Update (2013-12-22): 2.0.14.3 was released with a fix for entity framework boolean value handling. See this issue  and this commit for more info about this fix. Package zip files are already available from pgfoundry  and github . * * * After a lot of time since last stable release, Npgsql 2.0.14 is out! This is a small bugfix release with fix for hangs which could happen when connecting to Postgresql 9.3.  This bug appeared when Postgresql sent an error message. Npgsql had a problem handling some error code fields and then hang while processing it. Whooops! :)  Thanks to Glen Parker, it is  fixed on github .  If you are having hang problems while using Npgsql after upgrade the server to 9.3 version, this version is for you. 2.0.14? Those who are paying attention to the version number may have noticed that the version number is 2.0.14 and not 2.0.13 as it should be. After all, we already had a 2.0.13-beta1 released .  The ...

SSLStream support added to Npgsql!

Yesterday I merged a pull request which adds support to .Net SSLStream in Npgsql. When Npgsql development started, in 2002, there was no SSL support in .net 1.0 and 1.1. It was added later in .net 2.0 but the support to SSLStream was never added to Npgsql. This all changed a few weeks ago when  Dave G created a patch which adds support to .Net SSLStream in Npgsql. He also said that one of the motivations was the fact that the current SSL support was returning error when using client certificate authentication. (I'll post a tutorial about how to use client certificates later) There is a very old feature request  (like since 2005!) to somehow create a single Npgsql.dll which incorporates Mono.Security.dll assembly. This would easy the deployment of Npgsql and version control. This feature request generated a discussion about the removal of Mono.Security dependency and possible impact in current user code.  In order to get the lowest impact by this change...

2.0.13-beta1 Nuget packages available!

After a long delay, Nuget packages for 2.0.13-beta1 are finally available! Since they are beta, you will need to use a command line parameter when installing this package. According to Nuget , you will need to use the following command: PM> Install-Package Npgsql -Pre Please, give it a try and let me know if it works ok. This package also fixes  the problem of police files compiled to .Net 2.0 framework only. This was giving problems when installing Npgsql on .net 4.0 runtimes. Thanks  Yusuke Fujiwara for fixing it.

Npgsql 2.0.13 beta1 released!

Today we released the first beta of Npgsql 2.0.13!  This new beta release had a lot of bugs fixed and initial support for Entity Framework 6! More information about how to use Entity framework 6 with Npgsql can be found in  this post . Checkout the release notes for more information about the bugs fixed in this release. Download it from our  downloads section . Important notice about this release Unfortunately, I made a mistake when updating the assembly version for this release and it was created with a wrong value. I'm very sorry for that. This release should have been 2.0. 12 .91 and not 2.0. 13 .91 Next beta release will have the version value fixed. What are the implications?  The biggest problem is that this beta version will have a version number higher than the final 2.0.13 version while this beta version has 2.0.13.91. As it is a beta and it is not supposed to be deployed in production systems, we think this won't give pr...

Performance improvements when creating NpgsqlConnection objects

Recently,  I applied a patch from  Kevin Pullin  which will improve the performance of programs using Npgsql. This patch reduces significantly the time to create new NpgsqlConnection objects. This particularly applies in scenarios where you are creating and disposing a lot of NpgsqlConnection objects, like when  you are using connection pool , ( you are using it, right? :) ). Comparison test I made an artificial test to show the impact of this patch. This test consists of a simple loop where I create 10k NpgsqlConnection objects.  class   Program     {          static   void   Main ( string []  args )         {              var   connString   =   "server=127.0.0.1;userid=npgsql_tests;database=npgsql_tests;" ;        ...

Initial EF-6 support added to Npgsql

In my last post , I said there is a pull request by Pēteris Ņikiforovs to add support for EF-6 to Npgsql. Yesterday, I merged this pull request to the master branch of Npgsql . With this merge, Npgsql has officially initial support for EF-6! How to compile For now, in order to compile Npgsql to use EF-6, you have to open the solution file NpgsqlEF6.sln. Later,  as suggested by Pēteris Ņikiforovs , the idea is that we create a new configuration inside main project solution instead of maintain 2 separated projects. Another thing you will need to compile Npgsql is the latest release of EntityFramework assembly through NuGet: PM> Install-Package EntityFramework -Pre That's it! Now you will be able to play with Npgsql and EF-6. Check out my previous post about how to use Npgsql with EntityFramework. I'd like to thank Pēteris Ņikiforovs for his patch. And maxbundchen for his patch about Open/Close events needed for EF-6. Please, give it a try and let me know ...

Npgsql Code First Entity Framework 4.3.1 Sample

After reading the excellent article about entity framework on Postgresql by Brice Lambson, I decided to write this post to document my experience playing with Entity Framework 4.3.1 and Npgsql. This post will be an adaptation of the Code First To a New Database walkthrough in order to make it work with Npgsql.  First Steps You should follow the first 4 steps of Code First To a New Database. Go ahead, I''l wait for you. Next steps Here is where the adaptation of the walkthrough begins. As Brice noted in his post, Npgsql currently doesn't support database creation. ( I'm working on that and hope to get news about it soon.) So, for while, you have to create the database manually. Those are the steps you have to do to create the database and the model: First, run this command in the terminal to create the database (or you can use pgAdmin if you prefer a GUI): > createdb ef_code_first_sample  After that, you have to run the following commands ...

Npgsql code moved to GitHub!

Since the beginning, in 2002, Npgsql has been using cvs as its source code management system (SCM). At the time, cvs was being used by a lot of opensource projects, and so it was a natural choice for Npgsql. A couple of days ago, Npgsql code moved to GitHub. I didn't blog about that in the same day because I wanted to make sure things went well before spreading the word. :) ( You may be asking yourself: But Npgsql code was already at GitHub, wasn't it? Yes, it was. But it was only a mirror of the main cvs repository. And I had to update the code manually every time. Every change had to go first to the main repository cvs and then I would update in GitHub. Obviously the code was often outdated. This is a thing of the past now.) Git was chosen mainly because there is a lot of documentation about it, it is powerful and because of GitHub. GitHub provides many resources which will help us have a much better environment for our collaborators and users. For our collaborat...