This commit is contained in:
parent
c4b9627422
commit
9e2be5bb51
|
@ -91,6 +91,22 @@ public class Database
|
|||
Save();
|
||||
}
|
||||
|
||||
public void AddToTable(AddQuery? query)
|
||||
{
|
||||
var table = query?.TableName;
|
||||
var columns = query?.Columns;
|
||||
|
||||
var tableToReturn = _tables.Find(x => x.Name == table);
|
||||
|
||||
if (tableToReturn == null) return;
|
||||
|
||||
var row = new Row
|
||||
{
|
||||
Columns = columns
|
||||
};
|
||||
tableToReturn.Rows?.Append(row);
|
||||
Save();
|
||||
}
|
||||
public static void Loop()
|
||||
{
|
||||
while (true)
|
||||
|
|
|
@ -58,12 +58,7 @@ public class DbClient
|
|||
case QueryType.AddToTable:
|
||||
{
|
||||
AddQuery addQuery = JsonConvert.DeserializeObject<AddQuery>(query);
|
||||
foreach (var column in addQuery?.Columns)
|
||||
{
|
||||
Console.WriteLine(column.Value);
|
||||
}
|
||||
|
||||
|
||||
RsndMain.Db.AddToTable(addQuery);
|
||||
break;
|
||||
}
|
||||
case QueryType.CreateTable:
|
||||
|
|
Loading…
Reference in New Issue