diff --git a/Directory.Build.props b/Directory.Build.props
deleted file mode 100644
index 5d8722e..0000000
--- a/Directory.Build.props
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- enable
- 11.0.2
-
-
diff --git a/DiscordBotCore/Database/SqlDatabase.cs b/DiscordBotCore/Database/SqlDatabase.cs
index 9fe8865..ce34f01 100644
--- a/DiscordBotCore/Database/SqlDatabase.cs
+++ b/DiscordBotCore/Database/SqlDatabase.cs
@@ -385,6 +385,37 @@ public class SqlDatabase
return null;
}
+ ///
+ /// Read data from the result table and return the first row
+ ///
+ /// The query
+ /// The parameters of the query
+ /// The result is a string that has all values separated by space character
+ public async Task ReadDataAsync(string query, params KeyValuePair[] parameters)
+ {
+ if (!_connection.State.HasFlag(ConnectionState.Open))
+ await _connection.OpenAsync();
+
+ var command = new SQLiteCommand(query, _connection);
+ foreach (var parameter in parameters)
+ {
+ var p = CreateParameter(parameter);
+ if (p is not null)
+ command.Parameters.Add(p);
+ }
+
+ var reader = await command.ExecuteReaderAsync();
+
+ var values = new object[reader.FieldCount];
+ if (reader.Read())
+ {
+ reader.GetValues(values);
+ return string.Join