You can define indexes in Schema Classes if you want to

Das Goravani das at Goravani.com
Fri Jan 26 18:53:51 EST 2018


All of this is only valid if you’re into dragging your schemas to Tables to create your server tables.  If you create them through code then this is moot. 
Also moot if you have a way of creating indexes you’re happy with.  This is making use of the IDE  and drag and drop therein. 

For Studio 8.1.3, maybe earlier, I don’t know when they added it

With help from Kelly I learned this trick:

If you want to define your indexes in the Schema classes you can, it just takes a little setup and then silly maintenance.

To see the customer Schema class editor you might want to use, go Under the Hub, turn it’s knob, see Samples, go there, see “External Class Editor”, run that, you can read what appears, it describes what I’m describing here.  Then click the button and the custom editor will appear,  note the indexes at the bottom.  If you want you can have this as your editor, if you drag and drop schemas onto tables to create server tables. 

What you have to do to get it to be your editor:

One of the last entries in config.json is one for “show editor” under “Properties", you have to change this from False to True

Then in that new property (on Property Manager) for schema classes “Editor” put.   MYEDITOR

Now double click a Schema for whom you set Editor property to MYEDITOR and the custom editor window will appear. 

Don’t be alarmed that it’s missing the checkbox-that’s just a property you can set to True if it isn’t so already. 

Down at the bottom where the empty space is…click until you get an insert point on the left

There you enter just any name for your index…its not used, its only for here

To the right you put the SQL for creating an index as in

Create Index idx_cust_lastname ON customers ("Cust_LastName”)

Idx…. = name of index on server
customers. =. name of server table, or what it will be
Cust_LastName. =. Name of column that will be indexed (as it is/will be spelled on the server)

In this way you can tab and enter more indexes, supposedly they will be created when you drag your schema onto “Tables” under your Session under SQL Browser in the IDE Browser window. 

Caveat: I noticed that when I quit and come back into Omnis, it reverts to using the regular editor, but if I open the sample app again and click the button so that the editor appears, I guess that brings it back for this session and the schemas will open it.  So you have to open the sample every time you want to work on your indexes, but that’s not often, so I think it’s worth it. 

All of this is only valid if you’re into dragging your schemas to Tables to create your server tables.  If you create them through code then this is moot. 

One last thing: It mentions setting two properties to true. I found the second one isn’t in config.json.   I added it, and that broke the first one from appearing on the properties window at all, so I took it out.  I found the indexes survive through quitting and coming back in, opening the wrong editor, then doing the external sample, then opening MYEDITOR, they’re still there…the indexes, so, yay.  I have not tested to make sure it creates the indexes.  I dragged my schemas over as I was sitting on a blank database just so happens… the tables got created, but the IDE doesn’t show if they have indexes associated with them. Only SQL tests will confirm their existence or not. 

A nifty help or a lot of trouble for nothing, is up to you. 


More information about the omnisdev-en mailing list