Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Database Access With No Required Installation

Tags:

c++

c#

sql

database

I am looking for a database that can I run SQL statements on without having to have a database server installed. I.e. I need the ability to select/insert/update a database given only the database file and any external libraries.

Here is my situation:

  • I am using C++ to parse through a number of oddly-formatted binary files, and I would like to store them into some type of database to offer more convenient access to the data.
  • Once the files have been inserted into the database, I will use C# to write an interface/GUI by which a user can interact with the database.
  • I'm using C++ for the speed of reading the files and because I've already written that part.
  • I'm using C# because it is much easier to do GUI programming.

Here are my requirements:

  1. Database must provide a way to run commands in C++ using only external libraries (no installation)
  2. I should be able to move the database to any (similar [Windows]) computer and run my application

I believe this is possible with MS Access *.mdb files using ADO or JET or something like that, however, I would like to hear some alternatives. Please provide the database and the C++ engine/libraries in your answer.

My priorities are:

  1. "Lite"-ness
  2. Performance (speed of insert/select)
  3. Client code simplicity (i.e. how easy it is to set up)

Thank you all.

like image 448
Eric Avatar asked Dec 22 '22 13:12

Eric


1 Answers

You need to look into SQLite. It is perfect for this scenario and very easy to use. It is vastly popular (large community), compact, cross-platform, and simple to use.

There are SQLite implementations for other languages too. For instance, you can also access SQLite databases using C#. There is even a Linq-to-SQLite.

like image 136
Jordan Parmer Avatar answered Dec 29 '22 16:12

Jordan Parmer