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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Javascript support in the backend, i.e. PL/JS
Date: 2007-11-16 15:56:55
Message-ID: 12836.1195228615@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sam Mason <sam(at)samason(dot)me(dot)uk> 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 apparent to me is how one can avoid re-planning the query
every single time the function is called?

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])) { ...

I don't object to exposing the machinery for those who like to play with
such stuff, but you should have shortcuts to keep the simple things
simple.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-11-16 16:10:09 Re: [COMMITTERS] pgsql: update files for beta3
Previous Message Bruce Momjian 2007-11-16 15:41:00 Re: High Availability, Load Balancing, and Replication Feature Matrix