build method
Implementation
@override
QueryPrintable build() {
// all values keys
final keys =
listValues.map((e) => e.keys).expand((element) => element).toSet();
final valuesToInsert = listValues
.mapIndexed((index, values) => keys
.map((key) => values.containsKey(key) ? '@${key}_$index' : 'NULL')
.toList())
.toList();
final columns = keys.map((key) => mapColumn[key] ?? key).toList();
return QueryString()
.keyword('INSERT ')
.keyword('INTO ')
.userInput(name)
.space()
.parentheses((q) => q.comaSpaceSeparated(
columns.map((column) => QueryString().userInput(column))))
.keyword(' VALUES ')
.comaSpaceSeparated(valuesToInsert
.map((e) => QueryString().parentheses((q) =>
q.comaSpaceSeparated(e.map((e) => QueryString().userInput(e)))))
.toList());
}