mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Update 人大金仓 demo
This commit is contained in:
parent
3a805c7f39
commit
14d1e87ca9
Binary file not shown.
@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>SqlSugarCore.Kdbndp</id>
|
||||
<version>9.3.6.412</version>
|
||||
<version>9.3.6.618</version>
|
||||
<authors>sunkaixuan</authors>
|
||||
<owners>果糖大数据科技</owners>
|
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||
|
@ -6,7 +6,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SqlSugarCore.Kdbndp" Version="9.3.6.412" />
|
||||
<PackageReference Include="SqlSugarCore.Kdbndp" Version="9.3.6.618" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -1,4 +1,6 @@
|
||||
using SqlSugar;
|
||||
using Kdbndp;
|
||||
using KdbndpTypes;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
33
Src/Asp.NetCore2/KdbndpTest/OracleDemo/OracleDemo.cs
Normal file
33
Src/Asp.NetCore2/KdbndpTest/OracleDemo/OracleDemo.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OrmTest;
|
||||
namespace KdbndpTest.OracleDemo
|
||||
{
|
||||
internal class OracleDemo
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
|
||||
Demo0_SqlSugarClient.Init();
|
||||
Demo1_Queryable.Init();
|
||||
Demo2_Updateable.Init();
|
||||
Demo3_Insertable.Init();
|
||||
Demo4_Deleteable.Init();
|
||||
Demo5_SqlQueryable.Init();
|
||||
Demo6_Queue.Init();
|
||||
Demo7_Ado.Init();
|
||||
Demo8_Saveable.Init();
|
||||
Demo9_EntityMain.Init();
|
||||
DemoA_DbMain.Init();
|
||||
DemoB_Aop.Init();
|
||||
DemoC_GobalFilter.Init();
|
||||
DemoD_DbFirst.Init(); ;
|
||||
DemoE_CodeFirst.Init();
|
||||
DemoF_Utilities.Init();
|
||||
DemoG_SimpleClient.Init();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using SqlSugar;
|
||||
using KdbndpTest.OracleDemo.UnitTest;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using KdbndpTest.OracleDemo.UnitTest;
|
||||
|
||||
namespace OrmTest
|
||||
{
|
@ -1,4 +1,5 @@
|
||||
using SqlSugar;
|
||||
using OrmTest;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlTypes;
|
||||
@ -7,7 +8,7 @@ using System.Security.Principal;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest
|
||||
namespace KdbndpTest.OracleDemo.UnitTest
|
||||
{
|
||||
internal class UInsert3
|
||||
{
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using KdbndpTest.OracleDemo.UnitTest;
|
||||
|
||||
namespace OrmTest
|
||||
{
|
@ -1,4 +1,5 @@
|
||||
using SqlSugar;
|
||||
using KdbndpTest.OracleDemo.UnitTest;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using KdbndpTest.OracleDemo.UnitTest;
|
||||
using SqlSugar;
|
||||
namespace OrmTest
|
||||
{
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest
|
||||
namespace KdbndpTest.OracleDemo.UnitTest
|
||||
{
|
||||
public class UValidate
|
||||
{
|
@ -1,11 +1,12 @@
|
||||
using SqlSugar;
|
||||
using OrmTest;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest
|
||||
namespace KdbndpTest.OracleDemo.UnitTest
|
||||
{
|
||||
internal class UnitDateTime
|
||||
{
|
||||
@ -20,7 +21,8 @@ namespace OrmTest
|
||||
ConnectionString = Config.ConnectionString.Replace("59321", "59322"),
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
MoreSettings=new ConnMoreSettings() {
|
||||
MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
DatabaseModel = DbType.MySql
|
||||
},
|
||||
AopEvents = new AopEvents
|
@ -1,10 +1,11 @@
|
||||
using SqlSugar;
|
||||
using OrmTest;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest
|
||||
namespace KdbndpTest.OracleDemo.UnitTest
|
||||
{
|
||||
internal class UnitSplitTask
|
||||
{
|
||||
@ -26,7 +27,8 @@ namespace OrmTest
|
||||
|
||||
private static Task CreateTask(ISqlSugarClient client)
|
||||
{
|
||||
return Task.Run(() => {
|
||||
return Task.Run(() =>
|
||||
{
|
||||
client.Insertable(new SpitDemoModel()).SplitTable().ExecuteCommand();
|
||||
});
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using SqlSugar;
|
||||
using KdbndpTest.OracleDemo.UnitTest;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using KdbndpTest.OracleDemo;
|
||||
using KdbndpTest.SqlServerDemo;
|
||||
using System;
|
||||
|
||||
namespace OrmTest
|
||||
{
|
||||
@ -6,24 +8,12 @@ namespace OrmTest
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
//Demo
|
||||
Demo0_SqlSugarClient.Init();
|
||||
Demo1_Queryable.Init();
|
||||
Demo2_Updateable.Init();
|
||||
Demo3_Insertable.Init();
|
||||
Demo4_Deleteable.Init();
|
||||
Demo5_SqlQueryable.Init();
|
||||
Demo6_Queue.Init();
|
||||
Demo7_Ado.Init();
|
||||
Demo8_Saveable.Init();
|
||||
Demo9_EntityMain.Init();
|
||||
DemoA_DbMain.Init();
|
||||
DemoB_Aop.Init();
|
||||
DemoC_GobalFilter.Init();
|
||||
DemoD_DbFirst.Init(); ;
|
||||
DemoE_CodeFirst.Init();
|
||||
DemoF_Utilities.Init();
|
||||
DemoG_SimpleClient.Init();
|
||||
|
||||
//Oracle模式DEMO
|
||||
OracleDemo.Init();
|
||||
|
||||
//SqlServer模式DEMO
|
||||
SqlServer.Init();
|
||||
|
||||
//Unit test
|
||||
//NewUnitTest.Init();
|
||||
|
51
Src/Asp.NetCore2/KdbndpTest/SqlServerDemo/SqlServer.cs
Normal file
51
Src/Asp.NetCore2/KdbndpTest/SqlServerDemo/SqlServer.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using OrmTest;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KdbndpTest.SqlServerDemo
|
||||
{
|
||||
internal class SqlServer
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
DbType = DbType.Kdbndp,
|
||||
ConnectionString = "Server=211.95.20.236 ;Port=35052;UID=system;PWD=abc123;database=test222",
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
MoreSettings=new ConnMoreSettings() {
|
||||
DatabaseModel=DbType.SqlServer
|
||||
}
|
||||
}, db => {
|
||||
db.Aop.OnLogExecuting = (sql, p) =>
|
||||
{
|
||||
Console.WriteLine(sql);
|
||||
Console.WriteLine(string.Join(",", p?.Select(it => it.ParameterName + ":" + it.Value)));
|
||||
};
|
||||
});
|
||||
Db.DbMaintenance.CreateDatabase();
|
||||
|
||||
foreach (var item in Db.DbMaintenance.GetColumnInfosByTableName("order",false))
|
||||
{
|
||||
Console.WriteLine($"{item.DbColumnName} DataType:{item.DataType} IsIdentity :{item.IsIdentity} IsPrimarykey :{item.IsPrimarykey} IsNullable: {item.IsNullable} Length:{item.Length} Scale:{item.Scale}");
|
||||
}
|
||||
|
||||
var yyy = Db.Queryable<Order>().ToList();
|
||||
var xxx=Db.Ado.GetDataTable("select * from information_schema.columns where pg_catalog.UPPER(table_name)=pg_catalog.UPPER('ORDER')\r\n");
|
||||
|
||||
Db.CodeFirst.InitTables<Order>();
|
||||
Db.Insertable(new Order()
|
||||
{
|
||||
CreateTime=DateTime.Now,
|
||||
CustomId=1,
|
||||
Name="a",
|
||||
Price=1
|
||||
}).ExecuteCommand();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user