Page 1 of 1

Postgresql Support of Array datatype

Posted: Thu 14 Apr 2011 20:15
by alfrye
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));
	   }

Posted: Mon 18 Apr 2011 09:50
by StanislavK
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();

Re: Postgresql Support of Array datatype

Posted: Thu 27 Feb 2014 22:44
by peterharris
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

Re: Postgresql Support of Array datatype

Posted: Fri 28 Feb 2014 12:12
by MariiaI
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.