Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Quick explanation of function calls for postgresql
Re: Quick explanation of function calls for postgresql [message #16622 is a reply to message #16617] Wed, 02 July 2008 22:50 Go to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
captainc wrote on Wed, 02 July 2008 10:08

Thank you for the explanation; very helpful.
Quote:

All_Tables will "dump" SQL scripts from .sch file and stores them into database.

If this is going to execute the scripts anyway, what is the use for checking for changes to update immediately after? Will All_Tables() only execute the "create tables" sql from the "S_*.sql" file, whereas Upgrade() will execute the "U_*.sql" file?



All_Tables does not execute scripts, it creates them as Strings inside SqlSchema.

Checking for changes is useful mostly because executing scripts can take quite long and you do not want it to happen at each app start.

BTW, I usually create/upload scripts only in debug mode, while developing the app. Release mode has these parts excluded (by #ifdef).

Quote:


Also, is there an equivalent to the All_Tables() function that will only compare the current scripts with the potential new ones and not execute the create statements (even though the create statements simply fail when the table already exists...)?


I am not quite sure where are you aiming at.

Well, the much more advanced version of SqlSchema would perhaps tried to read the schema from DB and update only what is necessarry. That would also solve the problem of changing column types, removing columns or tables etc...

Anyway, it would also make it much much more complicated and dependant on specific RDBMS. Current model is not perfect, but is simple and works quite well.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: SQLite queries problem
Next Topic: PostgreSQL GetInsertedId()
Goto Forum:
  


Current Time: Fri May 10 22:27:48 CEST 2024

Total time taken to generate the page: 0.02612 seconds