-
Notifications
You must be signed in to change notification settings - Fork 2
Initial implementation #1
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
Conversation
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.
Very nice implementation!
| import Data.List (lookup) | ||
| import Data.List.NonEmpty (NonEmpty (..)) | ||
| import Data.Text (Text) | ||
| import Data.Text.Encoding (decodeUtf8) |
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.
Heh, I think it was painful to write all these imports without relude...
| :: forall m . WithError m | ||
| => NonEmpty Name -- ^ List of the names used in query | ||
| -> [NamedParam] -- ^ List of the named parameters | ||
| -> m (NonEmpty PG.Action) |
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.
It's nice that this function is abstracted over WithError monad. This means that in this package we can also implement queryNamed and executeNamed functions 👍 No necessary in this PR, but should be possible in theory.
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.
I made an issue: #3
| > queryNamed [sql| | ||
| > SELECT * | ||
| > FROM table | ||
| > WHERE foo = ?foo |
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.
Wow, it's very nice to such docs in the .cabal file description! Good idea!
Co-Authored-By: Dmitrii Kovanikov <dmitrii@holmusk.com>
No description provided.