Found out today that we previously missed the PostgreSQL Short Array converters and attributes.
Note: Using [PgSqlIntArray]
attribute seems to work as a work around for now, but doesn’t automatically pick up short[]
typed props and need to use the attribute. This is with PostgreSQL v11 so unsure if that wouldn’t work on older versions of PostgreSQL.
The following seemed to work.
public class PostgreSqlShortArrayConverter : PostgreSqlArrayConverterBase<short>
{
public override string ColumnDefinition => "short[]";
}
public class PgSqlShortArrayAttribute : CustomFieldAttribute
{
public PgSqlShortArrayAttribute() : base("short[]") { }
}
And add RegisterConverter<>
// https://github.com/ServiceStack/ServiceStack.OrmLite/blob/master/src/ServiceStack.OrmLite.PostgreSQL/PostgreSQLDialectProvider.cs
// Line 63
RegisterConverter<short[]>(new PostgreSqlShortArrayConverter());