POV-Ray : Newsgroups : povray.off-topic : C++ / database question : Re: C++ / database question Server Time
6 Sep 2024 05:17:27 EDT (-0400)
  Re: C++ / database question  
From: scott
Date: 17 Feb 2009 03:02:38
Message: <499a6f1e@news.povray.org>
> You do it with SQL. Probably something along the lines of
>
> CREATE DATABASE mystuff;
>
> CREATE TABLE mytable (
>   somenumber INTEGER NOT NULL,
>   comestring VARCHAR(50) DEFAULT '',
>   primary key somenumber
> );
>
> Look up those keywords.

OK thanks that's certainly a good start, I've never worked with creating 
this stuff from scratch before.

> You'll also need to figure out how to connect in the first place. Grep the 
> manual for "connection string", which is usually how it's described. It 
> tells basically the address of the server (IP & port, usually) plus user 
> plus password.

Got that all working now - at some later date I will need to figure out how 
to install postgres silently with all the correct options so my app will run 
without having to explain to the user how to install it.  And then cope with 
what happens when postgres is already installed...

> Warp wrote:
> >   If you need to output the data in some special format, after it has 
> > been
> > processed, I really don't know what tools, if any, SQL offers for this.
>
> SQL doesn't offer too many tools as such, i.e., not in a portable way.

Most of the "results" I will just be using to display tables or graphs 
within my app.

> You could also use metakit (from equi4.com) if you want a nice embeddable 
> database that isn't SQL (it's not even normalized). Just a plug for a 
> great product.

Will take a look, thanks.

> You can also use "SQL Server Everywhere", which is Microsoft's SQL server 
> in a form that you link it into your program.

Ditto.

> PHP is OK for doing database stuff, but it's kludgey, so if you expect the 
> system to grow, or other people to work on it, it's probably something to 
> stay away from unless you need it for some other reason anyway. It's a way 
> to quickly hack together web front ends, and its use as a desktop tool is 
> poor.

THere are certain other parts of my code that need to be run pretty quickly 
(some simulation stuff) and as I already have a lot of that in C++ I think 
my best bet is to find the best database backend to use from C++.

What I might do is write a wrapper class for the database parts of my code 
that will initially just use simple STL structures to store/retrieve/filter 
data and then later I can write code to use a db engine instead once I get 
it working with small datasets.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.