Matricsoft - software development
products > Quickdb
description
database creation
table creation
record creation
record retrieval
record operations
file operations
database operations
definition operations
exceptions
relations
header file

Quickdb Description (release 2)

Quickdb is a set of C++ classes that enables you to define and use databases from your C++ program.
Quickdb has been designed in C++ but is presented as a COM interface. This approach makes it much easier to integrate with clients (your C++ program) and avoids problems of compatibility with compilers.

You can see the complete class definition, the different functionality or an example.

Interface definition (C++ class definition)

quickdb has been completely revamped since the release 1, and is now much more reliable and above all does not leak resources as it may have before. It now enables to create relations between tables (you get a relational database engine which is very fast).

For ease of use, there is only one C++ class that your C++ program needs to use in order to create, read or write databases in memory or on disk (quickdb is not based on disk, all the information is kept in memory, however, you can save or load in XML).

To see how easy it is to create a database, just consider this code:

//creation of the database in memory...
db mydb("jobs");

//creation of a table...
mydb.new_table();
mydb.add_field("name", db_string);
mydb.add_field("surname", db_string);
mydb.add_field("age", db_int);
mydb.commit_table("employee");

//creation of a record of this table...
mydb.new_record("employee");
mydb.set_field("name", "john");
mydb.set_field("surname", "doe");
mydb.set_field("age", 39);
mydb.commit_record();

//to save the database on a file:
mydb.save_to_file("my database.xml");

What is also important is that you can create a totally dynamic database in memory (it does not need to be "hard-coded" in C++ code). At the beginning of writing quickdb, the data definition was declared in the xml file. However, the approach complicated the verification between the model kept in memory and the model from the file. Therefore, all the information from the file is just limited to the actual data.

The XML file generated by quickdb looks like this:

<database>
  <info>
    <name>jobs</name>
    <version>1</version>
  </info>
  <data>
    <employee>
      <record>
        <name>john</name>
        <surname>doe</surname>
        <age>12</age>
      </record>
    </employee>
  </data>
</database>

Instructions for compilation and integration

The quickdb package is easily integrated in your program the following way:

  • All the functionality is present in quickdb.dll. This is a "COM server" (it's just a dll, with some standard features which enable to use whichever C++ compiler -or even a Visual Basic program) to access the object, quickdb.
  • To avoid the burden of learning COM, a set of classes have been included. All the COM features have been hidden behind a wrapper so that you don't need to know COM in order to use this package.
  • All the functionality is available directly from this class.