Menu

#1522 Need a "Paste Selection" option

SQuirreL
open
nobody
None
medium
2023-10-29
2023-09-28
No

In the Objects view, you can multi-select a group of tables. Then you can do various things... you can copy those tables, for pasting later. You can copy the list to the clipboard. You can do other things.

If one has a requirement to repeatably copy a set of, say 50 tables out of 100, it would be very time consuming to have to manually select that list of tables time and again.

We've already got the ability to export a selection via the "Copy Object Name" popup menu selection. What we need is the ability to import such a selection. I suggest that if the right click menu on a schema had an option "Paste Selection", it could take what's on the clipboard in the format exported by "Copy Object Name", and apply those names to select the corresponding selection to your tables. Then you could do whatever to that selection, copy them, whatever.

I would further suggest that if you right click the schema for "Paste Selection" it would ignore any schema qualifiers in the import. But if you right click the database, it would use them to pick the schema.

This would have other uses too, like if you had multiple similarly structured databases (Prod and test as one example), you could easily apply the same actions to both by copying the selection from one, and pasting it to the other.

One other thing, it's kind of odd that Copy Object Name doesn't quote the names, but Copy Qualified Object Name does. After all the quoting decision is orthogonal to the qualified decision. I kind of think quoting should be configurable in the options, and disabled by default. If one wanted to copy between an Oracle and Postgres database, where the case of the letters is typically different (something I actually have to do), the quoting is annoying. I kind of think quoting is a rarely useful feature, for those who violate the SQL philosophy of case insensitive names.

Discussion

  • Gerd Wagner

    Gerd Wagner - 2023-10-28

    Is implemented except from the last paragraph and will be available in future snapshots and versions. Excerpt from change log:

    '#1522 Object tree: New right mouse submenu "Save/restore selection"
    that offers several functions to save and restore Object tree selections.

     

    Last edit: Gerd Wagner 2023-10-28
  • Gerd Wagner

    Gerd Wagner - 2023-10-29

    The last paragraph is now implemented, too. Excerpt from change log:

    '#1522 Copying qualified Object names from the Object tree used to always double quote the names.
    Now it respects the checkbox "Use double quotes for (") for qualifying"
    at menu File --> Global Preferences --> tab "SQL Scripts"

     

Log in to post a comment.

MongoDB Logo MongoDB