Skip to content
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

Easier logging of the update, insert ... #45

Open
jim108dev opened this issue Feb 6, 2021 · 0 comments
Open

Easier logging of the update, insert ... #45

jim108dev opened this issue Feb 6, 2021 · 0 comments
Labels
convenience Nice to have utility derived from existing functionality good first issue Good for newcomers

Comments

@jim108dev
Copy link

I guess everybody who wants to log his or her queries/commands is doing the same,

logUpdate 
  forall t s r m.
  TableToColsWithoutAlias s t r =>
  GetCols r =>
  MonadEffect m =>
  Table t  ({ | r }  Col s Boolean)  ({ | r }  { | r })  m Unit
logUpdate table pred up = do
  let
    { strQuery, params } = showPG $ showUpdate table pred up
  log strQuery
  log $ unsafeStringify params
  log ""

logQuery :: forall s i m. GetCols i => MonadEffect m => FullQuery s { | i } -> m Unit
logQuery q = do
  let
    { strQuery, params } = showPG $ showQuery q
  log strQuery
  log $ unsafeStringify params
  log ""
...

I don't know how to do it, but it would be nice to have some sort of tee or errorTee function, which lets me express the statement "I would like to see the generated output".

@Kamirus Kamirus added convenience Nice to have utility derived from existing functionality good first issue Good for newcomers labels Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
convenience Nice to have utility derived from existing functionality good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants