npgsql - Npgsql2: [#1010216] Array Handling.

From: fxjr(at)pgfoundry(dot)org (User Fxjr)
To: pgsql-committers(at)postgresql(dot)org
Subject: npgsql - Npgsql2: [#1010216] Array Handling.
Date: 2008-02-11 04:16:34
Message-ID: 20080211041635.16C8617AD0D8@pgfoundry.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------

[#1010216] Array Handling. Not fully tested by comments welcome
Added support for array datatype. Anything that implements IEnumerable<T> where T is a type already supported by npgsql will be treated the same as T[], anything that implements IEnumerable<U> where U implements IEnumerable<T> will be treated the same as T[,] (but cause an error if it's a "jagged" array, as postgres doesn't support them) and so on. In order to use it, just use an array or IEnumerable<T> as parameter value. Also, you can specify the NpgsqlDbType as an or'ed value to say it is an array: Binary or with other values. E.g. Array of Box is NpgsqlDbType.Array | NpgsqlDbType.Box. Thanks Jon Hanna (jon at hackcraft dot net) for patches. Also thanks Michael Parshin (parshim at gmail dot com) for his help fixing bugs.

Modified Files:
--------------
Npgsql2/src/Npgsql:
NpgsqlCommand.cs (r1.15 -> r1.16)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/npgsql/Npgsql2/src/Npgsql/NpgsqlCommand.cs.diff?r1=1.15&r2=1.16)
NpgsqlParameter.cs (r1.8 -> r1.9)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/npgsql/Npgsql2/src/Npgsql/NpgsqlParameter.cs.diff?r1=1.8&r2=1.9)
Npgsql2/src/NpgsqlTypes:
NpgsqlDbType.cs (r1.7 -> r1.8)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/npgsql/Npgsql2/src/NpgsqlTypes/NpgsqlDbType.cs.diff?r1=1.7&r2=1.8)
NpgsqlTypesHelper.cs (r1.10 -> r1.11)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/npgsql/Npgsql2/src/NpgsqlTypes/NpgsqlTypesHelper.cs.diff?r1=1.10&r2=1.11)

Added Files:
-----------
Npgsql2/src/NpgsqlTypes:
ArrayHandling.cs (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/npgsql/Npgsql2/src/NpgsqlTypes/ArrayHandling.cs?rev=1.1&content-type=text/x-cvsweb-markup)

Browse pgsql-committers by date

  From Date Subject
Next Message User Fxjr 2008-02-11 04:17:07 npgsql - Npgsql2: [#1010216] Array Handling.
Previous Message Tom Lane 2008-02-10 20:39:08 pgsql: Fix PageGetExactFreeSpace() so that it actually behaves sensibly