-
-
Notifications
You must be signed in to change notification settings - Fork 522
Closed
Description
Hi,
In this method in QueryBuilder.Query.Insert.cs, the columnsList.Count and valuesList.Count cannot be compared as same values. It seems to be that the number of rows inserted must be the same as the number of column in the table.
Is it possible to fix it?
public Query AsInsert(IEnumerable<string> columns, IEnumerable<object> values)
{
var columnsList = columns?.ToList();
var valuesList = values?.ToList();
if ((columnsList?.Count ?? 0) == 0 || (valuesList?.Count ?? 0) == 0)
{
throw new InvalidOperationException($"{nameof(columns)} and {nameof(values)} cannot be null or empty");
}
if (columnsList.Count != valuesList.Count)
{
throw new InvalidOperationException($"{nameof(columns)} and {nameof(values)} cannot be null or empty");
}
Method = "insert";
ClearComponent("insert").AddComponent("insert", new InsertClause
{
Columns = columnsList,
Values = valuesList
});
return this;
}Metadata
Metadata
Assignees
Labels
No labels