-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cff779f
commit dd62238
Showing
7 changed files
with
264 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,117 @@ | ||
name: hasql-dynamic-statements | ||
version: 0.3.1.2 | ||
synopsis: Toolkit for constructing Hasql statements dynamically | ||
name: hasql-dynamic-statements | ||
version: 0.3.1.2 | ||
synopsis: Toolkit for constructing Hasql statements dynamically | ||
description: | ||
This library introduces into the Hasql ecosystem a new abstraction named Snippet, | ||
which makes it trivial to construct SQL, while injecting values. | ||
It is intended to be used when the SQL of your statement depends on the parameters, | ||
that you want to pass in. | ||
homepage: https://github.com/nikita-volkov/hasql-dynamic-statements | ||
bug-reports: https://github.com/nikita-volkov/hasql-dynamic-statements/issues | ||
author: Nikita Volkov <nikita.y.volkov@mail.ru> | ||
maintainer: Nikita Volkov <nikita.y.volkov@mail.ru> | ||
copyright: (c) 2019, Nikita Volkov | ||
license: MIT | ||
license-file: LICENSE | ||
build-type: Simple | ||
|
||
homepage: https://github.com/nikita-volkov/hasql-dynamic-statements | ||
bug-reports: | ||
https://github.com/nikita-volkov/hasql-dynamic-statements/issues | ||
|
||
author: Nikita Volkov <nikita.y.volkov@mail.ru> | ||
maintainer: Nikita Volkov <nikita.y.volkov@mail.ru> | ||
copyright: (c) 2019, Nikita Volkov | ||
license: MIT | ||
license-file: LICENSE | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
|
||
source-repository head | ||
type: git | ||
type: git | ||
location: git://github.com/nikita-volkov/hasql-dynamic-statements.git | ||
|
||
library | ||
hs-source-dirs: library | ||
default-extensions: BangPatterns, DeriveDataTypeable, DeriveGeneric, DeriveFunctor, DeriveTraversable, GeneralizedNewtypeDeriving, FlexibleContexts, FlexibleInstances, LambdaCase, NoImplicitPrelude, OverloadedStrings, RankNTypes, ScopedTypeVariables, StandaloneDeriving, TypeApplications, TypeFamilies | ||
ghc-options: -funbox-strict-fields | ||
default-language: Haskell2010 | ||
hs-source-dirs: library | ||
default-extensions: | ||
NoImplicitPrelude | ||
BangPatterns | ||
DeriveDataTypeable | ||
DeriveFunctor | ||
DeriveGeneric | ||
DeriveTraversable | ||
FlexibleContexts | ||
FlexibleInstances | ||
GeneralizedNewtypeDeriving | ||
LambdaCase | ||
OverloadedStrings | ||
RankNTypes | ||
ScopedTypeVariables | ||
StandaloneDeriving | ||
TypeApplications | ||
TypeFamilies | ||
|
||
ghc-options: -funbox-strict-fields | ||
default-language: Haskell2010 | ||
exposed-modules: | ||
Hasql.DynamicStatements.Session | ||
Hasql.DynamicStatements.Snippet | ||
Hasql.DynamicStatements.Statement | ||
|
||
other-modules: | ||
Hasql.DynamicStatements.Prelude | ||
Hasql.DynamicStatements.Snippet.Defs | ||
|
||
build-depends: | ||
base >=4.12 && <5, | ||
bytestring >=0.10 && <0.13, | ||
containers >=0.6 && <0.7, | ||
hasql >=1.6 && <1.7, | ||
hasql-implicits >=0.1 && <0.2, | ||
ptr >=0.16.7.2 && <0.17 | ||
base >=4.12 && <5 | ||
, bytestring >=0.10 && <0.13 | ||
, containers >=0.6 && <0.7 | ||
, hasql >=1.6 && <1.7 | ||
, hasql-implicits >=0.1 && <0.2 | ||
, ptr >=0.16.7.2 && <0.17 | ||
|
||
test-suite test | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: test | ||
main-is: Main.hs | ||
default-extensions: Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeApplications, TypeFamilies, TypeOperators, UnboxedTuples | ||
default-language: Haskell2010 | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: test | ||
main-is: Main.hs | ||
default-extensions: | ||
NoImplicitPrelude | ||
NoMonomorphismRestriction | ||
Arrows | ||
BangPatterns | ||
ConstraintKinds | ||
DataKinds | ||
DefaultSignatures | ||
DeriveDataTypeable | ||
DeriveFoldable | ||
DeriveFunctor | ||
DeriveGeneric | ||
DeriveTraversable | ||
EmptyDataDecls | ||
FlexibleContexts | ||
FlexibleInstances | ||
FunctionalDependencies | ||
GADTs | ||
GeneralizedNewtypeDeriving | ||
LambdaCase | ||
LiberalTypeSynonyms | ||
MagicHash | ||
MultiParamTypeClasses | ||
MultiWayIf | ||
OverloadedStrings | ||
ParallelListComp | ||
PatternGuards | ||
QuasiQuotes | ||
RankNTypes | ||
RecordWildCards | ||
ScopedTypeVariables | ||
StandaloneDeriving | ||
TemplateHaskell | ||
TupleSections | ||
TypeApplications | ||
TypeFamilies | ||
TypeOperators | ||
UnboxedTuples | ||
|
||
default-language: Haskell2010 | ||
build-depends: | ||
hasql, | ||
hasql-dynamic-statements, | ||
QuickCheck >=2.8.1 && <3, | ||
quickcheck-instances >=0.3.11 && <0.4, | ||
rerebase <2, | ||
tasty >=0.12 && <2, | ||
tasty-hunit >=0.9 && <0.11, | ||
tasty-quickcheck >=0.9 && <0.11 | ||
hasql | ||
, hasql-dynamic-statements | ||
, QuickCheck >=2.8.1 && <3 | ||
, quickcheck-instances >=0.3.11 && <0.4 | ||
, rerebase <2 | ||
, tasty >=0.12 && <2 | ||
, tasty-hunit >=0.9 && <0.11 | ||
, tasty-quickcheck >=0.9 && <0.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
module Hasql.DynamicStatements.Session where | ||
|
||
import qualified Hasql.Decoders as Decoders | ||
import Hasql.DynamicStatements.Prelude | ||
import Hasql.Session | ||
import qualified Hasql.DynamicStatements.Snippet.Defs as SnippetDefs | ||
import qualified Hasql.DynamicStatements.Statement as Statement | ||
import qualified Hasql.Decoders as Decoders | ||
import Hasql.Session | ||
import qualified Hasql.Session as Session | ||
|
||
{-| | ||
Execute a dynamically parameterized statement, providing a result decoder. | ||
This is merely a shortcut, which immediately embeds | ||
@Hasql.DynamicStatements.Statement.'Statement.dynamicallyParameterized'@ | ||
in @Session@. | ||
For details see the docs on that function. | ||
-} | ||
-- | | ||
-- Execute a dynamically parameterized statement, providing a result decoder. | ||
-- | ||
-- This is merely a shortcut, which immediately embeds | ||
-- @Hasql.DynamicStatements.Statement.'Statement.dynamicallyParameterized'@ | ||
-- in @Session@. | ||
-- For details see the docs on that function. | ||
dynamicallyParameterizedStatement :: SnippetDefs.Snippet -> Decoders.Result result -> Bool -> Session result | ||
dynamicallyParameterizedStatement snippet decoder prepared = | ||
Session.statement () (Statement.dynamicallyParameterized snippet decoder prepared) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
module Hasql.DynamicStatements.Snippet | ||
( | ||
Snippet, | ||
param, | ||
encoderAndParam, | ||
sql, | ||
) | ||
( Snippet, | ||
param, | ||
encoderAndParam, | ||
sql, | ||
) | ||
where | ||
|
||
import Hasql.DynamicStatements.Snippet.Defs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.