Re: [HACKERS] Javascript support in the backend, i.e. PL/JS

2007-11-16 Thread Andreas Joseph Krogh
On Friday 16 November 2007 12:23:26 Sam Mason wrote: > On Fri, Nov 16, 2007 at 12:05:02PM +0100, Andreas Joseph Krogh wrote: > > On Friday 16 November 2007 11:29:09 Sam Mason wrote: > > [snip] > > > > > SP? > > > > Stored Procedure > > That was kind of obvious wasn't it! I failed to parse that bec

Re: [HACKERS] Javascript support in the backend, i.e. PL/JS

2007-11-16 Thread Sam Mason
On Fri, Nov 16, 2007 at 09:49:38AM +0100, Andreas Joseph Krogh wrote: > Most people, as you probably know, don't like JS as a language 'cause they > think of it as a "web-browser language with lots of bad side-effects", but > that's 'cause they don't know the language, really. Javascript is a ve

Re: [HACKERS] Javascript support in the backend, i.e. PL/JS

2007-11-16 Thread Pavel Stehule
On 16/11/2007, Sam Mason <[EMAIL PROTECTED]> wrote: > Hi All, > > I've been writing some code[1] to support Javascript in the backend. > I've got the basic bits working, the next job for me is implementing > SPI support. Currently, it runs simple bits of code like the > following: > > CREATE FUN

Re: [HACKERS] Javascript support in the backend, i.e. PL/JS

2007-11-16 Thread Sam Mason
On Fri, Nov 16, 2007 at 10:56:55AM -0500, Tom Lane wrote: > Sam Mason <[EMAIL PROTECTED]> writes: > > For SPI, I'm thinking that I'd currently like to attempt some object > > orientated style interface. ... > > So running some SQL would probably look something like: > > > for (row in spi.prepare

Re: [HACKERS] Javascript support in the backend, i.e. PL/JS

2007-11-16 Thread Tom Lane
Sam Mason <[EMAIL PROTECTED]> writes: > For SPI, I'm thinking that I'd currently like to attempt some object > orientated style interface. ... > So running some SQL would probably look something like: > for (row in spi.prepare("SELECT 1 AS n").query()) { > print(row.n); > } What's not app

Re: [HACKERS] Javascript support in the backend, i.e. PL/JS

2007-11-16 Thread Tom Lane
Sam Mason <[EMAIL PROTECTED]> writes: > On Fri, Nov 16, 2007 at 10:56:55AM -0500, Tom Lane wrote: >> More generally, I think that the average programmer would rather just >> not be bothered with all these details; he'd want to write >> >> for (row in spi.query("...sql..." [, arguments])) { ... >

Re: [HACKERS] Javascript support in the backend, i.e. PL/JS

2007-11-16 Thread Sam Mason
On Fri, Nov 16, 2007 at 12:05:02PM +0100, Andreas Joseph Krogh wrote: > On Friday 16 November 2007 11:29:09 Sam Mason wrote: > [snip] > > SP? > > Stored Procedure That was kind of obvious wasn't it! I failed to parse that because of the "an" before it; "an stored procedure" doesn't make much sen

Re: [HACKERS] Javascript support in the backend, i.e. PL/JS

2007-11-16 Thread Andreas Joseph Krogh
On Friday 16 November 2007 11:29:09 Sam Mason wrote: [snip] > SP? Stored Procedure -- Andreas Joseph Krogh <[EMAIL PROTECTED]> Senior Software Developer / Manager +-+ OfficeNet AS| The most difficult thing in the wor

Re: [HACKERS] Javascript support in the backend, i.e. PL/JS

2007-11-16 Thread Andreas Joseph Krogh
On Friday 16 November 2007 09:10:43 Sam Mason wrote: > Hi All, > > I've been writing some code[1] to support Javascript in the backend. [snip] Wow, this is supercool! Most people, as you probably know, don't like JS as a language 'cause they think of it as a "web-browser language with lots of ba

Re: [HACKERS] Javascript support in the backend, i.e. PL/JS

2007-11-16 Thread Sam Mason
On Fri, Nov 16, 2007 at 09:20:37AM +0100, Pavel Stehule wrote: > On 16/11/2007, Sam Mason <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > I've been writing some code[1] to support Javascript in the backend. > > I've got the basic bits working, the next job for me is implementing > > SPI support. Cu

[HACKERS] Javascript support in the backend, i.e. PL/JS

2007-11-16 Thread Sam Mason
Hi All, I've been writing some code[1] to support Javascript in the backend. I've got the basic bits working, the next job for me is implementing SPI support. Currently, it runs simple bits of code like the following: CREATE FUNCTION jsinc(n INTEGER) RETURNS INTEGER LANGUAGE pljs AS $$ ret