Thread overview
D Database Connectivity
May 23, 2011
Mandeep Singh Brar
May 24, 2011
bls
May 24, 2011
Mandeep Singh Brar
May 24, 2011
bls
May 24, 2011
Sean Kelly
May 24, 2011
Mandeep
May 23, 2011
I have tried to port the jdbc drivers of postgres and sqlite along with libodbcxx to D2/phobos. The library ddbc, having an API similar to JDBC has been uploaded to dsource.org/projects/ddbc. Though everything from JDBC (blobs etc) may not be working (or atleast have not been tested), simple things like statements, callable statements and prepared statements seem to be working and have been put in a sample program on the home page.

I want to release the code with an LGPL but do not have an understanding of the licensing part, so have retained the licensing information on the original files (though there might be significant changes) and have not included any information on new files if any.

Thanks
Mandeep
May 24, 2011
Am 23.05.2011 08:49, schrieb Mandeep Singh Brar:
> I have tried to port the jdbc drivers of postgres and sqlite along
> with libodbcxx to D2/phobos. The library ddbc, having an API similar
> to JDBC has been uploaded to dsource.org/projects/ddbc.

First of all : Well done.
I think it was Adam Ruppe (apologies in case that I am wrong with the name) who has created a quit appealing Java like ResultSet Implementation. Wouldn't it be cool to bring this stuff together ?

Bjoern
May 24, 2011
Sorry, I couldnt get what you are trying to say. the project ddbc already has an implementation of java.sql.ResultSet. In fact most of the methods of jdbc have been retained except that some might not be implemented by specific drivers.

Thanks
Mandeep
May 24, 2011
On May 22, 2011, at 11:49 PM, Mandeep Singh Brar wrote:

> I have tried to port the jdbc drivers of postgres and sqlite along with libodbcxx to D2/phobos. The library ddbc, having an API similar to JDBC has been uploaded to dsource.org/projects/ddbc. Though everything from JDBC (blobs etc) may not be working (or atleast have not been tested), simple things like statements, callable statements and prepared statements seem to be working and have been put in a sample program on the home page.

Nice work!  I'd like to see the API become a bit more D-like though.  For example, with overloading and the index operator, prepared statement parameters could be set like:

   st[0] = "hello world";

Similar with ResultSet for indexing, along with possibly an alternate way to specify the desired type:

    rs[0].to!string();
    rs[0].asString;
    rs["stringType"].to!string();

For licensing, have you considered the Boost license?
May 24, 2011
On 05/24/2011 10:08 AM, Sean Kelly wrote:
> On May 22, 2011, at 11:49 PM, Mandeep Singh Brar wrote:
>
>> I have tried to port the jdbc drivers of postgres and sqlite along
>> with libodbcxx to D2/phobos. The library ddbc, having an API similar
>> to JDBC has been uploaded to dsource.org/projects/ddbc. Though
>> everything from JDBC (blobs etc) may not be working (or atleast have
>> not been tested), simple things like statements, callable statements
>> and prepared statements seem to be working and have been put in a
>> sample program on the home page.
>
> Nice work!  I'd like to see the API become a bit more D-like though.  For example, with overloading and the index operator, prepared statement parameters could be set like:
>
>     st[0] = "hello world";
>
> Similar with ResultSet for indexing, along with possibly an alternate way to specify the desired type:
>
>      rs[0].to!string();
>      rs[0].asString;
>      rs["stringType"].to!string();
>
> For licensing, have you considered the Boost license?


Anything is ok with me for licensing. But i am not sure how it works in case i am porting code from another language. The ported classes are LGPL, so i thought LGPL would be the way to go. I am not sure of what all i need to do to put up a license though. Was thinking of putting up information on the site page.

I had thought about your suggestion earlier of overloading operators and making it more d like, but did not go that way because i am not comfortable with those functionalities and would have to read a bit to do that. Anyone who understands that is more than welcome to do that if people feel it adds more value.
But my priority was to get more drivers up and running.

Thanks
Mandeep
May 24, 2011
Am 24.05.2011 06:32, schrieb Mandeep Singh Brar:
> Sorry, I couldnt get what you are trying to say. the project ddbc
> already has an implementation of java.sql.ResultSet. In fact most of
> the methods of jdbc have been retained except that some might not be
> implemented by specific drivers.
>
> Thanks
> Mandeep

Sorry for making unnecessary noise Mandeep,
I should have a closer look on what's already done before making suggestions.
Bjoern