My Github repository at http://github.com/adamdruppe/arsd contains a
database.d interface file and implementation files for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server via ODBC. Here, we'll use them to perform some SQL queries.
database.d and a driver file (
postgres.d for PostgreSQL,
mysql.d for MySQL,
sqlite.d for SQLite, or
mssql.d for SQL Server) from my Github.
The drivers also require C libraries. The
mysql.d file needs
libmysqlclient, which comes with the MySQL server. The
postgres.d file needs
libpq, which comes with the PostgreSQL server. The
sqlite.d file needs SQLite installed on the system.
Let's also create a test database to use from the program. In our example, we'll use MySQL, ...