std.database

Erik Smith via Digitalmars-d digitalmars-d at puremagic.com
Sat Mar 5 10:00:56 PST 2016


On Saturday, 5 March 2016 at 13:13:09 UTC, Jacob Carlborg wrote:
> On 2016-03-05 11:23, Saurabh Das wrote:
>
>> A little late to the party, nevertheless: Thanks for doing 
>> this, it will
>> be super-helpful!
>>
>> My only feature request will be: please make it work with 
>> minimal effort
>> with Vibe.D! :)
>
> Yeah, that's really important. Unfortunately it looks like a 
> synchronous interface is prioritized :(.


I'm definitely going to start working in async capability (or 
more accurately, non-blocking) into the interface.   Both models 
are essential and there are strong use cases for both, but I know 
there is a lot of interest in NBIO for vibe.d compatibility.  
This is challenging and, as many are aware, the C clients for SQL 
databases have traditionally been synchronous only.  One 
suggested approach is to fork the driver source and change the 
I/O calls to be non-blocking. Another is to implement a 
non-blocking driver directly against the wire protocol (a 
"native" driver).  These are limited options, but to the extent 
this approach is viable in some cases (mysql-native for example), 
they could be adapted to a standard interface.  The good news is 
that some databases do have (or are working on) non-blocking 
support in their C clients. The webscalesql mysql fork, for 
example, has a non-blocking client that is in production and 
their client works with regular mysql databases.  That fork 
should eventually be merged back into mysql (or may have been 
already).  Postgres also provides non-blocking support.  These 
are two cases that I'm targeting for initial reference 
implementations.







More information about the Digitalmars-d mailing list