You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. using Apewer;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. namespace Apewer.Source
  6. {
  7. /// <summary>数据库引擎访问接口。</summary>
  8. public interface IDatabase : IDisposable
  9. {
  10. /// <summary>获取或设置日志记录器。</summary>
  11. Logger Logger { get; set; }
  12. /// <summary>数据库当前在线,表示连接可用。</summary>
  13. bool Online { get; }
  14. /// <summary>连接数据库,若未连接则尝试连接,获取连接成功的状态。</summary>
  15. bool Connect();
  16. /// <summary>关闭连接。</summary>
  17. void Close();
  18. /// <summary>关闭连接,且重置连接信息。</summary>
  19. new void Dispose();
  20. /// <summary>查询。</summary>
  21. IQuery Query(string statement);
  22. /// <summary>查询。</summary>
  23. IQuery Query(string statement, IEnumerable<IDataParameter> parameter);
  24. /// <summary>执行。</summary>
  25. IExecute Execute(string statement);
  26. /// <summary>执行。</summary>
  27. IExecute Execute(string statement, IEnumerable<IDataParameter> parameter);
  28. }
  29. }