Porting an existing driver
The vibe.d framework provides you with a rich set of database drivers and other I/O functionality. However, if you need access to another database, then you have to check whether the database driver supports vibe.d. The reason is the fiber-based pseudo-blocking model. A usual way to connect to a database is via TCP/IP. A standard C or D library creates a socket and uses this socket for communication. However, the standard functions block the calling thread. Using such a driver would stall your application: once the thread is blocked, every fiber is blocked as well. The solution is to replace all the blocking calls with an equivalent pseudo-blocking function.
Here are some guidelines:
The socket class for stream-oriented communication is
TCPConnection
. This class replaces theSocket
class from the standard library. An instance of this class is returned when you create a connection withconnectTCP()
. Most likely, you have to change the connection sequence completely...