{"id":13409020,"url":"https://github.com/stcarrez/ada-ado","last_synced_at":"2025-04-12T07:35:32.330Z","repository":{"id":25950187,"uuid":"29391791","full_name":"stcarrez/ada-ado","owner":"stcarrez","description":"Ada Database Objects","archived":false,"fork":false,"pushed_at":"2024-09-08T08:26:57.000Z","size":6451,"stargazers_count":25,"open_issues_count":1,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-09-08T17:10:03.282Z","etag":null,"topics":["ada","database","mysql","orm-framework","postgresql","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Ada","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stcarrez.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-17T13:22:20.000Z","updated_at":"2024-09-08T08:27:00.000Z","dependencies_parsed_at":"2024-09-07T16:49:48.657Z","dependency_job_id":"e2c93320-bd3a-4cff-bc57-28d2304ca4b6","html_url":"https://github.com/stcarrez/ada-ado","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcarrez%2Fada-ado","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcarrez%2Fada-ado/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcarrez%2Fada-ado/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stcarrez%2Fada-ado/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stcarrez","download_url":"https://codeload.github.com/stcarrez/ada-ado/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248535184,"owners_count":21120503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ada","database","mysql","orm-framework","postgresql","sqlite"],"created_at":"2024-07-30T20:00:57.369Z","updated_at":"2025-04-12T07:35:32.315Z","avatar_url":"https://github.com/stcarrez.png","language":"Ada","readme":"# Ada Database Objects\n\n[![Alire](https://img.shields.io/endpoint?url=https://alire.ada.dev/badges/ado.json)](https://alire.ada.dev/crates/ado)\n[![Alire](https://img.shields.io/endpoint?url=https://alire.ada.dev/badges/ado_sqlite.json)](https://alire.ada.dev/crates/ado_sqlite)\n[![Alire](https://img.shields.io/endpoint?url=https://alire.ada.dev/badges/ado_mysql.json)](https://alire.ada.dev/crates/ado_mysql)\n[![Alire](https://img.shields.io/endpoint?url=https://alire.ada.dev/badges/ado_postgresql.json)](https://alire.ada.dev/crates/ado_postgresql)\n[![Build Status](https://img.shields.io/endpoint?url=https://porion.vacs.fr/porion/api/v1/projects/ada-ado/badges/build.json)](https://porion.vacs.fr/porion/projects/view/ada-ado/summary)\n[![Test Status](https://img.shields.io/endpoint?url=https://porion.vacs.fr/porion/api/v1/projects/ada-ado/badges/tests.json)](https://porion.vacs.fr/porion/projects/view/ada-ado/xunits)\n[![Coverage](https://img.shields.io/endpoint?url=https://porion.vacs.fr/porion/api/v1/projects/ada-ado/badges/coverage.json)](https://porion.vacs.fr/porion/projects/view/ada-ado/summary)\n[![Documentation Status](https://readthedocs.org/projects/ada-ado/badge/?version=latest)](https://ada-ado.readthedocs.io/en/latest/?badge=latest)\n[![Download](https://img.shields.io/badge/download-2.4.0-brightgreen.svg)](http://download.vacs.fr/ada-ado/ada-ado-2.4.0.tar.gz)\n[![License](https://img.shields.io/badge/license-APACHE2-blue.svg)](LICENSE)\n[![GitLab](https://img.shields.io/badge/repo-GitLab-6C488A.svg)](https://gitlab.com/stcarrez/ada-ado)\n[![Commits](https://img.shields.io/github/commits-since/stcarrez/ada-ado/2.4.0.svg)](Commits)\n\nAda Database Objects is an Ada05 library that provides\nobject relational mapping to access a database in Ada05.\nThe library supports Postgresql, MySQL/MariaDB, SQLite as databases.\nMost of the concepts developped for ADO come from the Java Hibernate ORM.\n\nThe ORM uses an YAML, XML mapping file or an UML model, a code generator and a runtime library\nfor the implementation.  It provides a database driver for [Postgresql](https://www.postgresql.org/),\n[MySQL](https://www.mysql.com/)/[MariaDB](https://www.mariadb.org) and [SQLite](https://www.sqlite.org/).  The ORM helps your\napplication by providing a mapping of your database tables directly in the target programming\nlanguage: Ada05 in our case.  The development process is the following:\n\n  * You design your database model either using a UML tool or by writing a YAML or XML description,\n  * You generate the Ada05 mapping files by using the [Dynamo](https://gitlab.com/stcarrez/dynamo) code generator,\n  * You generate the SQL database tables by using the same tool,\n  * You write your application on top of the generated code that gives you direct and simplified access to your database.\n\n![ADO Development model](https://github.com/stcarrez/ada-ado/wiki/images/ado-orm.png)\n\nYou need at least one of these databases (or all of then).  The configure script will now\nfail if no supported database was found.  Check the [Database Drivers](#database-drivers)\nsection to install them and run the configure again after the installation.\n\n## Version 2.4.1   - Sep 2024\n  - Cleanup build environment to drop configure\n\n[List all versions](https://gitlab.com/stcarrez/ada-ado/blob/master/NEWS.md)\n\n## Using with Alire\n\nIf you are using [Alire](https://alire.ada.dev/) in your project, run the following command\nwithin your [Alire](https://alire.ada.dev/) project to use the library:\n\n```\nalr with ado\n```\n\nDepending on your project, you may need one or some of the following other components\nto get the support for SQLite, MySQL/MariaDB or PostgreSQL. Use ado_mysql for MariaDB.\n\n```\nalr with ado_sqlite\nalr with ado_mysql\nalr with ado_postgresql\n```\n\n## Using without Alire\n\nIf you don't have [Alire](https://alire.ada.dev/) or want to build and install the library\non a specific place, run a `setup` command to configure the build as well as installation\ndirectory.\nFor a detailed description on how you can configure, build and install the library\nrefer to the [Installation](https://ada-ado.readthedocs.io/en/latest/Installation/) guide.\nOtherwise, you can easily configure and build the library with the steps described below.\n\nThe support for SQLite, MySQL/MariaDB and PostgreSQL are enabled only when a `HAVE_XXX=yes` configuration\nvariable is defined.  Run the setup command that records in the `Makefile.conf` the configuration\nyou want to build.\n\nThe `HAVE_ALIRE` configuration allows you to build with [Alire](https://alire.ada.dev/) or not.\n\nThe example below enables the SQLite and PostgreSQL components but disables\nthe MySQL/MariaDB support and disables the use of [Alire](https://alire.ada.dev/) to build\nthe library.\n\n```\nmake setup BUILD=debug PREFIX=/build/install \\\n  HAVE_SQLITE=yes HAVE_POSTGRESQL=yes \\\n  HAVE_MYSQL=no HAVE_ALIRE=no\n```\n\nThen build, run the unit tests and install by using:\n\n```\nmake\nmake test\nmake install\n```\n\nTo use the installed libraries, make sure your `ADA_PROJECT_PATH` contains the directory\nwhere you installed the libraries (configured by the `PREFIX=\u003cpath\u003e` option in the setup phase).\nThe installed GNAT projects are the same as those used when using [Alire](https://alire.ada.dev/).\n\n# Samples\n\nThe samples can be built using:\n\n```\nmake samples\n```\n\nor\n\n```\ncd samples\nalr build\n```\n\nBefore launching the samples, the database must have been created.\nFor SQLite, use:\n\n```\nmake samples.db\n```\n\n# Documentation\n\nThe Ada Database Objects sources as well as a wiki documentation is provided on:\n\n  * [Ada Database Objects Programmer's Guide](https://ada-ado.readthedocs.io/en/latest/) [PDF](https://gitlab.com/stcarrez/ada-ado/blob/master/docs/ado-book.pdf)\n  * [ADO Documentation](https://gitlab.com/stcarrez/ada-ado/wiki)\n  * [ADO Sessions](https://gitlab.com/stcarrez/ada-ado/wiki/ADO_Sessions)\n  * [ADO Statements](https://gitlab.com/stcarrez/ada-ado/wiki/ADO_Statements)\n  * [ADO Queries](https://gitlab.com/stcarrez/ada-ado/wiki/ADO_Queries)\n  * [ADO Drivers](https://gitlab.com/stcarrez/ada-ado/wiki/ADO_Drivers)\n\n# Presentations\n\n  * [Persistence with Ada Database Objects](https://fr.slideshare.net/StephaneCarrez1/persistence-with-ada-database-objects-ado) FOSDEM 2019\n  * Uses Ada Database Objects: [Implementing a build manager in Ada](https://www.slideshare.net/StephaneCarrez1/implementing-a-build-manager-in-ada)\n\n# Database Drivers\n\nThe Postgresql, MySQL/MariaDB and SQLite development headers and runtime are necessary for building\nthe ADO driver.  The configure script will use them to enable the ADO drivers.\n\nPostgresql Development installation\n```\nsudo apt-get install postgresql-client libpq-dev\n```\n\nMySQL/MariaDB Development installation\n```\nsudo apt-get install mariadb-client libmariadb-dev\n```\n\nSQLite Development installation\n```\nsudo apt-get install sqlite3 libsqlite3-dev\n```\nFor Windows, check [win32/README](win32/README.md) to install the libraries.\n\n\n## Database Creation\n\nCreate the tests database by using the Dynamo command.\n(Dynamo is available at: https://gitlab.com/stcarrez/dynamo)\nNote: change 'root' and 'password' to a MySQL/MariaDB user that has admin access rights\n('create database' and 'grant option' privileges).\n```\ndynamo create-database db/regtests root password\n```\nThe default database connection string is defined in dynamo.xml.\nYou can also specify the connection string and create the schema by using:\n```\ndynamo create-database db/regtests 'mysql://localhost:3306/ado_test?user=ado' root password\n```\n\n### MySQL/MariaDB setup\n\nTo create manually the database, you can proceed to the following steps:\n\n1. Create the 'ado_test' database in MySQL/MariaDB\n```\nsudo mysql\nmysql\u003e CREATE DATABASE ado_test;\n```\n\n2. Create the 'ado' user and give the access rights:\n```\nmysql\u003e CREATE USER 'ado' IDENTIFIED BY '';\n```\n\n```\nmysql\u003e GRANT SELECT, INSERT, UPDATE, DELETE,\n       CREATE, DROP, CREATE TEMPORARY TABLES, EXECUTE,\n       SHOW VIEW ON `ado_test`.* TO ado@'%';\nmysql\u003e FLUSH PRIVILEGES;\n```\n\n3. Create the tables\n```\nmysql\u003e USE ado_test\nmysql\u003e SOURCE db/regtests/mysql/create-ado-mysql.sql\n```\n\n### Postgresql setup\n\nTo create manually the database, you can proceed to the following steps:\n\n1. Create the 'ado' user and configure the password\n(enter 'ado' for the password or update the Makefile as well as the test-postgresql.properties file):\n```\nsudo -u postgres createuser ado --pwprompt\n```\n\n2. Create the 'ado_test' database in Postgresql\n```\nsudo -u postgres createdb -O ado ado_test\n```\n\n3. Create the tables\n```\npsql \"postgresql://localhost:5432/ado_test?user=ado\u0026password=ado\" \\\n  --file=db/regtests/postgresql/create-ado-postgresql.sql\n```\n\n# Testing\n\nBefore running the unit tests for MySQL/MariaDB or Postgresql, you must create the\ntest database as described in [Database Creation](#database-creation).\n\nThe unit tests are built and executed using:\n```\nmake test\n```\nTo run manually the unit tests, use the following commands:\n```\nbin/ado_harness -config test-mysql.properties\n```\nor\n```\nbin/ado_harness -config test-sqlite.properties\n```\nor\n```\nbin/ado_harness -config test-postgresql.properties\n```\n\n# Building documentation\n\nThe *ADO Programmer's Guide* is generated by using [Dynamo](https://gitlab.com/stcarrez/dynamo)\nand [Pandoc](https://pandoc.org).  You may need the following Debian packages:\n\n```\nsudo apt-get install pandoc xsltproc texlive-latex-base texlive-latex-extra texlive-fonts-extra\n```\n\nThe documentation is created by the following command:\n```\nmake doc\n```\n\nand the book is generated in the *ado-book.pdf* file.\n\n","funding_links":[],"categories":["Frameworks"],"sub_categories":["Database"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstcarrez%2Fada-ado","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstcarrez%2Fada-ado","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstcarrez%2Fada-ado/lists"}