pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PGSQL and Javascript
10+ messages / 6 participants
[nested] [flat]

* PGSQL and Javascript
@ 2009-01-30 11:40  Reg Me Please <regmeplease@gmail.com>
  0 siblings, 4 replies; 10+ messages in thread

From: Reg Me Please @ 2009-01-30 11:40 UTC (permalink / raw)
  To: pgsql-general@postgresql.org; pgsql-interfaces

Hello all.

Is there a way to directly access PGSQL from a Javascript application?
With no application server intervention, I mean.
Just like libq allows access from C/C++.

-- 
Fahrbahn ist ein graues Band
weisse Streifen, grüner Rand



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: PGSQL and Javascript
@ 2009-01-30 11:53  Allan Kamau <kamauallan@gmail.com>
  parent: Reg Me Please <regmeplease@gmail.com>
  3 siblings, 1 reply; 10+ messages in thread

From: Allan Kamau @ 2009-01-30 11:53 UTC (permalink / raw)
  To: Reg Me Please <regmeplease@gmail.com>; +Cc: pgsql-general@postgresql.org; pgsql-interfaces

May be Javascript + JDBC not sure.

But the question is why would you want to do so?
Javascript can be read easily by the user having the javascript
running on their browser. JDBC or any other database connecting client
will want to some how authenticate the user in most cases the
username, password and maybe remote IP is used. This mean that your
javascript will probably contain username and password in order to use
JDBC to connect to the DB, is this favourable?

Allan.

On Fri, Jan 30, 2009 at 1:40 PM, Reg Me Please <regmeplease@gmail.com> wrote:
> Hello all.
>
> Is there a way to directly access PGSQL from a Javascript application?
> With no application server intervention, I mean.
> Just like libq allows access from C/C++.
>
> --
> Fahrbahn ist ein graues Band
> weisse Streifen, grüner Rand
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [INTERFACES] PGSQL and Javascript
@ 2009-01-30 11:56  Sean Davis <sdavis2@mail.nih.gov>
  parent: Reg Me Please <regmeplease@gmail.com>
  3 siblings, 0 replies; 10+ messages in thread

From: Sean Davis @ 2009-01-30 11:56 UTC (permalink / raw)
  To: Reg Me Please <regmeplease@gmail.com>; +Cc: pgsql-general@postgresql.org; pgsql-interfaces

No.  I'm not sure how that could be done given the security concerns.
Sean

On Fri, Jan 30, 2009 at 6:40 AM, Reg Me Please <regmeplease@gmail.com>wrote:

> Hello all.
>
> Is there a way to directly access PGSQL from a Javascript application?
> With no application server intervention, I mean.
> Just like libq allows access from C/C++.
>
> --
> Fahrbahn ist ein graues Band
> weisse Streifen, grüner Rand
>
> --
> Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-interfaces
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: PGSQL and Javascript
@ 2009-01-30 12:09  Reg Me Please <regmeplease@gmail.com>
  parent: Allan Kamau <kamauallan@gmail.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Reg Me Please @ 2009-01-30 12:09 UTC (permalink / raw)
  To: Allan Kamau <kamauallan@gmail.com>; +Cc: pgsql-general@postgresql.org; pgsql-interfaces

I'd like to write part of the application in Javascript, server side, not in 
the web page.

On Friday 30 January 2009 12:53:05 Allan Kamau wrote:
> May be Javascript + JDBC not sure.
>
> But the question is why would you want to do so?
> Javascript can be read easily by the user having the javascript
> running on their browser. JDBC or any other database connecting client
> will want to some how authenticate the user in most cases the
> username, password and maybe remote IP is used. This mean that your
> javascript will probably contain username and password in order to use
> JDBC to connect to the DB, is this favourable?
>
> Allan.
>
> On Fri, Jan 30, 2009 at 1:40 PM, Reg Me Please <regmeplease@gmail.com> 
wrote:
> > Hello all.
> >
> > Is there a way to directly access PGSQL from a Javascript application?
> > With no application server intervention, I mean.
> > Just like libq allows access from C/C++.
> >
> > --
> > Fahrbahn ist ein graues Band
> > weisse Streifen, grüner Rand
> >
> > --
> > Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-general

-- 
Fahrbahn ist ein graues Band
weisse Streifen, grüner Rand



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: PGSQL and Javascript
@ 2009-01-30 12:17  Leif B. Kristensen <leif@solumslekt.org>
  parent: Reg Me Please <regmeplease@gmail.com>
  3 siblings, 0 replies; 10+ messages in thread

From: Leif B. Kristensen @ 2009-01-30 12:17 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

On Friday 30. January 2009, Reg Me Please wrote:
>Hello all.
>
>Is there a way to directly access PGSQL from a Javascript application?
>With no application server intervention, I mean.
>Just like libq allows access from C/C++.

The usual way to handle it is to let the JavaScript code call a 
server-side script through an XMLHttpRequest() object.

>Fahrbahn ist ein graues Band
>weisse Streifen, grüner Rand

I like your sig.
-- 
Leif Biberg Kristensen | Registered Linux User #338009
Me And My Database: http://solumslekt.org/blog/



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [INTERFACES] PGSQL and Javascript
@ 2009-01-30 12:24  Sean Davis <sdavis2@mail.nih.gov>
  parent: Reg Me Please <regmeplease@gmail.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Sean Davis @ 2009-01-30 12:24 UTC (permalink / raw)
  To: Reg Me Please <regmeplease@gmail.com>; +Cc: Allan Kamau <kamauallan@gmail.com>; pgsql-general@postgresql.org; pgsql-interfaces

On Fri, Jan 30, 2009 at 7:09 AM, Reg Me Please <regmeplease@gmail.com>wrote:

> I'd like to write part of the application in Javascript, server side, not
> in
> the web page.
>

I missed your point.  Do a google search for javascript interpreters in the
language of your choice.  For example, there is Rhino for java.

Sean



>
> On Friday 30 January 2009 12:53:05 Allan Kamau wrote:
> > May be Javascript + JDBC not sure.
> >
> > But the question is why would you want to do so?
> > Javascript can be read easily by the user having the javascript
> > running on their browser. JDBC or any other database connecting client
> > will want to some how authenticate the user in most cases the
> > username, password and maybe remote IP is used. This mean that your
> > javascript will probably contain username and password in order to use
> > JDBC to connect to the DB, is this favourable?
> >
> > Allan.
> >
> > On Fri, Jan 30, 2009 at 1:40 PM, Reg Me Please <regmeplease@gmail.com>
> wrote:
> > > Hello all.
> > >
> > > Is there a way to directly access PGSQL from a Javascript application?
> > > With no application server intervention, I mean.
> > > Just like libq allows access from C/C++.
> > >
> > > --
> > > Fahrbahn ist ein graues Band
> > > weisse Streifen, grüner Rand
> > >
> > > --
> > > Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> > > To make changes to your subscription:
> > > http://www.postgresql.org/mailpref/pgsql-general
>
> --
> Fahrbahn ist ein graues Band
> weisse Streifen, grüner Rand
>
> --
> Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-interfaces
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [INTERFACES] PGSQL and Javascript
@ 2009-01-30 12:43  Reg Me Please <regmeplease@gmail.com>
  parent: Sean Davis <sdavis2@mail.nih.gov>
  0 siblings, 2 replies; 10+ messages in thread

From: Reg Me Please @ 2009-01-30 12:43 UTC (permalink / raw)
  To: Sean Davis <sdavis2@mail.nih.gov>; +Cc: Allan Kamau <kamauallan@gmail.com>; pgsql-general@postgresql.org; pgsql-interfaces

I already have a JS interpreter (spidermonkey) but there is no PGSQL 
interfacing API!
This'd be why I'm asking.

On Friday 30 January 2009 13:24:59 Sean Davis wrote:
> On Fri, Jan 30, 2009 at 7:09 AM, Reg Me Please <regmeplease@gmail.com>wrote:
> > I'd like to write part of the application in Javascript, server side, not
> > in
> > the web page.
>
> I missed your point.  Do a google search for javascript interpreters in the
> language of your choice.  For example, there is Rhino for java.
>
> Sean
>
> > On Friday 30 January 2009 12:53:05 Allan Kamau wrote:
> > > May be Javascript + JDBC not sure.
> > >
> > > But the question is why would you want to do so?
> > > Javascript can be read easily by the user having the javascript
> > > running on their browser. JDBC or any other database connecting client
> > > will want to some how authenticate the user in most cases the
> > > username, password and maybe remote IP is used. This mean that your
> > > javascript will probably contain username and password in order to use
> > > JDBC to connect to the DB, is this favourable?
> > >
> > > Allan.
> > >
> > > On Fri, Jan 30, 2009 at 1:40 PM, Reg Me Please <regmeplease@gmail.com>
> >
> > wrote:
> > > > Hello all.
> > > >
> > > > Is there a way to directly access PGSQL from a Javascript
> > > > application? With no application server intervention, I mean.
> > > > Just like libq allows access from C/C++.
> > > >
> > > > --
> > > > Fahrbahn ist ein graues Band
> > > > weisse Streifen, grüner Rand
> > > >
> > > > --
> > > > Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> > > > To make changes to your subscription:
> > > > http://www.postgresql.org/mailpref/pgsql-general
> >
> > --
> > Fahrbahn ist ein graues Band
> > weisse Streifen, grüner Rand
> >
> > --
> > Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-interfaces



-- 
Fahrbahn ist ein graues Band
weisse Streifen, grüner Rand



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [INTERFACES] PGSQL and Javascript
@ 2009-01-30 12:52  Miha D. Puc <miha.puc@eba.si>
  parent: Reg Me Please <regmeplease@gmail.com>
  1 sibling, 0 replies; 10+ messages in thread

From: Miha D. Puc @ 2009-01-30 12:52 UTC (permalink / raw)
  To: Reg Me Please <regmeplease@gmail.com>; +Cc: pgsql-general@postgresql.org; pgsql-interfaces

Well you can add you own objects to Spidermonkey via its c api. So you 
can implement something like Database object in c using libq and access 
it from your script.
Regards,
Miha

Reg Me Please pravi:
> I already have a JS interpreter (spidermonkey) but there is no PGSQL 
> interfacing API!
> This'd be why I'm asking.
>
> On Friday 30 January 2009 13:24:59 Sean Davis wrote:
>   
>> On Fri, Jan 30, 2009 at 7:09 AM, Reg Me Please <regmeplease@gmail.com>wrote:
>>     
>>> I'd like to write part of the application in Javascript, server side, not
>>> in
>>> the web page.
>>>       
>> I missed your point.  Do a google search for javascript interpreters in the
>> language of your choice.  For example, there is Rhino for java.
>>
>> Sean
>>
>>     
>>> On Friday 30 January 2009 12:53:05 Allan Kamau wrote:
>>>       
>>>> May be Javascript + JDBC not sure.
>>>>
>>>> But the question is why would you want to do so?
>>>> Javascript can be read easily by the user having the javascript
>>>> running on their browser. JDBC or any other database connecting client
>>>> will want to some how authenticate the user in most cases the
>>>> username, password and maybe remote IP is used. This mean that your
>>>> javascript will probably contain username and password in order to use
>>>> JDBC to connect to the DB, is this favourable?
>>>>
>>>> Allan.
>>>>
>>>> On Fri, Jan 30, 2009 at 1:40 PM, Reg Me Please <regmeplease@gmail.com>
>>>>         
>>> wrote:
>>>       
>>>>> Hello all.
>>>>>
>>>>> Is there a way to directly access PGSQL from a Javascript
>>>>> application? With no application server intervention, I mean.
>>>>> Just like libq allows access from C/C++.
>>>>>
>>>>> --
>>>>> Fahrbahn ist ein graues Band
>>>>> weisse Streifen, grüner Rand
>>>>>
>>>>> --
>>>>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>>>>> To make changes to your subscription:
>>>>> http://www.postgresql.org/mailpref/pgsql-general
>>>>>           
>>> --
>>> Fahrbahn ist ein graues Band
>>> weisse Streifen, grüner Rand
>>>
>>> --
>>> Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-interfaces
>>>       
>
>
>
>   

-- 
__________________________________________________________
Miha D. Puc
EBA, agencija za elektronsko poslovanje, d.o.o., Ljubljana
Teslova ulica 30
SI-1000 Ljubljana
e-mail: miha.puc@eba.si
internet: www.eba.si
GSM: +386 (0)40 620 408
TEL: +386 (0)1 477 66 60
__________________________________________________________




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: PGSQL and Javascript
@ 2009-01-30 13:01  Thomas Markus <t.markus@proventis.net>
  parent: Reg Me Please <regmeplease@gmail.com>
  3 siblings, 0 replies; 10+ messages in thread

From: Thomas Markus @ 2009-01-30 13:01 UTC (permalink / raw)
  To: Reg Me Please <regmeplease@gmail.com>; +Cc: pgsql-general@postgresql.org; pgsql-interfaces

look at apache cocoon for serverside javascript (rhino engine)
you can direct access java classes. write all db stuff in java and 
access it from js

var dao = Packages.my.own.package.DAOController.findAll();
Packages.java.lang.System.out.println(dao.myproperty);


regards
thomas

Reg Me Please schrieb:
> Hello all.
>
> Is there a way to directly access PGSQL from a Javascript application?
> With no application server intervention, I mean.
> Just like libq allows access from C/C++.
>
>   

Attachments:

  [text/x-vcard] t_markus.vcf (267B, ../../4982FA0D.2090909@proventis.net/2-t_markus.vcf)
  download | inline:
begin:vcard
fn:Thomas Markus
n:Markus;Thomas
org:proventis GmbH
adr:;;Zimmerstr. 79-80;Berlin;Berlin;10117;Germany
email;internet:t.markus@proventis.net
tel;work:+49 30 29 36 399 22
x-mozilla-html:FALSE
url:http://www.proventis.net
version:2.1
end:vcard


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [INTERFACES] PGSQL and Javascript
@ 2009-01-30 13:02  Sean Davis <sdavis2@mail.nih.gov>
  parent: Reg Me Please <regmeplease@gmail.com>
  1 sibling, 0 replies; 10+ messages in thread

From: Sean Davis @ 2009-01-30 13:02 UTC (permalink / raw)
  To: Reg Me Please <regmeplease@gmail.com>; +Cc: Allan Kamau <kamauallan@gmail.com>; pgsql-general@postgresql.org; pgsql-interfaces

On Fri, Jan 30, 2009 at 7:43 AM, Reg Me Please <regmeplease@gmail.com>wrote:

> I already have a JS interpreter (spidermonkey) but there is no PGSQL
> interfacing API!
> This'd be why I'm asking.
>

Ah.  Sorry again.  No idea if this will be useful, but you might take a look
at:

http://www.whitebeam.org/

Sean



>
> On Friday 30 January 2009 13:24:59 Sean Davis wrote:
> > On Fri, Jan 30, 2009 at 7:09 AM, Reg Me Please <regmeplease@gmail.com
> >wrote:
> > > I'd like to write part of the application in Javascript, server side,
> not
> > > in
> > > the web page.
> >
> > I missed your point.  Do a google search for javascript interpreters in
> the
> > language of your choice.  For example, there is Rhino for java.
> >
> > Sean
> >
> > > On Friday 30 January 2009 12:53:05 Allan Kamau wrote:
> > > > May be Javascript + JDBC not sure.
> > > >
> > > > But the question is why would you want to do so?
> > > > Javascript can be read easily by the user having the javascript
> > > > running on their browser. JDBC or any other database connecting
> client
> > > > will want to some how authenticate the user in most cases the
> > > > username, password and maybe remote IP is used. This mean that your
> > > > javascript will probably contain username and password in order to
> use
> > > > JDBC to connect to the DB, is this favourable?
> > > >
> > > > Allan.
> > > >
> > > > On Fri, Jan 30, 2009 at 1:40 PM, Reg Me Please <
> regmeplease@gmail.com>
> > >
> > > wrote:
> > > > > Hello all.
> > > > >
> > > > > Is there a way to directly access PGSQL from a Javascript
> > > > > application? With no application server intervention, I mean.
> > > > > Just like libq allows access from C/C++.
> > > > >
> > > > > --
> > > > > Fahrbahn ist ein graues Band
> > > > > weisse Streifen, grüner Rand
> > > > >
> > > > > --
> > > > > Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> > > > > To make changes to your subscription:
> > > > > http://www.postgresql.org/mailpref/pgsql-general
> > >
> > > --
> > > Fahrbahn ist ein graues Band
> > > weisse Streifen, grüner Rand
> > >
> > > --
> > > Sent via pgsql-interfaces mailing list (
> pgsql-interfaces@postgresql.org)
> > > To make changes to your subscription:
> > > http://www.postgresql.org/mailpref/pgsql-interfaces
>
>
>
> --
> Fahrbahn ist ein graues Band
> weisse Streifen, grüner Rand
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2009-01-30 13:02 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-01-30 11:40 PGSQL and Javascript Reg Me Please <regmeplease@gmail.com>
2009-01-30 11:53 ` Allan Kamau <kamauallan@gmail.com>
2009-01-30 12:09   ` Reg Me Please <regmeplease@gmail.com>
2009-01-30 12:24     ` Sean Davis <sdavis2@mail.nih.gov>
2009-01-30 12:43       ` Reg Me Please <regmeplease@gmail.com>
2009-01-30 12:52         ` Miha D. Puc <miha.puc@eba.si>
2009-01-30 13:02         ` Sean Davis <sdavis2@mail.nih.gov>
2009-01-30 11:56 ` Sean Davis <sdavis2@mail.nih.gov>
2009-01-30 12:17 ` Leif B. Kristensen <leif@solumslekt.org>
2009-01-30 13:01 ` Thomas Markus <t.markus@proventis.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox