8 messages in com.mysql.lists.plusplusRe: linking mysql++ 2.3.2| From | Sent On | Attachments |
|---|---|---|
| Joe Hudson | 30 Nov 2007 16:25 | |
| Warren Young | 30 Nov 2007 22:16 | |
| Joe Hudson | 01 Dec 2007 07:47 | |
| Warren Young | 03 Dec 2007 05:52 | |
| Joe Hudson | 04 Dec 2007 04:49 | |
| Warren Young | 04 Dec 2007 06:38 | |
| Joe Hudson | 07 Dec 2007 09:51 | |
| Warren Young | 07 Dec 2007 14:38 |
| Subject: | Re: linking mysql++ 2.3.2![]() |
|---|---|
| From: | Joe Hudson (joe....@gmail.com) |
| Date: | 12/04/2007 04:49:30 AM |
| List: | com.mysql.lists.plusplus |
Thanks Warren,
Building one project at a time in Eclipse and making sure MYSQLPP_SSQLS_NO_STATICS was n the right places did the trick.
With my template functions, SSQLSes do what I want for now and I've written quite a chunk of code that already uses them. But if I find I need to tweak them more I may go with your MyGenericThingy suggestion, thank you.
Note of warning duly taken re putting OO structure on relational DBs. Seems like a pragmatic solution for now though.
Thanks for your help!
Joe
On 03/12/2007, Warren Young <mysq...@etr-usa.com> wrote:
Joe Hudson wrote:
with you on the PIC microcontrollers :) well the include path for mysql.h is set in the project settings. and that is the first error... Seems Eclipse was very confusingly displayng errors for other projects in my build group,. :)
Dunno what to tell you, then. I don't think anything has changed in the way we #include MySQL C API headers in quite a while.
would defining MYSQLPP_SSQLS_NO_STATICS globally and just calling:
MYSQLPP_SSQLS_EXPAND(<SSQLS name>)
once for each struct in a .cpp file for the header that defines the SSQLS's be a reasonable solution to where there are lots of modules that use the same SSQLS's?
No. MYSQLPP_SSQLS_EXPAND isn't called that way, and replicating the way it *is* called would evaporate much of the advantage of SSQLSes.
You can do something like this instead in the .h file:
#if !defined(EXPAND_MYSTRUCT) #define MYSQLPP_SSQLS_NO_STATICS #endif
And then #define EXPAND_MYSTRUCT before #including that header in the one module that you nominate as owning the SSQLS.
I have lots (a few thousand) of tables with the same structure, but I want them as seperate tables because each could contain a lot of data and they are for seperate real world things that I want to keep seperate in the DB. I just want a neat and convenient way of using the same SSQLS type to manipulate different tables with the same structure. Is that weird?
It sounds to me like you're trying to impose an OO structure on top of a relational database, always a tarpit.
Maybe you should do without SSQLS altogether, and populate data structures you define from the lower-level Row data instead:
struct MyGenericThingy { int a; string b;
MyGenericThingy(mysqlpp::Row& row) : a(row["a"]), b(row["b"]) { } };
-- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsub=joe....@gmail.com
-- LIVE MUSIC + OTHER PERFORMANCE ART CHARITY FUNDRAISER Doors 6.30pm - 1st act 7:30pm, 2nd SUNDAY of EVERY month @ THE TALKING HEADS, PORTSWOOD Rd, SOUTHAMPTON £3 entrance: all profits to 2 Local Charities. SCRATCH and HAMPSHIRE AUTISTIC SOCIETY
-----------------------------------------------------------------------------------------------
Contact joe....@gmail.com for more info.
-------------------------------------------------------
--------------------------------------- Visit http://www.myspace.com/littlecog for latest details, to post new events or volunteer for future community action events.




