tomyeh / postgresql

Dart Postgresql database library.
https://quire.io
BSD 2-Clause "Simplified" License
15 stars 7 forks source link

Support of list types in DefaultTypeConverter #12

Closed darkstarx closed 4 years ago

darkstarx commented 4 years ago

Hi! For queries like this

  Future<List<OrderState>> getStates(final Iterable<int> orderIds) async
  {
    final sql = 'select id, state from orders where id in (@orderIds)';
    final rows = await query(sql, {
      'orderIds': orderIds
    });
    ...
  }

it would be nice to have list support for query values. Such query should look like this select id, state from orders where id in (1, 2, 3)

tomyeh commented 4 years ago

Sorry, I don't like this kind of extension. First, orderIds can be empty and the result will be syntax error. Second, List is a valid type.