mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-08 22:58:03 +08:00
Update pgsql array type
This commit is contained in:
parent
459be0b1af
commit
08535786f1
@ -402,6 +402,22 @@ namespace SqlSugar
|
|||||||
if (item.IsArray)
|
if (item.IsArray)
|
||||||
{
|
{
|
||||||
parameter.IsArray = true;
|
parameter.IsArray = true;
|
||||||
|
if (item.PropertyType.IsIn(typeof(Guid[]), typeof(Guid?[])))
|
||||||
|
{
|
||||||
|
parameter.DbType = System.Data.DbType.Guid;
|
||||||
|
}
|
||||||
|
else if (item.PropertyType.IsIn(typeof(int[]), typeof(int?[])))
|
||||||
|
{
|
||||||
|
parameter.DbType = System.Data.DbType.Int32;
|
||||||
|
}
|
||||||
|
else if (item.PropertyType.IsIn(typeof(long[]), typeof(long?[])))
|
||||||
|
{
|
||||||
|
parameter.DbType = System.Data.DbType.Int64;
|
||||||
|
}
|
||||||
|
else if (item.PropertyType.IsIn(typeof(short[]), typeof(short?[])))
|
||||||
|
{
|
||||||
|
parameter.DbType = System.Data.DbType.Int16;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (item.Value == null && isDic)
|
if (item.Value == null && isDic)
|
||||||
{
|
{
|
||||||
|
@ -177,6 +177,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
sqlParameter.NpgsqlDbType = NpgsqlDbType.Bigint | NpgsqlDbType.Array;
|
sqlParameter.NpgsqlDbType = NpgsqlDbType.Bigint | NpgsqlDbType.Array;
|
||||||
}
|
}
|
||||||
|
else if (parameter.DbType.IsIn(System.Data.DbType.Guid))
|
||||||
|
{
|
||||||
|
sqlParameter.NpgsqlDbType = NpgsqlDbType.Uuid | NpgsqlDbType.Array;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sqlParameter.NpgsqlDbType = NpgsqlDbType.Text | NpgsqlDbType.Array;
|
sqlParameter.NpgsqlDbType = NpgsqlDbType.Text | NpgsqlDbType.Array;
|
||||||
|
Loading…
Reference in New Issue
Block a user