Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #11299 > unrolled thread

DB library question

Started byEmil Barton <emilbarton@whynot.com>
First post2011-11-07 14:11 +0000
Last post2011-11-16 17:17 +0000
Articles 8 — 5 participants

Back to article view | Back to comp.lang.c++


Contents

  DB library question Emil Barton <emilbarton@whynot.com> - 2011-11-07 14:11 +0000
    Re: DB library question "Waldek M." <wm@localhost.localdomain> - 2011-11-07 18:52 +0100
      Re: DB library question Emil Barton <emilbarton@whynot.com> - 2011-11-07 18:20 +0000
        Re: DB library question "Waldek M." <wm@localhost.localdomain> - 2011-11-07 22:16 +0100
          Re: DB library question emilbarton <bartonemil@gmail.com> - 2011-11-11 02:55 -0800
    Re: DB library question Ian Collins <ian-news@hotmail.com> - 2011-11-08 07:36 +1300
      Re: DB library question Emil Barton <emilbarton@whynot.com> - 2011-11-07 19:05 +0000
    Re: DB library question yatremblay@bel1lin202.(none) (Yannick Tremblay) - 2011-11-16 17:17 +0000

#11299 — DB library question

FromEmil Barton <emilbarton@whynot.com>
Date2011-11-07 14:11 +0000
SubjectDB library question
Message-ID<j98ov0$p9i$2@wieslauf.sub.de>
Hello, I have a Perl program running on top of a Postgresql db that I'd 
like to replace by a standalone application independant from both Perl 
and Postgresql. Is there a C++ db library that offers as many query 
possibilities as Postgresql? I think mainly of nested requests. I dont 
need the query engine to be necessarily SQL compatible.

Thank you in advance for your answers.

[toc] | [next] | [standalone]


#11302

From"Waldek M." <wm@localhost.localdomain>
Date2011-11-07 18:52 +0100
Message-ID<tdq769s345iz.dlg@localhost.localdomain>
In reply to#11299
On Mon, 7 Nov 2011 14:11:44 +0000 (UTC), Emil Barton wrote:
> Hello, I have a Perl program running on top of a Postgresql db that I'd 
> like to replace by a standalone application independant from both Perl 
> and Postgresql. Is there a C++ db library that offers as many query 
> possibilities as Postgresql? I think mainly of nested requests. I dont 
> need the query engine to be necessarily SQL compatible.

It's a little off-topic for this group, but... 

You might want to have a look at SOCI: http://soci.sourceforge.net/

It's a very nice library that can use particular DB drivers
as a backend, eg. PgSQL, MySql, SQLite3 etc.

I haven't used it so far, but after reviewing the docs, I'm considering
giving it a try next time I do something SQL-related.


Best regards,
Waldek

[toc] | [prev] | [next] | [standalone]


#11303

FromEmil Barton <emilbarton@whynot.com>
Date2011-11-07 18:20 +0000
Message-ID<j997hj$19l$1@wieslauf.sub.de>
In reply to#11302
Thank you for this answer.

On Mon, 07 Nov 2011 18:52:38 +0100, Waldek M. wrote:

> It's a little off-topic for this group, but...

Please redirect me to the right group then.

> You might want to have a look at SOCI: http://soci.sourceforge.net/

This is nice but "off topic" for my question I'm afraid. I must have been 
unclear. What I want is to create a database in C++ that would not
have to rely on other backends, drivers, engines or whatever you call 
them in SQL or not. A pure C++ database providing its own structure,  
algorithms and access methods, you understand?

Thank you if you can tell me if this is feasible with some existing
libraries in C++ or if I have to pump code from an exsting (opensource) 
database system like Postgresql and translate it from scratch.

Emil

[toc] | [prev] | [next] | [standalone]


#11309

From"Waldek M." <wm@localhost.localdomain>
Date2011-11-07 22:16 +0100
Message-ID<vxwifftl4257$.dlg@localhost.localdomain>
In reply to#11303
On Mon, 7 Nov 2011 18:20:35 +0000 (UTC), Emil Barton wrote:
>> It's a little off-topic for this group, but...
> Please redirect me to the right group then.

I'm not sure which one would be good for you; comp.databases perhaps?
This one is on C++ language itself, and the standard library.

> This is nice but "off topic" for my question I'm afraid. I must have been 
> unclear. What I want is to create a database in C++ that would not
> have to rely on other backends, drivers, engines or whatever you call 
> them in SQL or not. A pure C++ database providing its own structure,  
> algorithms and access methods, you understand?

Frankly, I do not. C++ language does not specify databases, so there's
no way to have a "pure C++ database".
You might want to use some serialization framworks, like eg. google
protobuf. You might want to use simple write()/read() calls
on your structures provided you can save their state somehow.
Or use SQlite, which is an engine that comes as one header file.
More C in syntax than C++, actually.

Does any of these fulfil your needs?

Best regards,
Waldek

[toc] | [prev] | [next] | [standalone]


#11385

Fromemilbarton <bartonemil@gmail.com>
Date2011-11-11 02:55 -0800
Message-ID<faf27fbf-6ad6-4c08-a7a7-da4cf11ec5c7@e15g2000vba.googlegroups.com>
In reply to#11309
On Mon, 07 Nov 2011 22:16:44 +0100, Waldek M. wrote:
> Or use SQlite, which is an engine that comes as one
> header file. More C in syntax than C++, actually.
>
> Does any of these fulfil your needs?

Yes I think it should do what I need. Many thanks
and best regards!

Emil

[toc] | [prev] | [next] | [standalone]


#11305

FromIan Collins <ian-news@hotmail.com>
Date2011-11-08 07:36 +1300
Message-ID<9hqmp6F4bgU1@mid.individual.net>
In reply to#11299
On 11/ 8/11 03:11 AM, Emil Barton wrote:
> Hello, I have a Perl program running on top of a Postgresql db that I'd
> like to replace by a standalone application independant from both Perl
> and Postgresql. Is there a C++ db library that offers as many query
> possibilities as Postgresql? I think mainly of nested requests. I dont
> need the query engine to be necessarily SQL compatible.

Have a look at Berkeley DB.  Or just stick with Postgresql.

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#11307

FromEmil Barton <emilbarton@whynot.com>
Date2011-11-07 19:05 +0000
Message-ID<j99a5a$19l$2@wieslauf.sub.de>
In reply to#11305
On Tue, 08 Nov 2011 07:36:22 +1300, Ian Collins wrote:

> Have a look at Berkeley DB.  Or just stick with Postgresql.

Berkely DB does not allow nested requests if I remember well. You will 
understand my problem easily if I tell you that my program would not 
require often changes, however Postgresql is changing its procedural 
language syntax each now and then forcing me to rewrite. I don't always 
remember well the tricky parts of my code between 2 updates in Postgresql, 
which makes the whole process of following Postgresql updates a real 
pain, but otherwise my program doesn't run unless I reinstall an ancient 
Postgresql package (and this is not done out of the box either as you 
might know). I don't even tell you about explaining this to other users.. 
So I finally had the desire to get free from other programs...   
 

[toc] | [prev] | [next] | [standalone]


#11520

Fromyatremblay@bel1lin202.(none) (Yannick Tremblay)
Date2011-11-16 17:17 +0000
Message-ID<ja0r7u$n0q$1@dont-email.me>
In reply to#11299
In article <j98ov0$p9i$2@wieslauf.sub.de>,
Emil Barton  <emilbarton@whynot.com> wrote:
>Hello, I have a Perl program running on top of a Postgresql db that I'd 
>like to replace by a standalone application independant from both Perl 
>and Postgresql. Is there a C++ db library that offers as many query 
>possibilities as Postgresql? I think mainly of nested requests. I dont 
>need the query engine to be necessarily SQL compatible.

OT but anyway.  Assuming that you don't really want to become
independent from Postgresql but rather mean access the Postgresql
database directly and natively from C++ without using Perl or
SQL. Then:

a) Is your database relatively simple with few tables and simple
relationships: 

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

Very C++ and easy to use.  Will allow you to interface with the
database natively in C++.

b) Is your database complex with lots of different objects and complex
relationships between them:

Consider using a Object Relationship Mapping library (ORM).  This
could save you a large amount of development time rather than manually
defining everything.

See:
http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software#C.2B.2B 


Yannick

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web