Postgresql let you have multiple schemas on the same database,
qcodo supports only tables from the main (public) schema.
with this patch qcodo can see and code-gen classes for every table on any schema. (you still need to set the search_path in postgresql.conf to include all your schemas)
--- htdocs/includes/qcodo/_core/database/QPostgreSqlDatabase.class.php 2006-09-25 22:53:50.000000000 +0200
+++ svn/htdocs/quasar/includes/qcodo/_core/database/QPostgreSqlDatabase.class.php 2007-01-02 11:45:18.000000000 +0100
@@ -160,7 +160,7 @@
}
public function GetTables() {
- $objResult = $this->Query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = current_schema() ORDER BY TABLE_NAME ASC");
+ $objResult = $this->Query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ANY(current_schemas(false)) ORDER BY TABLE_NAME ASC");
$strToReturn = array();
while ($strRowArray = $objResult->FetchRow())
array_push($strToReturn, $strRowArray[0]);
@@ -182,7 +182,7 @@
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
- table_schema = current_schema()
+ table_schema = ANY(current_schemas(false))
AND
table_name = %s
ORDER BY ordinal_position
@@ -316,14 +316,14 @@
WHERE
relname=%s
AND
- relnamespace =
+ relnamespace = ANY
(
SELECT
oid
FROM
pg_catalog.pg_namespace
WHERE
- nspname=current_schema()
+ nspname=ANY(current_schemas(false))
)
)
AND
@@ -513,7 +513,7 @@
WHERE
tc.table_name = %s
AND
- tc.table_schema = current_schema()
+ tc.table_schema = ANY(current_schemas(false))
AND
tc.constraint_type = \'PRIMARY KEY\'
AND
@@ -542,7 +542,7 @@
WHERE
tc.table_name = %s
AND
- tc.table_schema = current_schema()
+ tc.table_schema = ANY(current_schemas(false))
AND
tc.constraint_type = \'UNIQUE\'
AND
.bc