suppourt ndty orm

This commit is contained in:
gbase_contributors
2021-12-15 14:48:26 +08:00
parent 563f695d09
commit fdcb76eaa2
53 changed files with 12244 additions and 187 deletions

View File

@ -0,0 +1,39 @@
using IBM.Data.Informix;
using System;
using System.Collections.Generic;
using System.Data.Odbc;
using System.Diagnostics;
using System.Text;
using System.Threading;
public class g
{
static Lazy<IFreeSql> gbaseLazy = new Lazy<IFreeSql>(() =>
{
var build = new OdbcConnectionStringBuilder();
build.Driver = "GBase ODBC DRIVER (64-Bit)"; // 在系统中注册的驱动名称
build.Add("Host", "192.168.164.134"); // 主机地址或者IP地址
build.Add("Service", "9088"); // 数据库服务器的使用的端口号
build.Add("Server", "gbase01"); // 数据库服务名称
build.Add("Database", "testdb"); // 数据库名DBNAME
build.Add("Protocol", "onsoctcp"); // 网络协议名称
build.Add("Uid", "gbasedbt"); // 用户
build.Add("Pwd", "GBase123"); // 密码
build.Add("Db_locale", "zh_CN.utf8"); // 数据库字符集
build.Add("Client_locale", "zh_CN.utf8"); // 客户端字符集
return new FreeSql.FreeSqlBuilder()
.UseConnectionString(FreeSql.DataType.GBase, build.ConnectionString)
.UseAutoSyncStructure(true)
.UseLazyLoading(true)
.UseMonitorCommand(
cmd => Trace.WriteLine(cmd.CommandText), //监听SQL命令对象在执行前
(cmd, traceLog) => Console.WriteLine(traceLog))
.Build();
});
public static IFreeSql gbase => gbaseLazy.Value;
}