Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow users to drag and drop fields from DB Schema dock to editor #1250
This is the first attempt to provide the functionality described in #119.
Drag in the dock is enabled (it was only enabled in the Database Structure tab). Then the fields are enabled for dragging and finally the MIME data exported for the drag and drop is tailored for exporting only the escaped field identifier.
This may interfere to other uses of drag&drop in the Database Structure, so I open this pull request for discussion and refinement. I've reproduced a crash dropping a table between databases, I think it is not related with my changes, but I'll try to figure it out.
Possible improvements: there are two uses of drag&drop and users might be confused. Tables paste the SQL creation and population statements, and fields only the name. Maybe the Dock and the Database Structure should have their own different drag&drop behaviours? Dock for statement composition, sot it would only drop the names; and Database Structure, only for exporting full SQL statements (then in this tab the fields would be again not candidate for dragging).
referenced this pull request
Dec 3, 2017
I would be fine with merging this as it is now. You are right that it is kind of odd to have two different things happening here depending on the node you are dragging. But then again, it is probably copying exactly what you would expect for each node. So it should be fine.
I am not so sure about making this behave differently for the Structure tab and the Structure dock, however. At least I feel like that those two tree views just look and feel to similar to not do the same thing. So my point is that the Structure dock just looks like an exact copy of the Structure tab (and which it basically is), so it would be super confusing to have them behave differently in such a subtle way. So I would say that the way it is done in this PR is better, but that is just my opinion
What do you think, @mgrojo?