Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: SSQLSv2 design discussion

From: Chris Frey <cdfrey(at)foursquare.net>
Date: Wed Aug 15 2007 - 03:55:07 EDT


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:

	getX
	get_x
	unique
	Unique

> 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.

Do you need help?X

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 unfortunately.

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
-- 
MySQL++ Mailing List
For list archives: 
http://lists.mysql.com/plusplus
To unsubscribe:    
http://lists.mysql.com/plusplus?unsub=lists@pantek.com
Received on Wed Aug 15 03:55:54 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:02:59 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library