Official C++ API for postgresql?

Started by niXmanover 13 years ago15 messagesgeneral
Jump to latest
#1niXman
i.nixman@gmail.com

Hello,

Tell me please, whether there is an official C++ API for postgresql?

Thanks,

--
Regards,
niXman
___________________________________________________
Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows:
http://sourceforge.net/projects/mingwbuilds/

#2Ryan Kelly
rpkelly22@gmail.com
In reply to: niXman (#1)
Re: Official C++ API for postgresql?

On Mon, Sep 17, 2012 at 10:58:30PM +0400, niXman wrote:

Hello,

Tell me please, whether there is an official C++ API for postgresql?

http://pqxx.org/development/libpqxx/

Thanks,

--
Regards,
niXman

-Ryan Kelly

#3Steve Atkins
steve@blighty.com
In reply to: niXman (#1)
Re: Official C++ API for postgresql?

On Sep 17, 2012, at 11:58 AM, niXman <i.nixman@gmail.com> wrote:

Hello,

Tell me please, whether there is an official C++ API for postgresql?

http://pqxx.org/development/libpqxx/ is the main C++ specific library. But
you can also use libpq from C++, and for simpler work it's often easier
than libpqxx.

There are also several other C++ bindings - sqlapi++, soci and Qt are
some off the top of my head.

Cheers,
Steve

#4niXman
i.nixman@gmail.com
In reply to: Ryan Kelly (#2)
Re: Official C++ API for postgresql?

2012/9/17 Ryan Kelly:

http://pqxx.org/development/libpqxx/

Ah, okay.

Thank you Ryan.

--
Regards,
niXman
___________________________________________________
Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows:
http://sourceforge.net/projects/mingwbuilds/

#5Dann Corbit
DCorbit@connx.com
In reply to: Steve Atkins (#3)
Re: Official C++ API for postgresql?

-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Steve Atkins
Sent: Monday, September 17, 2012 12:23 PM
To: pgsql-general@postgresql.org General
Subject: Re: [GENERAL] Official C++ API for postgresql?

On Sep 17, 2012, at 11:58 AM, niXman <i.nixman@gmail.com> wrote:

Hello,

Tell me please, whether there is an official C++ API for postgresql?

http://pqxx.org/development/libpqxx/ is the main C++ specific library. But you can also use libpq from C++, and for simpler work it's often easier than libpqxx.

There are also several other C++ bindings - sqlapi++, soci and Qt are some off the top of my head.

Not to mention the standards based drivers such as ODBC.
<<

#6niXman
i.nixman@gmail.com
In reply to: Ryan Kelly (#2)
Re: Official C++ API for postgresql?

2012/9/17 Ryan Kelly:

http://pqxx.org/development/libpqxx/

Last question...
According to the link provided by you, it is said that libpqxx comes
with postgres. But in the archive with postgres sources I haven't find
libpqxx.

--
Regards,
niXman
___________________________________________________
Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows:
http://sourceforge.net/projects/mingwbuilds/

#7Ryan Kelly
rpkelly22@gmail.com
In reply to: niXman (#6)
Re: Official C++ API for postgresql?

On Mon, Sep 17, 2012 at 11:52:13PM +0400, niXman wrote:

2012/9/17 Ryan Kelly:

http://pqxx.org/development/libpqxx/

Last question...
According to the link provided by you, it is said that libpqxx comes
with postgres. But in the archive with postgres sources I haven't find
libpqxx.

It is not provided with postgres. It is a separate library. This is
where you obtain it:
http://pqxx.org/development/libpqxx/wiki/DownloadPage

-Ryan

#8Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Ryan Kelly (#7)
Re: Official C++ API for postgresql?

On 09/17/2012 12:55 PM, Ryan Kelly wrote:

On Mon, Sep 17, 2012 at 11:52:13PM +0400, niXman wrote:

2012/9/17 Ryan Kelly:

http://pqxx.org/development/libpqxx/

Last question...
According to the link provided by you, it is said that libpqxx comes
with postgres. But in the archive with postgres sources I haven't find
libpqxx.

It is not provided with postgres. It is a separate library. This is
where you obtain it:
http://pqxx.org/development/libpqxx/wiki/DownloadPage

I think the confusing part is:

"This library works on top of the C-level API library, libpq. It comes
with postgres"

The it refers to libpq not libpqxx.

-Ryan

--
Adrian Klaver
adrian.klaver@gmail.com

#9niXman
i.nixman@gmail.com
In reply to: Ryan Kelly (#7)
Re: Official C++ API for postgresql?

2012/9/17 Ryan Kelly:

It is not provided with postgres. It is a separate library.

Hmm..

From link provided by you:

This library works on top of the C-level API library, libpq. It comes with postgres.

--
Regards,
niXman
___________________________________________________
Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows:
http://sourceforge.net/projects/mingwbuilds/

#10niXman
i.nixman@gmail.com
In reply to: Adrian Klaver (#8)
Re: Official C++ API for postgresql?

2012/9/17 Adrian Klaver:

The it refers to libpq not libpqxx.

I understang. Sorry..

--
Regards,
niXman
___________________________________________________
Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows:
http://sourceforge.net/projects/mingwbuilds/

#11Merlin Moncure
mmoncure@gmail.com
In reply to: niXman (#1)
Re: Official C++ API for postgresql?

On Mon, Sep 17, 2012 at 1:58 PM, niXman <i.nixman@gmail.com> wrote:

Hello,

Tell me please, whether there is an official C++ API for postgresql?

Technically speaking, the only official C++ api is libpq, which, while
a C API, is C++ compatible. libpxx is a set of wrappers to libpq that
will give you C++ classes to use vs the more traditional C API calls.
It's very mature and works well if you prefer that style of
development.

merlin

#12John R Pierce
pierce@hogranch.com
In reply to: niXman (#9)
Re: Official C++ API for postgresql?

On 09/17/12 12:57 PM, niXman wrote:

2012/9/17 Ryan Kelly:

It is not provided with postgres. It is a separate library.

Hmm..

From link provided by you:

This library works on top of the C-level API library, libpq. It comes with postgres.

I suspect that is saying that libpq comes with postgres.

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

#13John R Pierce
pierce@hogranch.com
In reply to: Dann Corbit (#5)
Re: Official C++ API for postgresql?

On 09/17/12 12:26 PM, Dann Corbit wrote:

Not to mention the standards based drivers such as ODBC.

the great thing about standards is there are so many to choose from. :)

ODBC, however, is, IMHO, awful.

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

#14Chris Angelico
rosuav@gmail.com
In reply to: Adrian Klaver (#8)
Re: Official C++ API for postgresql?

On Tue, Sep 18, 2012 at 5:56 AM, Adrian Klaver <adrian.klaver@gmail.com> wrote:

I think the confusing part is:

"This library works on top of the C-level API library, libpq. It comes with
postgres"

The it refers to libpq not libpqxx.

Sounds to me like a wording change might be in order - perhaps "...
libpq, which comes with ..."?

It's a wiki, but not one with public editing, I think.

ChrisA

#15Dann Corbit
DCorbit@connx.com
In reply to: John R Pierce (#13)
Re: Official C++ API for postgresql?

-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of John R Pierce
Sent: Monday, September 17, 2012 1:32 PM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Official C++ API for postgresql?

On 09/17/12 12:26 PM, Dann Corbit wrote:

Not to mention the standards based drivers such as ODBC.

the great thing about standards is there are so many to choose from. :)

ODBC, however, is, IMHO, awful.

A study by Ken North showed that there is nothing to be gained by using native low level drivers instead of ODBC in terms of speed.
PostgreSQL was not one of the database engines included in the study.
However, I suspect that a study of PostgreSQL would show the same tendencies.
Once you are used to programming in ODBC, it is quite simple.
Of course, I write standards based drivers for a living, so my testimony has a built-in bias.

<<