[GSOC] Database API draft proposal

Masahiro Nakagawa repeatedly at gmail.com
Tue Apr 5 19:35:46 PDT 2011


On Wed, 06 Apr 2011 05:38:02 +0900, Christian Manning  
<cmanning999 at gmail.com> wrote:

> Hello all,
>
> This is the second draft and a lot of changes have been made. Hopefully  
> it's a better overall proposal and I look forward to anybody's feedback  
> :)
> ---------------------------------
>
> Synopsis
> --------
> An API for databases is a common component of many languages' standard  
> library, though Phobos currently lacks this. This project will remedy  
> this by providing such an API and also begin to utilise it with  
> interfaces for some Database Management Systems (DBMS). I believe this  
> will benefit the D community greatly and will help bring attention and  
> developers to the language.
>
> Details
> -------
> Piotr Szturmaj has began working on DDB [1] which has a PostgreSQL  
> clietn written in D as well as some database neutral features such as  
> the DBRow type for storing rows from a database. Piotr and I have agreed  
> to collaborate such that DDB will continue with Piotr at the helm, and I  
> will begin implementing other DBMS clients based around his work. Once  
> there is another implementation, work will then begin on extracting a  
> common interface which will form the API.
> For example:
>
> module database;
>
> interface DBConnection {
>      //method definitions for connecting to databases go here.
> }
>
> Then in an implementation of MySQL:
>
> module mysql;
>
> import database;
>
> class Connection : DBConnection {
>      //implement defined methods tailoring to MySQL.
> }
>
> Exactly what will go in to these interfaces will depend on the  
> differences between the DBMSs, but they all share many things. The API  
> should also be developed in conjunction with the D community to minimise  
> any fallout of decisions made.
>
> The DBMSs I plan to implement are MySQL and SQLite. Unlike PostgreSQL,  
> MySQL doesn't seem to have a long-term and stable client-server  
> protocol. As a result of this I will be wrapping around the MySQL C API  
> (v5.1) to bring it to D. SQLite will also undergo the same process.  
> Because of this, these clients are not likely to get into Phobos and so,  
> if the API does then these will be an external package.
>
> If this project is completely successful, there will be a database API  
> and at least three DBMS clients ready for use in D applications. The  
> minimum amount of functionality for this to be considered successful  
> would be an API that is mostly utilised by the PostgreSql and MySQL  
> clients. In this scenario there will still be two usable clients,  
> however, perhaps the API is not totally complete and neither is the  
> SQLite client.
[snip]
> References
> ----------
> [1] https://github.com/pszturmaj/ddb  
> http://pszturmaj.github.com/ddb/db.html
>

Hmm.. In what way is your new module different from DDBI?
What's the new features?


Masahiro


More information about the Digitalmars-d mailing list