From c4972a5f59c47b80899c6dbe067fd9ddac3004c8 Mon Sep 17 00:00:00 2001 From: chriskl Date: Sat, 8 May 2004 14:08:00 +0000 Subject: [PATCH] show comments on functions --- HISTORY | 3 ++- classes/database/Postgres.php | 8 +++++--- classes/database/Postgres72.php | 5 +++-- classes/database/Postgres73.php | 5 +++-- functions.php | 5 ++++- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/HISTORY b/HISTORY index 3f2c3830..0770b99d 100644 --- a/HISTORY +++ b/HISTORY @@ -7,7 +7,8 @@ Version 3.4-dev Features * Add CACHE and CYCLE parameters in sequence creation * View, add, edit and delete comments on tables, views, schemas, - aggregates, conversions, operators and columns (Dan Boren & ChrisKL) + aggregates, conversions, operators, functions and + columns (Dan Boren & ChrisKL) * Allow creating array columns in tables * Allow adding array columns to tables * Allow creating domains with type length and arrays diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index 075726ac..11ba036f 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -4,7 +4,7 @@ * A class that implements the DB interface for Postgres * Note: This class uses ADODB and returns RecordSets. * - * $Id: Postgres.php,v 1.193 2004/05/08 11:34:08 chriskl Exp $ + * $Id: Postgres.php,v 1.194 2004/05/08 14:08:01 chriskl Exp $ */ // @@@ THOUGHT: What about inherits? ie. use of ONLY??? @@ -3314,7 +3314,8 @@ class Postgres extends BaseDB { proname, proretset, pt.typname AS return_type, - oidvectortypes(pc.proargtypes) AS arguments + oidvectortypes(pc.proargtypes) AS arguments, + (SELECT description FROM pg_description pd WHERE pc.oid=pd.objoid) AS funccomment FROM pg_proc pc, pg_user pu, pg_type pt WHERE @@ -3327,7 +3328,8 @@ class Postgres extends BaseDB { proname, proretset, 'OPAQUE' AS result, - oidvectortypes(pc.proargtypes) AS arguments + oidvectortypes(pc.proargtypes) AS arguments, + (SELECT description FROM pg_description pd WHERE pc.oid=pd.objoid) AS funccomment FROM pg_proc pc, pg_user pu, pg_type pt WHERE diff --git a/classes/database/Postgres72.php b/classes/database/Postgres72.php index d8db8755..17eac9da 100644 --- a/classes/database/Postgres72.php +++ b/classes/database/Postgres72.php @@ -4,7 +4,7 @@ * A class that implements the DB interface for Postgres * Note: This class uses ADODB and returns RecordSets. * - * $Id: Postgres72.php,v 1.60 2004/05/08 11:34:14 chriskl Exp $ + * $Id: Postgres72.php,v 1.61 2004/05/08 14:08:09 chriskl Exp $ */ @@ -263,7 +263,8 @@ class Postgres72 extends Postgres71 { p.proname, false AS proretset, format_type(p.prorettype, NULL) AS return_type, - oidvectortypes(p.proargtypes) AS arguments + oidvectortypes(p.proargtypes) AS arguments, + (SELECT description FROM pg_description pd WHERE p.oid=pd.objoid) AS funccomment FROM pg_proc p WHERE diff --git a/classes/database/Postgres73.php b/classes/database/Postgres73.php index 5d034be2..9af98894 100644 --- a/classes/database/Postgres73.php +++ b/classes/database/Postgres73.php @@ -4,7 +4,7 @@ * A class that implements the DB interface for Postgres * Note: This class uses ADODB and returns RecordSets. * - * $Id: Postgres73.php,v 1.96 2004/05/08 11:36:45 chriskl Exp $ + * $Id: Postgres73.php,v 1.97 2004/05/08 14:08:09 chriskl Exp $ */ // @@@ THOUGHT: What about inherits? ie. use of ONLY??? @@ -709,7 +709,8 @@ class Postgres73 extends Postgres72 { p.proname, p.proretset, pg_catalog.format_type(p.prorettype, NULL) AS return_type, - pg_catalog.oidvectortypes(p.proargtypes) AS arguments + pg_catalog.oidvectortypes(p.proargtypes) AS arguments, + pg_catalog.obj_description(p.oid, 'pg_proc') AS funccomment FROM pg_catalog.pg_proc p LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace WHERE p.prorettype <> 'pg_catalog.cstring'::pg_catalog.regtype diff --git a/functions.php b/functions.php index 53b74f2d..2ad434a3 100644 --- a/functions.php +++ b/functions.php @@ -3,7 +3,7 @@ /** * Manage functions in a database * - * $Id: functions.php,v 1.27 2004/01/14 02:14:28 chriskl Exp $ + * $Id: functions.php,v 1.28 2004/05/08 14:08:00 chriskl Exp $ */ // Include application functions @@ -335,6 +335,8 @@ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; $i = 0; while (!$funcs->EOF) { $funcs->f[$data->fnFields['setof']] = $data->phpBool($funcs->f[$data->fnFields['setof']]); @@ -357,6 +359,7 @@ $funcs->f[$data->fnFields['fnoid']], "&type=function\">{$lang['strprivileges']}\n"; } else echo ""; + echo "\n"; echo "\n"; $funcs->moveNext(); $i++; -- 2.39.5
{$lang['strfunctions']}{$lang['strreturns']}{$lang['strarguments']}{$lang['stractions']}{$lang['strcomment']}
", $misc->printVal($funcs->f['funccomment']), "