[Xesam] Relative date queries / Mono XESAM library
phreedom.stdin at gmail.com
Tue Jan 15 00:10:49 PST 2008
В сообщении от Tuesday 15 January 2008 06:51:33 Gabriel Burt написал(а):
> What is the best way to support relative date queries in XESAM? For
> example, in Banshee people will have smart playlists such as "songs
> not played in the last 2 hours." This is turned into a SQL query
> similar to "LastPlayed < now() - 7200". The user query language form
> of this would ideally be "played < 2 hours ago", but what of the XML?
> What do you think of an optional 'relative' attribute on the date
> value specifying the seconds to add to the date, and allowing 'now' as
> a valid date?
> <field name="lastplayed" />
> <date relative="-7200">now</date>
I can very well understand why user-level language needs constructs like this,
but for internal api, probably this would needlessly complicate the spec.
Somehow this resembles alowing Pi to be a valid value for a float field.
> Now the announcement:
> In Banshee we recently rewrote our query code and tried to make it
> compatible with XESAM. It includes two parsers (user query language
> and XML) and methods to produce user query language, XML, and SQL.
> The code is here:
> It's in a namespace/assembly that is not specific to Banshee, so
> Mono/.Net-based apps should be able to reuse it easily. The user
> query language is very similar to XESAM's, but also allows | and comma
> for or, NOT for -, and ()'s for grouping/nesting. We have some
> preliminary documentation up at:
More information about the Xesam