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/10/29 22:17:54 UTC

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

karl        2004/10/29 13:17:54

  Modified:    rivet/packages/dio dio_Mysql.tcl dio_Postgresql.tcl
  Log:
  Make the DIO handle method cause the database connection to exist if it
  doesn't already.
  
  Revision  Changes    Path
  1.3       +4 -6      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- dio_Mysql.tcl	7 Sep 2004 21:52:08 -0000	1.2
  +++ dio_Mysql.tcl	29 Oct 2004 20:17:54 -0000	1.3
  @@ -100,11 +100,9 @@
   	}
   
   	method handle {} {
  -	    if {[info exists conn]} {
  -		return $conn
  -	    } else {
  -		return ""
  -	    }
  +	    if {![info exists conn]} { open }
  +
  +	    return $conn
   	}
   
   	public variable db "" {
  
  
  
  1.3       +3 -6      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- dio_Postgresql.tcl	7 Sep 2004 21:52:08 -0000	1.2
  +++ dio_Postgresql.tcl	29 Oct 2004 20:17:54 -0000	1.3
  @@ -98,11 +98,8 @@
   	# case, the postgres connection handle
   	#
   	method handle {} {
  -	    if {[info exists conn]} {
  -		return $conn
  -	    } else {
  -		return ""
  -	    }
  +	    if {![info exists conn]} { open }
  +	    return $conn
   	}
   
   	## If they change DBs, we need to close the connection and re-open it.
  
  
  

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