H1 2015 - db access support in Phobos

Gary Willoughby via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 3 00:36:27 PST 2015


On Monday, 2 February 2015 at 04:00:31 UTC, Vadim Lopatin wrote:
> I would like to propose Java way for implementation of DB 
> access (JDBC - Java DataBase Connectors).
>
> Standard library must contain only
> * set of interfaces for uniform DB access
>     * Connection - can create Statement or PreparedStatement, 
> control transactions
>     * Statement - can run update or query
>     * PreparedStatement - same as Statement, but with parameters
>     * ResultSet - DB query result row access
>     * DataSource - can create connections, w/o parameters
>     * Driver - interface which implements connection factory 
> for particular DB types
>     * Some useful classes like ConnectionPool
> * factory method to create connection by URL and parameter set
> * some method to register DB driver for factory - e.g. when 
> called from driver's module __gshared static this()
>
> Drivers may be placed in separate packages in standard library 
> or in some DUB packages.
>
> Look at https://github.com/buggins/ddbc
> Currently it contains drivers for sqlite, MySQL and PostgreSQL.
>
>
> If Andrey/Walter wish, I can prepare pool request based on code 
> from ddbc.
>
> Best regards,
>      Vadim

Seems like a good idea. I'd also look at Go's implementation as 
they too only define an interface in the stdlib and rely on 
others to provide the drivers using the interface.


More information about the Digitalmars-d mailing list