18 messages in com.mysql.lists.plusplusRe: Problems with timestamp| From | Sent On | Attachments |
|---|---|---|
| Королев Илья | 16 Oct 2006 05:57 | |
| Warren Young | 16 Oct 2006 17:36 | |
| Королев Илья | 17 Oct 2006 00:34 | |
| Warren Young | 17 Oct 2006 01:46 | |
| Королев Илья | 17 Oct 2006 02:05 | |
| Warren Young | 17 Oct 2006 03:12 | |
| Королев Илья | 17 Oct 2006 03:26 | |
| Warren Young | 17 Oct 2006 05:03 | |
| Королев Илья | 17 Oct 2006 06:24 | |
| Warren Young | 18 Oct 2006 05:20 | |
| Королев Илья | 18 Oct 2006 06:40 | |
| Warren Young | 18 Oct 2006 11:34 | |
| Королев Илья | 24 Oct 2006 01:20 | |
| Warren Young | 24 Oct 2006 14:39 | |
| Королев Илья | 24 Oct 2006 22:39 | |
| Warren Young | 25 Oct 2006 05:13 | |
| Королев Илья | 20 Nov 2006 03:10 | |
| Warren Young | 20 Nov 2006 11:32 |
| Subject: | Re: Problems with timestamp![]() |
|---|---|
| From: | Warren Young (mysq...@etr-usa.com) |
| Date: | 10/18/2006 05:20:33 AM |
| List: | com.mysql.lists.plusplus |
Королев Илья wrote:
В сообщении от 17 октября 2006 16:04 Warren Young написал(a):
Королев Илья wrote:
Why we can't just drop away static names[] ( and table)?
How would SSQLS build queries without a table of the field names?
like this:
template <class Manip> std::ostream& operator << (std::ostream& s, const DB_AdvBase_field_list<Manip>& obj) { s << obj.manip << "user_id" << obj.delem; s << obj.manip << "position" << obj.delem; s << obj.manip << "ts" << obj.delem; s << obj.manip << "pads"; return s; }
IMHO in such way we don't need names[] at all.
Well, as a static example, that's interesting, but I'm not going to rebuild custom.pl to implement it. If I were to spend a lot of time on reworking SSQLS it would be to completely replace it with a different mechanism. The current macro-based mechanism is hard to understand and manipulate, so when we do run into problems, they tend not to get addressed.
This topic's come up before. I proposed defining the structures in XML or some other such language and create a preprocessor that translates that into header files defining the structures. This would be similar to the way things like IDL work in CORBA and COM. The idea fizzled because the driving force behind it at that time was Borland C++ incompatibility, but that problem's taken care of itself, leaving my solution unnecessary.
You're welcome to tackle it, if you like.
The only advantage IMHO is that we can change names[](table) on the fly.
Every single table in my own use of MySQL++ has a different name than the corresponding SSQLS. I am unwilling to give up that feature.
Explain please.
I mean that I will define an SSQLS called something like SQL_MyTableName, where the actual MySQL table name is something else, like my_table_name. There are several reasons I do this, but it's not important to argue them here. The important point is, I and others depend on being able to have C++ structure names that are different from the corresponding SQL table names, yet still bind them together via SSQLS.
In such case IMHO it's possible to declare "TableName" in other way. #define TABLE_NAME "TableName" Q << "SELECT " << obj.field_list() << " FROM " << TABLE_NAME;
Why would I want to do that? The whole point of SSQLS is to reduce the amount of SQL statements in my C++ code. This is a regression.




