mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 14:04:44 +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();
|
db.Updateable(updateObj).Where(true).ExecuteCommand();
|
||||||
|
|
||||||
//sql
|
//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();
|
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();
|
var t12 = db.Updateable<School>().AS("Student").UpdateColumns(it => new School() { Name = "jack" }).Where(it => it.Id == 1).ExecuteCommandAsync();
|
||||||
t12.Wait();
|
t12.Wait();
|
||||||
|
@ -76,7 +76,7 @@ namespace OrmTest.Demo
|
|||||||
SqlSugarClient db = new SqlSugarClient(
|
SqlSugarClient db = new SqlSugarClient(
|
||||||
new ConnectionConfig() {
|
new ConnectionConfig() {
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.PostgreSQL,
|
||||||
IsAutoCloseConnection = false,
|
IsAutoCloseConnection = false,
|
||||||
IsShardSameThread= true /*Shard Same Thread*/
|
IsShardSameThread= true /*Shard Same Thread*/
|
||||||
});
|
});
|
||||||
|
@ -18,14 +18,14 @@ namespace OrmTest.Demo
|
|||||||
UniqueMethodName = "MyToString",
|
UniqueMethodName = "MyToString",
|
||||||
MethodValue = (expInfo, dbType, expContext) =>
|
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()
|
var config = new ConnectionConfig()
|
||||||
{
|
{
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.PostgreSQL,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
ConfigureExternalServices = new ConfigureExternalServices()
|
ConfigureExternalServices = new ConfigureExternalServices()
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@ namespace OrmTest.Demo
|
|||||||
{
|
{
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() {
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() {
|
||||||
ConnectionString = Config.ConnectionString,
|
ConnectionString = Config.ConnectionString,
|
||||||
DbType = DbType.SqlServer,
|
DbType = DbType.PostgreSQL,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
ConfigureExternalServices=new ConfigureExternalServices() {
|
ConfigureExternalServices=new ConfigureExternalServices() {
|
||||||
EntityService = (property, column) => {
|
EntityService = (property, column) => {
|
||||||
|
@ -18,7 +18,7 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Demo.CodeFirst.Init();
|
// Demo.CodeFirst.Init();
|
||||||
// Demo.Aop.Init();
|
Demo.Aop.Init();
|
||||||
Demo.Query.Init();
|
Demo.Query.Init();
|
||||||
Demo.Insert.Init();
|
Demo.Insert.Init();
|
||||||
Demo.Delete.Init();
|
Demo.Delete.Init();
|
||||||
@ -26,7 +26,7 @@ namespace OrmTest
|
|||||||
Demo.MasterSlave.Init();
|
Demo.MasterSlave.Init();
|
||||||
Demo.SharedConnection.Init();
|
Demo.SharedConnection.Init();
|
||||||
Demo.ExtSqlFun.Init();
|
Demo.ExtSqlFun.Init();
|
||||||
Demo.QueryableView.Init();
|
// Demo.QueryableView.Init();
|
||||||
Demo.AttributeDemo.Init();
|
Demo.AttributeDemo.Init();
|
||||||
Demo.Mapper.Init();
|
Demo.Mapper.Init();
|
||||||
Demo.ExtEntity.Init();
|
Demo.ExtEntity.Init();
|
||||||
|
Loading…
Reference in New Issue
Block a user