C SQL DB Library

R

rabbits77

niq said:
i did lot of search before posting
if any noticable results from your side leave them here)
Just for laughs I noticed that the first google link
points to your original post. ha ha ha ha.
The stupid asshole with the google link should
follow his own advice before humiliating himself!
The real answer is that it kind of depends
on the db. Which db are you targetting?
 
U

user923005

I need c db library that works with most of RDBMS. Open source. Free))

Just use standards based database adapters like ODBC, OLEDB or .NET
(or JDBC if you want to use Java).
The most ubiquitous is ODBC, since it works everywhere (including
POSIX clients) or JDBC if you use Java for the same reason.
See:
http://www.sqlsummit.com/ODBCVend.HTM

I suggest that a web search is a better way to solve this sort of
problem.
 
N

niq

presumably you already found the ODBC driver libraries.

right. they are not suitable for my purposes
as much things are unified as much slow they are
i need fast db libs with minimum of abstraction levels using native
api of each db system.
 
N

niq

I need c db library that works with most of RDBMS. Open source. Free))

I'm writing kind of simple intermediate server so i need some kind of
unified interface to access RDBMS. It should be simple and fast. ODBC is
too much unified)) and probably will not be able to use some specific
features of each system.

I did it before myself in c++ using bridge pattern. Now i have some
difficulties in implementing it in C. So i just wanted to see how it is
done in other libraries)).

Maybe just new topic like "Unified simple client API interface to RDBMS"
should be created.

Thanks a lot for all suggestions.
Nevertheless topic is open for any discussion yet).
 
F

Flash Gordon

niq wrote:

Maybe just new topic like "Unified simple client API interface to RDBMS"
should be created.

Thanks a lot for all suggestions.
Nevertheless topic is open for any discussion yet).

I suggest asking it in the database groups. If anyone knows of something
better than ODBC you are more likely to find them there than here (you
have already failed to find them here).

I would also have suggested ODBC.
 
U

user923005

I'm writing kind of simple intermediate server so i need some kind of
unified interface to access RDBMS. It should be simple and fast. ODBC is
too much unified)) and probably will not be able to use some specific
features of each system.

That's a function of the driver vendor. For instance, our ODBC driver
can do a bulk insert when performing an insert select if the target
database supports it.
A study by Ken North a long, long time ago showed that ODBC performs
as well as native libraries:
http://www.sqlsummit.com/PDF/SQLAPI_benchmarks_1995.PDF
Our company has spent literally millions of dollars making our drivers
fast. I guess that all the other ODBC vendors have done the same
thing.
Will you put the same effort into your database layer?
I did it before myself in c++ using bridge pattern. Now i have some
difficulties in implementing it in C. So i just wanted to see how it is
done in other libraries)).

Sourceforge has the following non-standards based interfaces:
http://sourceforge.net/projects/cppdbc/
http://sourceforge.net/projects/gql/
http://sourceforge.net/projects/liblookdb/
http://sourceforge.net/projects/soci/
http://sourceforge.net/projects/dtemplatelib/
http://sourceforge.net/projects/otl/
http://sourceforge.net/projects/lwdba/

I kind of like some of the template based approaches.
Maybe just new topic like "Unified simple client API interface to RDBMS"
should be created.

ODBC drivers or OLEDB and .NET providers are going to be hard to beat.
They are based on standards, so your product will work with anything
from SQLite to IBM IMS/DB without changing a line of your source code.
There are dozens of free drivers for databases of all sorts. So cost
is not a problem.
Thanks a lot for all suggestions.
Nevertheless topic is open for any discussion yet).

What has it got to do with the C language?
 
N

niq

A study by Ken North a long, long time ago showed that ODBC performs
as well as native libraries:
http://www.sqlsummit.com/PDF/SQLAPI_benchmarks_1995.PDF
Our company has spent literally millions of dollars making our drivers
fast. I guess that all the other ODBC vendors have done the same
thing.
Will you put the same effort into your database layer?

Third party drivers, libs tend to be used in certain applied programs
and never in server like systems. Just glance over any open source server
system written in C (PostgreSQL, PHP, Sedna) they use their own
simplified access functions and avoid using external libs.

They all written in C++.
The last one is in Java even.
What has it got to do with the C language?

A post before your's shows why does it refer to C language
 
N

niq

the code above is just snipped off some prototyping, where I just want
to support a single native MySQL driver, but abstract those API's calls
away from the app. Adding code to support e.g. Oracle, would be easy.

thanks a lot for such a detailed intro)
i'll digest it and put a code here for revision))
 
Z

zorro

thanks a lot for such a detailed intro)
i'll digest it and put a code here for revision))

It was just a partial extracts from some prototyping I did a while
ago, but I will need to look into this again later and complete the
design. My intent was to provide an abstraction, where I could
support native MySQL API, and later on easily plug in support for the
ODBC API or some other native DB C API.

I see some private macros slipped by.. for debug builds PRE is simply
#define PRE(x) assert(x)
#define POST(x) assert(x)

while in release builds use
#define PRE(x) (0 && (x)) /* never evaluate 'x', but detect
an invalid 'x' */
#define POST(x) (0 && (x)) /* never evaluate 'x', but detect
an invalid 'x' */

and REQUIRE is part of my Eiffel inspired macros for run-time checks:

#define run_time_check(type, test) \
do {\
if ( !(test) )\
run_time_exit_handler(type, #test, __FILE__, __LINE__);
\
} while (0)

#define REQUIRE(test) run_time_check("pre-condition",
test)
#define ENSURE(test) run_time_check("post-condition ",
test)
#define INVARIANT(test) run_time_check("loop-invariant",
test)
#define CHECK(test) run_time_check("check-constraint",
test)

for fail-safe termination, in case the app detect an inconsistent
internal state.
 
U

user923005

Third party drivers, libs tend to be used in certain applied programs
and never in server like systems. Just glance over any open source server
system written in C (PostgreSQL, PHP, Sedna) they use their own
simplified access functions and avoid using external libs.

PostgreSQL uses dozens of external drivers. You have obviously never
examined the source code.
They all written in C++.
The last one is in Java even.


A post before your's shows why does it refer to C language

I think you need to explain it to me. I have read the thread in its
entirety and utterly fail to see any connection.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,295
Latest member
EmilG1510

Latest Threads

Top