[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?
dbobject_reloadSchema or tableobjects_reload
Moderators: FourthWorld, heatherlaine, Klaus, robinmiller, trevordevore
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
dbobject_reloadSchema or tableobjects_reload
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: dbobject_reloadSchema or tableobjects_reload
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.
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 - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: dbobject_reloadSchema or tableobjects_reload
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 - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder