hasColumns method
Determines if the given table has all of the specified columns.
Implementation
@override
Future<bool> hasColumns(
String table,
List<String> columns, {
String? schema,
}) async {
final tableColumns = await listColumns(table, schema: schema);
final lowerCaseColumns = tableColumns
.map((c) => c.name.toLowerCase())
.toSet();
for (final column in columns) {
if (!lowerCaseColumns.contains(column.toLowerCase())) {
return false;
}
}
return true;
}