54 lines
1.7 KiB
C#
Raw Normal View History

2025-04-02 14:06:40 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.CollectBus.IoTDBProvider
{
/// <summary>
2025-04-07 16:44:25 +08:00
/// IoTDB数据源,数据库能同时存多个时序模型,但数据是完全隔离的,不能跨时序模型查询,通过连接字符串配置
2025-04-02 14:06:40 +08:00
/// </summary>
public interface IIoTDBProvider
{
2025-04-11 11:56:23 +08:00
///// <summary>
///// 切换 SessionPool
///// </summary>
///// <param name="useTableSession">是否使用表模型</param>
//void SwitchSessionPool(bool useTableSession);
2025-04-07 16:44:25 +08:00
2025-04-02 14:06:40 +08:00
/// <summary>
/// 插入数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="entity"></param>
/// <returns></returns>
2025-04-07 16:44:25 +08:00
Task InsertAsync<T>(T entity) where T : IoTEntity;
2025-04-02 14:06:40 +08:00
/// <summary>
/// 批量插入数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="entities"></param>
/// <returns></returns>
2025-04-07 16:44:25 +08:00
Task BatchInsertAsync<T>(IEnumerable<T> entities) where T : IoTEntity;
2025-04-03 15:38:31 +08:00
/// <summary>
/// 删除数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="options"></param>
/// <returns></returns>
Task<object> DeleteAsync<T>(QueryOptions options) where T : IoTEntity;
2025-04-02 14:06:40 +08:00
/// <summary>
/// 查询数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="options"></param>
/// <returns></returns>
Task<PagedResult<T>> QueryAsync<T>(QueryOptions options) where T : IoTEntity, new();
}
}