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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Javascript support in the backend, i.e. PL/JS
Дата
Msg-id 12836.1195228615@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Javascript support in the backend, i.e. PL/JS  (Sam Mason <sam@samason.me.uk>)
Ответы Re: Javascript support in the backend, i.e. PL/JS  (Sam Mason <sam@samason.me.uk>)
Список pgsql-hackers
Sam Mason <sam@samason.me.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Mark Mielke
Дата:
Сообщение: Off-Topic: Float point division academia? (was: Re: Spinlock backoff algorithm)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: update files for beta3