Fucking fucking shit fuck
This commit is contained in:
parent
624f96e104
commit
d4367cbc9f
|
@ -83,14 +83,14 @@ public class Database
|
||||||
var table = query?.TableName;
|
var table = query?.TableName;
|
||||||
var key = query?.Key;
|
var key = query?.Key;
|
||||||
var value = query?.Value;
|
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 tableToReturn = _tables.Find(x => x.Name == table);
|
||||||
var row = tableToReturn?.Rows?.FirstOrDefault(x => x.Columns?.FirstOrDefault(y => y.Name == key)?.Value == value);
|
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)
|
if (column != null)
|
||||||
column.Value = newValue;
|
column.Value = valueSet;
|
||||||
|
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,5 +5,7 @@ public class SetQuery : Query
|
||||||
public string TableName { get; set; }
|
public string TableName { get; set; }
|
||||||
public string Key { get; set; }
|
public string Key { get; set; }
|
||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
|
public string KeySet { get; set; }
|
||||||
|
public string ValueSet { get; set; }
|
||||||
public string NewValue { get; set; }
|
public string NewValue { get; set; }
|
||||||
}
|
}
|
|
@ -13,21 +13,6 @@ public static class RsndMain
|
||||||
Db.SetupFiles();
|
Db.SetupFiles();
|
||||||
Db.Save();
|
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");
|
WebSocketServer server = new WebSocketServer("ws://0.0.0.0:7878");
|
||||||
Console.WriteLine("Server started");
|
Console.WriteLine("Server started");
|
||||||
FleckLog.Level = LogLevel.Error;
|
FleckLog.Level = LogLevel.Error;
|
||||||
|
|
Loading…
Reference in New Issue