Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 3f72b49

Browse files
committed
Merge branch 'master' of github.com:ServiceStack/ServiceStack.OrmLite
2 parents 1a5588c + 2829f31 commit 3f72b49

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

src/ServiceStack.OrmLite.PostgreSQL/PostgreSQLDialectProvider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,13 +580,16 @@ public override string GetLastInsertIdSqlSuffix<T>()
580580
{ "hstore", NpgsqlDbType.Hstore },
581581
{ "text[]", NpgsqlDbType.Array | NpgsqlDbType.Text },
582582
{ "short[]", NpgsqlDbType.Array | NpgsqlDbType.Smallint },
583+
{ "int[]", NpgsqlDbType.Array | NpgsqlDbType.Integer },
583584
{ "integer[]", NpgsqlDbType.Array | NpgsqlDbType.Integer },
584585
{ "bigint[]", NpgsqlDbType.Array | NpgsqlDbType.Bigint },
585586
{ "real[]", NpgsqlDbType.Array | NpgsqlDbType.Real },
586587
{ "double precision[]", NpgsqlDbType.Array | NpgsqlDbType.Double },
587588
{ "numeric[]", NpgsqlDbType.Array | NpgsqlDbType.Numeric },
588589
{ "timestamp[]", NpgsqlDbType.Array | NpgsqlDbType.Timestamp },
589590
{ "timestamp with time zone[]", NpgsqlDbType.Array | NpgsqlDbType.TimestampTz },
591+
{ "bool[]", NpgsqlDbType.Array | NpgsqlDbType.Boolean },
592+
{ "boolean[]", NpgsqlDbType.Array | NpgsqlDbType.Boolean },
590593
};
591594

592595
public override void SetParameter(FieldDefinition fieldDef, IDbDataParameter p)

tests/ServiceStack.OrmLite.PostgreSQL.Tests/OrmLiteExecuteProcedureTests.cs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,48 @@ IF v_integer_values[3] <> 3 THEN
4242
private const string Drop = "DROP FUNCTION f_service_stack(text[], integer[]);";
4343

4444
[Alias("f_service_stack")]
45-
public class ServiceStackFunction
45+
public class ServiceStackFunctionWithAlias
4646
{
4747
[CustomField("text[]")]
48+
[Alias("v_string_values")]
4849
public string[] StringValues { get; set; }
4950
[CustomField("integer[]")]
51+
[Alias("v_integer_values")]
5052
public int[] IntegerValues { get; set; }
5153
}
5254

55+
[Alias("f_service_stack")]
56+
public class ServiceStackFunctionNoAlias
57+
{
58+
[CustomField("text[]")]
59+
public string[] v_string_values { get; set; }
60+
[CustomField("int[]")]
61+
public int[] v_integer_values { get; set; }
62+
}
63+
5364
[Test]
54-
[Ignore("This test fails both on .NET and .NET Core")]
5565
public void Can_execute_stored_procedure_with_array_arguments()
5666
{
5767
using (var db = OpenDbConnection())
5868
{
5969
db.ExecuteSql(Create);
6070
db.GetLastSql().Print();
6171

62-
db.ExecuteProcedure(new ServiceStackFunction
72+
// Execute using [Alias()] attribute
73+
db.ExecuteProcedure(new ServiceStackFunctionWithAlias
6374
{
6475
StringValues = new[] { "ServiceStack", "Thoughtfully Architected" },
6576
IntegerValues = new[] { 1, 2, 3 }
6677
});
78+
db.GetLastSql().Print();
79+
80+
// Execute without using [Alias()] attribute
81+
db.ExecuteProcedure(new ServiceStackFunctionNoAlias
82+
{
83+
v_string_values = new[] { "ServiceStack", "Thoughtfully Architected" },
84+
v_integer_values = new[] { 1, 2, 3 }
85+
});
86+
db.GetLastSql().Print();
6787

6888
db.ExecuteSql(Drop);
6989
}

0 commit comments

Comments
 (0)