Tuesday, September 02, 2014

Npgsql 2.2.0 final release is out!

This is Npgsql 2.2.0 Final Release


This release contains 249 commits since the last stable release. Includes bug fixes, improvements and new features.

Update notice: If you have been using Npgsql 2.2.0-rc2, you don't need to update to this version. They are the same except for the Assembly version information.

Major highlights

Visual Studio DDEX support

 

Kenji Uno added support for DDEX. Now you can use Npgsql with Visual Studio data designer. This is a missing feature a lot of our users requested in the past. Kenji added a tutorial about how to use Npgsql with DDEX. You can find it here: https://github.com/npgsql/Npgsql/wiki/Visual-Studio-Design-Time-Support---DDEX-Provider#install-npgsqlddexprovidervsix

 

Entity Framework

 

David Karlaš added support for EFMigration and Database creation in EF6+.
Now it is possible to start Code First projects without needing to create a database upfront. EntityFramework and Npgsql will take care of it.

Emil Lenngren added support for a lot of missing features of EntityFramework.

A list containing fixes from David and Emil as well as others for EntityFramework can be seen here: https://github.com/npgsql/Npgsql/issues?direction=desc&labels=entity+framework&milestone=2&page=1&sort=created&state=closed

 

SSLStream support

 

In this release, SSLStream is on by default.
If you want to use Mono.Security, you will need to use the following line in your code:
NpgsqlConnection.UseSslStream = false; 
Note that in future releases, this option may not be available anymore as we are removing the dependency on Mono.Security assembly. Let us know in the forums if you have any problem with ssl when using SSLStream. This will help us check if we will be able to remove Mono.Security assembly.

 

Added support for JSON, JSONB and HSTORE datatypes


Shay added support for those datatypes.

 

Added GSSAPI support on Windows


Brian Crowell added support for GSSAPI on windows. Now it is easier to use Active Directory when authenticating users.

 

Removed support for protocol v2


Postgresql versions which use only protocol 2 are very old and don't receive support from postgresql group anymore. By removing support for protocol version 2, we removed a lot of code and can focus on functionalities provided by protocol 3.

 

Removed support for Postgresql 8.4 and below


In this thread, we talked about making Npgsql support the officially supported postgresql versions. we talked about making Npgsql support the officially supported postgresql versions. Postgresql has a table of officially supported versions and we decided to follow this table to guide us which postgresql version we will have support to.
This doesn't necessarily mean that Npgsql won't work on unsupported versions. It may work if we don't add any SQL or unsupported feature. For example, today Npgsql 2.2 works only on Postgresql 8.2 and above because we added server side support for command timeout handling and some other queries which aren't supported on earlier versions.
If you are using earlier postgresql versions, please, use an older version of Npgsql. We are creating a compatibility table to show which Postgresql version Npgsql works with.

 

Fixed bugs:


[#91] Support for EFMigration and Database creation
[#152] NpgsqlInterval different constructors different ToString
[#158] NpgsqlCommand.Dispose() should execute "DEALLOCATE " for a prepared command
[#177] XML data type doesn't seem to be quoting parameters properly on insert
[#179] NpgsqlCommandBuilder automatic sql commands configuration
[#188] Buffer too small problem in NpgsqlCopySerializer
[#201] Dynamic type parameters: Cannot cast System.Int32 into any valid DbType after upgrading from 2.0.14.3 to 2.1.2.0
[#208] ObjectDisposeException
[#217] Impossible to insert a Double.NaN value
[#219] [#1011005] using 2 NpgsqlCopyIn at the same time
[#223] HasRows property's bug
[#231] NpgsqlParameterCollection.Clear() doesn't reset NpgsqlParameter.Collection
[#225] Handle IEnumerable parameter
[#233] Cannot insert to tables which have only one column
[#246] Take followed by Skip is generated incorrectly in Entity Framework
[#262] FirstOrDefault() on navigation property subquery throws “Not Implemented” Exception
[#264] Mono.Security is outdated
[#269] Fix 's' value mapped to the 'a' byte
[#280] Bad SQL produced when selecting a field that was also used in the orderBy of a let subquery
[#287] Fix operator handling and date functions for EF
[#296] parameter parsing fails (regression) and duplicate [#240] NpgSqlCommand does not substitute parameters when there is a string with escaped apostrophe
[#315] Fix query parameter processing to more correctly match PostgreSQL's lexer
A list of the issues and pull requests merged for this release can be found at github here: https://github.com/npgsql/Npgsql/issues?direction=desc&milestone=2&page=1&sort=created&state=closed

 

Known Issues


There are some issues we are working for the next maintenance release 2.2.1. You can check which issues we are working on here: https://github.com/npgsql/Npgsql/issues?q=milestone%3A2.2.1

 

Thanks


I'd like to give a special thanks to Kenji Uno for his excellent work with Npgsql DDEX support. DDEX support was one of the biggest missing features of Npgsql.
I'd like to thank Emil Lenngren for all his work with Entity Framework improvements and insightful comments, David Karlaš for his help with Entity Framework support. Shay Rojansky, Glen Parker and Josh Cooley for all contributions and comments, and a big thanks to all the other contributors who helped us to make this release.

 

Downloads

Downloads are available on Nuget, github and pgfoundry.
Please, give it a try and let us know what you think. Drop by our user forums to discuss or send your bug reports to our issues section on github.

 

 List of contributors for this release


Kenji Uno
Shay Rojansky
Glen Parker
Emil Lenngren
David Karlaš
Brian Crowell
danzel
Tuan Nguyen
windcloud
asgeirh
Frans Bouma
Jaspalsinh Chauhan
Josh Cooley
Martin Willey
Francisco Figueiredo Jr.
shankbond
Javier Torres
Kevin Pullin
Michael de Lang
Oskar Gewalli
Sunny Ahuwanya
Thomas Radioyes
javitonino
mw
samy

Tuesday, August 05, 2014

Npgsql 2.2.0 Release Candidate 1 released!

This release contains 22 commits since the last release. It contains the following bug fixes:

[#217] Impossible to insert a Double.NaN value
[#179] NpgsqlCommandBuilder automatic sql commands configuration
[#158] NpgsqlCommand.Dispose() should execute "DEALLOCATE " for a prepared command
[#264] Mono.Security is outdated
[#296] parameter parsing fails (regression) and duplicate [#240] NpgSqlCommand does not substitute parameters when there is a string with escaped apostrophe

A complete list of commits for this release can be found here: v2.2.0-beta1...release-2.2.0

Friday, August 01, 2014

Npgsql 2.2.0 beta1 released!

The Npgsql Development team is proud to announce that Npgsql 2.2.0 beta1 is now available!

This release has the following highlights:


Visual Studio DDEX support


Kenji Uno added support for DDEX. Now you can use Npgsql with Visual Studio data designer. This is a missing feature a lot of our users requested in the past. Kenji added a tutorial about how to use Npgsql with DDEX. You can find it here.


Support for EFMigration and Database creation in EF6+

David Karlaš added support for that. Now it is possible to start Code First projects without needing to create a database upfront. EntityFramework and Npgsql will take care of it.

Emil Lenngren added support for a lot of missing features of EntityFramework.

Check out this list containing fixes from David and Emil as well as others for EntityFramework.

SSLStream support


In this release, SSLStream is on by default.

If you want to use Mono.Security, you will need to use the following line in your code:

NpgsqlConnection.UseSslStream = false;

Note that in future releases, this option may not be available anymore as we are removing the dependency on Mono.Security assembly. Let us know in the forums if you have any problem with ssl when using SSLStream. This will help us check if we will be able to remove Mono.Security assembly.

Added support for JSON, JSONB and HSTORE datatypes


Shay added support for those datatypes.

Added GSSAPI support on Windows


Brian Crowell added support for GSSAPI on windows. Now it is easier to use Active Directory when authenticating users.


Removed support for protocol v2


Postgresql versions which use only protocol 2 are very old and don't receive support from postgresql group anymore. By removing support for protocol version 2, we removed a lot of code and can focus on functionalities provided by protocol 3.


Removed support for Postgresql 8.3 and below


In this thread, we talked about making Npgsql support the officially supported postgresql versions. Postgresql has a table of officially supported versions and we decided to follow this table to guide us which postgresql version we will have support to.
This doesn't necessarily mean that Npgsql won't work on unsupported versions. It may work if we don't add any SQL or unsupported feature. For example, today Npgsql 2.2 works only on Postgresql 8.2 and above because we added server side support for command timeout handling and some other queries which aren't supported on earlier versions.
If you are using earlier postgresql versions, please, use an older version of Npgsql. We are creating a compatibility table to show which Postgresql version Npgsql works with.



Complete release notes for this release can be found on our github release page.


Downloads

Downloads are available on Nuget, github and pgfoundry.

Please, give it a try and let us know what you think. Drop by our user forums to discuss or send your bug reports to our issues section on github.

Tuesday, June 24, 2014

Initial Visual Studio Design time support added to master branch!


Achievement unlocked!


With the merge of Pull Request #213 (PR #213), Kenji Uno added support for Visual Studio Design Time also known as DDEX. 

A most wanted feature


From the statistics of pageviews I get from a previous post about design time support, I can affirm that this is a most wanted feature of Npgsql. And I'm very glad to say that Npgsql is finally having it. I'd like to thank Kenji Uno for all his hard work to make this happen. 

Npgsql DDEX support is done through an extension file which can be easily installed in Visual Studio. This is a much better situation than we had before where it was needed to use an experimental instance of Visual Studio. 


History


The code started with wwindcloud in PR #67 and Kenji started to play with it and said he was working to get it usable in VS2012 and 2013


In order to be able to add more fixes to the code, Kenji started the PR 213 and started to add more features and fixes until now when we merged all the changes back to master branch.

How to use it


Kenji Uno wrote a tutorial about how to build and use this feature. Below are some screenshots from the tutorial.

Please, give it a try and let us know if it works for you. Remember that this is a work in progress, so you may face bugs and problems. 

I'd like to thank Kenji Uno for all his hard work to get this feature working. And also thank wwindcloud for the initial work.


Sample screenshots


Here is an screenshot when you double click the .vsix file to install the extension:





When you install it, you will be able to select it when creating a new data source connection:











Wednesday, April 09, 2014

Npgsql 2.1.3 released!


This version restores the @@ operator support removed in the previous version. Thanks Glen Parker who provided a fix.

Downloads can be found at the usual locations:

github download page
and
the nuget repository.

Pgfoundry will be updated soon.

Thursday, March 27, 2014

Npgsql 2.1.2 released!

Npgsql 2.1.2 is out!

This is a bug fix release. Two fixes are present:



Please, give it a try and let me know if you have any problems. Please, report your issues in our github issues page.



Wednesday, March 19, 2014

Npgsql 2.1.0 released!

After a long time, Npgsql 2.1.0 is finally released! 

If you have been following my posts about Npgsql 2.1 beta and rc releases, you know we did a lot of changes since our last stable release.

The change log for this version is big. You can find a complete list of what has changed and the bugs fixed in the github project release page. It has a lot of information about the changes we made since our last stable 2.0.14 release. You should check it out to see what changed and what new features you will get when you use 2.1.

Developers using Npgsql 2.1 and Entity Framework should pay attention to the changes related to new configuration settings. More information about those changes can be checked here.

Downloads are available on Nuget, github. pgfoundry downloads will be made available soon.

Finally, I'd like to thank some people who did an incredible job and that without them this release wouldn't be possible!

Glen Parker has been working in the optimizations tasks since his first git commit. From the changelog you can see his tireless work regarding each part of Npgsql which could be optimized. Thank you very much for your contributions, Glen!

Shay Rojansky has been helping as the mastermind of the project restructuring support. He contributed a lot of changes which made our lives working with Npgsql much better. Thanks to him we can compile Npgsql for different .net platform versions easily. He also got TeamCity build server working as well as github integration. He helped us to get EntityFramework pre-6 and pos-6 verions easily integrated.
Thank you, Shay!

And Dave Page who helped us with the server where the TeamCity is installed. Without his help, I'm sure our TeamCity installation would be much more difficult. Thank you, Dave!


Please, give it a try and let us know what you think. Drop by Npgsql user forums to discuss and comment or send your bug reports to our issues section on github


Tuesday, February 25, 2014

Npgsql 2.1 Release Candidate 1 released!

Today we released Npgsql 2.1 RC1. This release has very few fixes since Beta1. In fact, only two:

Fixed bugs:

#141 AlwaysPrepare does not works in some cases. Thanks @avb1987.
#153 Fixed wrong comma putting in AddFunctionColumnListSupport(). Thanks @tyler-nguyen.

The changelog of the Beta1 is way bigger and has a lot of information about the changes we made since our last stable 2.0.14 release. You should check it out to see what changed and what new features you will get when you use 2.1.

We will have the final version release in the beginning of March.

Downloads are available on Nuget, github and pgfoundry. You may want to check my previous post about how to get Npgsql 2.1 beta1. The instructions there also apply to 2.1 rc1.

Please, give it a try and let us know what you think. Drop by our user forums to discuss or send your bug reports to our issues section on github. 

Thursday, February 20, 2014

How to get Npgsql 2.1.0 beta

In my last post, I talked about how to use Npgsql 2.1.0 and showed an App.config file which you could use as a template for your applications which use Entity Framework 6.

Npgsql 2.1.0 didn't have a stable release yet. It is currently in beta (and shortly in RC). You can download it from the following sources:


Nuget


As already mentioned, Npgsql 2.1.0 didn't have a stable release yet, so you will need to ask Nuget to install a pre-release version of Npgsql. You do that with the following nuget command:

PM> Install-Package Npgsql -Pre


If you plan to use Entity Framework 6, you will also need to download the Npgsql.EntityFramework assembly. This is done with the following nuget command:

PM> Install-Package Npgsql.EntityFramework -Pre


If you plan to use Entity Framework 4.x, you will need to download Npgsql.EntityFrameworkLegacy. Install it with the following nuget command:

PM> Install-Package Npgsql.EntityFrameworkLegacy -Pre


GitHub


You can download zip files of all the assemblies for many .net platform versions in our releases page at GitHub.


PgFoundry.org

You can download zip files of all the assemblies for many .net platform versions in our release pages at pgfoundry.org .






Monday, February 17, 2014

Using Entity Framework 6 with Npgsql 2.1.0

UPDATE (2014-05-19): Marek Beneš noticed a problem in the default connection factory config. It is fixed now. Thanks, Marek!

UPDATE (2014-02-20): I created a new post explaining how to get Npgsql 2.1.0.

Although this post is about EF 6, I'd like to talk about our current situation to support both EF 6 and EF4.x which explain why there are some subtle changes between EF 4.x and EF 6.x App.config settings. 

Support for EF versions 4.x and 6.x


Sometime after we started to work on Npgsql 2.1.0, we started to add code to support EF6 and decided to reorganize our Entity Framework support code. Shay created a pull request to organize this change and isolate the EF code out of core Npgsql code. The result was the creation of two separated assemblies:

  • Npgsql.EntityFramework.dll for EF6 and above;
  • Npgsql.EntityFrameworkLegacy.dll for EF4.x.

Only when using Npgsql with EF6 you will need to reference Npgsql.EntityFramework.dll assembly. This is needed because the EF system has to find it in order to use it.

When using EF 4.x, you won't need to reference Npgsql.EntityFrameworkLegacy.dll. Npgsql will load it using reflection. You just need to make sure the assembly is located at the same place as Npgsql.dll. With this approach, using EF 4.x with 2.1.0 will be the same way as using with previous versions of Npgsql.

In order to facilitate how to configure Npgsql 2.1.0 to work with EF6, I'm pasting* below an App.config template which you can use as a starting point(1).

Configuration settings for EF 6


<xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework,
 Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <entityFramework>
    <providers>
      <provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql.EntityFramework"></provider>
    </providers>
    <defaultConnectionFactory type="Npgsql.NpgsqlConnectionFactory, Npgsql" />
  </entityFramework>
  <system.data>
    <DbProviderFactories>
      <remove invariant="Npgsql" />
      <add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for Postgresql" 
 type="Npgsql.NpgsqlFactory, Npgsql" />
    </DbProviderFactories>
  </system.data>
</configuration>

*Sorry for the bad formatting :(

The most important change from previous configuration files is the provider entry which had its type changed from Npgsql.NpgsqlFactory to Npgsql.NpgsqlServices as well as the location of this type which used to be in the Npgsql assembly and now it is located at the Npgsql.EntityFramework assembly.

With those changes, you will be able to use Npgsql 2.1.0 with EF6 without any problem.

Let me know in the comments if you have any problem with those directions.

In a later post I'll show a step by step on how to use Npgsql 2.1.0 with EF 6 and some exciting features we are working on: Support for EFMigration and Database creation and Returning DB generated values on insert for EF

---------------------------------

1. Another option to have those configurations set up is to install the Nuget Npgsql.EntityFramework package. Shay added a script which configures the App.config file and add the needed entries in order to make it work with Npgsql.

Tuesday, January 21, 2014

New developer and user discussion groups available!

Npgsql has new developers and users communication channels.

Shay Rojansky created two new discussion groups for Npgsql: npgsql-dev and npgsql-help. Those groups will be used in place of the Npgsql-devel mailing list and the forums available on pgfoundry.org respectively.

Please, feel free to send your questions and comments to those groups. We hope those groups are very helpful to users looking for Npgsql support.