using System;
using System.Collections.Generic;
namespace TeamAAS.Database.Models
{
///
/// 数据库连接配置
///
public class DatabaseConfig
{
///
/// 数据库唯一标识
///
public Guid Id { get; set; } = Guid.NewGuid();
///
/// 显示名称
///
public string Name { get; set; }
///
/// 提供者类型(mysql / sqlite / sqlserver 等)
///
public string ProviderType { get; set; }
///
/// 服务器地址(文件型数据库填文件路径)
///
public string Server { get; set; }
///
/// 端口(文件型数据库可忽略)
///
public int Port { get; set; }
///
/// 数据库名(SQLite 可填文件名或留空)
///
public string DatabaseName { get; set; }
///
/// 用户名
///
public string UserId { get; set; }
///
/// 密码
///
public string Password { get; set; }
///
/// 连接超时(秒)
///
public int ConnectionTimeout { get; set; } = 30;
///
/// 自定义连接字符串(优先于上面的字段拼接)
///
public string ConnectionString { get; set; }
///
/// 扩展参数(各提供者特有配置)
///
public Dictionary ExtraParams { get; set; } = new Dictionary();
}
///
/// 表列信息
///
public class ColumnInfo
{
public string ColumnName { get; set; }
public string DataType { get; set; }
public bool IsNullable { get; set; }
public bool IsPrimaryKey { get; set; }
public int MaxLength { get; set; }
public string DefaultValue { get; set; }
public string Description { get; set; }
}
///
/// 数据库提供者类型信息(用于反射发现)
///
public class DatabaseProviderInfo
{
///
/// 提供者类型标识(小写,如 mysql、sqlite)
///
public string ProviderType { get; set; }
///
/// 显示名称(如 MySQL、SQLite)
///
public string DisplayName { get; set; }
///
/// 实现类类型完整名
///
public Type ImplementationType { get; set; }
///
/// 是否需要服务器(文件型数据库为 false)
///
public bool RequiresServer { get; set; }
///
/// 描述
///
public string Description { get; set; }
}
}