mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update PgSql
This commit is contained in:
parent
9fd5bb65f7
commit
83674d7f30
@ -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();
|
||||
|
@ -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*/
|
||||
});
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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) => {
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user