Re: mysql binding/wrapper?

2012-04-30 Thread James Oliphant
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.


Re: mysql binding/wrapper?

2012-04-30 Thread James Oliphant
On Mon, 30 Apr 2012 16:18:16 +0200, simendsjo wrote:

> On Mon, 30 Apr 2012 16:08:34 +0200, Steven Schveighoffer
>  wrote:
> 
>> On Sat, 28 Apr 2012 13:42:41 -0400, Adam D. Ruppe
>>  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.




Question about using regex

2012-03-21 Thread James Oliphant
While following the regex discussion, I have been compiling the examples 
to help with my understanding of how it works.

>From Dmitry's example page:
http://blackwhale.github.com/regular-expression.html
and from the dlang.org website:
http://dlang.org/phobos/std_regex.html

std.regex.replace calls a delegate
auto delegate(Captures!string)
which does not compile.  The definition in Phobos for Captures is
struct Captures(R,DIndex)
and for the purposes of these examples changing the delegate to
auto delegate(Captures!(string,uint))
seems to work.  Is this correct?


In another example on Dmitry's page that starts:
auto m = match("Ranges are hot!", r"(\w)\w*(\w)"); //at least 3 
"word" symbols
The output from the example is "Ranges, R, s", but I don't quite 
understand why those where the matches in this case.  Also does the 
regular expression imply match at least 2 "word" symbols where \w* means 
match 0 or more "word" symbols?

These newsgroups are a great resource, keep up the great work!