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 » Schema files, layouts
Schema files, layouts [message #53387] Wed, 01 April 2020 04:48 Go to next message
mtdew3q is currently offline  mtdew3q
Messages: 181
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

Hi all-

I noticed you can't 'redefine' a schema model with the same table identifiers.

Do you recommend one schema file per db? In postgres, there is the concept of separate schemas within a db.

I thought I read a while back that there is a limit to number of layouts to 5 per .lay file.

If you have a decent sized postgresql application, how can you organize it, so that your files can all use postgresql with the same database in U++?

I tried to run separate code files for postgresql and the linker is not happy.

The SqlApp example only uses 1 schema and 1 layout file.

Any cool tips are very much appreciated.

Thanks,
roboloki

Re: large exe size [message #53388 is a reply to message #53387] Wed, 01 April 2020 05:08 Go to previous messageGo to next message
mtdew3q is currently offline  mtdew3q
Messages: 181
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

Hi all-

I am not concerned about the size of the executable. I picked this old thread because it has to do with the size of the project but not really the size of the executable, which I found out is actually quite small, for one of Mireks mammoth projects.

I hope Mirek isn't angry !

Have a cool upcoming weekend,
roboloki


Re: large exe size SOLVED [message #53389 is a reply to message #53388] Wed, 01 April 2020 05:24 Go to previous messageGo to next message
mtdew3q is currently offline  mtdew3q
Messages: 181
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

HI all-

I will only have one main header file with all the postgresql stuff in it, and then if I want to have more than one .cpp file, I think I can include a postgres.h (main file) in all my *.cpp files as an include.

I will see if I can break the schemas out of public if I need to another day soon.

I know some of you guys are professional anglers (from the movie Training Day). I will try to limit my questions.

Sorry guys,
thnx,
later roboloki
Re: large exe size SOLVED [message #53393 is a reply to message #53389] Wed, 01 April 2020 09:06 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I think the trick you are missing with U++ .sch files is that they have header part and code part. Header part, e.g.:

#define SCHEMADIALECT <PostgreSQL/PostgreSQLSchema.h>

#define MODEL <MyApp/MyApp.sch>
#include "Sql/sch_header.h"
#undef MODEL


you put into header and then use that header in many .cpp files. In one of .cpp though, you add "definition" part:

#define MODEL <NosCore/Nos.sch>
#include <Sql/sch_source.h>
#include <Sql/sch_schema.h>
#undef MODEL


As for layouts, you can have any number of layouts in layout file and any number of layout files in your project.

In my large apps, I can easily have 30 layouts in single .lay file and 5 such .lay files in single package, app is then like 5 packages. Yes, 500-1000 dialogs per productivity app is normal... Smile

You can also have multiple schema files, usually when dealing with more than single database. (But you need to be aware about name clashes and e.g. use namespaces).

Mirek

[Updated on: Wed, 01 April 2020 09:07]

Report message to a moderator

Re: large exe size SOLVED [message #53416 is a reply to message #53393] Wed, 01 April 2020 22:14 Go to previous messageGo to next message
mtdew3q is currently offline  mtdew3q
Messages: 181
Registered: July 2010
Location: Upstate, NY (near Canada)
Experienced Member

Hi Mirek-

I will practice with some sample code tonight using your tricks. Thnx for the cool answer!

roboloki
Re: large exe size SOLVED [message #53650 is a reply to message #53393] Sat, 18 April 2020 17:36 Go to previous message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
I got stuck here and found a solution, thanks both, it works! Razz

Regards,
Pradip
Previous Topic: MSSQL TCP ports
Next Topic: sql session in a global variable?
Goto Forum:
  


Current Time: Thu Mar 28 10:09:20 CET 2024

Total time taken to generate the page: 0.01311 seconds