Monday, April 4th, 2005
SQL to query JavaScript? :)
<>p>TrimPath has a new TrimQuery release which groks SQL:With some inspiration from the JavaScript DB project, I’ve finally added a SQL parsing frontend to TrimQuery, release 1.0.28.
That is, the TrimQuery engine now supports SQL instead of just the TrimQuery Language (TQL).
You can take a look at the new demo page for a quick test drive http://trimpath.com/demos/test1/trimpath/query_demo.html
And, more TrimQuery information is available at http://trimpath.com/project/wiki/TrimQuery
Not quite sure how I feel about an SQL parser in JavaScript… but cool!











Just FYI to readers, that demo page throws piles of errors in IE, sits inertly in Mozilla, and crashes Opera messily.
Eric,
It works for me on Firefox 1.0 & IE 6.x, win 2k. But, then again, I wrote it, so that’s no surprise.
It doesnt appear to do anything at first because when the page loads the query has already run. Try the query below and you should see something change: SELECT Customer.id, Customer.acctBalance FROM Customer
I can confirm this works for me on XP (SP1) using IE6 and Mozilla.
I think I see the problem. I ran:
SELECT id, acctBalance FROM Customer
which produces the behavior I described (errors in IE, inaction in Mozilla). Qualifying the tablename for each field does appear to work.
Yeah, you have to qualify the tablenames.
SELECT Customer.id, Customer.acctBalance FROM Customer
And, it worked for me find on firefox and IE 6.x on win2K. Very strange. What IE version are you running?
By the way, I finally found a use for TrimQuery. See http://trimpath.com/project/wiki/TrimJunction, a Ruby-on-Rails clone in JavaScript.
Whoops, the last post had a buggered URL with the extra comma. Try…
http://trimpath.com/project/wiki/TrimJunction