zio / zio-protoquill

Quill for Scala 3
Apache License 2.0
198 stars 48 forks source link

Raw Query parse sql with Tuple output incorrect #454

Open timzaak opened 1 month ago

timzaak commented 1 month ago

Version: (e.g. 4.8.4) Module: (e.g. quill-jdbc) Database: (e.g. postgresql)

Expected behavior

 val data = db.run(quote{
      sql"""SELECT time, data from abc where user_id = 1 order by time"""
      .as[Query[(LocalDateTime, io.circe.Json)]]
    })

can be work correctly.

Actual behavior

The SQL log output:

SELECT x._1, x._2 FROM (SELECT time, data from abc  order by time) AS x

Workaround

 sql"""SELECT time as _1, data as _2 from abc where user_id = 1 order by time"""
      .as[Query[(LocalDateTime, io.circe.Json)]]

do it on my own

@getquill/maintainers