simonw/django-sql-dashboard

Example queries should use column names, not select *

simonw opened this issue · 1 comments

Because otherwise you get errors if you don't have permission to access all columns (e.g. the password column on auth_user) - see #98 (comment)

Those queries are generated in the template here:

<li style="break-inside: avoid;"><a href="?sql={% filter sign_sql|urlencode %}select count(*) from {{ table.name }}{% endfilter %}&sql={% filter sign_sql|urlencode %}select * from {{ table.name }}{% endfilter %}">{{ table.name }}</a>

Wrapped version:

<li style="break-inside: avoid;"><a href="?sql={% filter sign_sql|urlencode %}select count(*) from {{ table.name }}{% endfilter %}&sql={% filter sign_sql|urlencode %}select * from {{ table.name }}{% endfilter %}">{{ table.name }}</a>