Modify ↓
#13646 closed defect (fixed)
Please support Postgres
Reported by: | Massimo | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | SqlQueryMacro |
Severity: | normal | Keywords: | Postgres |
Cc: | Trac Release: | 1.2 |
Description
This is Trac 1.2.3
We installed SqlQueryMacro with a local version of pymills:
$ pip2.7 install --user pymills Requirement already satisfied: pymills in /mnt/data/trac/.local/lib64/python2.7/site-packages (3.4.2)
Our database is Postgres as this is the Trac default. How can it be that the plugin does not support postgres URIs like:
[sqlquery] uri = postgres://foo:foopass@/trac-pp
Attachments (0)
Change History (7)
comment:1 Changed 5 years ago by
comment:3 Changed 5 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Plugin name has changed:
$ pip2.7 uninstall SqlQuery $ pip2.7 install svn+https://trac-hacks.org/browser/sqlquerymacro/1.0
comment:4 Changed 5 years ago by
Thanks for the update. But postgres access is still failing:
2019-11-14 14:12:35,200 Trac[formatter] DEBUG: Executing Wiki macro SQLTable by provider <Component wikitable.table.SQLTable> 2019-11-14 14:12:35,268 Trac[formatter] DEBUG: Executing Wiki macro SQL by provider <Component sqlquery.macro.SqlQueryMacro> 2019-11-14 14:12:35,270 Trac[formatter] ERROR: Processor SQL failed for <Resource u'wiki:Users/test/SqlWikis'>: Traceback (most recent call last): File "/mnt/data/trac/.local/lib64/python2.7/site-packages/trac/wiki/formatter.py", line 1222, in _exec_processor return processor.process(text) File "/mnt/data/trac/.local/lib64/python2.7/site-packages/trac/wiki/formatter.py", line 389, in process text = self.processor(text) File "/mnt/data/trac/.local/lib64/python2.7/site-packages/trac/wiki/formatter.py", line 361, in _macro_processor text) File "build/bdist.linux-x86_64/egg/sqlquery/macro.py", line 53, in expand_macro db = Connection(self.uri) File "/mnt/data/trac/.local/lib64/python2.7/site-packages/pymills/dbapi.py", line 55, in create_connection return types[type](*args, **kwargs) KeyError: u'postgres://foo:foopass@/trac-pp'
comment:7 Changed 5 years ago by
No matter which statement, the macro is failing. I tried with this simple statement:
{{{#!SQL SELECT * FROM ticket_custom }}}
2019-11-15 08:06:07,591 Trac[formatter] DEBUG: Executing Wiki macro SQLTable by provider <Component wikitable.table.SQLTable> 2019-11-15 08:06:07,594 Trac[formatter] DEBUG: Executing Wiki macro SQLTable by provider <Component wikitable.table.SQLTable> 2019-11-15 08:06:07,668 Trac[formatter] DEBUG: Executing Wiki macro SQL by provider <Component sqlquery.macro.SqlQueryMacro> 2019-11-15 08:06:07,686 Trac[formatter] ERROR: Processor SQL failed for <Resource u'wiki:Users/test/SqlWikis'>: Traceback (most recent call last): File "/mnt/data/trac/.local/lib64/python2.7/site-packages/trac/wiki/formatter.py", line 1222, in _exec_processor return processor.process(text) File "/mnt/data/trac/.local/lib64/python2.7/site-packages/trac/wiki/formatter.py", line 389, in process text = self.processor(text) File "/mnt/data/trac/.local/lib64/python2.7/site-packages/trac/wiki/formatter.py", line 361, in _macro_processor text) File "build/bdist.linux-x86_64/egg/sqlquery/macro.py", line 65, in expand_macro records = cursor.execute(sql).fetchall() AttributeError: 'NoneType' object has no attribute 'fetchall'
Note: See
TracTickets for help on using
tickets.
WikiTableMacro is probably a better choice.