From: | David Fetter <david(at)fetter(dot)org> |
---|---|
To: | Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com> |
Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Kiswono Prayogo <kiswono(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: half OOT, plv8js group created ^^ |
Date: | 2009-10-31 06:54:24 |
Message-ID: | 20091031065424.GD28990@fetter.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2009-10-31 08:54:01 | Re: [HACKERS] FTP/GIT/WWW server move |
Previous Message | Jaime Casanova | 2009-10-31 05:11:24 | Re: Patch set under development to add usage reporting. |