Skip to content

Commit

Permalink
Merge pull request #254 from taosdata/fix/sangshuduo/typos
Browse files Browse the repository at this point in the history
fix: typos
  • Loading branch information
sangshuduo committed May 4, 2023
2 parents 700000e + a74388b commit f7d4f93
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ IoTSharp.EntityFrameworkCore.Taos 是一个Entity Framework Core 的提供器,
var rd = new Random();
context.sensor.Add(new sensor() { ts = DateTime.Now.AddMilliseconds(i), degree = rd.NextDouble(), pm25 = rd.Next(0, 1000) });
}
Console.WriteLine("Saveing");
Console.WriteLine("Saving");
context.SaveChanges();
Console.WriteLine("");
Console.WriteLine("from s in context.sensor where s.pm25 > 0 select s ");
Expand Down
8 changes: 4 additions & 4 deletions src/Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private static void ExecSqlByNative(TaosConnectionStringBuilder builder)
Console.WriteLine("");

Console.WriteLine("DROP TABLE meters ", connection.CreateCommand($"DROP TABLE IF EXISTS meters;").ExecuteNonQuery());
Console.WriteLine("CREATE TABLE meters ", connection.CreateCommand($"CREATE TABLE IF NOT EXISTS meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);").ExecuteNonQuery());
Console.WriteLine("CREATE TABLE meters ", connection.CreateCommand($"CREATE TABLE IF NOT EXISTS meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int);").ExecuteNonQuery());
Console.WriteLine("CREATE TABLE d1001 ", connection.CreateCommand($"CREATE TABLE d1001 USING meters TAGS (\"Beijing.Chaoyang\", 2);").ExecuteNonQuery());
Console.WriteLine("INSERT INTO d1001 ", connection.CreateCommand($"INSERT INTO d1001 USING METERS TAGS(\"Beijng.Chaoyang\", 2) VALUES(now, 10.2, 219, 0.32);").ExecuteNonQuery());
Console.WriteLine("DROP TABLE {0} {1}", database, connection.CreateCommand($"DROP TABLE {database}.t;").ExecuteNonQuery());
Expand Down Expand Up @@ -341,7 +341,7 @@ private static void ExecSqlByWebSocket(TaosConnectionStringBuilder builder)
ConsoleTableBuilder.From(readerdatas.ToDataTable()).WithFormat(ConsoleTableBuilderFormat.Default).ExportAndWriteLine();
Console.WriteLine("");

Console.WriteLine("CREATE TABLE meters ", connection.CreateCommand($"CREATE TABLE {database}.meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);").ExecuteNonQuery());
Console.WriteLine("CREATE TABLE meters ", connection.CreateCommand($"CREATE TABLE {database}.meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int);").ExecuteNonQuery());
Console.WriteLine("CREATE TABLE d1001 ", connection.CreateCommand($"CREATE TABLE {database}.d1001 USING {database}.meters TAGS (\"Beijing.Chaoyang\", 2);").ExecuteNonQuery());
Console.WriteLine("INSERT INTO d1001 ", connection.CreateCommand($"INSERT INTO {database}.d1001 USING {database}.METERS TAGS(\"Beijng.Chaoyang\", 2) VALUES(now, 10.2, 219, 0.32);").ExecuteNonQuery());
Console.WriteLine("DROP TABLE {0} {1}", database, connection.CreateCommand($"DROP TABLE {database}.t;").ExecuteNonQuery());
Expand Down Expand Up @@ -448,7 +448,7 @@ private static void ExecSqlByRESTFul(TaosConnectionStringBuilder builder_rest)
ConsoleTableBuilder.From(readerdatas.ToDataTable()).WithFormat(ConsoleTableBuilderFormat.Default).ExportAndWriteLine();
Console.WriteLine("");

Console.WriteLine("CREATE TABLE meters ", connection.CreateCommand($"CREATE TABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);").ExecuteNonQuery());
Console.WriteLine("CREATE TABLE meters ", connection.CreateCommand($"CREATE TABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int);").ExecuteNonQuery());
Console.WriteLine("CREATE TABLE d1001 ", connection.CreateCommand($"CREATE TABLE d1001 USING meters TAGS (\"Beijing.Chaoyang\", 2);").ExecuteNonQuery());
Console.WriteLine("INSERT INTO d1001 ", connection.CreateCommand($"INSERT INTO d1001 USING METERS TAGS(\"Beijng.Chaoyang\", 2) VALUES(now, 10.2, 219, 0.32);").ExecuteNonQuery());
Console.WriteLine("DROP TABLE {0} {1}", database, connection.CreateCommand($"DROP TABLE {database}.t;").ExecuteNonQuery());
Expand Down Expand Up @@ -513,7 +513,7 @@ private static void UseTaosEFCore(TaosConnectionStringBuilder builder)
context.Sensor.Add(new Sensor() { ts = DateTime.Now.AddMilliseconds(i + 10), degree = rd.NextDouble(), pm25 = rd.Next(0, 1000) });
Thread.Sleep(10);
}
Console.WriteLine("Saveing");
Console.WriteLine("Saving");
context.SaveChanges();
Console.WriteLine("");
Console.WriteLine("from s in context.sensor where s.pm25 > 0 select s ");
Expand Down
4 changes: 2 additions & 2 deletions src/IoTSharp.Data.Taos/Driver/TDengineDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ static public int StmtPrepare(IntPtr stmt, string sql)


/// <summary>
/// For INSERT only. Used to bind table name as a parmeter for the input stmt object.
/// For INSERT only. Used to bind table name as a parameter for the input stmt object.
/// </summary>
/// <param name="stmt">could be the value returned by 'StmtInit', that may be a valid object or NULL.</param>
/// <param name="name">table name you want to bind</param>
Expand Down Expand Up @@ -691,4 +691,4 @@ static public void Unsubscribe(IntPtr subscribe, bool keep)


}
}
}
6 changes: 3 additions & 3 deletions src/IoTSharp.Data.Taos/Driver/TaosMultiBind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public static TAOS_MULTI_BIND MultiBindBinary(string[] arr)
{
TAOS_MULTI_BIND multiBind = new TAOS_MULTI_BIND();
int elementCount = arr.Length;
//TypeSize represent the Max element length of the comming arr
//TypeSize represent the Max element length of the coming arr
//The size of the buffer is typeSize * elementCount
//This buffer is used to store TAOS_MULTI_BIND.buffer
int typeSize = MaxElementLength(arr);
Expand Down Expand Up @@ -495,7 +495,7 @@ public static TAOS_MULTI_BIND MultiBindNchar(string[] arr)
{
TAOS_MULTI_BIND multiBind = new TAOS_MULTI_BIND();
int elementCount = arr.Length;
//TypeSize represent the Max element length of the comming arr
//TypeSize represent the Max element length of the coming arr
//The size of the buffer is typeSize * elementCount
//This buffer is used to store TAOS_MULTI_BIND.buffer
int typeSize = MaxElementLength(arr);
Expand Down Expand Up @@ -546,7 +546,7 @@ public static TAOS_MULTI_BIND MultiBindJson(string[] jsonStr)
{
TAOS_MULTI_BIND multiBind = new TAOS_MULTI_BIND();
int elementCount = jsonStr.Length;
//TypeSize represent the Max element length of the comming arr
//TypeSize represent the Max element length of the coming arr
//The size of the buffer is typeSize * elementCount
//This buffer is used to store TAOS_MULTI_BIND.buffer
int typeSize = MaxElementLength(jsonStr);
Expand Down
6 changes: 3 additions & 3 deletions src/IoTSharp.Data.Taos/Protocols/TDNative/TaosNative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public TaosDataReader ExecuteReader(CommandBehavior behavior, TaosCommand comman
else
{
var isinsert = TDengine.StmtIsInsert(stmt);
BindParamters(pms, _taos, out var datas, out var tags,out var subtablename);
BindParameters(pms, _taos, out var datas, out var tags,out var subtablename);
int ret = -1;
if (isinsert)
{
Expand Down Expand Up @@ -366,7 +366,7 @@ public TaosDataReader ExecuteReader(CommandBehavior behavior, TaosCommand comman
return dataReader;
}

private void BindParamters(TaosParameterCollection pms, IntPtr _taos, out List<TAOS_MULTI_BIND> _datas, out List<TAOS_MULTI_BIND> _tags, out string _subtablename)
private void BindParameters(TaosParameterCollection pms, IntPtr _taos, out List<TAOS_MULTI_BIND> _datas, out List<TAOS_MULTI_BIND> _tags, out string _subtablename)
{
_datas = new List<TAOS_MULTI_BIND>();
_tags = new List<TAOS_MULTI_BIND>();
Expand Down Expand Up @@ -536,4 +536,4 @@ public int ExecuteBulkInsert(string[] lines, TDengineSchemalessProtocol protocol
return affectedRows;
}
}
}
}
8 changes: 4 additions & 4 deletions src/IoTSharp.Data.Taos/Protocols/TDWebSocket/TaosWebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ private TaosWSResult ExecuteStmt(string _commandText, Lazy<TaosParameterCollecti
var sql = StatementObject.ResolveCommandText(_commandText);
var _prepare = WSExecute<WSStmtRsp>(_stmt_client, "prepare", new { req_id, stmt_id, sql = sql.CommandText });
if (_prepare.code != 0) TaosException.ThrowExceptionForRC(new TaosErrorResult() { Code = _prepare.code, Error = _prepare.message });
BindParamters(pms, out var columns, out var tags,out var subtablename);

BindParameters(pms, out var columns, out var tags,out var subtablename);
req_id++;
if (!string.IsNullOrEmpty(subtablename))
{
Expand Down Expand Up @@ -131,7 +131,7 @@ private TaosWSResult ExecuteStmt(string _commandText, Lazy<TaosParameterCollecti
return wSResult;
}

private void BindParamters(TaosParameterCollection pms, out List<object[]> _datas, out List<string> _tags,out string _subtablename)
private void BindParameters(TaosParameterCollection pms, out List<object[]> _datas, out List<string> _tags,out string _subtablename)
{
_datas = new List<object[]>();
_tags = new List<string>();
Expand Down Expand Up @@ -525,4 +525,4 @@ private static string SchemalessPrecisionToString(TDengineSchemalessPrecision _p
return precision;
}
}
}
}
4 changes: 2 additions & 2 deletions src/Shared/SharedTypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ public static Type TryGetElementType(this Type type, Type interfaceOrBaseType)
var types = GetGenericTypeImplementations(type, interfaceOrBaseType);

Type singleImplementation = null;
foreach (var impelementation in types)
foreach (var implementation in types)
{
if (singleImplementation == null)
{
singleImplementation = impelementation;
singleImplementation = implementation;
}
else
{
Expand Down

0 comments on commit f7d4f93

Please sign in to comment.