Skip to content

Commit

Permalink
Display enums flagged as Flags as hexadecimal in sql output (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdX7 authored Oct 10, 2024
1 parent 4845fe3 commit 47e05d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions WowPacketParser/SQL/QueryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public virtual string Build()

query.Append(SQLUtil.AddBackQuotes(field.Item3.First().Name + (field.Item3.First().StartAtZero ? i : i+1)));
query.Append("=");
query.Append(SQLUtil.ToSQLValue(v, noQuotes: field.Item3.Any(a => a.NoQuotes)));
query.Append(SQLUtil.ToSQLValue(v, v.GetType().GetCustomAttribute<FlagsAttribute>() != null, field.Item3.Any(a => a.NoQuotes)));
query.Append(SQLUtil.CommaSeparator);

hasValues = true;
Expand All @@ -363,7 +363,7 @@ public virtual string Build()

query.Append(field.Item1);
query.Append("=");
query.Append(SQLUtil.ToSQLValue(value, noQuotes: field.Item3.Any(a => a.NoQuotes)));
query.Append(SQLUtil.ToSQLValue(value, value.GetType().GetCustomAttribute<FlagsAttribute>() != null, field.Item3.Any(a => a.NoQuotes)));
query.Append(SQLUtil.CommaSeparator);
}
if (!hasValues)
Expand Down Expand Up @@ -566,14 +566,14 @@ public string Build()
query.Append("UNKNOWN");
}
else
query.Append(SQLUtil.ToSQLValue(v, noQuotes: field.Item3.Any(a => a.NoQuotes)));
query.Append(SQLUtil.ToSQLValue(v, v.GetType().GetCustomAttribute<FlagsAttribute>() != null, field.Item3.Any(a => a.NoQuotes)));

query.Append(SQLUtil.CommaSeparator);
}
}
else
{
query.Append(SQLUtil.ToSQLValue(value, noQuotes: field.Item3.Any(a => a.NoQuotes == true)));
query.Append(SQLUtil.ToSQLValue(value, value.GetType().GetCustomAttribute<FlagsAttribute>() != null, field.Item3.Any(a => a.NoQuotes == true)));
query.Append(SQLUtil.CommaSeparator);
}
}
Expand Down

0 comments on commit 47e05d9

Please sign in to comment.