Ada Database Objects

Alire Alire Alire Build Status Test Status codecov Documentation Status Download License Commits

Ada Database Objects is an Ada05 library that provides object relational mapping to access a database in Ada05. The library supports Postgresql, MySQL, SQLite as databases. Most of the concepts developped for ADO come from the Java Hibernate ORM.

The ORM uses an YAML, XML mapping file or an UML model, a code generator and a runtime library for the implementation. It provides a database driver for Postgresql, MySQL and SQLite. The ORM helps your application by providing a mapping of your database tables directly in the target programming language: Ada05 in our case. The development process is the following:

  • You design your database model either using a UML tool or by writing a YAML or XML description,
  • You generate the Ada05 mapping files by using the Dynamo code generator,
  • You generate the SQL database tables by using the same tool,
  • You write your application on top of the generated code that gives you direct and simplified access to your database.

ADO Development model

You need at least one of these databases (or all of then). The configure script will now fail if no supported database was found. Check the Database Drivers section to install them and run the configure again after the installation.

Version 2.1.0 - May 2020

  • Added Is_Modified predicate on database objects
  • Fix SQLite Load_Schema to avoid loading SQLite specific tables

List all versions


To build ADO, you will need:

You should have installed either Postgresql, MySQL or SQLite before running the configure script. For Windows, please read the file win32/README that gives some installation hints.

Build with the following commands:



The samples can be built using:

gnatmake -Psamples

Before launching the samples, the database must have been created. For SQLite, use:

make samples.db


The Ada Database Objects sources as well as a wiki documentation is provided on:


Database Drivers

The Postgresql, MySQL and SQLite development headers and runtime are necessary for building the ADO driver. The configure script will use them to enable the ADO drivers.

Postgresql Development installation

sudo apt-get install postgresql-client libpq-dev

MySQL Development installation

sudo apt-get install mariadb-client libmariadb-client-lgpl-dev

SQLite Development installation

sudo apt-get install sqlite3 libsqlite3-dev

For Windows, check win32/README to install the libraries.

Database Creation

Create the tests database by using the Dynamo command. (Dynamo is available at: Note: change 'root' and 'password' to a MySQL user that has admin access rights ('create database' and 'grant option' privileges).

dynamo create-database db/regtests root password

The default database connection string is defined in dynamo.xml. You can also specify the connection string and create the schema by using:

dynamo create-database db/regtests 'mysql://localhost:3306/ado_test?user=ado' root password

MySQL setup

To create manually the database, you can proceed to the following steps:

  1. Create the 'ado_test' database in MySQL

    mysql -u root
    mysql> CREATE DATABASE ado_test;
  2. Create the 'ado' user and give the access rights:

    mysql> CREATE USER 'ado_test' IDENTIFIED BY '';
       SHOW VIEW ON `ado_test`.* TO [email protected]'%';
  1. Create the tables
    mysql> USE ado_test
    mysql> SOURCE db/regtests/mysql/create-ado-mysql.sql

Postgresql setup

To create manually the database, you can proceed to the following steps:

  1. Create the 'ado' user and configure the password (enter 'ado' for the password or update the Makefile as well as the file):

    sudo -u postgres createuser ado --pwprompt
  2. Create the 'ado_test' database in Postgresql

    sudo -u postgres createdb -O ado ado_test
  3. Create the tables

    psql "postgresql://localhost:5432/ado_test?user=ado&password=ado" \


Before running the unit tests for MySQL or Postgresql, you must create the test database as described in Database Creation.

The unit tests are built and executed using:

make test

To run manually the unit tests, use the following commands:

bin/ado_harness -config


bin/ado_harness -config


bin/ado_harness -config

Building documentation

The ADO Programmer's Guide is generated by using Dynamo and Pandoc. You may need the following Debian packages:

sudo apt-get install pandoc xsltproc texlive-latex-base texlive-latex-extra texlive-fonts-extra

The documentation is created by the following command:

make doc

and the book is generated in the ado-book.pdf file.

Ada Ado

Ada Database Objects

Ada Ado Info

⭐ Stars 14
🔗 Source Code
🕒 Last Update 10 months ago
🕒 Created 6 years ago
🐞 Open Issues 0
➗ Star-Issue Ratio Infinity
😎 Author stcarrez