[RFC] - mysql-native rewrite

simendsjo simendsjo at gmail.com
Sat Sep 28 09:38:47 PDT 2013


I've been working on a more or less complete rewrite of the 
mysql-native module.

The main focus has been on making the source better decoupled and 
more maintainable.
In the process, I've changed the API too...

The existing production code can be found here: 
https://github.com/rejectedsoftware/mysql-native

New code: 
http://simendsjo.me/files/simendsjo/mysqln-rewrite/mysqln-rewrite.7z
Documentation: 
http://simendsjo.me/files/simendsjo/mysqln-rewrite/docs/

The files:
* adhoc.d - Execute simple queries. This is meant to be the new 
high-level public API
* commands.d - Lower level public API
* result.d - Common interface for both Text and Binary MySQL 
results
* connection.d - Phobos/Vibe.d connection
* db.d - Vibe.d connection pool

The rest are just internal files.

Todo:
* Implement all MySQL types
* Prepared statement release/purge
* Lazily fetch data
* Fix bugs in prepared statement binding
* Implement SEND_LONG_DATA
* More integrationtests and unittests

Most of the above would be pretty simple to implement.

I'm very uncertain about several aspects of my design:
* Class vs. struct
* Returned values from MySQL - e.g. should SELECT TRUE return 
long as it does in MySQL, or should we interpret it as bool
* Probably a lot I don't remember right now :)

Any comments would be very helpful.
..Or in D terms: DESTROY!


More information about the Digitalmars-d mailing list