Ada database – first steps

Connect to database

Using Ada for application development require access to database.

With GNATColl library is possible to work with PostgreSQL and Sqlite (embedded database).

Checking if everything is in place for database development

If you successfully install AdaCore and compile GNATColl library, you can start writing and checking if everything works as expected.

Create new project, project file must contain gnatcoll reference:

My dbsample1.gpr file contains:

And main.adb file:

You do not forget to add PostgreSQL/bin folder to local windows PATH, or copy postgres libraries to executing application folder.

If you do everything as needed, main.exe will be created and when you run it, you  will get something minimal but without any errors :

 

 

Leave a Reply

Your email address will not be published.