Update 人大金仓 demo

This commit is contained in:
sunkaixuan 2024-07-10 21:15:51 +08:00
parent 3a805c7f39
commit 14d1e87ca9
38 changed files with 140 additions and 53 deletions

View File

@ -2,7 +2,7 @@
<package > <package >
<metadata> <metadata>
<id>SqlSugarCore.Kdbndp</id> <id>SqlSugarCore.Kdbndp</id>
<version>9.3.6.412</version> <version>9.3.6.618</version>
<authors>sunkaixuan</authors> <authors>sunkaixuan</authors>
<owners>果糖大数据科技</owners> <owners>果糖大数据科技</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl> <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>

View File

@ -6,7 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="SqlSugarCore.Kdbndp" Version="9.3.6.412" /> <PackageReference Include="SqlSugarCore.Kdbndp" Version="9.3.6.618" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,4 +1,6 @@
using SqlSugar; using Kdbndp;
using KdbndpTypes;
using SqlSugar;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;

View 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();
}
}
}

View File

@ -1,4 +1,5 @@
using SqlSugar; using KdbndpTest.OracleDemo.UnitTest;
using SqlSugar;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using KdbndpTest.OracleDemo.UnitTest;
namespace OrmTest namespace OrmTest
{ {

View File

@ -1,4 +1,5 @@
using SqlSugar; using OrmTest;
using SqlSugar;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data.SqlTypes; using System.Data.SqlTypes;
@ -7,7 +8,7 @@ using System.Security.Principal;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace OrmTest namespace KdbndpTest.OracleDemo.UnitTest
{ {
internal class UInsert3 internal class UInsert3
{ {

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using KdbndpTest.OracleDemo.UnitTest;
namespace OrmTest namespace OrmTest
{ {

View File

@ -1,4 +1,5 @@
using SqlSugar; using KdbndpTest.OracleDemo.UnitTest;
using SqlSugar;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using KdbndpTest.OracleDemo.UnitTest;
using SqlSugar; using SqlSugar;
namespace OrmTest namespace OrmTest
{ {

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace OrmTest namespace KdbndpTest.OracleDemo.UnitTest
{ {
public class UValidate public class UValidate
{ {

View File

@ -1,11 +1,12 @@
using SqlSugar; using OrmTest;
using SqlSugar;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace OrmTest namespace KdbndpTest.OracleDemo.UnitTest
{ {
internal class UnitDateTime internal class UnitDateTime
{ {
@ -20,7 +21,8 @@ namespace OrmTest
ConnectionString = Config.ConnectionString.Replace("59321", "59322"), ConnectionString = Config.ConnectionString.Replace("59321", "59322"),
InitKeyType = InitKeyType.Attribute, InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true, IsAutoCloseConnection = true,
MoreSettings=new ConnMoreSettings() { MoreSettings = new ConnMoreSettings()
{
DatabaseModel = DbType.MySql DatabaseModel = DbType.MySql
}, },
AopEvents = new AopEvents AopEvents = new AopEvents

View File

@ -1,10 +1,11 @@
using SqlSugar; using OrmTest;
using SqlSugar;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace OrmTest namespace KdbndpTest.OracleDemo.UnitTest
{ {
internal class UnitSplitTask internal class UnitSplitTask
{ {
@ -26,7 +27,8 @@ namespace OrmTest
private static Task CreateTask(ISqlSugarClient client) private static Task CreateTask(ISqlSugarClient client)
{ {
return Task.Run(() => { return Task.Run(() =>
{
client.Insertable(new SpitDemoModel()).SplitTable().ExecuteCommand(); client.Insertable(new SpitDemoModel()).SplitTable().ExecuteCommand();
}); });
} }

View File

@ -1,4 +1,5 @@
using SqlSugar; using KdbndpTest.OracleDemo.UnitTest;
using SqlSugar;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -1,4 +1,6 @@
using System; using KdbndpTest.OracleDemo;
using KdbndpTest.SqlServerDemo;
using System;
namespace OrmTest namespace OrmTest
{ {
@ -6,24 +8,12 @@ namespace OrmTest
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
//Demo
Demo0_SqlSugarClient.Init(); //Oracle模式DEMO
Demo1_Queryable.Init(); OracleDemo.Init();
Demo2_Updateable.Init();
Demo3_Insertable.Init(); //SqlServer模式DEMO
Demo4_Deleteable.Init(); SqlServer.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();
//Unit test //Unit test
//NewUnitTest.Init(); //NewUnitTest.Init();

View 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();
}
}
}