Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL language bindings for D?

Tags:

mysql

windows

d

Are there any existing, working MySQL language bindings for D (particularly D 2.0 under Windows) still being maintained, updated, or even remotely poked at? Dozens of google searches mostly only point to some code previously hosted at http://www.steinmole.de/d/ by one Manfred Hansen, but this site is now dead and no mirrored copies seem to exist anywhere.

I did manage to find this: http://code.google.com/p/mysql4d/ as well as another project called DDBI that apparently only works with D 1.0 and Tango. I am having trouble linking these, though.. more google searches indicate that I need to convert the libmysql.dll included with MySQL to a libmysql.lib using implib.exe, however the program seems to be failing for me:

>implib.exe /system libmysql.lib libmysql.dll     
Digital Mars Import Library Manager Version 7.6B1n
Copyright (C) Digital Mars 2000.  All Rights Reserved.
Error(10): Error: cannot read DLL input file

A google search for "cannot read DLL input file" reveals utter horror: zero results. Am I doing something completely wrong, or do I have some version of MySQL whose DLL can no longer be converted?

Versions:

DMD32 D Compiler v2.056
MySQL Ver 14.14 Distrib 5.5.8, for Win64 (x86)
like image 355
ccjuju Avatar asked Dec 29 '11 09:12

ccjuju


1 Answers

There are several MySQL bindings, starting with this one: https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/mysql.d

But (IMHO) the most promising project is the native D implementation of the MySQL protocol. It can be found here: https://github.com/britseye .

For the one you tried above, you need the COFFIMPLIB tool to create an OMF version of the MySQL library libmysql.lib from the one distributed with MySQL for the libmySQL.dll file.

Update: These two forks of Steve's mysqln project are active: https://github.com/simendsjo/mysqln and https://github.com/rejectedsoftware/mysql-native .

like image 99
DejanLekic Avatar answered Nov 13 '22 05:11

DejanLekic