dbobject_reloadSchema or tableobjects_reload

This is the place to post technical queries about SQL Yoga

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, trevordevore

Post Reply
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 871
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

dbobject_reloadSchema or tableobjects_reload

Post by trevordevore » Fri Oct 11, 2013 2:03 pm

[This post is an archive from old SQL Yoga forums]

I am not clear about when to use these?

Specifically - say you drop a table - would have thought that "tableobjects_reload" would do the trick, but seems you need to reload the schema as well, so do I then need to "tableobjects_reload". A longer explanation would be good to understand what exactly is going on with each command?
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 871
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: dbobject_reloadSchema or tableobjects_reload

Post by trevordevore » Fri Oct 11, 2013 2:04 pm

Use the diagram in this lesson on the Database Object and Database Schema as a reference. Notice the the Schema and Table Objects are independently of each other even though they are both part of the database object.

The schema stored inside of the database object has information specific to the actual design of your database. If you delete a table from the database itself then dbobject_reloadSchema is what you would call in order for SQL Yoga to update the database object with the new schema.

Table objects do not necessarily mirror the tables in your schema though and are only affected by the code that you place in the table objects behavior. If you change the code in the table objects behavior then you call tableobjects_reload.

So in your case, calling tableobjects_reload does nothing since you haven't changed any of your code. dbobject_reloadSchema is what you want since the change was in your database design.
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 871
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: dbobject_reloadSchema or tableobjects_reload

Post by trevordevore » Fri Oct 11, 2013 2:04 pm

Clear - thanks. I'll think of "tableobjects_reload" as "tablebehavior_reload" from now on so I can remember it's associations better :)
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

Post Reply

Return to “SQL Yoga”