-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using IoTSharp.Data.Taos; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.Metrics; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using TaosADODemo; | ||
|
||
namespace Example | ||
{ | ||
internal class issue245 | ||
{ | ||
public static void test(TaosConnection connection) | ||
{ | ||
|
||
try | ||
{ | ||
connection.Open(); | ||
connection.CreateCommand($"create database if not exists meters;").ExecuteNonQuery(); | ||
var lines = new List<string>(); | ||
for (int i = 0; i < 10000; i++) | ||
{ | ||
string line = string.Format($"meters,tname=cpu{i},location=California.LosAngeles{i},groupid=2 current={11.8 + i*2},voltage={221 + i},phase={0.28+i}", Program.DateTimeToLongTimeStamp()-10000+i); | ||
lines.Add(line); | ||
} | ||
connection.ChangeDatabase("meters"); | ||
connection.ExecuteLineBulkInsert(lines.ToArray(), TDengineDriver.TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MICRO_SECONDS); | ||
using var command = connection.CreateCommand(); | ||
command.CommandText = "select * from meters limit 1000000"; | ||
var reader = command.ExecuteReader(); | ||
var result = reader.ToDataTable(); | ||
Console.WriteLine(result.Rows.Count); // print 4096 | ||
} | ||
catch (Exception ex) | ||
{ | ||
Console.WriteLine(ex.Message); | ||
} | ||
finally | ||
{ connection.Close(); } | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/IoTSharp.Data.Taos/Protocols/TDWebSocket/WSSchemalessRsp.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
namespace IoTSharp.Data.Taos.Protocols.TDWebSocket | ||
{ | ||
public class WSSchemalessRsp | ||
public class WSSchemalessRsp: WSActionRsp | ||
{ | ||
public int req_id { get; set; } | ||
public string action { get; set; } | ||
public int timing { get; set; } | ||
|
||
} | ||
} |