Update NET

This commit is contained in:
610262374@qq.com 2018-12-12 01:27:36 +08:00
parent d2ca0ee001
commit 6ac627f4af
4 changed files with 11 additions and 4 deletions

View File

@ -207,6 +207,10 @@ namespace SqlSugar
{ {
return new OracleInsertable<T>(); return new OracleInsertable<T>();
} }
else if (currentConnectionConfig.DbType == DbType.PostgreSQL)
{
return new PostgreSQLInserttable<T>();
}
else else
{ {
return new InsertableProvider<T>(); return new InsertableProvider<T>();

View File

@ -5,6 +5,9 @@ using System.Text;
namespace SqlSugar namespace SqlSugar
{ {
internal class PostgreSQLInserttable<T> :InsertableProvider<T> where T : class, new()
{
}
internal class PostgreSQLExpressionContext : ExpressionContext, ILambdaExpressions internal class PostgreSQLExpressionContext : ExpressionContext, ILambdaExpressions
{ {
public SqlSugarClient Context public SqlSugarClient Context

View File

@ -8,8 +8,8 @@ namespace OrmTest
{ {
public class Config public class Config
{ {
public static string ConnectionString = "PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=jhl52771;USER ID=postgres"; public static string ConnectionString = "PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=haosql;USER ID=postgres";
public static string ConnectionString2 = "PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=jhl52771;USER ID=postgres"; public static string ConnectionString2 = "PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=haosql;USER ID=postgres";
public static string ConnectionString3 = "PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=jhl52771;USER ID=postgres"; public static string ConnectionString3 = "PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=haosql;USER ID=postgres";
} }
} }

View File

@ -47,7 +47,7 @@ namespace OrmTest.Demo
InitKeyType = InitKeyType.Attribute InitKeyType = InitKeyType.Attribute
}); });
db.CodeFirst.InitTables(typeof(Student), typeof(School)); db.CodeFirst.SetStringDefaultLength(30).InitTables(typeof(Student), typeof(School));
//Backup table //Backup table
//db.CodeFirst.BackupTable().InitTables(typeof(CodeTable),typeof(CodeTable2)); //db.CodeFirst.BackupTable().InitTables(typeof(CodeTable),typeof(CodeTable2));