Opened 5 years ago

Last modified 16 months ago

#14098 new New feature

Add "--skip" option to inspectdb.

Reported by: adamv Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Normal Keywords: inspectdb
Cc: anubhav9042@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you're inspecting a MySQL db, and it has a view that references missing columns, then inspectdb will stop with an exception while inspecting that database.

Add a "--skip" option to inspectdb to skip over tables that throw errors instead of aborting.

Attachments (3)

inspect-skip.diff (9.5 KB) - added by adamv 5 years ago.
skip.diff (9.5 KB) - added by adamv 5 years ago.
Updated patch.
14098-3.diff (1.5 KB) - added by claudep 22 months ago.
Output errors

Download all attachments as: .zip

Change History (12)

Changed 5 years ago by adamv

comment:1 Changed 5 years ago by akaariai

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

The first impression I get from --skip is that you can list tables you don't want to inspect. Better name could be something like --ignore-errors?

Another solution would be to provide --skip-tables and --only-tables, so that one could manually skip the error producing tables.

Changed 5 years ago by adamv

Updated patch.

comment:2 Changed 5 years ago by gabrielhurley

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 4 years ago by gabrielhurley

  • Component changed from django-admin.py inspectdb to Core (Management commands)

comment:4 Changed 4 years ago by patchhammer

  • Easy pickings unset
  • Patch needs improvement set
  • Severity set to Normal
  • Type set to Uncategorized

skip.diff fails to apply cleanly on to trunk

comment:5 Changed 4 years ago by adamv

If there is still interest in accepting this, I can rework the patch; otherwise a maintainer ought to close it.

comment:6 Changed 4 years ago by julien

  • Type changed from Uncategorized to New feature

comment:7 Changed 4 years ago by ramiro

  • Keywords inspectdb added
  • UI/UX unset

Changed 22 months ago by claudep

Output errors

comment:8 Changed 22 months ago by claudep

  • Needs tests set
  • Patch needs improvement unset
  • Version changed from 1.2 to master

The attached patch, instead of adding a new command parameter, just output in the result that some table was not introspected. For example:

# Unable to inspect table v_test
# The error was: View 'test_.v_test' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

comment:9 Changed 16 months ago by anubhav9042

  • Cc anubhav9042@… added
Note: See TracTickets for help on using tickets.
Back to Top