getOptional method

  1. @override
Future<Row?> getOptional(
  1. String sql, [
  2. List<Object?> parameters = const []
])
override

Execute a read-only (SELECT) query and return a single optional result.

Implementation

@override
Future<Row?> getOptional(String sql,
    [List<Object?> parameters = const []]) async {
  final rows = await getAll(sql, parameters);
  return rows.isEmpty ? null : rows.first;
}