generated from tpl/purs
Add command line parameter to purspgpp
This commit is contained in:
11
PurspgppExample.purs
Normal file
11
PurspgppExample.purs
Normal file
@@ -0,0 +1,11 @@
|
||||
module PurspgppExample where
|
||||
|
||||
f :: Query (String × Unit) (UUID × String × Unit)
|
||||
f = [query|
|
||||
SELECT id, name
|
||||
FROM files
|
||||
WHERE author_id = $1
|
||||
|]
|
||||
|
||||
g :: Query Unit (Boolean × Unit)
|
||||
g = [query|SELECT pg_try_advisory_lock(3735928559)|]
|
||||
18
purspgpp
18
purspgpp
@@ -75,21 +75,7 @@ sub process-query($conn, Str:D $source) {
|
||||
"(Query \"\"\"$source\"\"\" :: Query ($parameters) ($fields))";
|
||||
}
|
||||
|
||||
sub MAIN {
|
||||
sub MAIN(IO(Cool) $filename) {
|
||||
my $conn = libpq::Connection.new("user=postgres password=lol123 dbname=nn");
|
||||
|
||||
print process-module($conn, $=finish);
|
||||
print process-module($conn, $filename.slurp);
|
||||
}
|
||||
|
||||
=finish
|
||||
module M where
|
||||
|
||||
f :: Query (String × Unit) (UUID × String × Unit)
|
||||
f = [query|
|
||||
SELECT id, name
|
||||
FROM files
|
||||
WHERE author_id = $1
|
||||
|]
|
||||
|
||||
g :: Query Unit (Boolean × Unit)
|
||||
g = [query|SELECT pg_try_advisory_lock(3735928559)|]
|
||||
|
||||
Reference in New Issue
Block a user