- 增加 fsql.Insert(Dictionary<string, object>) 无实体类插入方法;#481

This commit is contained in:
2881099
2022-03-24 18:06:54 +08:00
parent 56ce675b65
commit dc688adc11
47 changed files with 416 additions and 80 deletions

View File

@ -55,10 +55,10 @@ namespace FreeSql.PostgreSQL
NpgsqlDbType GetNpgsqlDbType(DbColumnInfo column)
{
var dbtype = column.DbTypeText;
var isarray = dbtype.EndsWith("[]");
var isarray = dbtype?.EndsWith("[]") == true;
if (isarray) dbtype = dbtype.Remove(dbtype.Length - 2);
NpgsqlDbType ret = NpgsqlDbType.Unknown;
switch (dbtype.ToLower().TrimStart('_'))
switch (dbtype?.ToLower().TrimStart('_'))
{
case "int2": ret = NpgsqlDbType.Smallint; break;
case "int4": ret = NpgsqlDbType.Integer; break;