Re: half OOT, plv8js group created ^^ - Mailing list pgsql-hackers

From David Fetter
Subject Re: half OOT, plv8js group created ^^
Date
Msg-id 20091031065424.GD28990@fetter.org
Whole thread Raw
In response to Re: half OOT, plv8js group created ^^  (Hitoshi Harada <umi.tanuki@gmail.com>)
Responses Re: half OOT, plv8js group created ^^
List pgsql-hackers
On Fri, Oct 30, 2009 at 08:44:52PM +0900, Hitoshi Harada wrote:
> So, by chance, I have been working on plv8 for my own purpose and
> query like below is done:
> 
> regression=# CREATE OR REPLACE FUNCTION plv8_test(keys text[], vals
> text[]) RETURNS text AS $$
> var o = {};
> for(var i=0; i<keys.length; i++){
>   o[keys[i]] = vals[i];
> }
> return JSON.stringify(o);
> $$ LANGUAGE plv8 IMMUTABLE STRICT;
> CREATE FUNCTION
> 
> regression=# SELECT plv8_test(ARRAY['name', 'age'], ARRAY['Tom', '29']);
>          plv8_test
> ---------------------------
>  {"name":"Tom","age":"29"}
> (1 row)
> 
> There are still too many TODOs such like type conversion between JS
> and SQL, build system, and memory allocation. If you want I'll send
> you my code.

Please send a patch! :) :) :)

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: Patch set under development to add usage reporting.
Next
From: Peter Eisentraut
Date:
Subject: Re: FTP/GIT/WWW server move