List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:October 18 2006 6:34pm
Subject:Re: Problems with timestamp
View as plain text  
Королев Илья wrote:
>> 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.
> 
> Unfortunately in closest period I'm enough 
> busy, but in next months I'll try take it.

That's fine, I couldn't accept it before v3.0 anyway.

> are there any concrete ideas? Just to move in correct way.

Start with the file format.  Something like this:

<?xml blah blah blah>
<ssqls class="MyStructureName" table="MyTableName">
	<field type="mediumint" name="myFieldName" null="1" />
	<field type="datetime" name="myOtherFieldName" />
</ssqls>

The file name should use a unique extension (.ssqls ?) so you can write 
build rules.  For example, in Makefile syntax:

.ssqls.h:
	ssqlsgen $@

...takes mytables.ssqls and creates mytables.h.  (Maybe creates 
mytables.cpp, too, but I'm not certain about that.  It might be better 
if everything remained inline.)

For this to be valuable, the mechanism needs to:

1. Write clear, well-formatted C++ code

2. Create classes that are easy to subclass without problems.  This 
means that there should be as little public and protected methods and 
data as possible.

3. Cope with different type systems.  Notice above that I'm using SQL 
type names.  It should be smart enough to translate those into the 
proper MySQL++ type names.  Likewise, if I put in, say, time_t, it 
should be able to figure out the right thing to do there, too.

4. Work with the Null<> template.  Notice this in the first field 
definition.

5. SSQLS structures should derive from a common base class.  This let 
you put some useful common code in the MySQL++ library itself, but more 
importantly, it would let you make methods like Query::insert() into 
regular methods instead of templates.
Thread
Problems with timestampКоролев Илья16 Oct
  • Re: Problems with timestampWarren Young17 Oct
    • Re: Problems with timestampКоролев Илья17 Oct
      • Re: Problems with timestampWarren Young17 Oct
        • Re: Problems with timestampКоролев Илья17 Oct
          • Re: Problems with timestampWarren Young17 Oct
            • Re: Problems with timestampКоролев Илья17 Oct
              • Re: Problems with timestampWarren Young17 Oct
                • Re: Problems with timestampКоролев Илья17 Oct
                  • Re: Problems with timestampWarren Young18 Oct
                    • Re: Problems with timestampКоролев Илья18 Oct
                      • Re: Problems with timestampWarren Young18 Oct
                        • Re: Problems with timestampКоролев Илья24 Oct
                          • Re: Problems with timestampWarren Young24 Oct
                            • Re: Problems with timestampКоролев Илья25 Oct
                              • Re: Problems with timestampWarren Young25 Oct
                                • Re: Problems with timestampКоролев Илья20 Nov
                                  • Re: Problems with timestampWarren Young20 Nov