Opened 10 years ago
Closed 10 years ago
#12105 closed defect (fixed)
Add get_table_names method to DatabaseManager
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.1.6 |
| Component: | database backend | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: |
New method for retrieving database table names: |
||
| Internal Changes: | |||
Description
It would be useful to have a get_table_names method on DatabaseManager. The method would just be a helper that calls get_table_names on the ConnectionBase class, similar to how DatabaseManager.reset_tables directly calls reset_tables on the ConnectionBase class: tags/trac-1.1.5/trac/db/api.py@:393-394#L386.
Attachments (0)
Change History (4)
comment:1 by , 10 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:2 by , 10 years ago
comment:3 by , 10 years ago
I think we should compare table names of default_schema and the result of DatabaseManager.get_table_names(), e.g. for case get_table_names() returns unnecessary names.
-
trac/db/tests/api.py
diff --git a/trac/db/tests/api.py b/trac/db/tests/api.py index 6402f44..f445e37 100644
a b class DatabaseManagerTestCase(unittest.TestCase): 520 520 521 521 def test_get_table_names(self): 522 522 """Get table name for the default database.""" 523 table_names = self.dbm.get_table_names() 524 for table in default_schema: 525 self.assertIn(table.name, table_names) 523 self.assertEqual(sorted(table.name for table in default_schema), 524 sorted(self.dbm.get_table_names())) 526 525 527 526 def test_set_default_database_version(self): 528 527 """Set database version for the default entry named
comment:4 by , 10 years ago
| API Changes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
Thanks for reviewing. Committed to trunk in [14114].



Proposed changes in log:rjollos.git:t12105_get_table_names.