cruisercoder / dstddb

A proposed standard database interface and library for D
MIT License
28 stars 10 forks source link

FreeTDS bindings #5

Open neonile opened 8 years ago

neonile commented 8 years ago

It'd be quite helpful to get FreeTDS bindings, to facilitate connectivity to MS SQL Server and Sybase ASE databases.

neonile commented 8 years ago

Is there perhaps an ETA on this?

cruisercoder commented 8 years ago

It's being worked on currently. I'm expecting to have basic support within the next day or two.

cruisercoder commented 8 years ago

I've added basic support for freetds in v.0.0.5. Here's an example (set URI values appropriately):

auto db = createDatabase("freetds://SERVER/DB?username=UN&password=PW); auto result = db.query("SELECT 1,2,'abc'"); foreach (r; result) { for(int c = 0; c != r.columns; ++c) writeln("column: ",c,", value: ",r[c].as!string); }

The server name (SERVER) corresponds to the entry in a freetds configuration file (usually $HOME/.freetds.conf) and it looks like this:

[SERVER] host = 1.2.3.4 port = 1433

Let me know if it works for you on a basic level. If you have any particular features that you want prioritized, let me know. Input binding is one of the big things missing at the moment.