Fixed server crashes from stores' prepared statements.
This commit is contained in:
parent
5618b28c49
commit
4979553c74
@ -21,6 +21,8 @@ namespace HermesSocketServer.Store
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async Task DoPreparedStatement<V>(Database database, string sql, IEnumerable<V> values, string[] columns)
|
public async Task DoPreparedStatement<V>(Database database, string sql, IEnumerable<V> values, string[] columns)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
await database.Execute(sql, (c) =>
|
await database.Execute(sql, (c) =>
|
||||||
{
|
{
|
||||||
@ -36,8 +38,15 @@ namespace HermesSocketServer.Store
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.Error(ex, "Failed to execute a prepared statement: " + sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async Task DoPreparedStatementRaw<V>(Database database, string sql, IEnumerable<V> values, string[] columns)
|
public async Task DoPreparedStatementRaw<V>(Database database, string sql, IEnumerable<V> values, string[] columns)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
await database.Execute(sql, (c) =>
|
await database.Execute(sql, (c) =>
|
||||||
{
|
{
|
||||||
@ -53,6 +62,11 @@ namespace HermesSocketServer.Store
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.Error(ex, "Failed to execute a prepared statement: " + sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string GenerateInsertSql(string table, IEnumerable<T> values, IEnumerable<string> columns)
|
public string GenerateInsertSql(string table, IEnumerable<T> values, IEnumerable<string> columns)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user