aboutsummaryrefslogtreecommitdiff
path: root/elymas/lib
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2015-03-05 00:16:22 +0100
committerDrahflow <drahflow@gmx.de>2015-03-05 00:16:22 +0100
commit579a29c59b94370c40a71168271aa5fb96f764c8 (patch)
treedb7cf7289ff3069f3e7d22aa3657ea7cba548058 /elymas/lib
parentc3836f20bc8becaaa3e5266d1e56319b7d9093b8 (diff)
The nonbreaking-space hack is now official
Diffstat (limited to 'elymas/lib')
-rw-r--r--elymas/lib/ffi/pq.ey31
1 files changed, 31 insertions, 0 deletions
diff --git a/elymas/lib/ffi/pq.ey b/elymas/lib/ffi/pq.ey
index 0cf1d03..16997ab 100644
--- a/elymas/lib/ffi/pq.ey
+++ b/elymas/lib/ffi/pq.ey
@@ -171,6 +171,37 @@
> } ; -01 deffst
}' each
> } ; /connect deffd
+
+ {
+ connect ==con
+ con .status { <
+ con .errorMessage ==msg
+ > ???io.ffi.pq } rep
+
+ { # ==nsQuery
+ "" ==spaceQuery
+ { _ "([^ ]*) (.*)" regex } { -102 --
+ spaceQuery -01 cat " " cat =spaceQuery
+ } loop spaceQuery -01 cat =spaceQuery
+ spaceQuery ==parameterCountTmp
+ 0 ==maxParameter
+ { parameterCountTmp "^(.*)\\$(\\d+)(.*)$" regex } { ==a ==p ==b
+ a b cat =parameterCountTmp
+ p txt .consume .u maxParameter max =maxParameter
+ } loop
+
+ maxParameter {
+ maxParameter spaceQuery con .execParams
+ } {
+ spaceQuery con .exec
+ } ? * ":-" via
+ [
+ { :-status |COMMAND_OK eq }' { :-clear }'
+ { :-status |TUPLES_OK eq }' { :-all :-clear }'
+ { 1 }' { < :-error ==msg > ???io.ffi.pq }
+ ] conds
+ }
+ } /functional deffd
> /pq ffi .defv
# vim: syn=elymas