query method Null safety

Future<Results> query(
  1. String sql,
  2. [List<Object?>? values]
)

Run sql query on the database using values as positional sql parameters.

eg. query('SELECT FROM users WHERE id = ?', [userId]).

Implementation

Future<Results> query(String sql, [List<Object?>? values]) async {
  if (values == null || values.isEmpty) {
    return _conn.processHandlerWithResults(QueryStreamHandler(sql), _timeout);
  }

  return (await queryMulti(sql, [values])).first;
}