Skip to Content.
Sympa Menu

freetds - Re: [freetds] ctlib vs. dblib vs. tds

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] ctlib vs. dblib vs. tds
  • Date: Sat, 26 Mar 2005 09:27:49 -0500

<patrick.dunnigan AT centivia.com> wrote:
>
> My questions are: what are the major differences between ctlib, dblib,
> and using the code under src/tds?

They're different styles of programming. I learned db-lib 15 years ago,
and I think it's easy to grasp and use. ct-lib has always seemed a bit
alien to me, but I never had cause to use it much.

> My guess is that the ctlib and dblib use the tds libs, but haven't seen
> much mention of this.

You don't have to guess. :-) The source code and makefiles make plain
and various bintools e.g. nm(1) will confirm that all three client
libraries use libtds.

> Lastly, which is most likely to support 2005 use?

Microsoft will soon stop supplying any version of db-lib, although I'd bet
that they'd continue to "support" it in the sense that you could still use
the final version with new servers for years to come. They have other
APIs they prefer to promote, for their own reasons.

That doesn't affect FreeTDS one whit, though. FreeTDS will continue as it
has -- or better, or worse, depending on who participates. It has
thousands of users; I'd venture to say thousands of db-lib users alone.
I'm the maintainer today, but if I walked off the job, don't you think
someone else would step up sooner or later?

Of db-lib and ct-lib, it's hard to say which is more used. I think there
are more people out there like me who know and like db-lib, so I think of
that as the "programmer's interface". OTOH, ct-lib underpins DBD::Sybase,
and there's a gosh darn lot of perlheads out there, too, who exercise and
have benefitted from Bill's work. So ct-lib might actually get more use,
albeit indirectly.

> I'd like to use placeholders and bulkcopies and text fields. I didn't
> have much success with the Bulk Copies for TEXT or placeholders in
> ctlib. I didn't see any references to bulk in the TDS code but the
> placeholders worked ok (as long as it's not a text field insert). That's
> why I'm now considering trying out dblib, but I have concern that this
> lib won't be supported in the future.

These are new features of ct-lib. Placeholders aren't sufficiently
implemented to support DBD::Sybase, so they don't get exercised by the
aforementioned perlheads. Once they work with DBD::Sybase, I think you'll
find they'll be very solid.

I don't personally use TEXT fields much, but last I checked the db-lib
functions for managing TEXT data worked correctly. I take db-lib breakage
seriously, and I'm hardly alone on that score. db-lib doesn't have
placeholders per se, but see the rpc functions. They may suit your
purpose.

There isn't a ton of bcp-specific code in libtds. When Bill Thompson
added the ct-blk library, he found that the db-lib and ct-lib specs were
different enough that it was easier to have separate implementations.

Regards,

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page