-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Labels
enhancementIndicates new improvementsIndicates new improvements
Milestone
Description
Feature Request
Problem
If I attempt to drop a schema referenced by a foreign key constraint, DataJoint returns a pymysql error that is difficult to parse for the average user not familiar with reading the backend snake case. In discussing other code that would catch this error, @dimitri-yatsenko suggested that "external code should not rely on pymysql errors because we may replace pymysql with another database connector"
dj.schema('prefix_abc')
OperationalError: (3730, "Cannot drop table '#a_b_c' referenced by a foreign key constraint '_table_position_ibfk_2' on table '_table_position'.")Requirements
This feature should catch the underlying OperationalError and translate to camel case for the user as a DataJointError
Justification
Adding this feature would prevent a break in external code if DataJoint replaced pymysql
Alternative Considerations
Current workaround is to try/except the pymyql error
Metadata
Metadata
Assignees
Labels
enhancementIndicates new improvementsIndicates new improvements