A Custom Tailored API for RDM Schemas

October 10

Raima logo on grey background

Most database software provides one or more API (ApplicationProgramming Interface) for accessing data and data manipulation.These APIs for the most part either follow some standards or they areproprietary to the database software. RDM takes both approaches.

Introduction

The RDM Native interface with d_ functions is a low level interface optimized for the RDM core engine, while the SQL APIs is implemented on top of a SQL engine. The SQL engine uses the RDM native interface as its storage engine. The RDM Native interface relays on a schema that needs to be compiled. The compiled schema provides a dictionary (used by the engine) and a header file with struct declarations which can be used for accessing data and for data manipulation.

Custom tailored interface

With the release of RDM Embedded 10.1 (now RDM) we took a slightly different approach. Instead of using a standard API or a proprietary API specific to the database software, we tailored the interface towards the actual schemas used by users. The schema compiler was modified to also generate a tailored C++ API aimed towards an implementation.

The tailored API is implemented as a specialization of two base classes. The Db base class, which encapsulates access to a database, and the Cursor base class, which encapsulates access to records within a database. These base classes contain public methods that are common to all database schemas and protected methods that are only used by the implementation of the specialized classes generated by the schema compiler.

The two base classes together with the specialized classes for a particular schema defines the exact API. By using these specialized interfaces, the C++ programmer has access to a high level API matching their schema and one which can easily be used in the application. This API is complete and no other API is necessary for easy, safe, and efficient querying, insertion, updating, and deletion of data stored in an RDM database.

Next, we will look at how to instantiate these interfaces.

Get notified about new RDM updates

Be the first to know about new Raima Database Manager updates when they go live, use cases, industry trends and more.