Version 4 of SQL Relay

Updated 2005-07-15 20:16:29

SQL Relay http://sqlrelay.sourceforge.net/

From SQL Relay's home page:

SQL Relay is a persistent database connection pooling, proxying and load balancing system for Unix and Linux.

SQL Relay supports the following database backends:

  • Oracle
  • MySQL
  • mSQL
  • PostgreSQL
  • Sybase
  • MS SQL Server
  • IBM DB2
  • Interbase
  • Sybase
  • SQLite
  • Lago
  • ODBC
  • MS Access

SQL Relay includes a Tcl interface in the source distribution.


The documentation page [L1 ] provides this list:

"SQL Relay provides native client API's for many different programming languages."

 Guides:

  C++
  C
  Perl
  PHP
  Python
  Ruby
  Java

 References:

  C++
  C
  Perl
  PHP
  Python
  Ruby
  Java

Tcl is not mentioned on the documentation page, despite being mentioned on the home page.


JAG, 15-Jul-2005

I just traded an email with the (author? / maintainer?) of SQL Relay regarding TCL support. In part, here's what he had to say:

<--- BEGIN EMAIL FROM AUTHOR --->

There is a TCL module and it works, or at least did last time I tried it :) But, the module was contributed by a user who didn't write any docs for it, and I haven't gotten around to writing them myself.

Here's the short test program that the user contributed as well:

#!/usr/bin/tclsh

load ../../src/api/tcl/sqlrelay.so sqlrelay

set con sqlrcon -server localhost -port 8009 -user oracle8test -password oracle8test set cur $con sqlrcur

$cur sendQuery "select * from testtable"

(the load path will certainly need to be changed, probably to /usr/lib/sqlrelay/sqlrelay.so)

The function names for connection and cursor objects are listed in a comment in the .C file that implements the module. Here's that comment:

/*

 * sqlrconObjCmd --
 *    sqlrcon object command.
 * Synopsis:
 *  $con free
 *  $con endSession
 *  $con suspendSession
 *  $con getConnectionPort
 *  $con getConnectionSocket
 *  $con resumeSession port socket
 *  $con ping
 *  $con identify
 *  $con autoCommit bool
 *  $con commit
 *  $con rollback
 *  $con debug ?bool?
 *  $con sqlrcur
 *     set cur [$con sqlrcur]
 */

/*

 * sqlrcurObjCmd --
 *   This procedure is invoked to process the "sqlrcur" object command.
 * Synopsis:
 *   $cur eval query
 *   $cur setResultSetBufferSize ?rows?
 *   $cur getResultSetBufferSize
 *   $cur dontGetColumnInfo
 *   $cur getColumnInfo
 *   $cur caseColumnNames mixed|upper|low
 *   $cur cacheToFile filename
 *   $cur setCacheTtl ttl
 *   $cur getCacheFileName
 *   $cur cacheOff
 *   $cur sendQuery query
 *   $cur sendFileQuery path filename
 *   $cur prepareQuery query
 *   $cur prepareFileQuery path filename
 *   $cur substitution variable value
 *   $cur clearBinds
 *   $cur countBindVariables
 *   $cur inputBind
 *   $cur inputBindBlob variable value size
 *   $cur inputBindClob variable value size
 *   $cur defineOutputBind variable value
 *   $cur defineOutputBindBlob variable
 *   $cur defineOutputBindClob variable
 *   $cur defineOutputBindCursor variable
 *   $cur substitutions {{variable value} ...}
 *   $cur inputBinds {{variable value ?precision scale?} ...}
 *   $cur validateBinds
 *   $cur executeQuery
 *   $cur fetchFromBindCursor
 *   $cur getOutputBind variable
 *   $cur getOutputBindAsInteger variable
 *   $cur getOutputBindAsDouble variable
 *   $cur getOutputBindLength variable
 *   $cur getOutputBindCursor variable
 *   $cur openCacheResultSet variable
 *   $cur colCount
 *   $cur rowCount
 *   $cur totalRows
 *   $cur affectedRows
 *   $cur firstRowIndex
 *   $cur endOfResultSet
 *   $cur errorMessage
 *   $cur getFieldByIndex row col
 *   $cur getFieldByName row col
 *   $cur getFieldAsIntegerByIndex row col
 *   $cur getFieldAsIntegerByName row col
 *   $cur getFieldAsDoubleByIndex row col
 *   $cur getFieldAsDoubleByName row col
 *   $cur getFieldLengthByIndex row col
 *   $cur getFieldLengthByName row col
 *   $cur getRow row
 *   $cur getRowLengths row
 *   $cur getColumnNames
 *   $cur getColumnName col
 *   $cur getColumnTypeByIndex col
 *   $cur getColumnTypeByName col
 *   $cur getColumnLengthByIndex col
 *   $cur getColumnLengthByName col
 *   $cur getColumnPrecisionByIndex col
 *   $cur getColumnPrecisionByName col
 *   $cur getColumnScaleByIndex col
 *   $cur getColumnScaleByName col
 *   $cur getColumnIsNullableByIndex col
 *   $cur getColumnIsNullableByName col
 *   $cur getColumnIsPrimaryKeyByIndex col
 *   $cur getColumnIsPrimaryKeyByName col
 *   $cur getColumnIsUniqueByIndex col
 *   $cur getColumnIsUniqueByName col
 *   $cur getColumnIsPartOfKeyByIndex col
 *   $cur getColumnIsPartOfKeyByName col
 *   $cur getColumnIsUnsignedByIndex col
 *   $cur getColumnIsUnsignedByName col
 *   $cur getColumnIsZeroFilledByIndex col
 *   $cur getColumnIsZeroFilledByName col
 *   $cur getColumnIsBinaryByIndex col
 *   $cur getColumnIsBinaryByName col
 *   $cur getColumnIsAutoIncrementByIndex col
 *   $cur getColumnIsAutoIncrementByName col
 *   $cur getLongestByIndex col
 *   $cur getLongestByName col
 *   $cur getResultSetId
 *   $cur suspendResultSet
 *   $cur resumeResultSet is
 *   $cur resumeCachedResultSet id filename
 *  Note:
 *   cur->getNullsAsEmptyStrings, and cur->getNullsAsNulls are not
 *   supported.
 */

Hopefully this is enough to get you going. Let me know if you run into any problems.

David Muse

<--- END EMAIL FROM AUTHOR --->


Category Database