2024-01-21 18:11:04 +08:00
|
|
|
|
using SqlSugar;
|
2024-11-19 16:36:33 +08:00
|
|
|
|
using ArgumentException = System.ArgumentException;
|
2024-01-21 18:11:04 +08:00
|
|
|
|
|
|
|
|
|
|
namespace Yi.Framework.SqlSugarCore.Abstractions
|
|
|
|
|
|
{
|
2025-02-23 03:06:06 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 数据库连接配置选项
|
|
|
|
|
|
/// </summary>
|
2024-01-21 18:11:04 +08:00
|
|
|
|
public class DbConnOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2025-02-23 03:06:06 +08:00
|
|
|
|
/// 主数据库连接字符串
|
|
|
|
|
|
/// 如果开启多租户,此为默认租户数据库
|
2024-01-21 18:11:04 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string? Url { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 数据库类型
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public DbType? DbType { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-02-23 03:06:06 +08:00
|
|
|
|
/// 是否启用种子数据初始化
|
2024-01-21 18:11:04 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool EnabledDbSeed { get; set; } = false;
|
|
|
|
|
|
|
2024-10-06 03:32:34 +08:00
|
|
|
|
/// <summary>
|
2025-02-23 03:06:06 +08:00
|
|
|
|
/// 是否启用驼峰命名转下划线命名
|
2024-10-06 03:32:34 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool EnableUnderLine { get; set; } = false;
|
2024-01-21 18:11:04 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-02-23 03:06:06 +08:00
|
|
|
|
/// 是否启用Code First模式
|
2024-01-21 18:11:04 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool EnabledCodeFirst { get; set; } = false;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-02-23 03:06:06 +08:00
|
|
|
|
/// 是否启用SQL日志记录
|
2024-01-21 18:11:04 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool EnabledSqlLog { get; set; } = true;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-02-23 03:06:06 +08:00
|
|
|
|
/// 实体类所在程序集名称列表
|
2024-01-21 18:11:04 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public List<string>? EntityAssembly { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-02-23 03:06:06 +08:00
|
|
|
|
/// 是否启用读写分离
|
2024-01-21 18:11:04 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool EnabledReadWrite { get; set; } = false;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-02-23 03:06:06 +08:00
|
|
|
|
/// 只读数据库连接字符串列表
|
2024-01-21 18:11:04 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public List<string>? ReadUrl { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-02-23 03:06:06 +08:00
|
|
|
|
/// 是否启用SaaS多租户
|
2024-01-21 18:11:04 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool EnabledSaasMultiTenancy { get; set; } = false;
|
2025-11-17 11:19:15 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否开启更新并发乐观锁
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool EnabledConcurrencyException { get;set; } = false;
|
2024-01-21 18:11:04 +08:00
|
|
|
|
}
|
2024-11-19 16:36:33 +08:00
|
|
|
|
}
|