pluck method

  1. @override
Future<List> pluck(
  1. List<String> columns
)
override

pluck pluck

Implementation

@override
Future<List<dynamic>> pluck(List<String> columns) async {
  final builder = _copyQueryWith(
      columns: columns.map((column) => '${schema.table}.$column').toList());

  final completer = Completer<List<Map<String, dynamic>>>()
    ..complete(database!.rawQuery(builder.sql, builder.arguments));

  if (isLogger!) Logger.query(type, completer.future, builder);
  final result = await completer.future
      .then((value) => value.map((item) => item.values.toList()).toList())
      .whenComplete(clear);

  return columns.length == 1 ? result.flatten : result;
}