[pgsqlclient-checkins] SF.net SVN: pgsqlclient: [105] trunk/PostgreSqlClient/source/PostgreSql/Data/
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2006-04-12 14:56:45
|
Revision: 105 Author: carlosga_fb Date: 2006-04-12 07:56:35 -0700 (Wed, 12 Apr 2006) ViewCVS: http://svn.sourceforge.net/pgsqlclient/?rev=105&view=rev Log Message: ----------- ?\194?\183 More changes on schema support NOT FINISHED !!! Added Paths: ----------- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctionParameters.cs Added: trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctionParameters.cs =================================================================== --- trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctionParameters.cs (rev 0) +++ trunk/PostgreSqlClient/source/PostgreSql/Data/Schema/PgFunctionParameters.cs 2006-04-12 14:56:35 UTC (rev 105) @@ -0,0 +1,74 @@ +/* + * PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ + * + * The contents of this file are subject to the Initial + * Developer's Public License Version 1.0 (the "License"); + * you may not use this file except in compliance with the + * License. + * + * Software distributed under the License is distributed on + * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either + * express or implied. See the License for the specific + * language governing rights and limitations under the License. + * + * Copyright (c) 2003, 2006 Carlos Guzman Alvarez + * All Rights Reserved. + */ + +using System; + +namespace PostgreSql.Data.Schema +{ + internal class PgFunctionParameters : PgSchema + { + #region \xB7 Protected Methods \xB7 + + protected override string BuildSql(string[] restrictions) + { + string where = ""; + string sql = + "SELECT " + + "current_database() AS FUNCTION_CATALOG, " + + "pg_namespace.nspname AS FUNCTION_SCHEMA, " + + "pg_proc.proname AS FUNCTION_NAME, " + + "FROM " + + "pg_proc " + + "left join pg_namespace ON pg_proc.pronamespace = pg_namespace.oid " + + "left join pg_description ON pg_proc.oid = pg_description.objoid "; + + if (restrictions != null && restrictions.Length > 0) + { + // FUNCTION_CATALOG + if (restrictions.Length > 0 && restrictions[0] != null) + { + } + + // FUNCTION_SCHEMA + if (restrictions.Length > 1 && restrictions[1] != null) + { + if (where.Length > 0) + { + where += " and "; + } + where += String.Format("pg_namespace.nspname = '{0}'", restrictions[1]); + } + + // FUNCTION_NAME + if (restrictions.Length > 2 && restrictions[2] != null) + { + if (where.Length > 0) + { + where += " and "; + } + where += String.Format(" and pg_proc.proname = '{0}'", restrictions[2]); + } + } + + sql += "WHERE " + where + " ORDER BY pg_namespace.nspname, pg_proc.proname"; + + return sql; + } + + #endregion + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |