0

In the Opaleye Tutorial, line 88 lists the following example ghci command.

ghci> printSql personQuery

personQuery there is a predefined query, and it appears that printSql is a function which prints the SQL generated by it.

Where is this printSql function defined? I have searched through all the modules of the opaleye package and do not see it defined there.

How can I see the SQL generated by an opaleye query?

mherzl
  • 5,624
  • 6
  • 34
  • 75
  • 3
    `printSql` [is defined in the tutorial itself](https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/Doc/Tutorial/TutorialBasic.lhs#L854), in terms of [`showSqlForPostgres`](https://hackage.haskell.org/package/opaleye-0.6.0.0/docs/Opaleye-Sql.html#v:showSqlForPostgres). Note that the tutorial uses explicit or qualified imports for everything; that being so, if the function came from Opaleye you'd be able to discover that at once through the import list. – duplode Feb 20 '18 at 02:43
  • @duplode that answers my question, thank you. – mherzl Feb 20 '18 at 05:59

0 Answers0