IDatabaseHelper.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Azylee.Core.AppUtils.AppConfigUtils.AppConfigModels;
  2. using Azylee.Core.DbUtils.DbModels;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. namespace Azylee.Core.DbUtils.DbInterface
  9. {
  10. /// <summary>
  11. /// 数据库工具类接口定义
  12. /// </summary>
  13. public interface IDatabaseHelper : IDisposable
  14. {
  15. /// <summary>
  16. /// 创建并打开连接
  17. /// 注意:通常在构造函数中直接调用
  18. /// </summary>
  19. /// <returns></returns>
  20. bool OpenConnect();
  21. /// <summary>
  22. /// 测试连接
  23. /// </summary>
  24. /// <returns></returns>
  25. bool TestConnect();
  26. /// <summary>
  27. /// 普通查询
  28. /// </summary>
  29. /// <param name="sql"></param>
  30. /// <returns></returns>
  31. DataTable Select(string sql);
  32. /// <summary>
  33. /// 查询所有数据库名称
  34. /// </summary>
  35. /// <returns></returns>
  36. DataTable SchemaList();
  37. /// <summary>
  38. /// 执行文件
  39. /// </summary>
  40. /// <param name="SqlFile"></param>
  41. /// <param name="action"></param>
  42. /// <returns></returns>
  43. Tuple<bool, int, string> ExecuteFile(string SqlFile, Action<string, bool, int, string> action);
  44. }
  45. }