Skip to Content.
Sympa Menu

freetds - Re: [freetds] Using DBLIB With Azure

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Ken Collins <ken AT metaskills.net>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Using DBLIB With Azure
  • Date: Fri, 11 Mar 2011 07:36:11 -0500


I appreciate the offer to help, really.

But I think you are assuming that I have the ability to compile against
headers that are not available to me when my native ruby C extensions
compiles on a users machine with FreeTDS installed. Now I could really be
wrong here and that is specifically what I asked help for. So let me be clear.

I looked thru the FreeTDS code and saw how tsql uses deep internal TDS code
to accomplish a default database. If I was making software for my local
company or some other thing that I controlled I would dive deep into how tsql
does this, write some C, and compile my program against all the non published
headers and get what I need.

I on the other hand have a ruby C extension that compiles against publicly
available headers for a DBLIB api interface to Sybase/SQLServer. As
previously recommended here, my extension compiles against "sybdb.h" and
"sybfront.h". So what I am looking for is one of these two things.

1) Is there an API that I am missing to get me what I want because dbuse() is
not it.

2) Is there a way that FreeTDS should be working that is not and how can I
help contribute to the project by attempting a patch. For example in my last
email I stated that it appears that a default database should be pulled from
the freetds.conf when you give it a dataserver name. This is not happening
and would be one solution if (1) above does not exist. From my perspective, a
database pulled from conf may be a bug and again I would try to help with a
patch. But maybe somebody will say otherwise for historical reasons why the
default database is not being pulled from conf.

Do you either see what I am saying or am I missing your point? Are you
telling me that I should perhaps ship my native C extension with private
headers? Are you telling me that in order for me to say TinyTDS can connect
to Azure that I tell all my users that have just installed FreeTDS that they
need to reinstall it in such a way as to made tds.h available to my C
extension when it compiles? Or are you telling me that there is a function in
the DBLIB api that I can use? Or maybe that none of the above is valid and
that I should explore a patch to FreeTDS that would allow the default
database to be pulled from conf? Or something else?


- Ken



On Mar 11, 2011, at 6:21 AM, Konrad J Hambrick wrote:

> The default DB can be set in the per-user .sqshrc config file.
>
> Here's mine:
>
> ##################################################
> [konrad@kjhlt5 utl]$ cat ~/.sqshrc
>
> \set DSQUERY='Win2k3'
> \set datetime='%Y-%m-%d %H:%M:%S'
> \set date='%Y-%m-%d'
> \set time='%H:%M:%S'
> \set database='ppdf'
> \set username="$TarUser"
> \set password="$TarPass"
> \set style='bcp'
> \set bcp_rowsep=''
> \set banner=0
> ####################################################
>
> I set the Host, Default DB as well as the username and password
> in my ~/.sqshrc file.
>
> Sounded similar to setting a default DB in freetds.conf.
>
> You might also see how it works in the sqsh code.
>
> -- kjh





Archive powered by MHonArc 2.6.24.

Top of Page