From: Carlos G. Á. <car...@us...> - 2005-09-13 18:22:01
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Schema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29583/PostgreSql/Data/Schema Modified Files: MetaData.xml PgColumns.cs PgSchemaFactory.cs PgTables.cs Log Message: Started the rework of the Schema support Index: PgColumns.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Schema/PgColumns.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgColumns.cs 12 Sep 2005 18:27:45 -0000 1.1 --- PgColumns.cs 13 Sep 2005 18:21:51 -0000 1.2 *************** *** 58,63 **** if (restrictions != null && restrictions.Length > 0) { - sql += " WHERE "; - // TABLE_CATALOG if (restrictions.Length > 0) --- 58,61 ---- *************** *** 68,72 **** if (restrictions.Length > 1 && restrictions[1] != null) { ! sql += String.Format("pg_namespace.nspname = '{0}'", restrictions[1]); } --- 66,70 ---- if (restrictions.Length > 1 && restrictions[1] != null) { ! sql += String.Format(" and pg_namespace.nspname = '{0}'", restrictions[1]); } *************** *** 74,78 **** if (restrictions.Length > 2 && restrictions[2] != null) { ! sql += String.Format("pg_class.relname = '{0}'", restrictions[1]); } --- 72,76 ---- if (restrictions.Length > 2 && restrictions[2] != null) { ! sql += String.Format(" and pg_class.relname = '{0}'", restrictions[1]); } *************** *** 80,84 **** if (restrictions.Length > 3 && restrictions[3] != null) { ! sql += String.Format("pg_attribute.attname = '{0}'", restrictions[2]); } } --- 78,82 ---- if (restrictions.Length > 3 && restrictions[3] != null) { ! sql += String.Format(" and pg_attribute.attname = '{0}'", restrictions[2]); } } Index: PgSchemaFactory.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Schema/PgSchemaFactory.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgSchemaFactory.cs 12 Sep 2005 18:27:45 -0000 1.2 --- PgSchemaFactory.cs 13 Sep 2005 18:21:51 -0000 1.3 *************** *** 99,102 **** --- 99,106 ---- break; + case "primarykeys": + schema = new PgPrimaryKeys(); + break; + case "tables": schema = new PgTables(); Index: MetaData.xml =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Schema/MetaData.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MetaData.xml 12 Sep 2005 18:27:45 -0000 1.2 --- MetaData.xml 13 Sep 2005 18:21:51 -0000 1.3 *************** *** 108,114 **** <NumberOfRestrictions>0</NumberOfRestrictions> <NumberOfIdentifierParts>0</NumberOfIdentifierParts> ! <PopulationMechanism>PrepareCollection</PopulationMechanism> </MetaDataCollections> ! <MetaDataCollections> <CollectionName>CheckConstraints</CollectionName> <NumberOfRestrictions>3</NumberOfRestrictions> --- 108,115 ---- <NumberOfRestrictions>0</NumberOfRestrictions> <NumberOfIdentifierParts>0</NumberOfIdentifierParts> ! <PopulationMechanism>SQLCommand</PopulationMechanism> ! <PopulationString>SELECT pg_typesrc.typname AS SOURCE_TYPE, pg_typetgt.typname AS TARGET_TYPE, pg_namespace.nspname AS FUNCTION_SCHEMA, pg_proc.proname AS FUNCTION_NAME, case pg_cast.castcontext when 'e' THEN 'EXPLICIT' when 'a' THEN 'ASSIGNMENT' when 'i' THEN 'EXPRESSIONS' END AS CAST_CONTEXT FROM pg_cast left join pg_type as pg_typesrc ON pg_cast.castsource = pg_typesrc.oid left join pg_type as pg_typetgt ON pg_cast.casttarget = pg_typetgt.oid left join pg_proc ON pg_cast.castfunc = pg_proc.oid left join pg_namespace ON pg_proc.pronamespace = pg_namespace.oid ORDER BY pg_proc.proname</PopulationString> </MetaDataCollections> ! <MetaDataCollections> <CollectionName>CheckConstraints</CollectionName> <NumberOfRestrictions>3</NumberOfRestrictions> *************** *** 132,137 **** <NumberOfRestrictions>0</NumberOfRestrictions> <NumberOfIdentifierParts>0</NumberOfIdentifierParts> ! <PopulationMechanism>DataTable</PopulationMechanism> ! <PopulationString>DataSourceInformation</PopulationString> </MetaDataCollections> <MetaDataCollections> --- 133,138 ---- <NumberOfRestrictions>0</NumberOfRestrictions> <NumberOfIdentifierParts>0</NumberOfIdentifierParts> ! <PopulationMechanism>SQLCommand</PopulationMechanism> ! <PopulationString>SELECT pg_database.datname AS DATABASE_NAME, pg_database.datistemplate AS IS_TEMPLATE, pg_database.datallowconn AS ALLOW_CONNECTION, pg_database.datconfig AS DATABASE_CONFIG FROM pg_database</PopulationString> </MetaDataCollections> <MetaDataCollections> *************** *** 171,175 **** <NumberOfRestrictions>0</NumberOfRestrictions> <NumberOfIdentifierParts>0</NumberOfIdentifierParts> ! <PopulationMechanism>PrepareCollection</PopulationMechanism> </MetaDataCollections> <MetaDataCollections> --- 172,177 ---- <NumberOfRestrictions>0</NumberOfRestrictions> <NumberOfIdentifierParts>0</NumberOfIdentifierParts> ! <PopulationMechanism>SQLCommand</PopulationMechanism> ! <PopulationString>SELECT pg_group.groname AS GROUP_NAME, pg_group.grolist AS GROUP_USERS FROM pg_group ORDER BY pg_group.groname</PopulationString> </MetaDataCollections> <MetaDataCollections> *************** *** 247,252 **** <NumberOfIdentifierParts>0</NumberOfIdentifierParts> <PopulationMechanism>PrepareCollection</PopulationMechanism> ! </MetaDataCollections> ! <MetaDataCollections> <CollectionName>ViewColumns</CollectionName> <NumberOfRestrictions>4</NumberOfRestrictions> --- 249,261 ---- <NumberOfIdentifierParts>0</NumberOfIdentifierParts> <PopulationMechanism>PrepareCollection</PopulationMechanism> ! </MetaDataCollections> ! <MetaDataCollections> ! <CollectionName>Users</CollectionName> ! <NumberOfRestrictions>0</NumberOfRestrictions> ! <NumberOfIdentifierParts>0</NumberOfIdentifierParts> ! <PopulationMechanism>SQLCommand</PopulationMechanism> ! <PopulationString>SELECT pg_shadow.usename AS USER_NAME, pg_shadow.usecreatedb AS CREATE_DATABASE, pg_shadow.usesuper AS IS_SUPERUSER, pg_shadow.usecatupd AS UPDATE_SYSCATALOGS, pg_shadow.passwd AS PASSWORD, pg_shadow.useconfig AS CONFIGURATION FROM pg_shadow ORDER BY pg_shadow.usename</PopulationString> ! </MetaDataCollections> ! <MetaDataCollections> <CollectionName>ViewColumns</CollectionName> <NumberOfRestrictions>4</NumberOfRestrictions> *************** *** 291,294 **** --- 300,321 ---- </Restrictions> <Restrictions> + <CollectionName>PrimaryKeys</CollectionName> + <RestrictionName>Catalog</RestrictionName> + <RestrictionDefault>table_catalog</RestrictionDefault> + <RestrictionNumber>1</RestrictionNumber> + </Restrictions> + <Restrictions> + <CollectionName>PrimaryKeys</CollectionName> + <RestrictionName>Schema</RestrictionName> + <RestrictionDefault>table_schema</RestrictionDefault> + <RestrictionNumber>2</RestrictionNumber> + </Restrictions> + <Restrictions> + <CollectionName>PrimaryKeys</CollectionName> + <RestrictionName>Table</RestrictionName> + <RestrictionDefault>table_name</RestrictionDefault> + <RestrictionNumber>3</RestrictionNumber> + </Restrictions> + <Restrictions> <CollectionName>Tables</CollectionName> <RestrictionName>Catalog</RestrictionName> Index: PgTables.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/Schema/PgTables.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgTables.cs 12 Sep 2005 18:27:45 -0000 1.2 --- PgTables.cs 13 Sep 2005 18:21:51 -0000 1.3 *************** *** 50,55 **** if (restrictions != null && restrictions.Length > 0) { - sql += " WHERE "; - // TABLE_CATALOG if (restrictions.Length > 0) --- 50,53 ---- *************** *** 60,64 **** if (restrictions.Length > 1 && restrictions[1] != null) { ! sql += String.Format("pg_namespace.nspname = '{0}'", restrictions[1]); } --- 58,62 ---- if (restrictions.Length > 1 && restrictions[1] != null) { ! sql += String.Format(" and pg_namespace.nspname = '{0}'", restrictions[1]); } *************** *** 66,70 **** if (restrictions.Length > 2 && restrictions[2] != null) { ! sql += String.Format("pg_class.relname = '{0}'", restrictions[1]); } --- 64,68 ---- if (restrictions.Length > 2 && restrictions[2] != null) { ! sql += String.Format(" and pg_class.relname = '{0}'", restrictions[1]); } *************** *** 72,76 **** if (restrictions.Length > 3 && restrictions[3] != null) { ! sql += String.Format("pg_class.relkind = '{0}'", restrictions[2]); } } --- 70,74 ---- if (restrictions.Length > 3 && restrictions[3] != null) { ! sql += String.Format(" and pg_class.relkind = '{0}'", restrictions[2]); } } |