Reading and Writing image files to mySQL

G’day all and in particular Jean-Baptiste LE STANG

I have been thinking of adding to iMagine the ability to read and write image files to a BLOB field of a table of a mysql database. Would this be a feature that anybody would consider useful?

Jean,

When you implemented your mysql applescript interface, does it require that mysql is installed on the machine that the script is run on, or can it connect to a mysql database on another computer without requiring a local installation? If so does it require a particular version/implementation of mysql to work (There seems to be a few now available)? If it does not require mysql to be installed do you include a mysql framework or library in your bundle? and if so is there one that you would recommend?

Thanks for your time

Kevin

Yes, for mysql bridge it’s necessary to have MySQL installed because I forgot to manage the creation of the socket to communicate betweent the client and the server, and so mysql bridge uses the one created while installing MySQL. But you should be able to have an interface for MySQL without installing MySQL.

I’ve been working with the C library given by http://www.mysql.org. Once there donwload the sources and compile it by yourself if you’ve time or simply download the lastest binaries, they should come with libmysqlclient which is the one to use in your project. I’ve seen on http://www.mysql.org that there is a C++ library but i’ve never tried it. If iMagine is written with Cocoa, there is a framework you can use (I’ve not been able to use it)
http://mysql-cocoa.sourceforge.net/

I’ll be away fro the next few days, I’ll be back on Monday

I just realized I can’t do it due to licencing issues with mysql for a product that I sell. There would be no problems for a freeware tool.

As such I wont be looking into it in the short term, so the idea is freely available to anybody who wants to take it up. It would probably also be sensible not to limit the file types that can be copied to a BLOB database field to image files, any file type would be good.

Thanks for your comments Jean-Baptiste

Kevin

I don’t know squat about this topic but, in the spirit of trying to be helpful, I’ll risk looking like a fool. :wink:

NetNewsWire uses some open source stuff that you might want to take a look at.

http://blackholemedia.com/code/

SQLDatabase 0.1: “A set of objective-c classes that wrap around the SQLite library, an embeddable SQL database engine which reads and writes directly to and from database files on disk. This is very handy for developers who need some sort of flexible database solution. The SQLite library is public domain.”

– Rob (who hopes that this is at least remotely relevant)

Thanks Rob for the suggestion.

As far as I can determine the mysql public domain licences are fine if you want to create freeware. Unfortunately if you are trying to sell something, they all require a licence fee per registration and usually an upfront cost. I am not writing in Cocoa but even if I was the Cocoa libraries seem only to be interfaces to the original c mysql libraries. So the original licence question remains.

I believe this is totally reasonable, these tools have been developed with many hours work, and I or anybody else should not reep the financial rewards for somebody elses hard work.

If sometime way off in the future iMagine makes me some money such that it would look like it is worthwhile to organize the licencing I might consider it then. But currently the cost, but moreso the legal hassle of getting a licence agreement is more time and money than I have.

Kevin