Skip to content

Conversation

@vrom911
Copy link
Contributor

@vrom911 vrom911 commented Jul 3, 2019

No description provided.

@vrom911 vrom911 added the enhancement New feature or request label Jul 3, 2019
@vrom911 vrom911 requested a review from chshersh July 3, 2019 06:57
@vrom911 vrom911 self-assigned this Jul 3, 2019
Copy link
Contributor

@chshersh chshersh left a 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)
Copy link
Contributor

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)
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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!

vrom911 and others added 3 commits July 3, 2019 17:02
Co-Authored-By: Dmitrii Kovanikov <dmitrii@holmusk.com>
@chshersh chshersh merged commit cbfc6fa into master Jul 3, 2019
@chshersh chshersh deleted the vrom911/initial-impl branch July 3, 2019 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants