You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by ka...@apache.org on 2004/09/07 23:52:08 UTC

cvs commit: tcl-rivet/rivet/packages/dio dio_Mysql.tcl dio_Postgresql.tcl

karl        2004/09/07 14:52:08

  Modified:    rivet/packages/dio dio_Mysql.tcl dio_Postgresql.tcl
  Log:
  Add handle method to obtain the underlying database handle.
  
  Revision  Changes    Path
  1.2       +10 -2     tcl-rivet/rivet/packages/dio/dio_Mysql.tcl
  
  Index: dio_Mysql.tcl
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/rivet/packages/dio/dio_Mysql.tcl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- dio_Mysql.tcl	14 Apr 2004 13:39:02 -0000	1.1
  +++ dio_Mysql.tcl	7 Sep 2004 21:52:08 -0000	1.2
  @@ -99,6 +99,14 @@
   	    return " LIMIT [expr $offset - 1],$limit"
   	}
   
  +	method handle {} {
  +	    if {[info exists conn]} {
  +		return $conn
  +	    } else {
  +		return ""
  +	    }
  +	}
  +
   	public variable db "" {
   	    if {[info exists conn]} {
   		mysqluse $conn $db
  @@ -127,4 +135,4 @@
   
       } ; ## ::itcl::class MysqlResult
   
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +14 -2     tcl-rivet/rivet/packages/dio/dio_Postgresql.tcl
  
  Index: dio_Postgresql.tcl
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/rivet/packages/dio/dio_Postgresql.tcl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- dio_Postgresql.tcl	14 Apr 2004 13:39:02 -0000	1.1
  +++ dio_Postgresql.tcl	7 Sep 2004 21:52:08 -0000	1.2
  @@ -93,6 +93,18 @@
   	    return $sql
   	}
   
  +	#
  +	# handle - return the internal database handle, in the postgres
  +	# case, the postgres connection handle
  +	#
  +	method handle {} {
  +	    if {[info exists conn]} {
  +		return $conn
  +	    } else {
  +		return ""
  +	    }
  +	}
  +
   	## If they change DBs, we need to close the connection and re-open it.
   	public variable db "" {
   	    if {[info exists conn]} {
  @@ -143,4 +155,4 @@
   
       } ; ## ::itcl::class PostgresqlResult
   
  -}
  \ No newline at end of file
  +}
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org