WIP: show procs in OpenAPI description
Thanks @LogvinovLeon
This commit is contained in:
@@ -95,12 +95,20 @@ decodeSynonyms cols =
|
||||
<*> HD.value HD.text <*> HD.value HD.text
|
||||
<*> HD.value HD.text <*> HD.value HD.text
|
||||
|
||||
accessibleProcs :: H.Query Schema [(Text, Text)]
|
||||
accessibleProcs :: H.Query Schema [(Text, ProcDescription)]
|
||||
accessibleProcs =
|
||||
H.statement sql (HE.value HE.text) (HD.rowsList ((,) <$> HD.value HD.text <*> HD.value HD.text)) True
|
||||
H.statement sql (HE.value HE.text)
|
||||
(map addName <$> HD.rowsList (ProcDescription <$> HD.value HD.text
|
||||
<*> HD.value HD.text
|
||||
<*> HD.value HD.text)) True
|
||||
where
|
||||
addName :: ProcDescription -> (Text, ProcDescription)
|
||||
addName pd = (pdName pd, pd)
|
||||
|
||||
sql = [q|
|
||||
SELECT p.proname as "proc_name", pg_get_function_result(p.oid) as "return_type"
|
||||
SELECT p.proname as "proc_name",
|
||||
pg_get_function_arguments(p.oid) as "args",
|
||||
pg_get_function_result(p.oid) as "return_type"
|
||||
FROM pg_namespace n
|
||||
JOIN pg_proc p
|
||||
ON pronamespace = n.oid
|
||||
|
||||
Reference in New Issue
Block a user