using Azylee.Core.AppUtils.AppConfigUtils.AppConfigModels; using Azylee.Core.DbUtils.DbModels; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; namespace Azylee.Core.DbUtils.DbInterface { /// /// 数据库工具类接口定义 /// public interface IDatabaseHelper : IDisposable { /// /// 创建并打开连接 /// 注意:通常在构造函数中直接调用 /// /// bool OpenConnect(); /// /// 测试连接 /// /// bool TestConnect(); /// /// 普通查询 /// /// /// DataTable Select(string sql); /// /// 普通查询(异常时抛出异常,不能内部处理掉) /// /// /// DataTable SelectWithException(string sql); /// /// 查询所有数据库名称 /// /// DataTable SchemaList(); /// /// 查询表字段信息列表 /// /// DataTable ColumnList(string database, string schema, string table); /// /// 执行文件 /// /// 执行文件路径 /// 执行文件参数控制 /// 替换参数 /// 执行后动作(执行语句,是否成功,影响行数,异常提示信息) /// Tuple ExecuteFile(string SqlFile, Dictionary runParams, Dictionary repParams, Action action); /// /// 执行文件SQL(一段SQL脚本) /// /// /// Tuple ExecuteFileSql(string sql); /// /// 执行SQL(返回影响行数) /// /// /// int ExecuteNonQuery(string sql); /// /// 查询表清单 /// /// /// List QueryTables(string key = ""); /// /// 查询表字段列表 /// /// /// /// /// List QueryColumns(string database, string schema, string table); } }