On Thu, 16 Jul 2015 21:43:25 GMT, tchaloupka wrote:

Hi,
I want to use sqlite with vibe.d but I'm aware of it blocking the fiber with its IO ops.
What is the recomended way to use it then? I've read that DB drivers need to be written in the async way using vibe.d's TcpConnection and FileStream, but what to do with sqlite's C API where this is handled internally?

Make some working threads out of main fiber thread and use them to access the DB? What is then the preffered way to exchange the data with less possible overhead?

Thx,
Tom

I'm not experienced enough to give great advice, but here are my thoughts. I think you're mistaken in assuming that sqlite can handle anything related to vibes async functions internally. (I feel as thought I might have misunderstood you here.)

Here are links I have come across that might help you:
sqlite in dlang (not for vibe.d, it seems)
https://github.com/anton-dutov/db

vibe's mongo driver:
https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/db/mongo/client.d

This article and example seems like it might answer many of your questions:
http://vibed.org/blog/posts/writing-native-db-drivers