Update PgSql

This commit is contained in:
610262374@qq.com 2018-11-30 17:39:14 +08:00
parent 9fd5bb65f7
commit 83674d7f30
5 changed files with 7 additions and 7 deletions

View File

@ -60,7 +60,7 @@ namespace OrmTest.Demo
db.Updateable(updateObj).Where(true).ExecuteCommand();
//sql
db.Updateable(updateObj).Where("id=@x",new { x="1"}).ExecuteCommand();
db.Updateable(updateObj).Where("id=@x",new { x=1}).ExecuteCommand();
db.Updateable(updateObj).Where("id","=",1).ExecuteCommand();
var t12 = db.Updateable<School>().AS("Student").UpdateColumns(it => new School() { Name = "jack" }).Where(it => it.Id == 1).ExecuteCommandAsync();
t12.Wait();

View File

@ -76,7 +76,7 @@ namespace OrmTest.Demo
SqlSugarClient db = new SqlSugarClient(
new ConnectionConfig() {
ConnectionString = Config.ConnectionString,
DbType = DbType.SqlServer,
DbType = DbType.PostgreSQL,
IsAutoCloseConnection = false,
IsShardSameThread= true /*Shard Same Thread*/
});

View File

@ -18,14 +18,14 @@ namespace OrmTest.Demo
UniqueMethodName = "MyToString",
MethodValue = (expInfo, dbType, expContext) =>
{
return string.Format("CAST({0} AS VARCHAR(MAX))", expInfo.Args[0].MemberName);
return string.Format("CAST({0} AS VARCHAR)", expInfo.Args[0].MemberName);
}
});
var config = new ConnectionConfig()
{
ConnectionString = Config.ConnectionString,
DbType = DbType.SqlServer,
DbType = DbType.PostgreSQL,
IsAutoCloseConnection = true,
ConfigureExternalServices = new ConfigureExternalServices()
{

View File

@ -17,7 +17,7 @@ namespace OrmTest.Demo
{
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() {
ConnectionString = Config.ConnectionString,
DbType = DbType.SqlServer,
DbType = DbType.PostgreSQL,
IsAutoCloseConnection = true,
ConfigureExternalServices=new ConfigureExternalServices() {
EntityService = (property, column) => {

View File

@ -18,7 +18,7 @@ namespace OrmTest
{
// Demo.CodeFirst.Init();
// Demo.Aop.Init();
Demo.Aop.Init();
Demo.Query.Init();
Demo.Insert.Init();
Demo.Delete.Init();
@ -26,7 +26,7 @@ namespace OrmTest
Demo.MasterSlave.Init();
Demo.SharedConnection.Init();
Demo.ExtSqlFun.Init();
Demo.QueryableView.Init();
// Demo.QueryableView.Init();
Demo.AttributeDemo.Init();
Demo.Mapper.Init();
Demo.ExtEntity.Init();