From koffice-devel Sat Aug 09 18:45:00 2003 From: Adam Pigg Date: Sat, 09 Aug 2003 18:45:00 +0000 To: koffice-devel Subject: Kexi Thoughts....... X-MARC-Message: https://marc.info/?l=koffice-devel&m=106045473503453 Hi I was busy working away on my postgresql driver when i decided it was time to add a function to find the primary key for a table. PostgreSQL stores all keys(primary/unique) in a table pg_index. To find the primary key for a table i query pg_index which for the primay key returns an integer array representing the columns that make up the primary key (composite key), simple enough. In a composite key situation, on their own, each column is not nescesserily unique, but together they are. Now i get to reimplementing kexidbrecordset using the mysql driver as a starting point. The findKey function loops round the columns looking for a column that has the primarykey boolean set, and sets this column as the key field (or the last one it finds). From what i understand of the code, this wouldnt seem to work if a composite key was used. It may be wise to add a vector/list that represens the primary key and maybe another list to store all the unique indexes or as lucijan suggested maybe a KexiDBIndex class. Anyway, for the time being, for simplicities sake im gonna work on the assumption that the primary key is a single column which will keep my code almost identical to the mysql version. Just my thoughts PiggZ -- adampigg.9p.org.uk adam@piggz.fsnet.co.uk adam@adampigg.9p.org.uk _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/koffice-devel