-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow inner subqueries with CTEs in postgres #720
base: master
Are you sure you want to change the base?
Conversation
@@ -155,13 +155,13 @@ runPgRowReader conn rowIdx res fields (FromBackendRowM readRow) = | |||
Pg.ConversionFailed { Pg.errSQLType = sql | |||
, Pg.errHaskellType = hs | |||
, Pg.errMessage = msg | |||
, Pg.errSQLField = field } -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting rid of GHC warnings here.
in Q (liftF (QAll (\tblPfx tName -> | ||
let (_, names) = mkFieldNames @Postgres @res (qualifiedField tName) | ||
in fromTable (PgTableSourceSyntax $ | ||
mconcat [ emit "(", fromPgSelect (fromSyntax tblPfx), emit ")" ]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need the ( )
to surround the WITH
clause here.
|
||
!beam-query | ||
```haskell | ||
!example chinook only:Postgres |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually works!
Tangential comment: what's the process for generating documentation now? |
I have a nix expression I use to build documentation. I know ken had some issues with using Nix, but my own workflow is nix heavy. I could try doing it with Docker and seeing if I get it to work. It unfortunately needs a postgresql server as well. |
This is a response to #662 which allows postgres (which supports inner CTEs) to embed
With
monads into regularQ
objects, instead of justSqlSelect
(which is whatselectWith
does). TheselectWith
behavior is correct since that's the standard specified constraint, butpgSelectWith
is more flexible.Docs are included (working on building them again)