Okay, I know it was only last week, but I have a new version of the MySQL FFI ready for testing. As soon as a Gambit module system is in place, I will totally be making this a module.
There are much improvements made here. There are a few more higher level functions (mysql-map-rows, mysql-map-fields, get-mysql-datum, mysql-row->list, mysql-column->list, mysql-result->alist, mysql-result->list) and better testing and error recovery.
I have also commented the source a lot more, licensed it under the Apache 2.0 license.
As Usual, play with it, make suggestions, comments bug reports, etc.
Blog entry about it (including personal motivations for writing it! Wow!): http://blog.jonnay.net/archives/744-More-Gambit-MySQL-Mana-From-Heaven,-due-...
Link to Download: http://blog.jonnay.net/index.php?serendipity%5Bsubpage%5D=downloadmanager&am...
I also have a few questions regarding how the C functions handle strings with null values and how they handle references, The C Function mysql_real_escape_string is defined like this:
unsigned long mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, unsigned long length);
"to" is the variable where the result of mysql_real_escape_string is stored, "from" is the string to escape which may contain null bytes, and length is the length of "from".
If I define my c-lambda in similar terms, will the string I pass in be properly mutated? Or will I have to build a wrapper function that will return the "to" string instead? (which might be the better option anyway)
Also, what happens when I have a Scheme string that contains a null character, and I pass it into a c-function? Will the passed in string be terminated at the first null byte? If so, how do I get around this?
Thanks in Advance!
Afficher les réponses par date