SQL API for *NIX C++
NickName:Henrik Hillestad Løvold Ask DateTime:2013-12-04T20:48:58

SQL API for *NIX C++

I am currently writing a client-server app for the iOS platform. The client is written in Obj-C, and the server uses C++ on OSX11.9. Since I intend to run the server software on an Ubuntu dedicated server, I am trying my best to keep the serverside code portable.

To store data about users and user-game-relations I intend to use an SQL database (most likely MySQL or possibly PostgreSQL since I'm familiar with those). I know that it is possible to read from/write to the database through a filedescriptor just like I do in my TCP module, but I wish to utilize a higher-level SQL communications API to make the programming process quicker.

Can anyone recommend me a good open source/free SQL API for *NIX C++? Any help would be appreciated. Thanks in advance!

Copyright Notice:Content Author:「Henrik Hillestad Løvold」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/20375866/sql-api-for-nix-c

Answers
DarkWanderer 2013-12-04T12:54:50

You have several options here:\n\n\nUse native database SDK. They are usually distributed along with the database installation or as separate downloads/packets. The upside is you can get maximum speed out of it. Downside is that you'll be limited by your initial choice - no switching afterwards without rewriting part of application.\nUse a C++ ORM (example: ODB). This gives you DB independence along with some tasty features, at the cost of slightly reduced speed.\n",


More about “SQL API for *NIX C++” related questions

SQL API for *NIX C++

I am currently writing a client-server app for the iOS platform. The client is written in Obj-C, and the server uses C++ on OSX11.9. Since I intend to run the server software on an Ubuntu dedicated

Show Detail

Error building PostgreSQL 12 with nix on Big Sur: “stdio.h not found”

I'm trying to build postgresql 12 with timescaledb on macOS Big Sur (x86), but the build fails with “error: 'stdio.h' file not found”: ❯ nix-shell -p 'postgresql_12.withPackages (p: [ p.timescaledb...

Show Detail

Is it possible to get the current git SHA when building a Nix project with Hydra?

I'm building a Haskell project with Nix, with CI done by a Hydra server. One thing I would like to do is embed the git SHA in the application itself, that way the SHA can be included in our exception

Show Detail

An Overview of Nix/OS Architecture?

While the Nix/OS wiki and manuals provide a lot of excellent information, I am still having trouble getting an architectural overview. Apologies for the quantity and naivity of the questions; feel ...

Show Detail

Missing C library error during stack build with nix

In my project I'm using a library that depends on two C packages: sqlite3 and libsqlite3-dev. I installed them using apt-get install and then build the project with stack build and everything works...

Show Detail

dotnet restore failed when using nix-build, but works when under nix-shell --pure

I'm trying to use nix for building dotnet (sdk 5) projects. The configuration is something like stdenv.mkDerivation { # builder = "${bash}/bin/bash"; # args = [ ./builder.sh ]; name = "

Show Detail

How to refresh a nix derivation (nix pill's 7.5) in nix-repl?

Looking at the example given in the 7th nix pill, typing :b simple builds the derivation for a short c program. In nix-repl simple = derivation { name = "simple"; builder = "${bash}/bin/bash"; arg...

Show Detail

Failed when `nix-build hello.nix`

I followed the steps on http://lethalman.blogspot.com/2014/08/nix-pill-8-generic-builders.html to build GNU Hello, and here is the files I used to build GNU hello 2.9: $ wget -c http://ftp.gnu.org...

Show Detail

First steps on nix: Doing configure/make the Nix way?

I want to see what the experience is when working with non-nix-ready packages - most of the tools I use aren't part of nixpkgs just yet, so I want to work on that and try some things out. In order to

Show Detail

First steps on nix: Doing configure/make the Nix way?

I want to see what the experience is when working with non-nix-ready packages - most of the tools I use aren't part of nixpkgs just yet, so I want to work on that and try some things out. In order to

Show Detail