Working demo SQLite with C++ on Mac OSX Xcode

(Last Updated On: January 4, 2016)

Working demo SQLite with C++ on Mac OSX Xcode

This was developed for Mac OSX which seems the preferred database.

Problems with the alternatives databases:

Open source Maria DB does not work at all which appears to be a mess

MYSQL is unstable and incomplete thanks to Oracle butchering it

Postgres development libraries seem complex for Xcode or just does not link up for some reason

SQLite seems to be the only one that work. For my new version 2 system, this should be fine for very simplistics needs as long as I don’t need it for Clustering on multiple systems

Instructions here:

Install SQLite3 with: brew install sqlite3

This could already be installed by default in your  Mac OSX

You could use this to Download SQLiteBrowser from http://sqlitebrowser.org/

I installed using http://macappstore.org/sqlitebrowser/

brew cask install sqlitebrowser

I installed Valentina Studio through Apple OS X App store which is free

Could make a sample C++ client for SQLite



#include <stdio.h>

#include <sqlite3.h>

int main(int argc, char* argv[])


    sqlite3 *db;

    char *zErrMsg = 0;

    int rc;


    rc = sqlite3_open(“test.db”, &db);


    if( rc ){

        fprintf(stderr, “Can’t open database: %s\n”, sqlite3_errmsg(db));

        return -1;


        fprintf(stderr, “Opened database successfully\n”);




Join my FREE newsletter to see how SQLite should fit my simplistic needs for automated trading

My working demo with SQLite

Helpful tutorial video



NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!
share this recipe:

Still hungry? Here’s more

Automated Bots: Your Key to Stock Trading Success

Automated bots are rapidly gaining ground in the stock market, and if you’re still trading manually, the box will outrun you. Yes, you heard it right! These powerful bots are set to become the new norm, and those who embrace them will have a significant advantage over those who don’t.

Read More

Are you interested in: