Fucking fucking shit fuck

This commit is contained in:
j4ck 2022-06-05 00:21:27 +03:00
parent 624f96e104
commit d4367cbc9f
3 changed files with 7 additions and 20 deletions

View File

@ -83,14 +83,14 @@ public class Database
var table = query?.TableName;
var key = query?.Key;
var value = query?.Value;
var newValue = query?.NewValue;
var keySet = query?.KeySet;
var valueSet = query?.ValueSet;
var tableToReturn = _tables.Find(x => x.Name == table);
var row = tableToReturn?.Rows?.FirstOrDefault(x => x.Columns?.FirstOrDefault(y => y.Name == key)?.Value == value);
var column = row?.Columns?.FirstOrDefault(x => x.Name == key);
var column = row?.Columns?.Find(x => x.Name == keySet);
if (column != null)
column.Value = newValue;
column.Value = valueSet;
Save();
}

View File

@ -5,5 +5,7 @@ public class SetQuery : Query
public string TableName { get; set; }
public string Key { get; set; }
public string Value { get; set; }
public string KeySet { get; set; }
public string ValueSet { get; set; }
public string NewValue { get; set; }
}

View File

@ -13,21 +13,6 @@ public static class RsndMain
Db.SetupFiles();
Db.Save();
Db.CreateTable(new Table
{
Name = "fooTable",
Rows = new List<Row>
{
new()
{
Columns = new List<Column>
{
new("test", "1")
}
}
}
});
WebSocketServer server = new WebSocketServer("ws://0.0.0.0:7878");
Console.WriteLine("Server started");
FleckLog.Level = LogLevel.Error;