using Apache.IoTDB.DataStructure;

namespace JiShe.CollectBus.IoTDB.Interface
{
    /// <summary>
    /// Session 连接池
    /// </summary>
    public interface IIoTDbSessionPool : IDisposable
    {
        /// <summary>
        /// 打开连接池
        /// </summary>
        /// <returns></returns>
        Task OpenAsync();

        /// <summary>
        /// 关闭连接池
        /// </summary>
        /// <returns></returns>
        Task CloseAsync();

        /// <summary>
        /// 插入数据
        /// </summary>
        /// <param name="tablet"></param>
        /// <returns></returns>
        Task<int> InsertAsync(Tablet tablet);

        /// <summary>
        /// 查询数据
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        Task<SessionDataSet> ExecuteQueryStatementAsync(string sql);
    }
}
