Otis wrote:
There's no such type converter available ready for download but I don't think it's that much work to create yourself, in theory. (See the SDK docs: https://www.llblgen.com/Documentation/5.6/SDK/gui_implementingtypeconverter.htm )
In practice it might be more difficult as I dont' know (have to check) if npgsql requires extra settings on the parameter for the array. If it just accepts the array as-is it might work.
It definetly does not work.
First of all when a postgres table has a column of type int[] LLBLGen will identify its db type as varchar(max) and thus maps it to string.
The Npgsql driver internally used to fetch the data from this colum, sees the type of the column as what it is: an int[] array.
The line
object currentValue = this._fields.GetCurrentValue(fieldIndex);
in the GetValue() method from EntityCore reads and returns the value as an int[].
So far all good.
Unfortunately the getter from the entities corresponding property then casts this int[] to string, which leads to a crash.
public virtual System.String CostelloDistinctSiteAuthorIds
{
get { return (System.String)GetValue((int)SiteAuthorNameFieldIndex.CostelloDistinctSiteAuthorIds, true); }
set { SetValue((int)SiteAuthorNameFieldIndex.CostelloDistinctSiteAuthorIds, value); }
}
So what I'm saying is, that currently LLBLGen cannot retrieve entities with int[] columns at all.
Accessing these columns in code will inevitably lead to a crash.
And the idea of using a type converter as suggested on several spots here on forum doesn't work either because it is based on the idea that you convert string to int[] and vice versa .