dotancohen / squeal

Database explorer with a focus on breadth, not depth.
2 stars 0 forks source link

Crasher when table has no primary key #6

Closed dotancohen closed 10 years ago

dotancohen commented 10 years ago

Crasher when there is no primary key:

   Showing table test
   ------------------
+-------+---------+------+-----+---------+-------+
| Field | Type    | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| phone | int(11) | YES  |     | None    |       |
+-------+---------+------+-----+---------+-------+
Time: 0.0028
Traceback (most recent call last):
  File "./squeal.py", line 294, in <module>
    main()
  File "./squeal.py", line 121, in main
    show_table_details(conn, cursor, prompt, menu_tables[operation-1])
  File "./squeal.py", line 246, in show_table_details
    primary_key = [c.field for c in table.columns if c.key=='PRI'][0]
IndexError: list index out of range