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 » PostgreSQL Support Classes [Experimental]
Re: PostgreSQL Support Classes [Experimental] [message #9063 is a reply to message #9056] Mon, 16 April 2007 10:22 Go to previous messageGo to previous message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

I think one should manualy write in schema file that a field is primary key, even if serial generates unique values. That's better IMO. Someone else without deep knowledge about given database know immediately what is primary key. And we should remember that we provide a COMMON way to define databse structure. In others databases serial not awlays means primary key (rather auto increment)

I think we should solve the problem of multi-field primary key.
Does it work in upp?:
TABLE(Test)
  INT ID PRIMARY_KEY
  INT VERSION PRIMARY_KEY
  ...
END_TABLE

Antoher thing are database scripts. There should be ONE funtcion to create/update database schema like:
OleDBSession db;
db.Prepare() - creates db or update it

and some additional funtions
db.Create() - only creating db
db.Update() - only updating db
db.Drop() - removing all tables

rather than
SqlSchema sch(SQLITE3);
StdStatementExecutor se(sqlite3);
All_Tables(sch);
if(sch.ScriptChanged(SqlSchema::UPGRADE))
	Sqlite3PerformScript(sch.Upgrade(),se);
if(sch.ScriptChanged(SqlSchema::ATTRIBUTES)) {
	Sqlite3PerformScript(sch.Attributes(),se);
}
if(sch.ScriptChanged(SqlSchema::CONFIG)) {
	Sqlite3PerformScript(sch.ConfigDrop(),se);
	Sqlite3PerformScript(sch.Config(),se);
}
sch.SaveNormal();

It is too complicated.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Catch errors with Sql.Execute
Next Topic: Newbie help with PostgreSQL example
Goto Forum:
  


Current Time: Tue May 14 08:59:23 CEST 2024

Total time taken to generate the page: 0.02782 seconds