Jump to page: 1 2
Thread overview
mysql binding/wrapper?
Apr 28, 2012
simendsjo
Apr 28, 2012
Adam D. Ruppe
Apr 28, 2012
simendsjo
Apr 28, 2012
Adam D. Ruppe
Apr 30, 2012
simendsjo
Apr 30, 2012
James Oliphant
Apr 30, 2012
simendsjo
Apr 30, 2012
James Oliphant
Apr 30, 2012
simendsjo
Apr 30, 2012
Ary Manzana
Apr 30, 2012
simendsjo
Frustration [Was: mysql binding/wrapper?]
May 01, 2012
Ary Manzana
May 01, 2012
simendsjo
May 10, 2012
#coder
May 01, 2012
SomeDude
May 01, 2012
SomeDude
May 01, 2012
SomeDude
Apr 29, 2012
dnewbie
April 28, 2012
I guess there are several bindings lingering around. Has anyone experience with any of these?
I found the following:
https://github.com/britseye/mysqln
https://github.com/britseye/mysqld
https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/mysql.d
http://my.opera.com/run3/blog/2012/03/13/d-mysql
https://github.com/D-Programming-Deimos/libmysql - seems empty
April 28, 2012
On Saturday, 28 April 2012 at 15:30:13 UTC, simendsjo wrote:
> https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/mysql.d

That's mine. I use it all the time; nothing super fancy, but
it gets the job done for me.

I didn't really document it... but the basic usage is simple:

auto mysql = new MySql("hostname, "username", "password", "database_name");

int userId = getMyUserId();

foreach(line; mysql.query("SELECT id, name FROM something WHERE user_id = ?", userId)) {
    line["id"]   == line[0]
    line["name"] == line[1]
}


The columns are returned as strings. The query returns a simple
range, so you can also check .empty, get .front, etc.
April 28, 2012
On Sat, 28 Apr 2012 17:54:49 +0200, Adam D. Ruppe <destructionator@gmail.com> wrote:

> On Saturday, 28 April 2012 at 15:30:13 UTC, simendsjo wrote:
>> https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/mysql.d
>
> That's mine. I use it all the time; nothing super fancy, but
> it gets the job done for me.
>
> I didn't really document it... but the basic usage is simple:
>
> auto mysql = new MySql("hostname, "username", "password", "database_name");
>
> int userId = getMyUserId();
>
> foreach(line; mysql.query("SELECT id, name FROM something WHERE user_id = ?", userId)) {
>      line["id"]   == line[0]
>      line["name"] == line[1]
> }
>
>
> The columns are returned as strings. The query returns a simple
> range, so you can also check .empty, get .front, etc.

Hmm.. Seems my previous message was lost in the void.

As it resides in this big misc repository, does it have many dependecies?
Would you mind if the module was added to vibe, and thus relicensed to MIT? No idea if the vibe folks would actually want that though :)
April 28, 2012
On Saturday, 28 April 2012 at 16:19:37 UTC, simendsjo wrote:
> As it resides in this big misc repository, does it have many dependecies?

It depends on the database.d module in there too. (database.d
provides the base interface and some common functions with
other db providers.)

That's it though, D wise. It also uses the mysql C library
so you'll need libmysql on your system for it to link too.

> Would you mind if the module was added to vibe, and thus relicensed to MIT? No idea if the vibe folks would actually want that though :)

My stuff is all free to take as far as I'm concerned, but
since this uses libmysql it might technically be GPL.

I don't really know. But if you're ok with that, you can have it.
April 29, 2012
On Saturday, 28 April 2012 at 15:30:13 UTC, simendsjo wrote:
stuff/blob/master/mysql.d
> http://my.opera.com/run3/blog/2012/03/13/d-mysql

I use it in a bank account application. It works.
April 30, 2012
On Sat, 28 Apr 2012 13:42:41 -0400, Adam D. Ruppe <destructionator@gmail.com> wrote:

> On Saturday, 28 April 2012 at 16:19:37 UTC, simendsjo wrote:
>> Would you mind if the module was added to vibe, and thus relicensed to MIT? No idea if the vibe folks would actually want that though :)
>
> My stuff is all free to take as far as I'm concerned, but
> since this uses libmysql it might technically be GPL.

If that's the case, using this lib will make your entire project GPL.

I think the britseyeview version was an attempt by Steve Teale to write a non-GPL lib that used the protocol spec from MySQL for inclusion in Phobos.  Not sure where it stands.

-Steve
April 30, 2012
On Mon, 30 Apr 2012 16:08:34 +0200, Steven Schveighoffer <schveiguy@yahoo.com> wrote:

> On Sat, 28 Apr 2012 13:42:41 -0400, Adam D. Ruppe <destructionator@gmail.com> wrote:
>
>> On Saturday, 28 April 2012 at 16:19:37 UTC, simendsjo wrote:
>>> Would you mind if the module was added to vibe, and thus relicensed to MIT? No idea if the vibe folks would actually want that though :)
>>
>> My stuff is all free to take as far as I'm concerned, but
>> since this uses libmysql it might technically be GPL.
>
> If that's the case, using this lib will make your entire project GPL.
>
> I think the britseyeview version was an attempt by Steve Teale to write a non-GPL lib that used the protocol spec from MySQL for inclusion in Phobos.  Not sure where it stands.
>
> -Steve

I wrote a reply yesterday that obviously didn't make it.
Sönke Ludwig integrated Steve Teales native mysql library: https://github.com/rejectedsoftware/mysql-native
Haven't had the time to test it yet, but at least it compiles and is able to get metadata from mysql.
April 30, 2012
On Mon, 30 Apr 2012 16:18:16 +0200, simendsjo wrote:

> On Mon, 30 Apr 2012 16:08:34 +0200, Steven Schveighoffer <schveiguy@yahoo.com> wrote:
> 
>> On Sat, 28 Apr 2012 13:42:41 -0400, Adam D. Ruppe <destructionator@gmail.com> wrote:
>>
>>> On Saturday, 28 April 2012 at 16:19:37 UTC, simendsjo wrote:
>>>> Would you mind if the module was added to vibe, and thus relicensed to MIT? No idea if the vibe folks would actually want that though :)
>>>
>>> My stuff is all free to take as far as I'm concerned, but since this uses libmysql it might technically be GPL.
>>
>> If that's the case, using this lib will make your entire project GPL.
>>
>> I think the britseyeview version was an attempt by Steve Teale to write a non-GPL lib that used the protocol spec from MySQL for inclusion in Phobos.  Not sure where it stands.
>>
>> -Steve
> 
> I wrote a reply yesterday that obviously didn't make it.
> Sönke Ludwig integrated Steve Teales native mysql library:
> https://github.com/rejectedsoftware/mysql-native Haven't had the time to
> test it yet, but at least it compiles and is able to get metadata from
> mysql.

Actually, it looks like the vibe folks are using my fork of Steve Teales mysqln. I had hoped to contact Steve first, so that these changes existed in one place.

https://github.com/JollieRoger

All of the changes exist in individual branches off the master branch. Git
will merge these into one file fuzzily.
What they are is as follows:

	seperatemain - split main() into its own file (app.d in vibe).
	seperatemainwithport - main() using branch addporttoconnection.
	addporttoconnection - add no standard port selection to Connection.
	fixfordmd2058 - cosmetic changes to work with dmd-2.058.
	fixresultset - allow the return of an empty resultset. When
iterating schema, test had no tables and would crash.
	fixconnection - would only connect to localhost in Steve's code.

I have other changes that I haven't pushed up yet relating to NUMERIC and null variants with a more detailed main.d.

Vibe.d looks interesting, I hope these fixes help.


April 30, 2012
On Mon, 30 Apr 2012 18:19:29 +0200, James Oliphant <jollie.roger@gmail.com> wrote:

> Actually, it looks like the vibe folks are using my fork of Steve Teales
> mysqln. I had hoped to contact Steve first, so that these changes existed
> in one place.
> https://github.com/JollieRoger
> All of the changes exist in individual branches off the master branch. Git
> will merge these into one file fuzzily.
> What they are is as follows:
> 	seperatemain - split main() into its own file (app.d in vibe).
> 	seperatemainwithport - main() using branch addporttoconnection.
> 	addporttoconnection - add no standard port selection to Connection.
> 	fixfordmd2058 - cosmetic changes to work with dmd-2.058.
> 	fixresultset - allow the return of an empty resultset. When
> iterating schema, test had no tables and would crash.
> 	fixconnection - would only connect to localhost in Steve's code.
> I have other changes that I haven't pushed up yet relating to NUMERIC and
> null variants with a more detailed main.d.
> Vibe.d looks interesting, I hope these fixes help.

Yes, your patches has been merged. Of course it would be best to have everything database complete already, but I'm glad it's been merged as-is for now - it might take a long time (and has already) before a generic database interface is completed.
April 30, 2012
On Mon, 30 Apr 2012 18:57:57 +0200, simendsjo wrote:

> Yes, your patches has been merged. Of course it would be best to have everything database complete already, but I'm glad it's been merged as-is for now - it might take a long time (and has already) before a generic database interface is completed.

Hi simendsjo,

I now see your repository at: https://github.com/simendsjo/mysqln

Is there a way that we can have one central repository that people can pull from. I would like it to be Steve's since that is the one everybody knows, but I am not sure he wants to manage pull requests and such (If your are listening Steve, please weigh in). He seems to be enjoying "Adventures in Woodworking" and may not have any fingers left when he finishes his latest project (just joking, read your blog). Otherwise, maybe we could use your repository listed above.

My goal is not a generic database interface discussed previously in these groups. I just want an interface for mysql/mariadb and less so for postgresql at this point.
« First   ‹ Prev
1 2