On Thursday 27 May 2010 10:05:56 am Andrea Aime wrote:
> > Actually, there are two different symbols: "LIKE" and LIKE. So, in the
> > SQL language "LIKE" is an identifier and  LIKE is the keyword.
>
> What happens in ECQL in that respect? Is there a way to use a keyword
> as an identifier?
No, it isn't. I think we could use double quote like SQL because CQL/ECQL are 
sql like. But, I want to hear the geoserver community. 
>
> > So, how could be solved the problem, if someone wants to define an
> > CQL/ECQL keyword as property/attribute name in a Layer?
>
> I agree a language has keywords and there is nothing that can be done
> about it.
>
> The problem here is that we're superimposing different sets of
> keywords and rules on the user making it hard to setup a database table
> that can be used in all contexts. The rule sets I have in mind here are:
> - what is valid as a database column name
> - what is valid a XML element (thinking WFS here)
> - what is valid as ECQL
>
> I don't have statistics at hand, but my guess is that ID is a very
> commonly used column name, especially for primary keys.
> Primary keys can be exposed as read only attributes from JDBC data
> stores so we're likely to face complaints once ECQL goes in common use.
>
> Possible ways out:
> - use an identifier that's very unlikely or downright wrong as an
>    attribute name. Something like @id or ::id or id() (just making them
>    up, did not check if I'm actually introducing other problems with
>    any of them).
> - turn that into a pseudo function call, something like
>    id_in(id1, id2, ..., idn)
> - have escapes to state ID is intended to be used as an attribute.
>    "ID" would work I guess
I like this option, it matches with SQL convention (cql is sql like), and we 
could apply the same criteria for all keyword.

ID is Keyword, "ID" is attribute 
LIKE is Keyword, "LIKE" is attribute
BEFORE is keyword, "BEFORE" is attribute 
...
etc.
>
> Cheers
> Andrea
cheers
-- 
Mauricio Pazos
www.axios.es

------------------------------------------------------------------------------

_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to