List:MySQL++« Previous MessageNext Message »
From:Chris Frey Date:August 15 2007 7:55am
Subject:Re: SSQLSv2 design discussion
View as plain text  
On Tue, Aug 14, 2007 at 11:35:29PM -0600, Warren Young wrote:
> It's clear to me that SSQLSv2 needs to be some kind of specialized
> declaration language that's translated by a tool to C++ implementation
> and header files.  The main goal is to fix the type safety and
> debuggability issues people have had with SSQLS.

Looks cool to me.

>      option use_accessors getX

As you mention later, there could be multiple styles here.  Capitalization
of the X could be significant:


>         void getId(mysqlpp::sql_bigint value);
>         void getNum(mysqlpp::sql_bigint value);
>         void getWeight(mysqlpp::sql_double value);
>         void getPrice(mysqlpp::sql_double value);
>         void getSdate(const mysqlpp::sql_date& value);

I assume you meant "set".

> Think of the syntax of .ssqls files as a pastiche of Python and SQL
> syntax: whitespace is significant, case is preserved but insignificant
> in comparisons, quotes are optional unless needed to preserve spaces in
> names, and named options ("type," "alias," "{not_}null," "filebase"...)
> let us accept them in any order.  It's a little verbose, but it's better
> than the XML ideas I've been kicking around for the last year or so, and
> probably nearly as easy to parse.  (I still have to write a tokenizer
> this way instead of using an existing XML parser, but after that it's
> walking trees no matter which way I go.)

I like this syntax more than XML.

> The "option" statements let you control naming scheme details.  By
> default it will output code in a style close to that used within
> MySQL++; if we have to pick a default, it might as well be that.  But I
> realize this is not the worldwide standard, so wherever possible it
> should give you the option to change its output code style.

If I understand what you mean by style, this seems like a lot of work
for nothing.  Nobody should care what indentation is used in a file
full of generated code.

What does matter (and perhaps you were thinking of this all along)
is the interface, and how the programmer calls it.  This is the kind
of style difference between get_item() and getItem() and GetItem().
I agree with that.

This brought an interesting idea to mind though: would there be any
use in putting actual C++ code in the .ssqls file, that would get
passed on to the generated file?  In this case, the .ssqls file *becomes*
the code, and the generated .cc file is just another .o from the
programmer's point of view.  Just a thought.

I'm not really here. :-)  This just looked like an interesting
post, and I couldn't help but read it. :-)  I wish I had more time
to hack on mysql++... I don't even manage to read the stable releases

Where does portable database support stand, btw? (i.e. mysql, postgres,
sqlite, etc)  Is it any easier to implement now than it was before?
My interest still lies there, for some odd reason. :-)

- Chris

SSQLSv2 design discussionWarren Young15 Aug
  • Re: SSQLSv2 design discussionChris Frey15 Aug
    • Re: SSQLSv2 design discussionWarren Young16 Aug
      • Re: SSQLSv2 design discussionChris Frey16 Aug
  • RE: SSQLSv2 design discussionJoel Fielder15 Aug
    • RE: SSQLSv2 design discussionJoel Fielder15 Aug
      • Re: SSQLSv2 design discussionWarren Young16 Aug
        • RE: SSQLSv2 design discussionJoel Fielder17 Aug
    • Re: SSQLSv2 design discussionWarren Young16 Aug