On Sat, 28 Apr 2012 17:54:49 +0200, Adam D. Ruppe <destructiona...@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 :)

Reply via email to