Postgresql Support of Array datatype

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
alfrye
Posts: 16
Joined: Wed 05 May 2010 19:39

Postgresql Support of Array datatype

Post by alfrye » Thu 14 Apr 2011 20:15

I have Postgresql stored procedure that accepts an array datatype but i don't believe LinqConnect for Postgresql supports this data type. Is the there away to work around. Entity Developer allows me to add the stored procedure to my model and the method has a data type of object for my data type.

I also noticed that the code generated from Entity developer has a the dbType = _text

Code: Select all

  [Function(Name = @"add_multiple_items")]
	   public System.Int32 AddMultipleItems([Parameter(Name = "i_diagrams", DbType = "_text")] object IDiagrams)
	   {
		   IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), IDiagrams);
		   return ((System.Int32)(result.ReturnValue));
	   }

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Mon 18 Apr 2011 09:50

LinqConnect does not support PostgreSQL array types. We plan to implement such support, but cannot provide any timeframe at the moment.

As a workaround, you can, e.g., execute this function via PgSqlCommand with a PgSqlArray parameter:

Code: Select all

PgSqlArray array = new PgSqlArray(new object[] { 3, 4, 5 }, PgSqlType.Int, 1, 3);
PgSqlCommand cmd = new PgSqlCommand("select add_multiple_items(?)", connection);
cmd.Parameters.Add(new PgSqlParameter("1", array));
var result = cmd.ExecuteScalar();

peterharris
Posts: 13
Joined: Fri 03 Jan 2014 11:13

Re: Postgresql Support of Array datatype

Post by peterharris » Thu 27 Feb 2014 22:44

Has there been any development on this? I would be very interested in this feature, I think it would set LinqConnect just a little further apart from EF. Being able to use arrays in a relational database transforms what you're able to achieve, joining some of the great benefits of NoSQL with all the greatness of relational data. Couple this with LinqConnect and this could potentially be a seriously powerful feature.

I have started a suggestion here for people to vote:
https://devart.uservoice.com/forums/802 ... inqconnect

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Postgresql Support of Array datatype

Post by MariiaI » Fri 28 Feb 2014 12:12

Thank you for the suggestion. This functionality has not been implemented yet and we can't tell any timeframe at the moment. We will inform you about the results as soon as any are available.

Post Reply