Databases and the D Standard Library

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 2 23:25:55 PST 2017


On 2017-01-03 06:25, Adam Wilson wrote:

> Ok. How would you design a database API for D?

I don't know. I think it's difficult to design something upfront without 
trying out different API's to see what's possible to implement in code.

Structs and functions, with or without templates. Could something like 
this work:

module db_interface;

version (Postgres)
     public import pg.db_interface;
else version (MySQL)
     public import mysql.db_interface;

static assert(isInterfaceImplemented, "The DB interface is not 
implemented");


-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list