Subscribe to this thread
Home - General / All posts - Insert Definition for drawings and images

8,168 post(s)
#01-Aug-18 00:07

In the query builder, we can drag tables, drawings and images into the table panel (lower right).

Having done that, we can right-click the name of the component, and have three options: Insert Name, Insert Definition, Insert Field List.

Insert Name always inserts the name of the specific component (table, drawing or image), while Insert Field List necessarily always inserts the fields for the table or the underlying table.

Currently, the result of Insert Definition always inserts a CREATE TABLE definition, regardless of whether we have right-clicked on table, drawing or image.

Would it be more natural and useful if Insert Definition instead gave a CREATE DRAWING definition for a drawing, and a CREATE IMAGE definition for an image?

I know we can achieve exactly that by copying the drawing or image in the Project pane, and pasting directly into the code panel.


8,037 post(s)
#02-Aug-18 15:01

We think it is easy enough to copy and paste the definition of any component from the Project pane (select the component in the Project pane, Ctrl-C, put the cursor into the query text, Ctrl-V).

Insert Definition in the query builder does something else: the query builder determines the schema of the table used by the component (possibly, the result table of a query) and composes a CREATE TABLE statement for that schema.

We can rename existing Insert Definition to Insert Schema or whatever and we can add a new command that would do what copy and paste from the Project pane does, but the new command would have to cache existing properties at the moment you drop the component into the query builder list (because the component must stay in the query builder list even if you remove it in the Project pane), this means the cached properties can get outdated, this seems not worth the effort.


8,168 post(s)
#02-Aug-18 15:28

Thanks for explaining. The last point, having to cache properties, seems decisive, since that would no doubt create more confusion than clarity.

Perhaps Insert Schema would be clearer wording, but Insert Definition is fine.

If I could change anything actually, it would be to allow both copy-and-paste and drag-and-drop, in both places: from Project pane to tables panel, and from Project pane to code panel. The symmetry of actions would make the alternatives even clearer. Drag/paste here means this, drag/paste there means that. But it is a small thing, everything already works.

Manifold User Community Use Agreement Copyright (C) 2007-2017 Manifold Software Limited. All rights reserved.