dabo Commit
Revision 5176
Date: 2009-04-08 15:10:54 -0700 (Wed, 08 Apr 2009)
Author: Johnf
Trac: http://trac.dabodev.com/changeset/5176

Changed:
U   trunk/dabo/db/dbPostgreSQL.py

Log:
added a simple way to support 'views'.  Maybe I'll get back to this someday and 
determine a way to make a single select call.  Running this against a 600 table 
database along with many views worked as expected and the performance was 
reasonable.  I was also able to create a bizobj from a view using ClassDesigner.

Diff:
Modified: trunk/dabo/db/dbPostgreSQL.py
===================================================================
--- trunk/dabo/db/dbPostgreSQL.py       2009-04-08 16:54:02 UTC (rev 5175)
+++ trunk/dabo/db/dbPostgreSQL.py       2009-04-08 22:10:54 UTC (rev 5176)
@@ -123,9 +123,16 @@
                                        "schemaname NOT LIKE 'information%') 
AND")
                query.append("""has_schema_privilege(schemaname, 'usage') AND 
""" 
                                  
"""has_table_privilege('"'||schemaname||'"."'||tablename||'"', 'select')""") 
-
+               record=[]
                cursor.execute(" ".join(query))
-               return tuple(record["tablename"] for record in 
cursor.getDataSet())
+               for rec1 in cursor.getDataSet():
+                       record.append(rec1["tablename"])
+               cursor.execute("SELECT schemaname||'.'||viewname as tablename 
FROM pg_views WHERE schemaname NOT IN('information_schema', 'pg_catalog')")
+               
+               for rec in cursor.getDataSet():
+                       record.append(rec["tablename"])
+                                     
+               return tuple(record)
 
 
        def getTableRecordCount(self, tableName, cursor):



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to