1 Star 9 Fork 1

麦壳饼 / PinusDB.Data

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

PinusDB.Data

为国产松果时序数据库(pinusdb)实现的标准ADO.Net 的数据访问接口。

PinusDB.Data 不同于官方提供的 .Net SDK , 本库符合ADO.Net标准。


Build status License

NuGet名称 版本 下载量 说明
PinusDB.Data PinusDB Nuget ADO.Net Core 基础组件
PinusDB.HealthChecks PinusDB.HealthChecks Nuget 供Asp.Net Core 使用的健康检查组件

示例如下:

   var builder = new PinusConnectionStringBuilder()
                {
                    Server = "127.0.0.1",
                    Username = "sa",
                    Password = "future",
                    Port = 8105
                };
                using (var connection = new PinusConnection(builder.ConnectionString))
                {
                    connection.Open();
                    Console.WriteLine("创建遥测数据表", connection.CreateCommand(
                        @" CREATE TABLE test (  devid bigint,                  tstamp datetime, val01 bool, val02 bigint, val03 double, val04 real2 )").ExecuteNonQuery());
                    Console.WriteLine("创建设备", connection.CreateCommand(@"INSERT INTO sys_dev(tabname, devid) VALUES('test',1)").ExecuteNonQuery());
                    Console.WriteLine("添加数据", connection.CreateCommand(@"INSERT INTO test(devid,tstamp,val01,val02,val03) VALUES(1, now(), true, 1, 1.1111)").ExecuteNonQuery());
                    var cmd_select = connection.CreateCommand();
                    cmd_select.CommandText = $"SELECT * FROM test";
                    var reader = cmd_select.ExecuteReader();
                    Console.WriteLine(cmd_select.CommandText);
                    Console.WriteLine("查询数据");
                    ConsoleTableBuilder.From(reader.ToDataTable()).WithFormat(ConsoleTableBuilderFormat.MarkDown).ExportAndWriteLine();
                    Console.WriteLine("");
                    Console.WriteLine("删除表", connection.CreateCommand($"DROP TABLE test").ExecuteNonQuery());
                    Console.WriteLine("删除设备", connection.CreateCommand($"DELETE FROM sys_dev WHERE tabname='test'").ExecuteNonQuery());
                    connection.Close();
                }

img1

MIT License Copyright (c) 2021 MysticBoy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

为国产松果时序数据库(pinusdb)实现的标准ADO.Net 的数据访问接口。 展开 收起
C#
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/maikebing/PinusDB.Data.git
git@gitee.com:maikebing/PinusDB.Data.git
maikebing
PinusDB.Data
PinusDB.Data
main

搜索帮助