refactor: Use hasql-dynamic on RPC/POST/PUT/PATCH
Change callProc/createWriteStatement to H.Snippet. Parametrize the inputs on the same SQLFragments by taking advantage of hasql-dynamic-statements. It's not necessary to parametrize every input, inlining with pgFmtLit can still be used for queries that can't be parametrized(like SET LOCALs). Also adds hasql-dynamic-statements to Nix and stack.
This commit is contained in:
committed by
Steve Chavez
parent
b13e95aefb
commit
8e58b56d5c
@@ -17,6 +17,33 @@ let
|
||||
#
|
||||
# To get the sha256:
|
||||
# nix-prefetch-url --unpack https://hackage.haskell.org/package/protolude-0.3.0/protolude-0.3.0.tar.gz
|
||||
|
||||
# TODO: We need to patch upstream for unbreaking hasql-dynamic-statements, hasql-implicits, ptr
|
||||
hasql-dynamic-statements =
|
||||
self.haskell.lib.dontCheck (prev.callHackageDirect
|
||||
{
|
||||
pkg = "hasql-dynamic-statements";
|
||||
ver = "0.3.1";
|
||||
sha256 = "1zjv91xlfkyxwq6mhzj7rsfm4kjvs9ygkgbl6jbbg19jihcn2kiy";
|
||||
}
|
||||
{ }
|
||||
);
|
||||
hasql-implicits =
|
||||
prev.callHackageDirect
|
||||
{
|
||||
pkg = "hasql-implicits";
|
||||
ver = "0.1.0.2";
|
||||
sha256 = "1z05amiy5zmf8fmr3dqp8b4svb0sj037gdjc5b9va5d5kdi95bv7";
|
||||
}
|
||||
{ };
|
||||
ptr =
|
||||
prev.callHackageDirect
|
||||
{
|
||||
pkg = "ptr";
|
||||
ver = "0.16.7.2";
|
||||
sha256 = "1njb05jc1bdyxk7qh7s1y4ivn5nrpy3rhlkf4jlfamvlg8idkavc";
|
||||
}
|
||||
{ };
|
||||
protolude = prev.protolude_0_3_0;
|
||||
} // extraOverrides final prev;
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user