Skip to content

AsyncSQLToOption.future ignores isSingle flag #593

Open
@sbmpost

Description

@sbmpost
  1. Create a table with 2 rows in it.
  2. Execute: withSQL { sqls("select * from table") }.first.future()

This returns TooManyRowsError. The reason is that future() does not take into account the isSingle = false value set by first. See AsyncSQLs.AsyncSQLToOption.

Fix: The implementation of future() should check the isSingle field before calling session.single.

Workaround: Execute with limit like so: withSQL { sqls("select * from table limit 1") }.first.future()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions