Please excuse me for not explaining.

The syntax that you puzzle about is supported by madIS [*] which translates it into SQLite. Having being using madIS for many years (we created it in 2008) it comes natural to me, forgetting that SQLite doesn't support it.

What essentially madIS does is to create and destroy the virtual tables in an madIS/SQLite query. It also supports an "inverted" syntax, that permits virtual table pipelines (like pipes in unix):

select * from (XMLPARSE select * from FILE("data.xml"));

above query is the same as writting:

select * from XMLPARSE(' select * from FILE("data.xml") ')

but without the thorny quote escaping problems.

The "select * from " part is optional (it is autocompleted) so above query could be rewritten to:

XMLPARSE FILE "data.xml";

Both XMLPARSE and FILE are regular SQLite virtual table functions coded in Python (the whole madIS is in Python). Also, due to SQLite's virtual table API design quality, both functions are also streaming (XML parsing works on continuous multi-GB long streams of XML input, coming from the internal query that uses FILE).

You may think that it is crazy to do this pipelining through a relational engine (SQLite), but the whole thing is very fast and very versatille. We have been processing hundrends of GB of data (in various forms) using such "enhanced" SQLite queries for many years.

Having said all of the above, i hope that you can see why we care so much about SQLite's virtual table API efficiency.

estama.

[*] https://code.google.com/p/madis/

On 1/3/2014 10:35 πμ, Max Vlasov wrote:
On Fri, Feb 28, 2014 at 10:14 PM, Dominique Devienne
<ddevie...@gmail.com> wrote:
Can someone tell me how the statement below works?
....

Thanks for any help on this. This is really puzzling to me. --DD


Very puzzling for me too
For any statement like this

   select * from blablabla(123)

sqlite (3.8.3.1) primarily reports syntax a error...

    near "(": syntax error

... before complaining about anything else.

I'd also be glad to see a shortcut when a virtual table created just
for a select statement and dies automatically, but I suspect it is not
supported and it was their own modified version of sqlite. Hope OP
reads this post also and will have an answer for us. Probably this
will help providing following information regarding his issues.

Max
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to