Current Projects, Language Bindings

Current Projects

FreeTDS consists of some C libraries.

The FreeTDS libraries support three separate APIs: DB-Library, CT-Library, and ODBC. Underlying these three is libtds, which handles the low-level details of the TDS protocol, such as sending, receiving, and datatype conversion. This document and the FreeTDS website are dedicated to these libraries.

Status

The libraries are portable, mature, and stable. They're expected to compile readily and normally do not crash or corrupt data. Extensive logging aids in diagnosing problems. While they do not include every feature provided by the vendors' libraries, they do faithfully implement a useful — and widely used — subset of their APIs.

The DB-Library and CT-Library APIs have been usable for several years. They have been successfully substituted for Sybase's own libraries in a variety of venues, including Perl and PHP.

The ODBC driver should be fully ODBC 3.5 compliant.

Basic API coverage information for all libraries may be found in this manual. It is maintained in doc/api_status.txt, included in the source distribution.

[Note]Note

For Microsoft servers, FreeTDS now offers the best DB-Library for any OS on the planet (including Windows!) thanks not only to the hard work of its contributors, but also to Microsoft's[3] strategy. It is the only Win64 implementation of DB-Library, and the only Win32 implementation to support modern versions of the protocol. (SQL Server 2008 still accepts the TDS 4.2 connections that Microsoft's old library uses, but rejects BCP uploads with a spurious permission-denied message.)

In addition to the core DB-Library API, FreeTDS includes a full implementation of DB-Library's bcp functions, as well as freebcp, a replacement for Sybase's bcp utility.

How big is it? FreeTDS has over 100,000 lines of C code, maintained by a handful of developers. Patches arrive irregularly, varying in size from one-liners to thousand-line monsters. Almost all are applied or used in some way. Safe to say, FreeTDS's success so far lies somewhere between the Beetle and the Edsel.

Who uses it? Oh, pretty much everyone. FreeTDS users number in the tens of thousands. It's used by large corporations, by the U.S. federal government (e.g. Database Access Library at the National Center for Biotechnology Information) and by many webservers running Apache and PHP. Sybase recommends FreeTDS for their EAServer product. Microsoft recommended FreeTDS to their customers who want access to Microsoft SQL Server from non-Win32 clients. So do we.

Languages besides C

You may be wondering how these libraries fit with Perl, PHP, TCL, Python, or other popular scripting languages. Most of these languages have bindings to Sybase that use either the DB-Library or CT-Library API, for which FreeTDS is intended as a drop-in replacement. For instance, Michael Peppler's DBD::Sybase works very well using FreeTDS to access Sybase or Microsoft SQL Servers. PHP has options for sybase (DB-Library) and sybase-ct (CT-Library) APIs.



[3] Microsoft ceased enhancing DB-Library in 2001, advising customers to avoid using DB-Library. For Microsoft's unmaintained product, that's good advice. But if the DB-Library specification meets your needs, FreeTDS permits you to keep using it with little loss (and some gain) of functionality.